text:
.class public final Lcom/payu/android/sdk/internal/ca;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/payu/android/sdk/internal/br;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/payu/android/sdk/internal/ca$a;
    }
.end annotation

# static fields
.field static final synthetic a:Z

# instance fields
.field private b:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Landroid/content/Context;>;"
        }
    .end annotation
.end field

.field private c:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/bf;>;"
        }
    .end annotation
.end field

.field private d:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/ke;>;"
        }
    .end annotation
.end field

.field private e:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/ct;>;"
        }
    .end annotation
.end field

.field private f:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/shade/com/squareup/picasso/Picasso;>;"
        }
    .end annotation
.end field

.field private g:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/rest/environment/RestEnvironment;>;"
        }
    .end annotation
.end field

.field private h:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/v;>;"
        }
    .end annotation
.end field

.field private i:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/jf;>;"
        }
    .end annotation
.end field

.field private j:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/le<Landroid/app/Activity;>;>;"
        }
    .end annotation
.end field

.field private k:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/lg;>;"
        }
    .end annotation
.end field

.field private l:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/hj;>;"
        }
    .end annotation
.end field

.field private m:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/ny;>;"
        }
    .end annotation
.end field

.field private n:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/la;>;"
        }
    .end annotation
.end field

.field private o:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/oa;>;"
        }
    .end annotation
.end field

.field private p:Lcom/payu/android/sdk/internal/vn;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vn<Lcom/payu/android/sdk/internal/me;>;"
        }
    .end annotation
.end field

.field private q:Lcom/payu/android/sdk/internal/vj;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/payu/android/sdk/internal/vj<Lcom/payu/android/sdk/payment/ui/LoginActivity;>;"
        }
    .end annotation
.end field

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

    .line 40
    const-class v0, Lcom/payu/android/sdk/internal/ca;

    invoke-virtual {v0}, Ljava/lang/Class;->desiredAssertionStatus()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    sput-boolean v0, Lcom/payu/android/sdk/internal/ca;->a:Z

    return-void
.end method

.method private constructor <init>(Lcom/payu/android/sdk/internal/ca$a;)V
    .locals 12

    .line 59
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 60
    sget-boolean v0, Lcom/payu/android/sdk/internal/ca;->a:Z

    if-nez v0, :cond_0

    if-nez p1, :cond_0

    new-instance v0, Ljava/lang/AssertionError;

    invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V

    throw v0

    .line 61
    :cond_0
    move-object v11, p1

    move-object p1, p0

    new-instance v0, Lcom/payu/android/sdk/internal/ca$1;

    invoke-direct {v0, p1, v11}, Lcom/payu/android/sdk/internal/ca$1;-><init>(Lcom/payu/android/sdk/internal/ca;Lcom/payu/android/sdk/internal/ca$a;)V

    iput-object v0, p0, Lcom/payu/android/sdk/internal/ca;->b:Lcom/payu/android/sdk/internal/vn;

    new-instance v0, Lcom/payu/android/sdk/internal/ca$2;

    invoke-direct {v0, p1, v11}, Lcom/payu/android/sdk/internal/ca$2;-><init>(Lcom/payu/android/sdk/internal/ca;Lcom/payu/android/sdk/internal/ca$a;)V

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->c:Lcom/payu/android/sdk/internal/vn;

    new-instance v0, Lcom/payu/android/sdk/internal/ca$3;

    invoke-direct {v0, p1, v11}, Lcom/payu/android/sdk/internal/ca$3;-><init>(Lcom/payu/android/sdk/internal/ca;Lcom/payu/android/sdk/internal/ca$a;)V

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->d:Lcom/payu/android/sdk/internal/vn;

    new-instance v0, Lcom/payu/android/sdk/internal/ca$4;

    invoke-direct {v0, p1, v11}, Lcom/payu/android/sdk/internal/ca$4;-><init>(Lcom/payu/android/sdk/internal/ca;Lcom/payu/android/sdk/internal/ca$a;)V

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->e:Lcom/payu/android/sdk/internal/vn;

    new-instance v0, Lcom/payu/android/sdk/internal/ca$5;

    invoke-direct {v0, p1, v11}, Lcom/payu/android/sdk/internal/ca$5;-><init>(Lcom/payu/android/sdk/internal/ca;Lcom/payu/android/sdk/internal/ca$a;)V

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->f:Lcom/payu/android/sdk/internal/vn;

    new-instance v0, Lcom/payu/android/sdk/internal/ca$6;

    invoke-direct {v0, p1, v11}, Lcom/payu/android/sdk/internal/ca$6;-><init>(Lcom/payu/android/sdk/internal/ca;Lcom/payu/android/sdk/internal/ca$a;)V

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->g:Lcom/payu/android/sdk/internal/vn;

    iget-object v0, p1, Lcom/payu/android/sdk/internal/ca;->g:Lcom/payu/android/sdk/internal/vn;

    invoke-static {v0}, Lcom/payu/android/sdk/internal/w;->a(Lcom/payu/android/sdk/internal/vn;)Lcom/payu/android/sdk/internal/vk;

    move-result-object v0

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->h:Lcom/payu/android/sdk/internal/vn;

    iget-object v0, v11, Lcom/payu/android/sdk/internal/ca$a;->a:Lcom/payu/android/sdk/internal/bs;

    invoke-static {v0}, Lcom/payu/android/sdk/internal/bt;->a(Lcom/payu/android/sdk/internal/bs;)Lcom/payu/android/sdk/internal/vk;

    move-result-object v0

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->i:Lcom/payu/android/sdk/internal/vn;

    iget-object v0, v11, Lcom/payu/android/sdk/internal/ca$a;->a:Lcom/payu/android/sdk/internal/bs;

    iget-object v1, p1, Lcom/payu/android/sdk/internal/ca;->h:Lcom/payu/android/sdk/internal/vn;

    iget-object v2, p1, Lcom/payu/android/sdk/internal/ca;->f:Lcom/payu/android/sdk/internal/vn;

    invoke-static {}, Lcom/payu/android/sdk/internal/jn;->create()Lcom/payu/android/sdk/internal/vk;

    move-result-object v3

    iget-object v4, p1, Lcom/payu/android/sdk/internal/ca;->i:Lcom/payu/android/sdk/internal/vn;

    invoke-static {v0, v1, v2, v3, v4}, Lcom/payu/android/sdk/internal/bu;->a(Lcom/payu/android/sdk/internal/bs;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;)Lcom/payu/android/sdk/internal/vk;

    move-result-object v0

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->j:Lcom/payu/android/sdk/internal/vn;

    invoke-static {}, Lcom/payu/android/sdk/internal/mb;->create()Lcom/payu/android/sdk/internal/vk;

    move-result-object v0

    invoke-static {v0}, Lcom/payu/android/sdk/internal/lh;->a(Lcom/payu/android/sdk/internal/vn;)Lcom/payu/android/sdk/internal/vk;

    move-result-object v0

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->k:Lcom/payu/android/sdk/internal/vn;

    iget-object v0, p1, Lcom/payu/android/sdk/internal/ca;->d:Lcom/payu/android/sdk/internal/vn;

    invoke-static {}, Lcom/payu/android/sdk/internal/jd;->create()Lcom/payu/android/sdk/internal/vk;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/payu/android/sdk/internal/hk;->a(Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;)Lcom/payu/android/sdk/internal/vk;

    move-result-object v0

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->l:Lcom/payu/android/sdk/internal/vn;

    sget-object v0, Lcom/payu/android/sdk/internal/vl$a;->INSTANCE:Lcom/payu/android/sdk/internal/vl$a;

    iget-object v1, p1, Lcom/payu/android/sdk/internal/ca;->b:Lcom/payu/android/sdk/internal/vn;

    iget-object v2, p1, Lcom/payu/android/sdk/internal/ca;->f:Lcom/payu/android/sdk/internal/vn;

    iget-object v3, p1, Lcom/payu/android/sdk/internal/ca;->h:Lcom/payu/android/sdk/internal/vn;

    iget-object v4, p1, Lcom/payu/android/sdk/internal/ca;->k:Lcom/payu/android/sdk/internal/vn;

    invoke-static {}, Lcom/payu/android/sdk/internal/ld;->create()Lcom/payu/android/sdk/internal/vk;

    move-result-object v5

    iget-object v6, p1, Lcom/payu/android/sdk/internal/ca;->l:Lcom/payu/android/sdk/internal/vn;

    invoke-static {}, Lcom/payu/android/sdk/internal/mb;->create()Lcom/payu/android/sdk/internal/vk;

    move-result-object v7

    invoke-static/range {v0 .. v7}, Lcom/payu/android/sdk/internal/nz;->a(Lcom/payu/android/sdk/internal/vj;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;)Lcom/payu/android/sdk/internal/vk;

    move-result-object v0

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->m:Lcom/payu/android/sdk/internal/vn;

    invoke-static {}, Lcom/payu/android/sdk/internal/mb;->create()Lcom/payu/android/sdk/internal/vk;

    move-result-object v0

    invoke-static {v0}, Lcom/payu/android/sdk/internal/lb;->a(Lcom/payu/android/sdk/internal/vn;)Lcom/payu/android/sdk/internal/vk;

    move-result-object v0

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->n:Lcom/payu/android/sdk/internal/vn;

    sget-object v0, Lcom/payu/android/sdk/internal/vl$a;->INSTANCE:Lcom/payu/android/sdk/internal/vl$a;

    iget-object v1, p1, Lcom/payu/android/sdk/internal/ca;->b:Lcom/payu/android/sdk/internal/vn;

    iget-object v2, p1, Lcom/payu/android/sdk/internal/ca;->n:Lcom/payu/android/sdk/internal/vn;

    invoke-static {}, Lcom/payu/android/sdk/internal/mb;->create()Lcom/payu/android/sdk/internal/vk;

    move-result-object v3

    invoke-static {v0, v1, v2, v3}, Lcom/payu/android/sdk/internal/ob;->a(Lcom/payu/android/sdk/internal/vj;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;)Lcom/payu/android/sdk/internal/vk;

    move-result-object v0

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->o:Lcom/payu/android/sdk/internal/vn;

    sget-object v0, Lcom/payu/android/sdk/internal/vl$a;->INSTANCE:Lcom/payu/android/sdk/internal/vl$a;

    iget-object v1, p1, Lcom/payu/android/sdk/internal/ca;->b:Lcom/payu/android/sdk/internal/vn;

    invoke-static {v0, v1}, Lcom/payu/android/sdk/internal/mf;->a(Lcom/payu/android/sdk/internal/vj;Lcom/payu/android/sdk/internal/vn;)Lcom/payu/android/sdk/internal/vk;

    move-result-object v0

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->p:Lcom/payu/android/sdk/internal/vn;

    sget-object v0, Lcom/payu/android/sdk/internal/vl$a;->INSTANCE:Lcom/payu/android/sdk/internal/vl$a;

    invoke-static {}, Lcom/payu/android/sdk/internal/ks;->create()Lcom/payu/android/sdk/internal/vk;

    move-result-object v1

    iget-object v2, p1, Lcom/payu/android/sdk/internal/ca;->c:Lcom/payu/android/sdk/internal/vn;

    iget-object v3, p1, Lcom/payu/android/sdk/internal/ca;->e:Lcom/payu/android/sdk/internal/vn;

    iget-object v4, p1, Lcom/payu/android/sdk/internal/ca;->h:Lcom/payu/android/sdk/internal/vn;

    invoke-static {}, Lcom/payu/android/sdk/internal/nh;->create()Lcom/payu/android/sdk/internal/vk;

    move-result-object v5

    invoke-static {}, Lcom/payu/android/sdk/internal/mb;->create()Lcom/payu/android/sdk/internal/vk;

    move-result-object v6

    iget-object v7, p1, Lcom/payu/android/sdk/internal/ca;->j:Lcom/payu/android/sdk/internal/vn;

    iget-object v8, p1, Lcom/payu/android/sdk/internal/ca;->m:Lcom/payu/android/sdk/internal/vn;

    iget-object v9, p1, Lcom/payu/android/sdk/internal/ca;->o:Lcom/payu/android/sdk/internal/vn;

    iget-object v10, p1, Lcom/payu/android/sdk/internal/ca;->p:Lcom/payu/android/sdk/internal/vn;

    invoke-static/range {v0 .. v10}, Lcom/payu/android/sdk/payment/ui/LoginActivity_MembersInjector;->create(Lcom/payu/android/sdk/internal/vj;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;Lcom/payu/android/sdk/internal/vn;)Lcom/payu/android/sdk/internal/vj;

    move-result-object v0

    iput-object v0, p1, Lcom/payu/android/sdk/internal/ca;->q:Lcom/payu/android/sdk/internal/vj;

    .line 62
    return-void
.end method

.method public synthetic constructor <init>(Lcom/payu/android/sdk/internal/ca$a;Lcom/payu/android/sdk/internal/ca$1;)V
    .locals 0

    .line 41
    invoke-direct {p0, p1}, Lcom/payu/android/sdk/internal/ca;-><init>(Lcom/payu/android/sdk/internal/ca$a;)V

    return-void
.end method

.method public static a()Lcom/payu/android/sdk/internal/ca$a;
    .locals 2

    .line 65
    new-instance v0, Lcom/payu/android/sdk/internal/ca$a;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lcom/payu/android/sdk/internal/ca$a;-><init>(Lcom/payu/android/sdk/internal/ca$1;)V

    return-object v0
.end method

# virtual methods
.method public final a(Lcom/payu/android/sdk/payment/ui/LoginActivity;)V
    .locals 1

    .line 173
    iget-object v0, p0, Lcom/payu/android/sdk/internal/ca;->q:Lcom/payu/android/sdk/internal/vj;

    invoke-interface {v0, p1}, Lcom/payu/android/sdk/internal/vj;->injectMembers(Ljava/lang/Object;)V

    .line 174
    return-void
.end method

.method public final b()Landroid/content/Context;
    .locals 1

    .line 143
    iget-object v0, p0, Lcom/payu/android/sdk/internal/ca;->b:Lcom/payu/android/sdk/internal/vn;

    invoke-interface {v0}, Lcom/payu/android/sdk/internal/vn;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/Context;

    return-object v0
.end method

.method public final c()Lcom/payu/android/sdk/internal/bf;
    .locals 1

    .line 148
    iget-object v0, p0, Lcom/payu/android/sdk/internal/ca;->c:Lcom/payu/android/sdk/internal/vn;

    invoke-interface {v0}, Lcom/payu/android/sdk/internal/vn;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/payu/android/sdk/internal/bf;

    return-object v0
.end method

.method public final d()Lcom/payu/android/sdk/internal/ke;
    .locals 1

    .line 153
    iget-object v0, p0, Lcom/payu/android/sdk/internal/ca;->d:Lcom/payu/android/sdk/internal/vn;

    invoke-interface {v0}, Lcom/payu/android/sdk/internal/vn;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/payu/android/sdk/internal/ke;

    return-object v0
.end method

.method public final e()Lcom/payu/android/sdk/internal/ct;
    .locals 1

    .line 158
    iget-object v0, p0, Lcom/payu/android/sdk/internal/ca;->e:Lcom/payu/android/sdk/internal/vn;

    invoke-interface {v0}, Lcom/payu/android/sdk/internal/vn;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/payu/android/sdk/internal/ct;

    return-object v0
.end method

.method public final f()Lcom/payu/android/sdk/shade/com/squareup/picasso/Picasso;
    .locals 1

    .line 163
    iget-object v0, p0, Lcom/payu/android/sdk/internal/ca;->f:Lcom/payu/android/sdk/internal/vn;

    invoke-interface {v0}, Lcom/payu/android/sdk/internal/vn;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/payu/android/sdk/shade/com/squareup/picasso/Picasso;

    return-object v0
.end method

.method public final g()Lcom/payu/android/sdk/internal/rest/environment/RestEnvironment;
    .locals 1

    .line 168
    iget-object v0, p0, Lcom/payu/android/sdk/internal/ca;->g:Lcom/payu/android/sdk/internal/vn;

    invoke-interface {v0}, Lcom/payu/android/sdk/internal/vn;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/payu/android/sdk/internal/rest/environment/RestEnvironment;

    return-object v0
.end method


text:
package template;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;

/**
 * 用于处理Excel写操作
 */
public class ExcelTemplate {
	// 开始位置
	public final static String TEMPLATE_NAME = "datastart";
	// 样式,用于要标志自定义的样式的列.
	public final static String STYLE = "style";
	// 默认样式
	public final static String DEFALULT_STYLE = "defaultStyle";
	// 序号,确定Excel是否需要样式.
	public final static String SERNUMS = "sernums";
	private int initRowIndex; // 初始行
	private int initColIndex; // 初始列
	private int curRowIndex; // 当前行
	private int curColIndex; // 当前列
	private int lastRowInex; // 最后一行
	private float defaultHeight; // 默认行高
	private int serColIndex; // 序号行.
	private Workbook workbook = null;
	private Sheet sheet = null;
	private Row curRow = null; // 当前行
	// 样式
	private Map<Integer, CellStyle> styles = null;
	// 默认样式
	private CellStyle defaultStyle = null;
	// 使用单例
	private static ExcelTemplate excel = new ExcelTemplate();

	private ExcelTemplate() {
	}

	public static ExcelTemplate getInstance() {
		return excel;
	}

	/**
	 * 读取模板(从classpath中)
	 *
	 * @param path
	 *            模板路径
	 * @return ExcelTemplate
	 */
	public ExcelTemplate readTemplateClassPath(String calsspath) {
		try {
			workbook = WorkbookFactory.create(ExcelTemplate.class
					.getResourceAsStream(calsspath));
			initTemplate();
		} catch (InvalidFormatException e) {
			e.printStackTrace();
			throw new RuntimeException("读取模板格式有错!请检查.");
		} catch (IOException e) {
			e.printStackTrace();
			throw new RuntimeException("读取模板文件不存在!请检查.");
		}
		return this;
	}

	/**
	 * 读取模板(从指定路径)
	 *
	 * @param path
	 *            模板路径
	 * @return ExcelTemplate
	 */
	public ExcelTemplate readTemplatePath(String path) {
		try {
			workbook = WorkbookFactory.create(new File(path));
			initTemplate();
		} catch (InvalidFormatException e) {
			e.printStackTrace();
			throw new RuntimeException("读取模板格式有错!请检查.");
		} catch (IOException e) {
			e.printStackTrace();
			throw new RuntimeException("读取模板文件不存在!请检查.");
		}
		return this;
	}

	/**
	 * 创建新的一行
	 */
	public void creatNewRow() {
		// curRowIndex != initRowIndxe : 当前行本身是存在的,所以下移多余.
		if (lastRowInex > curRowIndex && curRowIndex != initRowIndex) {
			sheet.shiftRows(curRowIndex, lastRowInex, 1, true, true); // 有的模板最后可能是日期或者姓名之类的非数据.所以要移动行.
			lastRowInex++;
		}
		curRow = sheet.createRow(curRowIndex);
		curRow.setHeightInPoints(defaultHeight);
		curRowIndex++;
		curColIndex = initColIndex;
	}

	public void createNewCol(String value) {
		Cell cell = curRow.createCell(curColIndex);
		setStyle(cell);
		cell.setCellValue(value);
		curColIndex++;
	}

	public void createNewCol(double value) {
		Cell cell = curRow.createCell(curColIndex);
		setStyle(cell);
		cell.setCellValue(value);
		curColIndex++;
	}

	public void createNewCol(boolean value) {
		Cell cell = curRow.createCell(curColIndex);
		setStyle(cell);
		cell.setCellValue(value);
		curColIndex++;
	}

	public void createNewCol(Date value) {
		Cell cell = curRow.createCell(curColIndex);
		setStyle(cell);
		cell.setCellValue(value);
		curColIndex++;
	}

	public void createNewCol(Calendar value) {
		Cell cell = curRow.createCell(curColIndex);
		setStyle(cell);
		cell.setCellValue(value);
		curColIndex++;
	}

	public void createNewCol(RichTextString value) {
		Cell cell = curRow.createCell(curColIndex);
		setStyle(cell);
		cell.setCellValue(value);
		curColIndex++;
	}

	/**
	 * 根据#xxx替换模板中的其它样式.
	 *
	 * @param datas
	 *            要替换的数据
	 */
	public void replaceFind(Map<String, String> datas) {
		if (datas == null)
			return;
		for (Row row : sheet) {
			for (Cell cell : row) {
				if (cell.getCellType() != Cell.CELL_TYPE_STRING)
					continue;
				String value = cell.getStringCellValue().trim();
				if (value.startsWith("#")) {
					if (datas.containsKey(value.substring(1))) {
						cell.setCellValue(datas.get(value.substring(1)));
					}
				}
			}
		}
	}

	/**
	 * 插入序号
	 */
	public void insertSer() {
		int index = 1;
		Row row = null;
		Cell cell = null;
		for (int i = initRowIndex; i < curRowIndex; i++) {
			row = sheet.getRow(i);
			cell = row.createCell(serColIndex);
			setStyle(cell);
			cell.setCellValue(index++);
		}
	}

	/**
	 * 输出文件,根据路径
	 *
	 * @param path
	 *            路径
	 */
	public void writeToFile(String path) {
		FileOutputStream fos = null;
		try {
			fos = new FileOutputStream(path);
			workbook.write(fos);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			throw new RuntimeException("找不到文件!请检查.");
		} catch (IOException e) {
			e.printStackTrace();
			throw new RuntimeException("文件输出异常!请检查.");
		} finally {
			try {
				if (fos != null) {
					fos.close();
					fos = null;
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}

	/**
	 * 输出文件,根据流输出
	 *
	 * @param stream
	 *            OutputStream
	 */
	public void writeToStream(OutputStream stream) {
		try {
			workbook.write(stream);
		} catch (IOException e) {
			e.printStackTrace();
			throw new RuntimeException("文件输出异常!请检查.");
		} finally {
			try {
				if (stream != null) {
					stream.close();
					stream = null;
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}

	/**
	 * 初始化模板
	 */
	private void initTemplate() {
		sheet = workbook.getSheetAt(0);
		styles = new HashMap<Integer, CellStyle>();
		initConfigData();
		lastRowInex = sheet.getLastRowNum();
	}

	/**
	 * defaultStyles:获得默认样式(如果默认样式没有则使用开始样式) styles:获取自定义样式
	 *
	 */
	private void initConfigData() {
		for (Row row : sheet) {
			for (Cell cell : row) {
				if (cell.getCellType() != Cell.CELL_TYPE_STRING)
					continue;
				String value = cell.getStringCellValue().trim();
				// 获取开始位置,初始化数据
				if (TEMPLATE_NAME.equals(value)) {
					initRowIndex = cell.getRowIndex();
					initColIndex = cell.getColumnIndex();
					curRowIndex = initRowIndex;
					curColIndex = initColIndex;
					defaultHeight = row.getHeightInPoints();
					if (defaultStyle == null)
						defaultStyle = cell.getCellStyle();
				}
				// 获取defaultStyles,无论如何,当有设置defaultStyles都设置为defaultStyles
				if (DEFALULT_STYLE.equals(value))
					defaultStyle = cell.getCellStyle();
				// 获取自定义样式的列
				if (STYLE.equals(value)) {
					styles.put(cell.getColumnIndex(), cell.getCellStyle());
				}
				// 获取样式所在的列
				if (SERNUMS.equals(value))
					serColIndex = cell.getColumnIndex();
			}
		}
	}

	/**
	 * 设置样式
	 *
	 * @param cell
	 *            Cell
	 */
	private void setStyle(Cell cell) {
		// 当前列存在自定义样式时使用自定义样式,否则使用默认样式.
		if (styles.containsKey(curColIndex)) {
			cell.setCellStyle(styles.get(curColIndex));
		} else {
			cell.setCellStyle(defaultStyle);
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2009 Red Hat, Inc.
  ~ Red Hat licenses this file to you 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.
  -->
<project default="run" name="HornetQ XA Recovery Example">

   <import file="../common/build.xml"/>

   <target name="copy-resources">
      <property name="example-profile" value="${jboss.home}/server/${example.name}-example-profile"/>
      <!-- this file contains the XA Recovery configuration -->
      <copy todir="${example-profile}/conf"
            file="server/jbossts-properties.xml"
            overwrite="true"/>
   </target>

   <target name="run">
      <antcall target="runExample">
         <param name="example.classname" value="org.hornetq.javaee.example.XARecoveryExample"/>
      </antcall>
   </target>

   <target name="restart">
   <echo>==============================</echo>
   <echo>Restart the server and recover</echo>
   <echo>==============================</echo>
      <exec dir="${jboss.home}/bin" executable="sh" osfamily="unix">
         <arg line="run.sh -c ${example.name}-example-profile"/>
      </exec>
      <exec dir="${jboss.home}/bin" executable="cmd" osfamily="windows">
         <arg line="/c run.bat -c ${example.name}-example-profile"/>
      </exec>
   </target>
</project>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
TextButton
</TITLE>

<META NAME="date" CONTENT="2011-05-30">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Class TextButton

java.lang.Object
  TextButton

public class TextButton
extends java.lang.Object

Helper class used to draw Strings to the screen.

Author:

Reed Weichler

Field Summary

static java.awt.Color
HIGHLIGHT

          default colors

static java.awt.Color
TEXT

          default colors

static java.awt.Color
TITLE

          default colors

Constructor Summary

TextButton(java.lang.String str,
           java.awt.Font font)

TextButton(java.lang.String str,
           java.awt.Font font,
           java.awt.Color color)

TextButton(java.lang.String str,
           java.awt.Font font,
           java.awt.Color color,
           java.awt.Color highlight)

TextButton(java.lang.String str,
           java.awt.Font font,
           int x,
           int y)

TextButton(java.lang.String str,
           java.awt.Font font,
           int x,
           int y,
           java.awt.Color color)

TextButton(java.lang.String str,
           java.awt.Font font,
           int x,
           int y,
           java.awt.Color color,
           java.awt.Color highlight)

          Creates a new TextButton with the specified attributes

Method Summary

 boolean
contains(int x,
         int y)

          determines if a point at coordinates (x,y) is within the bounds of this

 boolean
contains(java.awt.Point p)

          determines if p is within the bounds of this

 void
draw(java.awt.Graphics g)

          draws this to g, mouse coordinates are determined from ScreenPanel.mouse

 void
draw(java.awt.Graphics g,
     java.awt.Point mouse)

          draws this to g

 int
getHeight()

 int
getWidth()

 void
setPos(int x,
       int y)

 void
setPos(java.awt.Point p)

 void
setText(java.lang.String str)

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

TITLE

public static final java.awt.Color TITLE

default colors

TEXT

public static final java.awt.Color TEXT

default colors

HIGHLIGHT

public static final java.awt.Color HIGHLIGHT

default colors

Constructor Detail

TextButton

public TextButton(java.lang.String str,
                  java.awt.Font font,
                  int x,
                  int y,
                  java.awt.Color color,
                  java.awt.Color highlight)

Creates a new TextButton with the specified attributes

Parameters:
str - text to be displayed
font - font of text
x - the very left part of the text
y - the top part of the text
color - default color
highlight - color when the mouse hovers over

TextButton

public TextButton(java.lang.String str,
                  java.awt.Font font,
                  int x,
                  int y)

TextButton

public TextButton(java.lang.String str,
                  java.awt.Font font,
                  int x,
                  int y,
                  java.awt.Color color)

TextButton

public TextButton(java.lang.String str,
                  java.awt.Font font,
                  java.awt.Color color,
                  java.awt.Color highlight)

TextButton

public TextButton(java.lang.String str,
                  java.awt.Font font,
                  java.awt.Color color)

TextButton

public TextButton(java.lang.String str,
                  java.awt.Font font)

Method Detail

contains

public boolean contains(java.awt.Point p)

determines if p is within the bounds of this

Returns:
true if p is within the bounds of this, false if not

contains

public boolean contains(int x,
                        int y)

determines if a point at coordinates (x,y) is within the bounds of this

Returns:
true if (x,y) is within the bounds of this, false if not

getWidth

public int getWidth()

getHeight

public int getHeight()

setPos

public void setPos(java.awt.Point p)

setPos

public void setPos(int x,
                   int y)

setText

public void setText(java.lang.String str)

draw

public void draw(java.awt.Graphics g,
                 java.awt.Point mouse)

draws this to g

Parameters:
mouse - coordinates of the mouse

draw

public void draw(java.awt.Graphics g)

draws this to g, mouse coordinates are determined from ScreenPanel.mouse

      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
{
  var config = oneEventLoopTestConfig(three);
  config.startShouldSetResponder.captured.grandParent = {
    order: 0,
    returnVal: false
  };
  config.startShouldSetResponder.captured.parent = {
    order: 1,
    returnVal: false
  };
  config.startShouldSetResponder.captured.child = {
    order: 2,
    returnVal: false
  };
  config.startShouldSetResponder.bubbled.child = {
    order: 3,
    returnVal: true
  };
  config.responderGrant.child = {
    order: 4
  };
  config.responderStart.child = {
    order: 5
  };
  run(config, three, startConfig(three.child, [three.child], [0]));
  expect(ResponderEventPlugin._getResponder()).toBe(
    getInstanceFromNode(three.child)
  );
  config = oneEventLoopTestConfig(three);
  config.scrollShouldSetResponder.captured.grandParent = {
    order: 0,
    returnVal: false
  };
  config.scrollShouldSetResponder.captured.parent = {
    order: 1,
    returnVal: false
  };
  config.scrollShouldSetResponder.bubbled.parent = {
    order: 2,
    returnVal: true
  };
  config.responderGrant.parent = {
    order: 3
  };
  config.responderTerminationRequest.child = {
    order: 4,
    returnVal: false
  };
  config.responderReject.parent = {
    order: 5
  };
  run(config, three, {
    topLevelType: "topScroll",
    targetInst: getInstanceFromNode(three.parent),
    nativeEvent: {}
  });
  expect(ResponderEventPlugin._getResponder()).toBe(
    getInstanceFromNode(three.child)
  );
  config = oneEventLoopTestConfig(three);
  config.scrollShouldSetResponder.captured.grandParent = {
    order: 0,
    returnVal: false
  };
  config.scrollShouldSetResponder.captured.parent = {
    order: 1,
    returnVal: false
  };
  config.scrollShouldSetResponder.bubbled.parent = {
    order: 2,
    returnVal: true
  };
  config.responderGrant.parent = {
    order: 3
  };
  config.responderTerminationRequest.child = {
    order: 4,
    returnVal: true
  };
  config.responderTerminate.child = {
    order: 5
  };
  run(config, three, {
    topLevelType: "topScroll",
    targetInst: getInstanceFromNode(three.parent),
    nativeEvent: {}
  });
  expect(ResponderEventPlugin._getResponder()).toBe(
    getInstanceFromNode(three.parent)
  );
}


text:
class CChevDrop : public CWnd
{
	CToolBarCtrl	m_tb;

	// Imagelist for the toolbar
	CImageList	m_hImageList;

	// This window receives the notifications for the toolbar !
	HWND	m_hMsgReceiver;

	// Helper to create a toolbar
	HWND	CreateToolBar( HWND hwndParent, HWND hToolToReplicate );

	// Cleans all toolbar
	BOOL	CleanToolBar( );

// Construction
public:
	CChevDrop();

	BOOL	CreatePopup( CWnd* pParent );

	BOOL	ShowPopup(
						CWnd*	pMsgReceiver,
						CToolBar* pToolBar,
						CRect	rectDisplayed,
						CPoint	ptScreen );

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CChevDrop)
	protected:
	virtual void PostNcDestroy();
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CChevDrop();

	// Generated message map functions
protected:
	//{{AFX_MSG(CChevDrop)
	afx_msg void OnKillFocus(CWnd* pNewWnd);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CHEVDROP_H__E462CCF6_009E_11D4_84C8_0080450EA020__INCLUDED_)


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\base\setting\BankList */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>
    <?= $form->field($model, 'bank_name')->textInput(['maxlength' => true]) ?>
    <?= $form->field($model, 'bank_code')->textInput(['maxlength' => true]) ?>
    <?= $form->field($model, 'service_tel')->textInput(['maxlength' => true]) ?>
    <?= $form->field($model, 'bank_logo')->textInput(['maxlength' => true]) ?>
    <?= $form->field($model, 'card_type')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'card_attribute')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'binding_pay_1time_limit')->textInput() ?>

    <?= $form->field($model, 'binding_pay_time_limit')->textInput() ?>

    <?= $form->field($model, 'binding_pay_day_limit')->textInput() ?>

    <?= $form->field($model, 'binding_pay_time_min_limit')->textInput() ?>

    <?= $form->field($model, 'is_valid')->dropDownList($model->isValidLables()) ?>

        <?= Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
#include "ImwPlatformWindowDX11.h"

#include "ImwWindowManager.h"

#include <DxErr.h>

#include "Win32MessageHelper.h">

#pragma comment (lib, "d3d11.lib")
#pragma comment (lib, "d3dx11.lib")
#pragma comment (lib, "d3dx10.lib")
#pragma comment (lib, "d3dcompiler.lib")
#pragma comment (lib, "dxgi.lib")
#pragma comment (lib, "dxerr.lib")

using namespace ImWindow;

ImwPlatformWindowDX11::InstanceMap		ImwPlatformWindowDX11::s_mInstances;
bool									ImwPlatformWindowDX11::s_bClassInitialized = false;
WNDCLASSEX								ImwPlatformWindowDX11::s_oWndClassEx;

IDXGIFactory*							ImwPlatformWindowDX11::s_pFactory = NULL;
ID3D11Device*							ImwPlatformWindowDX11::s_pDevice = NULL;
ID3D11DeviceContext*					ImwPlatformWindowDX11::s_pDeviceContext = NULL;

ImwPlatformWindow*						ImwPlatformWindowDX11::s_pLastHoveredWindow = NULL;

INT64									ImwPlatformWindowDX11::g_Time = 0;
INT64									ImwPlatformWindowDX11::g_TicksPerSecond = 0;

IMGUI_API void							ImGui_ImplDX11_RenderDrawLists(ImDrawData* draw_data);

ImwPlatformWindowDX11::ImwPlatformWindowDX11( bool bMain, bool bIsDragWindow )
	: ImwPlatformWindow( bMain, bIsDragWindow )
{
	m_pSwapChain = NULL;
	m_pRenderTargetView = NULL;
	m_bDrag = false;
	m_oSize = IM_VEC2_0;
	m_oPosition = IM_VEC2_N1;
}

ImwPlatformWindowDX11::~ImwPlatformWindowDX11()
{
	s_mInstances.erase(m_hWnd);

	//ImwSafeRelease(m_pDevice);
	//ImwSafeRelease(m_pDeviceContext);

	ImwSafeRelease(m_pSwapChain);
	ImwSafeRelease(m_pRenderTargetView);

	DestroyWindow(m_hWnd);
}

bool ImwPlatformWindowDX11::Init(ImwPlatformWindow* pMain)
{
	InitWndClassEx();

	HRESULT hr;

	DWORD iWindowStyle;
	if (m_bIsDragWindow)
	{
		iWindowStyle = WS_POPUP;
	}
	else if (pMain != NULL)
	{
		iWindowStyle = WS_POPUP | WS_VISIBLE | WS_THICKFRAME;
		iWindowStyle = WS_OVERLAPPEDWINDOW;
	}
	else
	{
		iWindowStyle = WS_OVERLAPPEDWINDOW;
	}

	RECT wr = { 0, 0, 800, 600 };
	AdjustWindowRect(&wr, iWindowStyle, FALSE);

	m_hWnd = CreateWindowEx(NULL,
		"ImwPlatformWindowDX11",
		"ImwWindow",
		iWindowStyle,
		300,
		300,
		wr.right - wr.left,
		wr.bottom - wr.top,
		(pMain != NULL) ? ((ImwPlatformWindowDX11*)pMain)->GetHWnd() : NULL,
		NULL,
		GetModuleHandle(NULL),
		NULL);

	if (m_bIsDragWindow)
	{
		SetWindowLong(m_hWnd, GWL_EXSTYLE, GetWindowLong(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
		SetLayeredWindowAttributes(m_hWnd, RGB(0, 0, 0), 128, LWA_ALPHA);
	}

	s_mInstances.insert(std::pair<HWND, ImwPlatformWindowDX11*>(m_hWnd, this));

	DXGI_SWAP_CHAIN_DESC scd;
	ZeroMemory(&scd, sizeof(DXGI_SWAP_CHAIN_DESC));
	scd.BufferCount = 1;
	scd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
	scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
	scd.OutputWindow = m_hWnd;
	scd.SampleDesc.Count = 4;
	scd.Windowed = true;

	//hr = s_pFactory->CreateSwapChainForHwnd( )
	hr = s_pFactory->CreateSwapChain( s_pDevice, &scd, &m_pSwapChain );

	if (FAILED(hr))
	{
		MessageBox(NULL, DXGetErrorDescription(hr), TEXT("D3D11CreateDeviceAndSwapChain"), MB_OK);
		return false;
	}

	hr = s_pFactory->MakeWindowAssociation(m_hWnd, DXGI_MWA_NO_ALT_ENTER );

	if (FAILED(hr))
	{
		MessageBox(NULL, DXGetErrorDescription(hr), TEXT("s_pFactory->MakeWindowAssociation"), MB_OK);
		return false;
	}

	//Create our BackBuffer
	ID3D11Texture2D* pBackBuffer;
	hr = m_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (void**)&pBackBuffer);
	if (FAILED(hr))
	{
		MessageBox(NULL, DXGetErrorDescription(hr), TEXT("m_pSwapChain->GetBuffer"), MB_OK);
		return false;
	}

	//Create our Render Target
	hr = s_pDevice->CreateRenderTargetView(pBackBuffer, NULL, &m_pRenderTargetView);
	pBackBuffer->Release();
	if (FAILED(hr))
	{
		MessageBox(NULL, DXGetErrorDescription(hr), TEXT("m_pDevice->CreateRenderTargetView"), MB_OK);
		return false;
	}

	//Set our Render Target
	s_pDeviceContext->OMSetRenderTargets(1, &m_pRenderTargetView, NULL);

	SetState();
	ImGui_ImplDX11_Init(m_hWnd, s_pDevice, s_pDeviceContext);

	if (!QueryPerformanceFrequency((LARGE_INTEGER *)&g_TicksPerSecond))
		return false;
	if (!QueryPerformanceCounter((LARGE_INTEGER *)&g_Time))
		return false;

	ImGuiIO& io = ImGui::GetIO();
	io.KeyMap[ImGuiKey_Tab] = VK_TAB;                       // Keyboard mapping. ImGui will use those indices to peek into the io.KeyDown[] array that we will update during the application lifetime.
	io.KeyMap[ImGuiKey_LeftArrow] = VK_LEFT;
	io.KeyMap[ImGuiKey_RightArrow] = VK_RIGHT;
	io.KeyMap[ImGuiKey_UpArrow] = VK_UP;
	io.KeyMap[ImGuiKey_DownArrow] = VK_DOWN;
	io.KeyMap[ImGuiKey_PageUp] = VK_PRIOR;
	io.KeyMap[ImGuiKey_PageDown] = VK_NEXT;
	io.KeyMap[ImGuiKey_Home] = VK_HOME;
	io.KeyMap[ImGuiKey_End] = VK_END;
	io.KeyMap[ImGuiKey_Delete] = VK_DELETE;
	io.KeyMap[ImGuiKey_Backspace] = VK_BACK;
	io.KeyMap[ImGuiKey_Enter] = VK_RETURN;
	io.KeyMap[ImGuiKey_Escape] = VK_ESCAPE;
	io.KeyMap[ImGuiKey_A] = 'A';
	io.KeyMap[ImGuiKey_C] = 'C';
	io.KeyMap[ImGuiKey_V] = 'V';
	io.KeyMap[ImGuiKey_X] = 'X';
	io.KeyMap[ImGuiKey_Y] = 'Y';
	io.KeyMap[ImGuiKey_Z] = 'Z';

	io.RenderDrawListsFn = ImGui_ImplDX11_RenderDrawLists;  // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
	io.ImeWindowHandle = m_hWnd;

	RestoreState();

	m_hCursorArrow = LoadCursor( NULL, IDC_ARROW );
	m_hCursorResizeNS = LoadCursor( NULL, IDC_SIZENS );
	m_hCursorResizeWE = LoadCursor( NULL, IDC_SIZEWE );

	if( pMain == NULL )
	{
		ImGui_ImplDX11_NewFrame();
	}

	return true;
}

const ImVec2& ImwPlatformWindowDX11::GetPosition() const
{
	return m_oPosition;
}

const ImVec2& ImwPlatformWindowDX11::GetSize() const
{
	return m_oSize;
}

void ImwPlatformWindowDX11::Show()
{
	ShowWindow(m_hWnd, SW_SHOW);
}

void ImwPlatformWindowDX11::Hide()
{
	ShowWindow(m_hWnd, SW_HIDE);
}

void ImwPlatformWindowDX11::SetSize(int iWidth, int iHeight)
{
	RECT oRect;
	oRect.left = 0;
	oRect.top = 0;
	oRect.right = iWidth;
	oRect.bottom = iHeight;
	AdjustWindowRect(&oRect, GetWindowLong(m_hWnd, GWL_STYLE), false);
	SetWindowPos(m_hWnd, 0, 0, 0, oRect.right - oRect.left, oRect.bottom - oRect.top, SWP_NOMOVE);
}

void ImwPlatformWindowDX11::SetPosition(int iX, int iY)
{
	RECT oRect;
	oRect.left = iX;
	oRect.top = iY;
	oRect.right = iX + m_oSize.x;
	oRect.bottom = iY + m_oSize.y;
	AdjustWindowRect(&oRect, GetWindowLong(m_hWnd, GWL_STYLE), false);
	SetWindowPos(m_hWnd, 0, oRect.left, oRect.top, 0, 0, SWP_NOSIZE);
}

void ImwPlatformWindowDX11::SetTitle(const char* pTtile)
{
	SetWindowText(m_hWnd, pTtile);
}

void ImwPlatformWindowDX11::PreUpdate()
{
	MSG msg;
	int iCount = 0;
	while (PeekMessage(&msg, m_hWnd, 0, 0, PM_REMOVE) && iCount < 10) // Max 10 messages
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
		//OnMessage(msg.)
		//OnMessage(msg.message, msg.wParam, msg.lParam);
		++iCount;
	}
}

void ImwPlatformWindowDX11::Paint()
{
	if (m_bDrag)
	{
		//GetCursorPos()

		RECT oRect;
		GetWindowRect(m_hWnd, &oRect);

		POINT oCursorPoint;
		GetCursorPos(&oCursorPoint);

		int iX = m_iWindowPosStartDrag.x + oCursorPoint.x - m_iCursorPosStartDrag.x;
		int iY = m_iWindowPosStartDrag.y + oCursorPoint.y - m_iCursorPosStartDrag.y;
		SetWindowPos(m_hWnd, 0, iX, iY, 0, 0, SWP_NOSIZE);
	}

	if ( NULL != m_pSwapChain )
	{
		D3DXCOLOR bgColor(0.4f, 0.4f, 0.4f, 1.0f);

		s_pDeviceContext->OMSetRenderTargets(1, &m_pRenderTargetView, NULL);

		ImwIsSafe(s_pDeviceContext)->ClearRenderTargetView(m_pRenderTargetView, bgColor);

		SetState();

		ImGui::GetIO().DisplaySize = ImVec2(m_oSize.x, m_oSize.y);

		ImGui::NewFrame();

		ImwPlatformWindow::Paint();

		if (this == s_pLastHoveredWindow)
		{
			switch (ImGui::GetMouseCursor())
			{
			case ImGuiMouseCursor_Arrow:
				SetCursor(m_hCursorArrow);
				break;
			case ImGuiMouseCursor_TextInput:         // When hovering over InputText, etc.
				SetCursor(m_hCursorArrow);
				break;
			case ImGuiMouseCursor_Move:              // Unused
				SetCursor(m_hCursorArrow);
				break;
			case ImGuiMouseCursor_ResizeNS:          // Unused
				SetCursor(m_hCursorResizeNS);
				break;
			case ImGuiMouseCursor_ResizeEW:          // When hovering over a column
				SetCursor(m_hCursorResizeWE);
				break;
			case ImGuiMouseCursor_ResizeNESW:        // Unused
				SetCursor(m_hCursorArrow);
				break;
			case ImGuiMouseCursor_ResizeNWSE:        // When hovering over the bottom-right corner of a window
				SetCursor(m_hCursorArrow);
				break;
			}
		}

		RestoreState();

		//Present the backbuffer to the screen
		ImwIsSafe(m_pSwapChain)->Present(0, 0);
	}
}

void ImwPlatformWindowDX11::Destroy()
{

}

void ImwPlatformWindowDX11::StartDrag()
{
	m_bDrag = true;
	RECT oRect;
	GetWindowRect(m_hWnd, &oRect);
	m_iWindowPosStartDrag.x = oRect.left;
	m_iWindowPosStartDrag.y = oRect.top;

	POINT oCursorPoint;
	GetCursorPos(&oCursorPoint);
	m_iCursorPosStartDrag.x = oCursorPoint.x;
	m_iCursorPosStartDrag.y = oCursorPoint.y;
}

void ImwPlatformWindowDX11::StopDrag()
{
	m_bDrag = false;
}

bool ImwPlatformWindowDX11::IsDraging()
{
	return m_bDrag;
}

HWND ImwPlatformWindowDX11::GetHWnd()
{
	return m_hWnd;
}

LRESULT ImwPlatformWindowDX11::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
	if (IsStateSet())
	{
		std::string sMsg = GetStringFromMessages(message);
		ImwWindowManager::GetInstance()->Log("OnMessage %d %s\n", message, sMsg.c_str());
		return DefWindowProc(m_hWnd, message, wParam, lParam);
	}
	SetState();
	ImGuiIO& io = ImGui::GetIO();
	RestoreState();

	switch (message)
	{
	case WM_CLOSE:
		OnClose();
		return 1;
		break;
	//case WM_ENTERSIZEMOVE:
	//case WM_EXITSIZEMOVE:
	case WM_SIZE:
		{
			//RECT wr = { 0, 0, LOWORD(lParam), HIWORD(lParam) };
			//AdjustWindowRect(&wr, GetWindowLong(m_hWnd, GWL_STYLE), FALSE);
			if (NULL != m_pSwapChain)
			{
				s_pDeviceContext->OMSetRenderTargets(0, 0, 0);

				// Release all outstanding references to the swap chain's buffers.
				m_pRenderTargetView->Release();

				HRESULT hr;
				// Preserve the existing buffer count and format.
				// Automatically choose the width and height to match the client rect for HWNDs.
				hr = m_pSwapChain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, 0);

				hr = s_pFactory->MakeWindowAssociation(m_hWnd, DXGI_MWA_NO_ALT_ENTER );

				// Perform error handling here!

				// Get buffer and create a render-target-view.
				ID3D11Texture2D* pBuffer;
				hr = m_pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (void**)&pBuffer);
				// Perform error handling here!

				hr = s_pDevice->CreateRenderTargetView(pBuffer, NULL, &m_pRenderTargetView);
				// Perform error handling here!
				pBuffer->Release();

				s_pDeviceContext->OMSetRenderTargets(1, &m_pRenderTargetView, NULL);

				RECT oRect;
				GetClientRect(m_hWnd, &oRect);
				m_oSize = ImVec2(oRect.right - oRect.left, oRect.bottom - oRect.top);
				ClientToScreen(m_hWnd, reinterpret_cast<POINT*>(&oRect.left)); // convert top-left
				ClientToScreen(m_hWnd, reinterpret_cast<POINT*>(&oRect.right)); // convert bottom-right
				m_oPosition = ImVec2(oRect.left, oRect.top);

				ImwAssert(m_oSize.x == LOWORD(lParam));
				ImwAssert(m_oSize.y == HIWORD(lParam));

				ImwAssert(m_oSize.x > 0);
				ImwAssert(m_oSize.y > 0);
				//m_iWidth = LOWORD(lParam);
				//m_iHeight = HIWORD(lParam);

				// Set up the viewport.
				D3D11_VIEWPORT vp;
				vp.Width = m_oSize.x;
				vp.Height = m_oSize.y;
				vp.MinDepth = 0.0f;
				vp.MaxDepth = 1.0f;
				vp.TopLeftX = 0;
				vp.TopLeftY = 0;
				s_pDeviceContext->RSSetViewports(1, &vp);

				if (NULL == ImwWindowManager::GetInstance()->GetCurrentPlatformWindow())
				{
					Paint();
				}
			}
			return 0;
		}
		//break; // Not a forget
	case WM_GETMINMAXINFO:
		{
			MINMAXINFO* mmi = (MINMAXINFO*)lParam;
			mmi->ptMinTrackSize.x = 100;
			mmi->ptMinTrackSize.y = 100;
			return 0;
		}
	case WM_MOVE:
		{
			RECT oRect;
			GetClientRect(m_hWnd, &oRect);
			m_oSize = ImVec2(oRect.right - oRect.left, oRect.bottom - oRect.top);
			ClientToScreen(m_hWnd, reinterpret_cast<POINT*>(&oRect.left)); // convert top-left
			ClientToScreen(m_hWnd, reinterpret_cast<POINT*>(&oRect.right)); // convert bottom-right
			m_oPosition = ImVec2(oRect.left, oRect.top);
			//AdjustWindowRect(&oRect, GetWindowLong(m_hWnd, GWL_STYLE), FALSE);
			//m_oPosition = ImVec2(oRect.left, oRect.top);
		}
		break;
	case WM_KILLFOCUS:
		{
			OnLoseFocus();
		}
		break;

	case WM_DESTROY:
		//OutputDebugString("WM_DESTROY\n");
		//PostQuitMessage(0);
		break;
	case WM_ERASEBKGND:
		return 1;
		break;
	case WM_PAINT:
		return 1;
		break;
	case WM_LBUTTONDOWN:
		io.MouseDown[0] = true;
		return 1;
	case WM_LBUTTONUP:
		io.MouseDown[0] = false;
		return 1;
	case WM_RBUTTONDOWN:
		io.MouseDown[1] = true;
		return 1;
	case WM_RBUTTONUP:
		io.MouseDown[1] = false;
		return 1;
	case WM_MBUTTONDOWN:
		io.MouseDown[2] = true;
		return 1;
	case WM_MBUTTONUP:
		io.MouseDown[2] = false;
		return 1;
	case WM_MOUSEWHEEL:
		io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA;
		return 1;
	case WM_MOUSEMOVE:
		io.MousePos.x = (signed short)(lParam);
		io.MousePos.y = (signed short)(lParam >> 16);
		s_pLastHoveredWindow = this;
		return 1;
	case WM_KEYDOWN:
		if (wParam < 256)
			io.KeysDown[wParam] = 1;
		return 1;
	case WM_KEYUP:
		if (wParam < 256)
			io.KeysDown[wParam] = 0;
		return 1;
	case WM_CHAR:
		// You can also use ToAscii()+GetKeyboardState() to retrieve characters.
		if (wParam > 0 && wParam < 0x10000)
			io.AddInputCharacter((unsigned short)wParam);
		return 1;
	}

	return DefWindowProc(m_hWnd, message, wParam, lParam);
}

// Static

int ImwPlatformWindowDX11::GetInstanceCount()
{
	return s_mInstances.size();
}

void ImwPlatformWindowDX11::InitWndClassEx()
{
	if (!s_bClassInitialized)
	{
		WNDCLASSEX wc;

		ZeroMemory(&wc, sizeof(WNDCLASSEX));

		wc.cbSize = sizeof(WNDCLASSEX);
		wc.style = CS_HREDRAW | CS_VREDRAW;
		wc.lpfnWndProc = ImwPlatformWindowDX11Proc;
		//wc.hInstance = hInstance;
		wc.hInstance = GetModuleHandle(NULL);
		wc.hCursor = LoadCursor(NULL, IDC_ARROW);
		wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
		wc.lpszClassName = "ImwPlatformWindowDX11";

		RegisterClassEx(&wc);

		s_bClassInitialized = true;
	}
}

LRESULT ImwPlatformWindowDX11::ImwPlatformWindowDX11Proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	std::map<HWND, ImwPlatformWindowDX11*>::iterator it = s_mInstances.find(hWnd);
	if (it != s_mInstances.end())
	{
		return it->second->OnMessage(message, wParam, lParam);
	}
	/*else
	{
		ImAssert(false, "HWND not found in ImwPlatformWindowDX11 instances");
	}
	*/

	return DefWindowProc(hWnd, message, wParam, lParam);
}

bool ImwPlatformWindowDX11::InitDX11()
{
	HRESULT hr = CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)(&s_pFactory));

	if (FAILED(hr))
	{
		MessageBox(NULL, DXGetErrorDescription(hr), TEXT("CreateDXGIFactory"), MB_OK);
		return false;
	}

	hr = D3D11CreateDevice(NULL,
		D3D_DRIVER_TYPE_HARDWARE,
		NULL,
		NULL,
		NULL,
		NULL,
		D3D11_SDK_VERSION,
		&s_pDevice,
		NULL,
		&s_pDeviceContext);

	if (FAILED(hr))
	{
		MessageBox(NULL, DXGetErrorDescription(hr), TEXT("CreateDXGIFactory"), MB_OK);
		return false;
	}

	return true;
}

void ImwPlatformWindowDX11::ShutdownDX11()
{
	ImwSafeRelease(s_pDevice);
	ImwSafeRelease(s_pDeviceContext);
	ImwSafeRelease(s_pFactory);
}


text:
1. downloader : download data from the Internet.
2. pageProcessor : process data and.
3. scheduler : manage task queues.
4. utils : some useful tools such as xml and json Parser.
5. includes : all header files
6. init : initialize cspider.


text:
package edu.isi.karma.util;

import org.slf4j.Logger;

public class LogStackTrace {

	public LogStackTrace(Exception e, Logger logger)
	{
		logger.debug(e.getMessage());
		for(int i=0; i<e.getStackTrace().length; i++)
			logger.error(e.getStackTrace()[i].toString());
	}
}


text:
package com.facebook.buck.android;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import com.facebook.buck.io.MorePathsForTests;
import com.facebook.buck.util.HumanReadableException;
import com.facebook.buck.util.environment.Platform;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.Files;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Set;
import java.util.regex.Matcher;

public class AndroidPlatformTargetTest {
  @Rule public TemporaryFolder tempDir = new TemporaryFolder();
  @Rule public TemporaryFolder projectRoot = new TemporaryFolder();

  @Test
  public void testCreateFromDefaultDirectoryStructure() {
    String name = "Example Inc.:Google APIs:16";
    Path androidSdkDir = MorePathsForTests.rootRelativePath("home/android");
    String platformDirectoryPath = "platforms/android-16";
    Set<Path> additionalJarPaths = ImmutableSet.of();
    AndroidDirectoryResolver androidDirectoryResolver =
        new FakeAndroidDirectoryResolver(
            Optional.of(androidSdkDir),
            /* androidNdkDir */ Optional.<Path>absent(),
            /* ndkVersion */ Optional.<String>absent());

    AndroidPlatformTarget androidPlatformTarget = AndroidPlatformTarget
        .createFromDefaultDirectoryStructure(
            name,
            androidDirectoryResolver,
            platformDirectoryPath,
            additionalJarPaths,
            /* aaptOverride */ Optional.<Path>absent());
    assertEquals(name, androidPlatformTarget.getName());
    assertEquals(
        ImmutableList.of(
            MorePathsForTests.rootRelativePath(
                "home/android/platforms/android-16/android.jar")),
        androidPlatformTarget.getBootclasspathEntries());
    assertEquals(MorePathsForTests.rootRelativePath(
            "home/android/platforms/android-16/android.jar"),
        androidPlatformTarget.getAndroidJar());
    assertEquals(MorePathsForTests.rootRelativePath(
            "home/android/platforms/android-16/framework.aidl"),
        androidPlatformTarget.getAndroidFrameworkIdlFile());
    assertEquals(MorePathsForTests.rootRelativePath(
            "home/android/tools/proguard/lib/proguard.jar"),
        androidPlatformTarget.getProguardJar());
    assertEquals(MorePathsForTests.rootRelativePath(
            "home/android/tools/proguard/proguard-android.txt"),
        androidPlatformTarget.getProguardConfig());
    assertEquals(MorePathsForTests.rootRelativePath(
            "home/android/tools/proguard/proguard-android-optimize.txt"),
        androidPlatformTarget.getOptimizedProguardConfig());
    assertEquals(androidSdkDir.resolve("platform-tools/aapt").toAbsolutePath(),
        androidPlatformTarget.getAaptExecutable());
    assertEquals(androidSdkDir.resolve("platform-tools/aidl"),
        androidPlatformTarget.getAidlExecutable());
    assertEquals(
        androidSdkDir.resolve(
            Platform.detect() == Platform.WINDOWS ? "platform-tools/dx.bat" : "platform-tools/dx"),
        androidPlatformTarget.getDxExecutable());
  }

  @Test
  public void testInstalledNewerBuildToolsViaOldUpgradePath() throws IOException {
    File androidSdkDir = tempDir.newFolder();
    Path pathToAndroidSdkDir = androidSdkDir.toPath();
    AndroidDirectoryResolver androidDirectoryResolver =
        new FakeAndroidDirectoryResolver(
            Optional.of(androidSdkDir.toPath()),
            /* androidNdkDir */ Optional.<Path>absent(),
            /* ndkVersion */ Optional.<String>absent());
    File buildToolsDir = new File(androidSdkDir, "build-tools");
    buildToolsDir.mkdir();
    File buildToolsDirFromOldUpgradePath = new File(buildToolsDir, "17.0.0");
    buildToolsDirFromOldUpgradePath.mkdir();
    File addOnsLibsDir = new File(androidSdkDir, "add-ons/addon-google_apis-google-17/libs");
    addOnsLibsDir.mkdirs();
    Files.touch(new File(addOnsLibsDir, "effects.jar"));
    Files.touch(new File(addOnsLibsDir, "maps.jar"));
    Files.touch(new File(addOnsLibsDir, "usb.jar"));

    String platformId = "Google Inc.:Google APIs:17";
    Optional<AndroidPlatformTarget> androidPlatformTargetOption =
        AndroidPlatformTarget.getTargetForId(
            platformId,
            androidDirectoryResolver,
            /* aaptOverride */ Optional.<Path>absent());

    assertTrue(androidPlatformTargetOption.isPresent());
    AndroidPlatformTarget androidPlatformTarget = androidPlatformTargetOption.get();
    assertEquals(platformId, androidPlatformTarget.getName());
    assertEquals(
        ImmutableList.of(
            pathToAndroidSdkDir.resolve("platforms/android-17/android.jar"),
            pathToAndroidSdkDir.resolve("add-ons/addon-google_apis-google-17/libs/effects.jar"),
            pathToAndroidSdkDir.resolve("add-ons/addon-google_apis-google-17/libs/maps.jar"),
            pathToAndroidSdkDir.resolve("add-ons/addon-google_apis-google-17/libs/usb.jar")),
        androidPlatformTarget.getBootclasspathEntries());
    assertEquals(pathToAndroidSdkDir.resolve("platforms/android-17/android.jar"),
        androidPlatformTarget.getAndroidJar());
    assertEquals(pathToAndroidSdkDir.resolve("build-tools/17.0.0/aapt"),
        androidPlatformTarget.getAaptExecutable());
    assertEquals(pathToAndroidSdkDir.resolve("platform-tools/adb"),
        androidPlatformTarget.getAdbExecutable());
    assertEquals(pathToAndroidSdkDir.resolve("build-tools/17.0.0/aidl"),
        androidPlatformTarget.getAidlExecutable());
    assertEquals(pathToAndroidSdkDir.resolve(Platform.detect() == Platform.WINDOWS ?
                "build-tools/17.0.0/dx.bat" : "build-tools/17.0.0/dx"),
        androidPlatformTarget.getDxExecutable());
  }

  @Test
  public void testInstalledNewerBuildToolsViaFreshDownload() throws IOException {
    File androidSdkDir = tempDir.newFolder();
    Path pathToAndroidSdkDir = androidSdkDir.toPath();
    AndroidDirectoryResolver androidDirectoryResolver =
        new FakeAndroidDirectoryResolver(
            Optional.of(androidSdkDir.toPath()),
            /* androidNdkDir */ Optional.<Path>absent(),
            /* ndkVersion */ Optional.<String>absent());
    File buildToolsDir = new File(androidSdkDir, "build-tools");
    buildToolsDir.mkdir();
    File buildToolsDirFromFreshDownload = new File(buildToolsDir, "android-4.2.2");
    buildToolsDirFromFreshDownload.mkdir();
    File addOnsLibsDir = new File(androidSdkDir, "add-ons/addon-google_apis-google-17/libs");
    addOnsLibsDir.mkdirs();
    Files.touch(new File(addOnsLibsDir, "effects.jar"));
    Files.touch(new File(addOnsLibsDir, "maps.jar"));
    Files.touch(new File(addOnsLibsDir, "usb.jar"));

    String platformId = "Google Inc.:Google APIs:17";
    Optional<AndroidPlatformTarget> androidPlatformTargetOption =
        AndroidPlatformTarget.getTargetForId(
            platformId,
            androidDirectoryResolver,
            /* aaptOverride */ Optional.<Path>absent());

    assertTrue(androidPlatformTargetOption.isPresent());
    AndroidPlatformTarget androidPlatformTarget = androidPlatformTargetOption.get();
    assertEquals(platformId, androidPlatformTarget.getName());
    assertEquals(
        ImmutableList.of(
            pathToAndroidSdkDir.resolve("platforms/android-17/android.jar"),
            pathToAndroidSdkDir.resolve("add-ons/addon-google_apis-google-17/libs/effects.jar"),
            pathToAndroidSdkDir.resolve("add-ons/addon-google_apis-google-17/libs/maps.jar"),
            pathToAndroidSdkDir.resolve("add-ons/addon-google_apis-google-17/libs/usb.jar")),
        androidPlatformTarget.getBootclasspathEntries());
    assertEquals(pathToAndroidSdkDir.resolve("platforms/android-17/android.jar"),
        androidPlatformTarget.getAndroidJar());
    assertEquals(pathToAndroidSdkDir.resolve("build-tools/android-4.2.2/aapt"),
        androidPlatformTarget.getAaptExecutable());
    assertEquals(pathToAndroidSdkDir.resolve("platform-tools/adb"),
        androidPlatformTarget.getAdbExecutable());
    assertEquals(pathToAndroidSdkDir.resolve("build-tools/android-4.2.2/aidl"),
        androidPlatformTarget.getAidlExecutable());
    assertEquals(pathToAndroidSdkDir.resolve(Platform.detect() == Platform.WINDOWS ?
                "build-tools/android-4.2.2/dx.bat" : "build-tools/android-4.2.2/dx"),
        androidPlatformTarget.getDxExecutable());
  }

  @Test
  public void testChoosesCorrectBuildToolsDirectory() throws IOException {
    File androidSdkDir = tempDir.newFolder();
    AndroidDirectoryResolver androidDirectoryResolver =
        new FakeAndroidDirectoryResolver(
            Optional.of(androidSdkDir.toPath()),
            /* androidNdkDir */ Optional.<Path>absent(),
            /* ndkVersion */ Optional.<String>absent());
    File buildToolsDir = new File(androidSdkDir, "build-tools");
    buildToolsDir.mkdir();
    File addOnsLibsDir = new File(androidSdkDir, "add-ons/addon-google_apis-google-17/libs");
    addOnsLibsDir.mkdirs();
    Files.touch(new File(addOnsLibsDir, "effects.jar"));
    Files.touch(new File(addOnsLibsDir, "maps.jar"));
    Files.touch(new File(addOnsLibsDir, "usb.jar"));

    // Here is a number of subfolders in the build tools directory.
    new File(buildToolsDir, "android-4.2.2").mkdir();
    new File(buildToolsDir, "android-4.1").mkdir();
    new File(buildToolsDir, "android-4.0.0").mkdir();
    new File(buildToolsDir, "17.0.0").mkdir();
    new File(buildToolsDir, "16.0.0").mkdir();

    Optional<AndroidPlatformTarget> androidPlatformTargetOption =
        AndroidPlatformTarget.getTargetForId(
            "Google Inc.:Google APIs:17",
            androidDirectoryResolver,
            /* aaptOverride */ Optional.<Path>absent());
    assertTrue(androidPlatformTargetOption.isPresent());

    assertEquals(
        "17.0.0 should be used as the build directory",
        new File(androidSdkDir, "build-tools/17.0.0/aapt").toPath().toAbsolutePath(),
        androidPlatformTargetOption.get().getAaptExecutable());
  }

  @Test
  public void testChoosesCorrectBuildToolsBinDirectory() throws IOException {
    File androidSdkDir = tempDir.newFolder();
    AndroidDirectoryResolver androidDirectoryResolver =
        new FakeAndroidDirectoryResolver(
            Optional.of(androidSdkDir.toPath()),
            /* androidNdkDir */ Optional.<Path>absent(),
            /* ndkVersion */ Optional.<String>absent());
    File buildToolsDir = new File(androidSdkDir, "build-tools");
    buildToolsDir.mkdir();

    // Here is a number of subfolders in the build tools directory.
    new File(buildToolsDir, "17.0.0").mkdir();
    File buildToolsDir23 = new File(buildToolsDir, "23.0.0_rc1");
    buildToolsDir23.mkdir();

    // Create the bin directory that is found inside newer SDK build-tools folders.
    new File(buildToolsDir23, "bin").mkdir();

    Optional<AndroidPlatformTarget> androidPlatformTargetOption =
        AndroidPlatformTarget.getTargetForId(
            "android-17",
            androidDirectoryResolver,
            /* aaptOverride */ Optional.<Path>absent());
    assertTrue(androidPlatformTargetOption.isPresent());

    assertThat(
        "aapt should be found in the bin directory",
        androidPlatformTargetOption.get().getAaptExecutable(),
        equalTo(new File(
                androidSdkDir,
                "build-tools/23.0.0_rc1/bin/aapt").toPath().toAbsolutePath()));
    assertThat(
        "aidl should be found in the bin directory",
        androidPlatformTargetOption.get().getAidlExecutable(),
        equalTo(new File(
                androidSdkDir,
                "build-tools/23.0.0_rc1/bin/aidl").toPath().toAbsolutePath()));
    assertThat(
        "zipalign should be found in the bin directory",
        androidPlatformTargetOption.get().getZipalignExecutable(),
        equalTo(new File(
                androidSdkDir,
                "build-tools/23.0.0_rc1/bin/zipalign").toPath().toAbsolutePath()));
  }

  @Test
  public void testLooksForAdditionalAddonsDirectories() throws IOException {
    File androidSdkDir = tempDir.newFolder();
    AndroidDirectoryResolver androidDirectoryResolver =
        new FakeAndroidDirectoryResolver(
            Optional.of(androidSdkDir.toPath()),
            /* androidNdkDir */ Optional.<Path>absent(),
            /* ndkVersion */ Optional.<String>absent());
    File buildToolsDir = new File(androidSdkDir, "build-tools");
    buildToolsDir.mkdir();
    new File(buildToolsDir, "android-4.2.2").mkdir();

    File addOnsLibsDir1 = new File(androidSdkDir, "add-ons/addon-google_apis-google-17/libs");
    addOnsLibsDir1.mkdirs();
    File addOnsLibsDir2 = new File(androidSdkDir, "add-ons/addon-google_apis-google-17-2/libs");
    addOnsLibsDir2.mkdirs();
    Files.touch(new File(addOnsLibsDir2, "effects.jar"));

    // '-11' to test that the sorting works correctly.
    File addOnsLibsDir3 = new File(androidSdkDir, "add-ons/addon-google_apis-google-17-11/libs");
    addOnsLibsDir3.mkdirs();
    Files.touch(new File(addOnsLibsDir3, "ignored.jar"));

    Optional<AndroidPlatformTarget> androidPlatformTargetOption =
        AndroidPlatformTarget.getTargetForId(
            "Google Inc.:Google APIs:17",
            androidDirectoryResolver,
            /* aaptOverride */ Optional.<Path>absent());
    assertTrue(androidPlatformTargetOption.isPresent());

    // Verify that addOnsLibsDir2 was picked up since addOnsLibsDir1 is empty.
    assertTrue(androidPlatformTargetOption.get().getBootclasspathEntries().contains(
            addOnsLibsDir2.toPath().resolve("effects.jar").toAbsolutePath()));
    assertFalse(androidPlatformTargetOption.get().getBootclasspathEntries().contains(
            addOnsLibsDir3.toPath().resolve("ignored.jar").toAbsolutePath()));
  }

  @Test
  public void testThrowsExceptionWhenAddOnsDirectoryIsMissing() throws IOException {
    File androidSdkDir = tempDir.newFolder();
    String platformId = "Google Inc.:Google APIs:17";
    AndroidDirectoryResolver androidDirectoryResolver =
        new FakeAndroidDirectoryResolver(
            Optional.of(androidSdkDir.toPath()),
            /* androidNdkDir */ Optional.<Path>absent(),
            /* ndkVersion */ Optional.<String>absent());
    try {
      AndroidPlatformTarget.getTargetForId(
          platformId,
          androidDirectoryResolver,
          /* aaptOverride */ Optional.<Path>absent());
      fail("Should have thrown HumanReadableException");
    } catch (HumanReadableException e) {
      assertEquals(
          String.format(
              "Google APIs not found in %s.\n" +
              "Please run '%s/tools/android sdk' and select both 'SDK Platform' and " +
              "'Google APIs' under Android (API 17)",
              new File(androidSdkDir, "add-ons/addon-google_apis-google-17/libs").getAbsolutePath(),
              androidSdkDir.getPath()),
          e.getMessage());
    }
  }

  @Test
  public void testLooksForGoogleLibsOnlyWhenGoogleApiTarget() throws IOException {
    File androidSdkDir = tempDir.newFolder();
    Path pathToAndroidSdkDir = androidSdkDir.toPath();
    AndroidDirectoryResolver androidDirectoryResolver =
        new FakeAndroidDirectoryResolver(
            Optional.of(androidSdkDir.toPath()),
            /* androidNdkDir */ Optional.<Path>absent(),
            /* ndkVersion */ Optional.<String>absent());
    File buildToolsDir = new File(androidSdkDir, "build-tools");
    buildToolsDir.mkdir();
    new File(buildToolsDir, "android-4.2.2").mkdir();

    File addOnsLibsDir = new File(androidSdkDir, "add-ons/addon-google_apis-google-17/libs");
    addOnsLibsDir.mkdirs();
    Files.touch(new File(addOnsLibsDir, "effects.jar"));
    Files.touch(new File(addOnsLibsDir, "maps.jar"));
    Files.touch(new File(addOnsLibsDir, "usb.jar"));

    // This one should include the Google jars
    Optional<AndroidPlatformTarget> androidPlatformTargetOption1 =
        AndroidPlatformTarget.getTargetForId(
            "Google Inc.:Google APIs:17",
            androidDirectoryResolver,
            /* aaptOverride */ Optional.<Path>absent());
    assertTrue(androidPlatformTargetOption1.isPresent());
    assertEquals(
        ImmutableList.of(
            pathToAndroidSdkDir.resolve("platforms/android-17/android.jar"),
            pathToAndroidSdkDir.resolve("add-ons/addon-google_apis-google-17/libs/effects.jar"),
            pathToAndroidSdkDir.resolve("add-ons/addon-google_apis-google-17/libs/maps.jar"),
            pathToAndroidSdkDir.resolve("add-ons/addon-google_apis-google-17/libs/usb.jar")),
        androidPlatformTargetOption1.get().getBootclasspathEntries());

    // This one should only include android.jar
    Optional<AndroidPlatformTarget> androidPlatformTargetOption2 =
        AndroidPlatformTarget.getTargetForId(
            "android-17",
            androidDirectoryResolver,
            /* aaptOverride */ Optional.<Path>absent());
    assertTrue(androidPlatformTargetOption2.isPresent());
    assertEquals(
        ImmutableList.of(
            pathToAndroidSdkDir.resolve("platforms/android-17/android.jar")),
        androidPlatformTargetOption2.get().getBootclasspathEntries());
  }

  @Test
  public void testPlatformTargetFindsCorrectZipAlign() throws IOException {
    File androidSdkDir = tempDir.newFolder();
    Path pathToAndroidSdkDir = androidSdkDir.toPath();
    AndroidDirectoryResolver androidDirectoryResolver =
        new FakeAndroidDirectoryResolver(
            Optional.of(androidSdkDir.toPath()),
            /* androidNdkDir */ Optional.<Path>absent(),
            /* ndkVersion */ Optional.<String>absent());
    File buildToolsDir = new File(androidSdkDir, "build-tools");
    buildToolsDir.mkdir();
    File buildToolsDirFromOldUpgradePath = new File(buildToolsDir, "17.0.0");
    buildToolsDirFromOldUpgradePath.mkdir();
    Files.touch(new File(buildToolsDirFromOldUpgradePath, "zipalign"));
    File addOnsLibsDir = new File(androidSdkDir, "add-ons/addon-google_apis-google-17/libs");
    addOnsLibsDir.mkdirs();
    Files.touch(new File(addOnsLibsDir, "effects.jar"));

    String platformId = "Google Inc.:Google APIs:17";
    Optional<AndroidPlatformTarget> androidPlatformTargetOption =
        AndroidPlatformTarget.getTargetForId(
            platformId,
            androidDirectoryResolver,
            /* aaptOverride */ Optional.<Path>absent());

    assertTrue(androidPlatformTargetOption.isPresent());
    AndroidPlatformTarget androidPlatformTarget = androidPlatformTargetOption.get();
    assertEquals(platformId, androidPlatformTarget.getName());
    assertEquals(
        pathToAndroidSdkDir.resolve("build-tools/17.0.0/zipalign"),
        androidPlatformTarget.getZipalignExecutable());

    File toolsDir = new File(androidSdkDir, "tools");
    toolsDir.mkdirs();
    Files.touch(new File(toolsDir, "zipalign"));
    androidPlatformTargetOption =
        AndroidPlatformTarget.getTargetForId(
            platformId,
            androidDirectoryResolver,
            /* aaptOverride */ Optional.<Path>absent());
    assertTrue(androidPlatformTargetOption.isPresent());
    androidPlatformTarget = androidPlatformTargetOption.get();
    assertEquals(platformId, androidPlatformTarget.getName());
    assertEquals(
        pathToAndroidSdkDir.resolve("tools/zipalign"),
        androidPlatformTarget.getZipalignExecutable());
  }

  @Test
  public void testPlatformTargetPattern() {
    testPlatformTargetRegex("Google Inc.:Google APIs:8", true, "8");
    testPlatformTargetRegex("Google Inc.:Google APIs:17", true, "17");
    testPlatformTargetRegex("android-8", true, "8");
    testPlatformTargetRegex("android-17", true, "17");
    testPlatformTargetRegex("Google Inc.:Google APIs:", false, "");
    testPlatformTargetRegex("Google Inc.:Google APIs:blah", false, "");
    testPlatformTargetRegex("android-", false, "");
    testPlatformTargetRegex("android-blah", false, "");
  }

  private void testPlatformTargetRegex(String input, boolean matches, String id) {
    Matcher matcher = AndroidPlatformTarget.PLATFORM_TARGET_PATTERN.matcher(input);
    assertEquals(matches, matcher.matches());
    if (matches) {
      assertEquals(id, matcher.group(1));
    }
  }
}


text:
'use strict';

const ESLintTester = require('eslint').RuleTester;

ESLintTester.setDefaultConfig({
  parser: require.resolve('@babel/eslint-parser'),
  parserOptions: {
    requireConfigFile: false,
    ecmaVersion: 6,
    sourceType: 'module',
  },
});

module.exports = ESLintTester;


text:
namespace oakvr
{
	class ConsoleVisual;

	class Console : public Updatable
	{
	public:
		auto Update(float dt) -> bool;

	private:
		auto HandleInput() -> void;

		std::string m_currentCommand;
		std::vector<std::string> m_history;
		up<ConsoleVisual> m_pConsoleVisual;
		size_t m_cursorPosition = 0;
		bool m_bOnScreen = false;
	};
}


text:
i = 10; %inital videoframe
j = 100; %final videoframe

%close all the other images
close all
%get the first image of the video
videoFrame = (uint8(x(:,:,:,i)));
%[x,y,width,height]
bbox=[165,235,90,36];

%shows the location of interest probably remove this line later
videoFrame = insertShape(videoFrame, 'Rectangle', bbox);
%display the image with the rectangle3
figure; imshow(videoFrame); title('Initial domino');

% Convert the first box into a list of 4 points
% This is needed to be able to visualize the rotation of the object.
bboxPoints = bbox2points(bbox(1, :))

% Detect feature points in the face region.
points = detectMinEigenFeatures(rgb2gray(videoFrame), 'ROI', bbox);

% Display the detected points.
figure, imshow(videoFrame), hold on, title('Detected features');
plot(points);

% Create a point tracker and enable the bidirectional error constraint to
% make it more robust in the presence of noise and clutter.
pointTracker = vision.PointTracker('MaxBidirectionalError', 2);

% Initialize the tracker with the initial point locations and the initial
% video frame.
points = points.Location;
initialize(pointTracker, points, videoFrame);

videoPlayer  = vision.VideoPlayer('Position',...
    [100 100 [size(videoFrame, 2), size(videoFrame, 1)]+30]);

% Make a copy of the points to be used for computing the geometric
% transformation between the points in the previous and the current frames
oldPoints = points;

while i < j
    % get the next frame
    i=i+1;
    videoFrame = (uint8(x(:,:,:,i)));

     % Track the points. Note that some points may be lost.
    [points, isFound] = step(pointTracker, videoFrame);
    visiblePoints = points(isFound, :);
    oldInliers = oldPoints(isFound, :);

     if size(visiblePoints, 1) >= 2 % need at least 2 points

        % Estimate the geometric transformation between the old points
        % and the new points and eliminate outliers
        [xform, oldInliers, visiblePoints] = estimateGeometricTransform(...
            oldInliers, visiblePoints, 'similarity', 'MaxDistance', 4);

         % Apply the transformation to the bounding box points
        bboxPoints = transformPointsForward(xform, bboxPoints);

         % Insert a bounding box around the object being tracked
        bboxPolygon = reshape(bboxPoints', 1, []);
        videoFrame = insertShape(videoFrame, 'Polygon', bboxPolygon, ...
            'LineWidth', 2);

         % Display tracked points
        videoFrame = insertMarker(videoFrame, visiblePoints, '+', ...
            'Color', 'white');

        % Reset the points
        oldPoints = visiblePoints;
        setPoints(pointTracker, oldPoints);

     end
     step(videoPlayer, videoFrame);

end


text:
% v2-acmsmall-sample.tex, dated March 6 2012
% This is a sample file for ACM small trim journals
%
% Compilation using 'acmsmall.cls' - version 1.3 (March 2012), Aptara Inc.
% (c) 2010 Association for Computing Machinery (ACM)
%
% Questions/Suggestions/Feedback should be addressed to => "acmtexsupport@aptaracorp.com".
% Users can also go through the FAQs available on the journal's submission webpage.
%
% Steps to compile: latex, bibtex, latex latex
%
% For tracking purposes => this is v1.3 - March 2012

\documentclass[prodmode,acmtecs]{acmsmall} % Aptara syntax

% Package to generate and customize Algorithm as per ACM style
\usepackage[ruled]{algorithm2e}
\renewcommand{\algorithmcfname}{ALGORITHM}
\SetAlFnt{\small}
\SetAlCapFnt{\small}
\SetAlCapNameFnt{\small}
\SetAlCapHSkip{0pt}
\IncMargin{-\parindent}

% Metadata Information
\acmVolume{1}
\acmNumber{1}
\acmArticle{1}
\acmYear{2016}
\acmMonth{10}

% Document starts
\begin{document}

% Page heads
\markboth{Shi and Xue}{Non-Human Social Graphs}

% Title portion
\title {Non-Human Social Graphs}
\author{Wendy Shi
\affil{Stanford University}
Alfred Xue
\affil{Stanford University}}

\begin{abstract}
In CS224 lecture, we discussed the concept of a small world - the idea that the shortest path between any two individuals
is relatively small. This has been attributed to the principle that the likelihood that two individuals know each other
correlates significantly with the geographical distance between them. Effectively, this allows each step in the shortest
path to travel a percentage of the remaining distance, which causes the shortest path to grow logarithmically with
geographical distance, rather than linearly. Other properties, such as having small two-hop neighborhoods and a specific
degree distribution have all been attributed to Social Network.

We are curious to see which of these characteristics can be found in non-social graphs, and using such information evaluate
which of these characteristics are actually specific to social graphs, and which might be artifacts of some property that
isn't specific to social graphs. To do so, we compute the coefficents for these characteristics on many social and information
networks, including MyAnimeList, actors, and Wikipedia, and compare these values to those found on Social Networks such as
Facebook. We found that (insert conclusion here).
\end{abstract}

\category{C}{Graph Characteristics}{}

\terms{Design, Algorithms, Performance}

\keywords{Small World, Network Analysis}

\acmformat{Wendy Shi, Alfred Xue, 2016. Diameter of MyAnimeList}
\begin{bottomstuff}
\end{bottomstuff}

\maketitle

\section{Introduction}
Plenty of research has been done on the topological properties of social and information networks. From a non-technical perspective,
it is very easy to define what a social network is. We think of it as the networks that describe some types of relationships between
individuals in society. The most popular example is Facebook, which defines itself to be a social network. But there are also other
social networks, such as phone contacts and collaborators. Information networks tend to be defined as "not social networks", but we
think of them as web links or co-authored research papers. Myers et al admits that there isn't a clear definition by researchers of
what a social network is, and their own research on the Twitter network demonstrates that the boundary between a social network and
a non-social network isn't super clear. Our objective is to evaluate the topological properties of a set of networks that have varrying degrees
of what people would traditionally consider to be a "social network", and use those to attempt to discern which properties are more
relevant to a technical definition of a social network.

The networks that we studied (from most social to most informational) are Facebook, Actors, Twitter, MyAnimeList with edges based on recommendations,
MyAnimeList with edges based on Genre, and Wikipedia page links.

\section{Literature Review}
The question
\begin{quote}
``If you chose any two people in the world at random, how many acquaintances are needed to create a chain between them?''
[Kochen, 1989; Garfield 1979]
\end{quote}
describes the small world problem in a succinct manner. Stanley Milgram's famous postcard experiment was the
first experiment that attempted to measure the degrees of separation between people in the world. To do so, he selected
a broker in Boston to be a target, and had a group of individuals send letters to acquaintances, seeing if those letters
could eventually be routed to the Boston broker. The famous "six degrees of separation" phrase is derived from the results
of Milgram's experiment.

Although there are heavy criticisms around the veracity of Milgram's experiments, his work clearly demonstrates two ideas.
The first is that the degrees of separation in a human social graph are far smaller than one would intuitively think,
and the other is that the graph is \textit{navigable}, that is, there exists some algorithm that can traverse from any
node $s$ to destination node $t$ only knowing the edges of the current node in $O(\log(N)^\beta)$ time.

The intuition for both of these properties derives from the idea that the likelihood of two people knowing each other is strongly
correlated with their geographical distance. That is, in general, as long as the next hop is geographically closer, then our
new node has a shorter path to the destination node than our current one. However, this isn't sufficient to explain the
results of Milgram's experiments. For example, if every individual knows every other individual within a one mile radius, but
knows no one else, then the shortest path between two nodes eight hundred miles apart requires eight hundred hops -- order of
magnitudes greater than what was observed in Milgram's study. Thus the second requirement is that with high probability, our current
node will be connected to another node whose distance to the destination is no more than $\alpha << 1$ times the distance from
our current node to the destination node. This allows us to travel to the destination much faster -- the number of hops now
scales logarithmically rather than linearly with the distance to the destination.

Although "six degrees of separation" is often cited, Milgram's experiment has a few key flaws that should prevent its results
from extending to the claim that "all humans are seperated by six degrees." These key flaws are highlighted by Judith Kleinfeld.
The first is that both the start and end nodes were recruited from socially active people --
basically, in expectation the degrees of separation between individuals is actually higher, because starting nodes and ending
node should be less reachable than the ones used in the experiment. Other criticisms he highlights include that humans have
a psychological bias to believe in a short degree of separation. In general, Kleinfeld criticizes the legitimacy of the study,
but does not provide any methods to provide a better study, and his criticisms probably aren't strong enough to reject the
concept of a small world, although they are probably strong enough to suggest that six degrees of separation is insufficient [1].

Nevertheless, "six degrees of separation" is probably here to stay, and is supported by more recent analysis on the Facebook
social network by Backstrom et. al.

The Facebook network is clearly a social graph, and maintains the properties one would expect from a social graph.
Properties such as high clustering, low degrees of separation, and relatively low connections (i.e. number of edges << number of nodes$^2$)
are all observed in this network. Other networks where these properties are observed includes a network of actors, where
edges are defined by having collaborated on multiple movies together, or a network of researchers, where an edge is
defined to be when two researches have collaborated on a published paper together. The work by Backstorm uses HyperANF, which
is similar to what snap.py uses to compute node distances, but uses hyperloglog counters to estimate these distances with
high accuracy. HyperANF increases the amount of nodes that can be computed on exponentially with little loss of overall accuracy
(individual pairs are less accurate), and allows computation over 700 billion edges [2].

This study introduces the concept of a spid, or a \textit{index of dispersion} $\frac{\sigma^2}{\mu}$ of the distance distribution.
This paper describes the importance of spid as follows,
\begin{quote}
    "In particular, networks with a spid larger than
    one should be considered "web-like", whereas networks with a
    spid smaller than one should be considered 'properly social'"
\end{quote}
with the logic being that social networks tend to favor short connections (and thus low dispersion), whereas in web/information networks
long connections are not uncommon. The results of Backstorm's work clearly indicates that Facebook has a spid well below one. Because this
paper used HyperANF, it cannot compute the diameter on the graph -- it can only get a lower bound. This is one drawback of using
HyperANF, and something to consider when working with large databases. One criticism of this work is that it does not attempt to draw
any meaningful conclusions. It concludes that Facebook is a "small-world graph" with an average distance of less than 4, but does not
attempt to understand any interesting phenomenon observed. We would also liked to have seen analysis on the diameter of Facebook, but
that may be infeasible with the computing power at the time.

At this point it becomes clear that there is an interesting distinction between social graphs and web graphs, so we would like to explore
the distinction between them. Luckily there has already been work done on this on the twitter graph by Myers et. al. Myers et. al. wanted to
determine whether Twitter acted more like a social graph or an information network. The basis of this question is that follows are done
through interests rather than relationships, which makes it more like an information network, but initial follows are often based on
social interactions. They define the nodes to be twitter accounts and edges to be mutual follows between the accounts.

Myers et. al. also used HyperANF on their dataset of 175 million users and approximately twenty billion edges for mutual follows. (Twitter
has more edges per node than Facebook since follows are more common than friendships). In this case, they analyzed multiple graph characteristics
of the Twitter graph and compared them to the known characteristics of both information and social graphs. For degree distributions, it is clear
that Twitter does not exhibit social graph like characteristics because it has too many individuals who follow and are followed by thousands
of people when people are typically unable to maintain more than 150 social relationships at any given time. For both shortest path length and spid,
the authors concluded that Twitter exhibited social graph like behaviors, with the shortest path being around 4 (slightly longer than Facebook), and
the spid being around 0.11 (slightly wider than Facebook). They also noted that the clustering coefficient of the Twitter graph was relatively high,
and thus indicative of a social graph. However, they also noted that the two-hop neighborhoods of Twitter were much much larger than what
would be expected in a social graph.

The authors than unhelpfully concluded that Twitter exhibits some characteristics of a social graph and some characteristics of a information graph,
but make no attempt to unify the differing characteristics [3].

% Bibliography
\section{Bibliography}
[1] Kleinfield, J. 2002. Could It Be A Big World?. Forthcoming Society 2002.

[2] L. Backstrom, P. Boldi, M. Rosa, J. Ugander, and S.Vigna. Four degrees of separation. WebSci 2012.

[3] S. A. Myers, A. Sharma, P. Gupta, and J. Lin. Information network or social network? The structure of the Twitter follow graph. WWW Companion, 2014.
\end{document}
% End of v2-acmsmall-sample.tex (March 2012) - Gerry Murray, ACM


text:
import sinon from 'sinon'
import chai from 'chai'
import sinonChai from 'sinon-chai'
import sinonAsPromised from 'sinon-as-promised'
import chaiAsPromised from 'chai-as-promised'

chai.should()
chai.use(sinonChai)
chai.use(chaiAsPromised)


text:
namespace NLog.UnitTests.Config
{
    using System;
    using NLog.Config;
    using NLog.LayoutRenderers;
    using NLog.Layouts;
    using NLog.Targets;
    using Xunit;

    public class VariableTests : NLogTestBase
    {
        [Fact]
        public void VariablesTest1()
        {
            var configuration = XmlLoggingConfiguration.CreateFromXmlString(@"
<nlog throwExceptions='true'>
    <variable name='prefix' value='[[' />
    <variable name='suffix' value=']]' />

    <targets>
        <target name='d1' type='Debug' layout='${prefix}${message}${suffix}' />
    </targets>
</nlog>");

            var d1 = configuration.FindTargetByName("d1") as DebugTarget;
            Assert.NotNull(d1);
            var layout = d1.Layout as SimpleLayout;
            Assert.NotNull(layout);
            Assert.Equal(3, layout.Renderers.Count);
            var lr1 = layout.Renderers[0] as LiteralLayoutRenderer;
            var lr2 = layout.Renderers[1] as MessageLayoutRenderer;
            var lr3 = layout.Renderers[2] as LiteralLayoutRenderer;
            Assert.NotNull(lr1);
            Assert.NotNull(lr2);
            Assert.NotNull(lr3);
            Assert.Equal("[[", lr1.Text);
            Assert.Equal("]]", lr3.Text);
        }

        /// <summary>
        /// Expand of property which are not layoutable <see cref="Layout"/>, but still get expanded.
        /// </summary>
        [Fact]
        public void VariablesTest_string_expanding()
        {
            var configuration = XmlLoggingConfiguration.CreateFromXmlString(@"
<nlog throwExceptions='true'>
  <variable name='test' value='hello'/>
  <targets>
    <target type='DataBase'  name='test' DBProvider='${test}'/>
  </targets>
</nlog>");

            var target = configuration.FindTargetByName("test") as DatabaseTarget;
            Assert.NotNull(target);
            //dont change the ${test} as it isn't a Layout
            Assert.NotEqual(typeof(Layout), target.DBProvider.GetType());
            Assert.Equal("hello", target.DBProvider);
        }

        [Fact]
        public void VariablesTest_minLevel_expanding()
        {
            var configuration = XmlLoggingConfiguration.CreateFromXmlString(@"
<nlog throwExceptions='true'>
   <variable name='test' value='debug'/>
    <rules>
      <logger minLevel='${test}' final='true' />
    </rules>
</nlog>");

            var rule = configuration.LoggingRules[0];
            Assert.NotNull(rule);
            Assert.False(rule.IsLoggingEnabledForLevel(LogLevel.Trace));
            Assert.True(rule.IsLoggingEnabledForLevel(LogLevel.Debug));
            Assert.True(rule.IsLoggingEnabledForLevel(LogLevel.Info));
            Assert.True(rule.IsLoggingEnabledForLevel(LogLevel.Warn));
            Assert.True(rule.IsLoggingEnabledForLevel(LogLevel.Error));
            Assert.True(rule.IsLoggingEnabledForLevel(LogLevel.Fatal));

        }

        /// <summary>
        /// Expand of level attributes
        /// </summary>
        [Fact]
        public void VariablesTest_Level_expanding()
        {
            var configuration = XmlLoggingConfiguration.CreateFromXmlString(@"
<nlog throwExceptions='true'>
   <variable name='test' value='debug'/>
    <rules>
      <logger level='${test}' final='true' />
    </rules>
</nlog>");

            var rule = configuration.LoggingRules[0];
            Assert.NotNull(rule);
            Assert.False(rule.IsLoggingEnabledForLevel(LogLevel.Trace));
            Assert.True(rule.IsLoggingEnabledForLevel(LogLevel.Debug));
            Assert.False(rule.IsLoggingEnabledForLevel(LogLevel.Info));
            Assert.False(rule.IsLoggingEnabledForLevel(LogLevel.Warn));
            Assert.False(rule.IsLoggingEnabledForLevel(LogLevel.Error));
            Assert.False(rule.IsLoggingEnabledForLevel(LogLevel.Fatal));

        }

        [Fact]
        public void Xml_configuration_returns_defined_variables()
        {
            var configuration = XmlLoggingConfiguration.CreateFromXmlString(@"
<nlog throwExceptions='true'>
    <variable name='prefix' value='[[' />
    <variable name='suffix' value=']]' />

    <targets>
        <target name='d1' type='Debug' layout='${prefix}${message}${suffix}' />
    </targets>
</nlog>");

            LogManager.Configuration = configuration;

            Assert.Equal("[[", LogManager.Configuration.Variables["prefix"].OriginalText);
            Assert.Equal("]]", LogManager.Configuration.Variables["suffix"].OriginalText);
        }

        [Fact]
        public void Xml_configuration_with_inner_returns_defined_variables_withValueElement()
        {
            var configuration = XmlLoggingConfiguration.CreateFromXmlString(@"
<nlog throwExceptions='true'>
    <variable name='prefix'>

<value><![CDATA[
newline
]]></value>

</variable>
    <variable name='suffix'><value>]]</value></variable>
</nlog>");

            var nullEvent = LogEventInfo.CreateNullEvent();

            // Act & Assert
            Assert.Equal("\nnewline\n", configuration.Variables["prefix"].Render(nullEvent).Replace("\r", ""));
            Assert.Equal("]]", configuration.Variables["suffix"].Render(nullEvent));
        }

        [Fact]
        public void Xml_configuration_variableWithInnerAndAttribute_attributeHasPrecedence()
        {
            var configuration = XmlLoggingConfiguration.CreateFromXmlString(@"
<nlog throwExceptions='true'>
    <variable name='var1' value='1'><value>2</value></variable>
</nlog>");

            var nullEvent = LogEventInfo.CreateNullEvent();

            // Act & Assert
            Assert.Equal("1", configuration.Variables["var1"].FixedText);
        }

        [Fact]
        public void NLogConfigurationExceptionShouldThrown_WhenVariableNodeIsWrittenToWrongPlace()
        {
            LogManager.ThrowConfigExceptions = true;
            const string configurationString_VariableNodeIsInnerTargets =
                    @"<nlog>
	                        <targets>
			                    <variable name='variableOne' value='${longdate:universalTime=True}Z | ${message}'/>
                    			<target name='d1' type='Debug' layout='${variableOne}' />
	                        </targets>
                            <rules>
			                    <logger name='*' minlevel='Debug' writeTo='d1'/>
                            </rules>
                    </nlog>";

            const string configurationString_VariableNodeIsAfterTargets =
                    @"<nlog>
	                        <targets>
			                    <target name='d1' type='Debug' layout='${variableOne}' />
	                        </targets>
                            <variable name='variableOne' value='${longdate:universalTime=True}Z | ${message}'/>
                            <rules>
			                    <logger name='*' minlevel='Debug' writeTo='d1'/>
                            </rules>
                    </nlog>";

            NLogConfigurationException nlogConfEx_ForInnerTargets = Assert.Throws<NLogConfigurationException>(
                () => XmlLoggingConfiguration.CreateFromXmlString(configurationString_VariableNodeIsInnerTargets)
                );

            NLogConfigurationException nlogConfExForAfterTargets = Assert.Throws<NLogConfigurationException>(
                () => XmlLoggingConfiguration.CreateFromXmlString(configurationString_VariableNodeIsAfterTargets)
                );
        }
    }
}


text:
require 'ting_yun/support/http_clients/uri_util'

module TingYun
  module Agent
    class Transaction
      class RequestAttributes

        attr_reader :request_path, :referer, :accept, :content_length, :host,
                    :port, :user_agent, :request_method, :header, :cookie

        HTTP_ACCEPT_HEADER_KEY = 'HTTP_ACCEPT'.freeze

        def initialize request
          @header = request.env
          @request_path = path_from_request request
          @referer = referer_from_request request
          @accept = attribute_from_env request, HTTP_ACCEPT_HEADER_KEY
          @content_length = content_length_from_request request
          @host = attribute_from_request request, :host
          @port = port_from_request request
          @user_agent = attribute_from_request request, :user_agent
          @request_method = attribute_from_request request, :request_method
          @cookie = set_cookie(request)
        end

        def assign_agent_attributes(attributes)
          attributes.add_agent_attribute :request_path, request_path
          attributes.add_agent_attribute :referer, referer
          attributes.add_agent_attribute :accept, accept
          attributes.add_agent_attribute :contentLength, content_length
          attributes.add_agent_attribute :host, host
          attributes.add_agent_attribute :port, port
          attributes.add_agent_attribute :userAgent, user_agent
          attributes.add_agent_attribute :method, request_method
        end

        private

        # Make a safe attempt to get the referer from a request object, generally successful when
        # it's a Rack request.

        def referer_from_request request
          if referer = attribute_from_request(request, :referer)
            TingYun::Agent::HTTPClients::URIUtil.strip_query_string referer.to_s
          end
        end

        ROOT_PATH = "/".freeze

        def path_from_request request
          path = attribute_from_request(request, :path) || ''
          path = TingYun::Agent::HTTPClients::URIUtil.strip_query_string(path)
          path.empty? ? ROOT_PATH : path
        end

        def content_length_from_request request
          if content_length = attribute_from_request(request, :content_length)
            content_length.to_i
          end
        end

        def port_from_request request
          if port = attribute_from_request(request, :port)
            port.to_i
          end
        end

        def attribute_from_request request, attribute_method
          if request.respond_to? attribute_method
            request.send(attribute_method)
          end
        end

        def attribute_from_env request, key
          if env = attribute_from_request(request, :env)
            env[key]
          end
        end

        def set_cookie(request)
          cookie = {}
          _c = attribute_from_env(request, 'HTTP_COOKIE')
          _c.split(/\s*;\s*/).each do |i|
            _k, _v = i.split('=')
            if _k && _v
              cookie[_k] = _v
            end
          end if _c
          cookie
        end

      end
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace FileDialogs.Design
{
    public partial class FileDialogFilterEditorForm : Form
    {
        public FileDialogFilterEditorForm()
        {
            InitializeComponent();
        }

        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}