text:
package ua.com.fielden.platform.domaintree.testing;

import java.math.BigDecimal;

import ua.com.fielden.platform.entity.AbstractEntity;
import ua.com.fielden.platform.entity.annotation.DescTitle;
import ua.com.fielden.platform.entity.annotation.IsProperty;
import ua.com.fielden.platform.entity.annotation.KeyTitle;
import ua.com.fielden.platform.entity.annotation.KeyType;
import ua.com.fielden.platform.entity.annotation.Observable;

/**
 * Entity for "included properties logic" testing.
 *
 * @author TG Team
 *
 */
@KeyTitle(value = "Key title", desc = "Key desc")
@DescTitle(value = "Desc title", desc = "Desc desc")
@KeyType(String.class)
public class MasterEntityForCentreDomainTree extends AbstractEntity<String> {
    private static final long serialVersionUID = 1L;

    protected MasterEntityForCentreDomainTree() {
    }

    ////////// Range types //////////
    @IsProperty
    private Integer integerProp = null;

    public Integer getIntegerProp() {
        return integerProp;
    }

    @Observable
    public void setIntegerProp(final Integer integerProp) {
        this.integerProp = integerProp;
    }

    @IsProperty
    private BigDecimal bigDecimalProp = new BigDecimal(0.0);

    public BigDecimal getBigDecimalProp() {
        return bigDecimalProp;
    }

    @Observable
    public void setBigDecimalProp(final BigDecimal bigDecimalProp) {
        this.bigDecimalProp = bigDecimalProp;
    }

    @IsProperty
    private EntityWithStringKeyType simpleEntityProp;

    public EntityWithStringKeyType getSimpleEntityProp() {
        return simpleEntityProp;
    }

    @Observable
    public void setSimpleEntityProp(final EntityWithStringKeyType simpleEntityProp) {
        this.simpleEntityProp = simpleEntityProp;
    }

    @IsProperty
    private boolean booleanProp = false;

    public boolean isBooleanProp() {
        return booleanProp;
    }

    @Observable
    public void setBooleanProp(final boolean booleanProp) {
        this.booleanProp = booleanProp;
    }

    @IsProperty
    private boolean booleanProp2 = false;

    public boolean isBooleanProp2() {
        return booleanProp2;
    }

    @Observable
    public void setBooleanProp2(final boolean booleanProp2) {
        this.booleanProp2 = booleanProp2;
    }
}


text:
package com.tts.component.cache;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Created by zhaoqi on 2016/8/12 0012.
 * 添加缓存
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface TTSCache {

    /**
     * 缓存key表达式
     * 格式: "anyWords#{productId}anyWords#{ProductName}anyWords"
     * #{arg} 会被arg的字段值替换
     * @return
     */
    String keyExpression() default "";

    /**
     * 缓存key用到的参数
     * @return
     */
    String[] includeArgs() default {};

    /**
     * 缓存key不用到的参数
     * @return
     */
    String[] excludeArgs() default {};

    /**
     * 缓存失效时间,默认失效五分钟
     * 单位为秒(second)
     * @return
     */
    int expire() default 300;
}

redpajama_set_name: RedPajamaGithub


text:
FOUNDATION_EXPORT double LegacyVersionNumber;

//! Project version string for Legacy.
FOUNDATION_EXPORT const unsigned char LegacyVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <Legacy/PublicHeader.h>


text:
<?php

namespace Traits;

interface DynamicPropHandlerInterface
{
	/**
	 * Method for setting parameters
	 *
	 * @param   array $properties Array with needle parameters as keys
	 *
	 * @return  $this
	 */
	public function setProperties(array $properties);

	/**
	 * Method for getting parameters
	 *
	 * @param   array $properties Array with needle parameters as keys
	 */
	public function getProperties(array &$properties);

	/**
	 * Method for getting array filled with initialized properties
	 *
	 * @return array
	 */
	public function toArray();
}


text:
.class Lcom/pittvandewitt/viperfx/main/j;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/support/design/widget/aw;

# instance fields
.field final synthetic a:Lcom/pittvandewitt/viperfx/main/MainActivity;

# direct methods
.method constructor <init>(Lcom/pittvandewitt/viperfx/main/MainActivity;)V
    .locals 0

    iput-object p1, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

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

    return-void
.end method

# virtual methods
.method public a(Landroid/view/MenuItem;)Z
    .locals 5

    const/4 v4, 0x1

    const/4 v3, 0x0

    if-nez p1, :cond_0

    :goto_0
    return v4

    :cond_0
    iget-object v0, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    iget-object v0, v0, Lcom/pittvandewitt/viperfx/main/MainActivity;->mDrawerLayout:Landroid/support/v4/widget/DrawerLayout;

    const v1, 0x800003

    invoke-virtual {v0, v1}, Landroid/support/v4/widget/DrawerLayout;->f(I)V

    iget-object v0, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    const-string v1, "com.pittvandewitt.viperfx.settings"

    invoke-virtual {v0, v1, v3}, Lcom/pittvandewitt/viperfx/main/MainActivity;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    goto :goto_0

    :pswitch_0
    iget-object v0, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    invoke-static {v0}, Lcom/pittvandewitt/viperfx/base/e;->h(Landroid/content/Context;)V

    goto :goto_0

    :pswitch_1
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/pittvandewitt/viperfx/main/k;

    invoke-direct {v1, p0}, Lcom/pittvandewitt/viperfx/main/k;-><init>(Lcom/pittvandewitt/viperfx/main/j;)V

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

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    goto :goto_0

    :pswitch_2
    iget-object v0, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    invoke-static {v0}, Lcom/pittvandewitt/viperfx/base/e;->g(Landroid/content/Context;)V

    goto :goto_0

    :pswitch_3
    invoke-interface {p1}, Landroid/view/MenuItem;->getTitle()Ljava/lang/CharSequence;

    move-result-object v0

    invoke-interface {v0}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    invoke-virtual {v1}, Lcom/pittvandewitt/viperfx/main/MainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f0600b4

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1

    new-instance v0, Landroid/support/v7/app/ad;

    iget-object v1, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    invoke-direct {v0, v1}, Landroid/support/v7/app/ad;-><init>(Landroid/content/Context;)V

    const-string v1, "ViPERFX"

    invoke-virtual {v0, v1}, Landroid/support/v7/app/ad;->a(Ljava/lang/CharSequence;)Landroid/support/v7/app/ad;

    iget-object v1, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    invoke-virtual {v1}, Lcom/pittvandewitt/viperfx/main/MainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f060096

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/support/v7/app/ad;->b(Ljava/lang/CharSequence;)Landroid/support/v7/app/ad;

    iget-object v1, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    invoke-virtual {v1}, Lcom/pittvandewitt/viperfx/main/MainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f0600bf

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    new-instance v2, Lcom/pittvandewitt/viperfx/main/l;

    invoke-direct {v2, p0}, Lcom/pittvandewitt/viperfx/main/l;-><init>(Lcom/pittvandewitt/viperfx/main/j;)V

    invoke-virtual {v0, v1, v2}, Landroid/support/v7/app/ad;->a(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/support/v7/app/ad;

    iget-object v1, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    invoke-virtual {v1}, Lcom/pittvandewitt/viperfx/main/MainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f0600a5

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/support/v7/app/ad;->b(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/support/v7/app/ad;

    invoke-virtual {v0}, Landroid/support/v7/app/ad;->c()Landroid/support/v7/app/ac;

    goto/16 :goto_0

    :cond_1
    iget-object v1, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    invoke-virtual {v1}, Lcom/pittvandewitt/viperfx/main/MainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f06009e

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2

    new-instance v0, Landroid/os/Message;

    invoke-direct {v0}, Landroid/os/Message;-><init>()V

    const v1, 0xa00a

    iput v1, v0, Landroid/os/Message;->what:I

    iget-object v1, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    iput-object v1, v0, Landroid/os/Message;->obj:Ljava/lang/Object;

    invoke-static {}, Lcom/pittvandewitt/viperfx/main/MainActivity;->j()Landroid/os/Handler;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto/16 :goto_0

    :cond_2
    iget-object v0, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    invoke-virtual {v0}, Lcom/pittvandewitt/viperfx/main/MainActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f0600ae

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    iget-object v1, v1, Lcom/pittvandewitt/viperfx/main/MainActivity;->mCoordinatorLayout:Landroid/support/design/widget/CoordinatorLayout;

    invoke-static {v1, v0, v3}, Landroid/support/design/widget/Snackbar;->a(Landroid/view/View;Ljava/lang/CharSequence;I)Landroid/support/design/widget/Snackbar;

    move-result-object v0

    invoke-virtual {v0}, Landroid/support/design/widget/Snackbar;->a()V

    goto/16 :goto_0

    :pswitch_4
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    const-class v2, Lcom/pittvandewitt/viperfx/setting/SettingActivity;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    iget-object v1, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    invoke-virtual {v1, v0}, Lcom/pittvandewitt/viperfx/main/MainActivity;->startActivity(Landroid/content/Intent;)V

    iget-object v0, p0, Lcom/pittvandewitt/viperfx/main/j;->a:Lcom/pittvandewitt/viperfx/main/MainActivity;

    const v1, 0x7f050010

    invoke-virtual {v0, v1, v3}, Lcom/pittvandewitt/viperfx/main/MainActivity;->overridePendingTransition(II)V

    goto/16 :goto_0

    :pswitch_data_0
    .packed-switch 0x7f0d0149
        :pswitch_0
        :pswitch_2
        :pswitch_3
        :pswitch_1
        :pswitch_4
    .end packed-switch
.end method


text:
''' Jottings to work out format for __function_workspace__ matrix at end
of mat file.

'''
import os.path
import io

from scipy.io.matlab.mio5 import MatFile5Reader

test_data_path = os.path.join(os.path.dirname(__file__), 'data')

def read_minimat_vars(rdr):
    rdr.initialize_read()
    mdict = {'__globals__': []}
    i = 0
    while not rdr.end_of_stream():
        hdr, next_position = rdr.read_var_header()
        name = 'None' if hdr.name is None else hdr.name.decode('latin1')
        if name == '':
            name = 'var_%d' % i
            i += 1
        res = rdr.read_var_array(hdr, process=False)
        rdr.mat_stream.seek(next_position)
        mdict[name] = res
        if hdr.is_global:
            mdict['__globals__'].append(name)
    return mdict

def read_workspace_vars(fname):
    fp = open(fname, 'rb')
    rdr = MatFile5Reader(fp, struct_as_record=True)
    vars = rdr.get_variables()
    fws = vars['__function_workspace__']
    ws_bs = io.BytesIO(fws.tobytes())
    ws_bs.seek(2)
    rdr.mat_stream = ws_bs
    # Guess byte order.
    mi = rdr.mat_stream.read(2)
    rdr.byte_order = mi == b'IM' and '<' or '>'
    rdr.mat_stream.read(4)  # presumably byte padding
    mdict = read_minimat_vars(rdr)
    fp.close()
    return mdict

def test_jottings():
    # example
    fname = os.path.join(test_data_path, 'parabola.mat')
    read_workspace_vars(fname)


text:
using System;
using System.Text.Json;
using Azure.Core;

namespace Azure.AI.FormRecognizer.Training
{
    internal partial class ModelsSummary_internal
    {
        internal static ModelsSummary_internal DeserializeModelsSummary_internal(JsonElement element)
        {
            int count = default;
            int limit = default;
            DateTimeOffset lastUpdatedDateTime = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("count"))
                {
                    count = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("limit"))
                {
                    limit = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("lastUpdatedDateTime"))
                {
                    lastUpdatedDateTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
            }
            return new ModelsSummary_internal(count, limit, lastUpdatedDateTime);
        }
    }
}


text:
using System;
using System.Reflection;
using System.IO;
using MigraDoc.DocumentObjectModel;
using MigraDoc.DocumentObjectModel.Visitors;
using MigraDoc.Rendering.Resources;
using PdfSharp.Pdf;
using PdfSharp.Drawing;

namespace MigraDoc.Rendering
{
  /// <summary>
  /// Provides the functionality to convert a MigraDoc document into PDF.
  /// </summary>
  public class PdfDocumentRenderer
  {
    /// <summary>
    /// Initializes a new instance of the PdfDocumentRenderer class.
    /// </summary>
    public PdfDocumentRenderer()
    {
    }

    /// <summary>
    /// Initializes a new instance of the PdfDocumentRenderer class.
    /// </summary>
    /// <param name="unicode">If true Unicode encoding is used for all text. If false, WinAnsi encoding is used.</param>
    public PdfDocumentRenderer(bool unicode)
    {
      this.unicode = unicode;
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="PdfDocumentRenderer"/> class.
    /// </summary>
    /// <param name="unicode">If true Unicode encoding is used for all text. If false, WinAnsi encoding is used.</param>
    /// <param name="fontEmbedding">Specifies which fonts will be imbedded in the PDF file.</param>
    public PdfDocumentRenderer(bool unicode, PdfFontEmbedding fontEmbedding)
    {
      this.unicode = unicode;
      this.fontEmbedding = fontEmbedding;
    }

    /// <summary>
    /// Gets a value indicating whether the text is rendered as Unicode.
    /// </summary>
    public bool Unicode
    {
      get { return this.unicode; }
    }
    bool unicode;

    /// <summary>
    /// Gets a value indicating whether all used fonts are embedded in the document.
    /// </summary>
    public PdfFontEmbedding FontEmbedding
    {
      get { return this.fontEmbedding; }
    }
    PdfFontEmbedding fontEmbedding;

    /// <summary>
    /// Gets or sets the language.
    /// </summary>
    /// <value>The language.</value>
    public string Language
    {
      get { return this.language; }
      set { this.language = value; }
    }
    string language = String.Empty;

    /// <summary>
    /// Set the MigraDoc document to be rendered by this printer.
    /// </summary>
    public Document Document
    {
      set
      {
        this.document = null;
        value.BindToRenderer(this);
        this.document = value;
      }
    }
    Document document;

    /// <summary>
    /// Gets or sets a document renderer.
    /// </summary>
    /// <remarks>
    /// A document renderer is automatically created and prepared
    /// when printing before this property was set.
    /// </remarks>
    public DocumentRenderer DocumentRenderer
    {
      get
      {
        if (this.documentRenderer == null)
          PrepareDocumentRenderer();
        return this.documentRenderer;
      }
      set { this.documentRenderer = value; }
    }
    DocumentRenderer documentRenderer;

    void PrepareDocumentRenderer()
    {
      PrepareDocumentRenderer(false);
    }

    void PrepareDocumentRenderer(bool prepareCompletely)
    {
      if (this.document == null)
        throw new InvalidOperationException(Messages.PropertyNotSetBefore("DocumentRenderer", MethodInfo.GetCurrentMethod().Name));

      if (this.documentRenderer == null)
      {
        this.documentRenderer = new DocumentRenderer(this.document);
        this.documentRenderer.WorkingDirectory = this.workingDirectory;
      }
      if (prepareCompletely && this.documentRenderer.formattedDocument == null)
      {
        this.documentRenderer.PrepareDocument();
      }
    }

    /// <summary>
    /// Renders the document into a PdfDocument containing all pages of the document.
    /// </summary>
    public void RenderDocument()
    {
#if true
      PrepareRenderPages();
#else
      if (this.documentRenderer == null)
        PrepareDocumentRenderer();

      if (this.pdfDocument == null)
      {
        this.pdfDocument = new PdfDocument();
        this.pdfDocument.Info.Creator = VersionInfo.Creator;
      }

      WriteDocumentInformation();
#endif
      RenderPages(1, this.documentRenderer.FormattedDocument.PageCount);
    }

    /// <summary>
    /// Renders the document into a PdfDocument containing all pages of the document.
    /// </summary>
    public void PrepareRenderPages()
    {
      //if (this.documentRenderer == null)
      PrepareDocumentRenderer(true);

      if (this.pdfDocument == null)
      {
        this.pdfDocument = CreatePdfDocument();
        if (this.document.UseCmykColor)
          this.pdfDocument.Options.ColorMode = PdfColorMode.Cmyk;
      }

      WriteDocumentInformation();
      //RenderPages(1, this.documentRenderer.FormattedDocument.PageCount);
    }

    /// <summary>
    /// Gets the count of pages.
    /// </summary>
    public int PageCount
    {
      get { return this.documentRenderer.FormattedDocument.PageCount; }
    }

    /// <summary>
    /// Saves the PdfDocument to the specified path. If a file already exists, it will be overwritten.
    /// </summary>
    public void Save(string path)
    {
      if (path == null)
        throw new ArgumentNullException("path");

      else if (path == "")
        throw new ArgumentException("PDF file Path must not be empty");

      if (this.workingDirectory != null)
        Path.Combine(this.workingDirectory, path);

      this.pdfDocument.Save(path);
    }

    /// <summary>
    /// Saves the PDF document to the specified stream.
    /// </summary>
    public void Save(Stream stream, bool closeStream)
    {
      this.pdfDocument.Save(stream, closeStream);
    }

    /// <summary>
    /// Renders the spcified page range.
    /// </summary>
    /// <param name="startPage">The first page to print.</param>
    /// <param name="endPage">The last page to print</param>
    public void RenderPages(int startPage, int endPage)
    {
      if (startPage < 1)
        throw new ArgumentOutOfRangeException("startPage");

      if (endPage > this.documentRenderer.FormattedDocument.PageCount)
        throw new ArgumentOutOfRangeException("endPage");

      if (this.documentRenderer == null)
        PrepareDocumentRenderer();

      if (this.pdfDocument == null)
        this.pdfDocument = CreatePdfDocument();

      this.documentRenderer.printDate = DateTime.Now;
      for (int pageNr = startPage; pageNr <= endPage; ++pageNr)
      {
        PdfPage pdfPage = this.pdfDocument.AddPage();
        PageInfo pageInfo = this.documentRenderer.FormattedDocument.GetPageInfo(pageNr);
        pdfPage.Width = pageInfo.Width;
        pdfPage.Height = pageInfo.Height;
        pdfPage.Orientation = pageInfo.Orientation;

        using (XGraphics gfx = XGraphics.FromPdfPage(pdfPage))
        {
          gfx.MUH = this.unicode ? PdfFontEncoding.Unicode : PdfFontEncoding.WinAnsi;
          gfx.MFEH = this.fontEmbedding;
          this.documentRenderer.RenderPage(gfx, pageNr);
        }
      }
    }

    /// <summary>
    /// Gets or sets a working directory for the printing process.
    /// </summary>
    public string WorkingDirectory
    {
      get { return this.workingDirectory; }
      set { this.workingDirectory = value; }
    }
    string workingDirectory;

    /// <summary>
    /// Gets or sets the PDF document to render on.
    /// </summary>
    /// <remarks>A PDF document in memory is automatically created when printing before this property was set.</remarks>
    public PdfDocument PdfDocument
    {
      get { return this.pdfDocument; }
      set { this.pdfDocument = value; }
    }
    PdfDocument pdfDocument;

    /// <summary>
    /// Writes document information like author and subject to the PDF document.
    /// </summary>
    public void WriteDocumentInformation()
    {
      if (!this.document.IsNull("Info"))
      {
        DocumentInfo docInfo = this.document.Info;
        PdfDocumentInformation pdfInfo = this.pdfDocument.Info;

        if (!docInfo.IsNull("Author"))
          pdfInfo.Author = docInfo.Author;

        if (!docInfo.IsNull("Keywords"))
          pdfInfo.Keywords = docInfo.Keywords;

        if (!docInfo.IsNull("Subject"))
          pdfInfo.Subject = docInfo.Subject;

        if (!docInfo.IsNull("Title"))
          pdfInfo.Title = docInfo.Title;
      }
    }

    /// <summary>
    /// Creates a new PDF document.
    /// </summary>
    PdfDocument CreatePdfDocument()
    {
      PdfDocument document = new PdfDocument();
      document.Info.Creator = VersionInfo.Creator;
      if (this.language != null && this.language.Length != 0)
        document.Language = this.language;
      return document;
    }
  }
}


text:
from tensorflow.examples.tutorials.mnist import input_data
import sys
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt

FLAGS = tf.flags.FLAGS
tf.flags.DEFINE_integer("batch_size", "64", "batch size for training")
tf.flags.DEFINE_string("logs_dir", "logs/MNIST_logs/", "path to logs directory")
tf.flags.DEFINE_string("data_dir", "Data_zoo/MNIST_data/", "path to dataset")
tf.flags.DEFINE_float("learning_rate", "1e-4", "Learning rate for Optimizer")
tf.flags.DEFINE_string("mode", "train", "Model mode = train / test")
tf.flags.DEFINE_float("keep_prob", "0.5", "keep probability for test")
tf.flags.DEFINE_integer("label", "7", "image label to analyse for uncertainty during test")
MAX_ITERATION = int(1e4 + 1)

def weight_variable(shape):
    initial = tf.truncated_normal(shape, stddev=0.1)
    return tf.Variable(initial)

def bias_variable(shape):
    initial = tf.constant(0.1, shape=shape)
    return tf.Variable(initial)

def conv2d_basic(x, W):
    return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding="SAME")

def max_pool_2x2(x):
    return tf.nn.max_pool(x, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding="SAME")

def leaky_relu(x, alpha=0.0):
    return tf.maximum(alpha * x, x)

def activation_function(x):
    return tf.nn.relu(x)

def inference(input, keep_prob=1.0):
    # First Convolution Layer - RELU + pooling
    W_conv1 = weight_variable([5, 5, 1, 32])
    b_conv1 = bias_variable([32])
    tf.histogram_summary("W_conv1", W_conv1)
    tf.histogram_summary("b_conv1", b_conv1)

    h_conv1 = activation_function(conv2d_basic(input, W_conv1) + b_conv1)
    h_pool1 = max_pool_2x2(h_conv1)

    W_conv2 = weight_variable([5, 5, 32, 64])
    b_conv2 = bias_variable([64])
    tf.histogram_summary("W_conv2", W_conv2)
    tf.histogram_summary("b_conv2", b_conv2)

    # Second Convolution layer - Relu + pooling
    h_conv2 = activation_function(conv2d_basic(h_pool1, W_conv2) + b_conv2)
    h_pool2 = max_pool_2x2(h_conv2)

    # Fully connected NN
    h_pool2_flat = tf.reshape(h_pool2, [-1, (7 * 7 * 64)])

    W_fc1 = weight_variable([(7 * 7 * 64), 1024])
    b_fc1 = bias_variable([1024])
    tf.histogram_summary("W_fc1", W_fc1)
    tf.histogram_summary("b_fc1", b_fc1)

    h_fc1 = activation_function(tf.matmul(h_pool2_flat, W_fc1) + b_fc1)

    # Dropout
    h_fc1_dropout = tf.nn.dropout(h_fc1, keep_prob)

    # Readout Layer
    W_fc2 = weight_variable([1024, 10])
    b_fc2 = bias_variable([10])
    tf.histogram_summary("W_fc2", W_fc2)
    tf.histogram_summary("b_fc2", b_fc2)
    pred = tf.nn.softmax(tf.matmul(h_fc1_dropout, W_fc2) + b_fc2)
    return pred

def main(argv=None):
    mnist = input_data.read_data_sets(FLAGS.data_dir, one_hot=True)
    sess = tf.InteractiveSession()
    x = tf.placeholder(tf.float32, shape=[None, 784])
    y_actual = tf.placeholder(tf.float32, shape=[None, 10])
    prob = tf.placeholder(tf.float32)

    x_image = tf.reshape(x, [-1, 28, 28, 1])
    y_pred = inference(x_image, prob)

    # Train
    entropy = -tf.reduce_sum(y_actual * tf.log(y_pred))
    train_step = tf.train.AdamOptimizer(FLAGS.learning_rate).minimize(entropy)

    tf.scalar_summary("X_Entropy", entropy)

    # Eval
    accuracy = tf.reduce_mean(tf.cast(tf.equal(tf.argmax(y_pred, 1), tf.argmax(y_actual, 1)), tf.float32))

    # Session start
    saver = tf.train.Saver()
    sess.run(tf.initialize_all_variables())
    summary_writer = tf.train.SummaryWriter(FLAGS.logs_dir, sess.graph)
    summary_op = tf.merge_all_summaries()

    ckpt = tf.train.get_checkpoint_state(FLAGS.logs_dir)
    if ckpt and ckpt.model_checkpoint_path:
        saver.restore(sess, ckpt.model_checkpoint_path)
        print("Model restored...")

    if FLAGS.mode == 'train':
        for itr in xrange(MAX_ITERATION):
            batch = mnist.train.next_batch(FLAGS.batch_size)
            train_step.run(feed_dict={x: batch[0], y_actual: batch[1], prob: 0.9})

            if itr % 10 == 0:
                summary_str = sess.run(summary_op, feed_dict={x: batch[0], y_actual: batch[1], prob: 0.9})
                summary_writer.add_summary(summary_str, itr)

            if itr % 100 == 0:
                train_accuracy = accuracy.eval(feed_dict={x: batch[0], y_actual: batch[1], prob: 1.0})
                print("step: %d, training accuracy: %g" % (itr, train_accuracy))
                saver.save(sess, FLAGS.logs_dir + "model.ckpt", itr)
    else:
        # test_accuracy = accuracy.eval(feed_dict={x: mnist.test.images, y_actual: mnist.test.labels, prob: 1.0})
        # print("************* test accuracy: %g ************" % test_accuracy)
        # print (np.shape(mnist.test.labels))
        images_label = mnist.test.images[np.argmax(mnist.test.labels, 1) == FLAGS.label]
        # print(len(images_label))
        offset = np.random.randint(0, len(images_label) - FLAGS.batch_size)
        images = images_label[offset: offset + FLAGS.batch_size]

        feed_dict = {x: images, prob: FLAGS.keep_prob}
        predictions = [sess.run(y_pred, feed_dict=feed_dict) for i in range(100)]
        pred_nw = sess.run(y_pred, feed_dict={x: images, prob: 1.0})
        prediction_mean = np.mean(predictions, axis=0)
        prediction_var = np.var(predictions, axis=0) + (2 * FLAGS.batch_size * 0.0005 / FLAGS.keep_prob)
        # print (np.shape(prediction_mean))
        # print(np.shape(prediction_var))
        reshaped_images = np.reshape(images_label, [-1, 28, 28])
        fig = plt.figure(figsize=(20, 20))
        x_values = range(10)
        for i in range(FLAGS.batch_size):
            a = fig.add_subplot(FLAGS.batch_size, 2, (i + 1) * 2 - 1)
            plt.imshow(reshaped_images[i, :, :])
            a = fig.add_subplot(FLAGS.batch_size, 2, (i + 1) * 2)
            a.plot(x_values, pred_nw[i], 'r')
            a.errorbar(x_values, prediction_mean[i, :], yerr=prediction_var[i, :], linestyle=':')

        plt.show()

if __name__ == "__main__":
    tf.app.run()


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto

namespace Google\Cloud\Dlp\V2;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * InfoType description.
 *
 * Generated from protobuf message google.privacy.dlp.v2.InfoTypeDescription
 */
class InfoTypeDescription extends \Google\Protobuf\Internal\Message
{
    /**
     * Internal name of the infoType.
     *
     * Generated from protobuf field string name = 1;
     */
    private $name = '';
    /**
     * Human readable form of the infoType name.
     *
     * Generated from protobuf field string display_name = 2;
     */
    private $display_name = '';
    /**
     * Which parts of the API supports this InfoType.
     *
     * Generated from protobuf field repeated .google.privacy.dlp.v2.InfoTypeSupportedBy supported_by = 3;
     */
    private $supported_by;

    public function __construct() {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct();
    }

    /**
     * Internal name of the infoType.
     *
     * Generated from protobuf field string name = 1;
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Internal name of the infoType.
     *
     * Generated from protobuf field string name = 1;
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Human readable form of the infoType name.
     *
     * Generated from protobuf field string display_name = 2;
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Human readable form of the infoType name.
     *
     * Generated from protobuf field string display_name = 2;
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Which parts of the API supports this InfoType.
     *
     * Generated from protobuf field repeated .google.privacy.dlp.v2.InfoTypeSupportedBy supported_by = 3;
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getSupportedBy()
    {
        return $this->supported_by;
    }

    /**
     * Which parts of the API supports this InfoType.
     *
     * Generated from protobuf field repeated .google.privacy.dlp.v2.InfoTypeSupportedBy supported_by = 3;
     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setSupportedBy($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Dlp\V2\InfoTypeSupportedBy::class);
        $this->supported_by = $arr;

        return $this;
    }

}


text:
package jsoniter

import (
	"fmt"
	"io"
	"reflect"
	"unsafe"
	"strings"
)

func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder) (ValDecoder, error) {
	knownHash := map[int32]struct{}{
		0: {},
	}
	switch len(fields) {
	case 0:
		return &skipObjectDecoder{typ}, nil
	case 1:
		for fieldName, fieldDecoder := range fields {
			fieldHash := calcHash(fieldName)
			_, known := knownHash[fieldHash]
			if known {
				return &generalStructDecoder{typ, fields}, nil
			}
			knownHash[fieldHash] = struct{}{}
			return &oneFieldStructDecoder{typ, fieldHash, fieldDecoder}, nil
		}
	case 2:
		var fieldHash1 int32
		var fieldHash2 int32
		var fieldDecoder1 *structFieldDecoder
		var fieldDecoder2 *structFieldDecoder
		for fieldName, fieldDecoder := range fields {
			fieldHash := calcHash(fieldName)
			_, known := knownHash[fieldHash]
			if known {
				return &generalStructDecoder{typ, fields}, nil
			}
			knownHash[fieldHash] = struct{}{}
			if fieldHash1 == 0 {
				fieldHash1 = fieldHash
				fieldDecoder1 = fieldDecoder
			} else {
				fieldHash2 = fieldHash
				fieldDecoder2 = fieldDecoder
			}
		}
		return &twoFieldsStructDecoder{typ, fieldHash1, fieldDecoder1, fieldHash2, fieldDecoder2}, nil
	case 3:
		var fieldName1 int32
		var fieldName2 int32
		var fieldName3 int32
		var fieldDecoder1 *structFieldDecoder
		var fieldDecoder2 *structFieldDecoder
		var fieldDecoder3 *structFieldDecoder
		for fieldName, fieldDecoder := range fields {
			fieldHash := calcHash(fieldName)
			_, known := knownHash[fieldHash]
			if known {
				return &generalStructDecoder{typ, fields}, nil
			}
			knownHash[fieldHash] = struct{}{}
			if fieldName1 == 0 {
				fieldName1 = fieldHash
				fieldDecoder1 = fieldDecoder
			} else if fieldName2 == 0 {
				fieldName2 = fieldHash
				fieldDecoder2 = fieldDecoder
			} else {
				fieldName3 = fieldHash
				fieldDecoder3 = fieldDecoder
			}
		}
		return &threeFieldsStructDecoder{typ,
			fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3}, nil
	case 4:
		var fieldName1 int32
		var fieldName2 int32
		var fieldName3 int32
		var fieldName4 int32
		var fieldDecoder1 *structFieldDecoder
		var fieldDecoder2 *structFieldDecoder
		var fieldDecoder3 *structFieldDecoder
		var fieldDecoder4 *structFieldDecoder
		for fieldName, fieldDecoder := range fields {
			fieldHash := calcHash(fieldName)
			_, known := knownHash[fieldHash]
			if known {
				return &generalStructDecoder{typ, fields}, nil
			}
			knownHash[fieldHash] = struct{}{}
			if fieldName1 == 0 {
				fieldName1 = fieldHash
				fieldDecoder1 = fieldDecoder
			} else if fieldName2 == 0 {
				fieldName2 = fieldHash
				fieldDecoder2 = fieldDecoder
			} else if fieldName3 == 0 {
				fieldName3 = fieldHash
				fieldDecoder3 = fieldDecoder
			} else {
				fieldName4 = fieldHash
				fieldDecoder4 = fieldDecoder
			}
		}
		return &fourFieldsStructDecoder{typ,
			fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3,
			fieldName4, fieldDecoder4}, nil
	case 5:
		var fieldName1 int32
		var fieldName2 int32
		var fieldName3 int32
		var fieldName4 int32
		var fieldName5 int32
		var fieldDecoder1 *structFieldDecoder
		var fieldDecoder2 *structFieldDecoder
		var fieldDecoder3 *structFieldDecoder
		var fieldDecoder4 *structFieldDecoder
		var fieldDecoder5 *structFieldDecoder
		for fieldName, fieldDecoder := range fields {
			fieldHash := calcHash(fieldName)
			_, known := knownHash[fieldHash]
			if known {
				return &generalStructDecoder{typ, fields}, nil
			}
			knownHash[fieldHash] = struct{}{}
			if fieldName1 == 0 {
				fieldName1 = fieldHash
				fieldDecoder1 = fieldDecoder
			} else if fieldName2 == 0 {
				fieldName2 = fieldHash
				fieldDecoder2 = fieldDecoder
			} else if fieldName3 == 0 {
				fieldName3 = fieldHash
				fieldDecoder3 = fieldDecoder
			} else if fieldName4 == 0 {
				fieldName4 = fieldHash
				fieldDecoder4 = fieldDecoder
			} else {
				fieldName5 = fieldHash
				fieldDecoder5 = fieldDecoder
			}
		}
		return &fiveFieldsStructDecoder{typ,
			fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3,
			fieldName4, fieldDecoder4, fieldName5, fieldDecoder5}, nil
	case 6:
		var fieldName1 int32
		var fieldName2 int32
		var fieldName3 int32
		var fieldName4 int32
		var fieldName5 int32
		var fieldName6 int32
		var fieldDecoder1 *structFieldDecoder
		var fieldDecoder2 *structFieldDecoder
		var fieldDecoder3 *structFieldDecoder
		var fieldDecoder4 *structFieldDecoder
		var fieldDecoder5 *structFieldDecoder
		var fieldDecoder6 *structFieldDecoder
		for fieldName, fieldDecoder := range fields {
			fieldHash := calcHash(fieldName)
			_, known := knownHash[fieldHash]
			if known {
				return &generalStructDecoder{typ, fields}, nil
			}
			knownHash[fieldHash] = struct{}{}
			if fieldName1 == 0 {
				fieldName1 = fieldHash
				fieldDecoder1 = fieldDecoder
			} else if fieldName2 == 0 {
				fieldName2 = fieldHash
				fieldDecoder2 = fieldDecoder
			} else if fieldName3 == 0 {
				fieldName3 = fieldHash
				fieldDecoder3 = fieldDecoder
			} else if fieldName4 == 0 {
				fieldName4 = fieldHash
				fieldDecoder4 = fieldDecoder
			} else if fieldName5 == 0 {
				fieldName5 = fieldHash
				fieldDecoder5 = fieldDecoder
			} else {
				fieldName6 = fieldHash
				fieldDecoder6 = fieldDecoder
			}
		}
		return &sixFieldsStructDecoder{typ,
			fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3,
			fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, fieldName6, fieldDecoder6}, nil
	case 7:
		var fieldName1 int32
		var fieldName2 int32
		var fieldName3 int32
		var fieldName4 int32
		var fieldName5 int32
		var fieldName6 int32
		var fieldName7 int32
		var fieldDecoder1 *structFieldDecoder
		var fieldDecoder2 *structFieldDecoder
		var fieldDecoder3 *structFieldDecoder
		var fieldDecoder4 *structFieldDecoder
		var fieldDecoder5 *structFieldDecoder
		var fieldDecoder6 *structFieldDecoder
		var fieldDecoder7 *structFieldDecoder
		for fieldName, fieldDecoder := range fields {
			fieldHash := calcHash(fieldName)
			_, known := knownHash[fieldHash]
			if known {
				return &generalStructDecoder{typ, fields}, nil
			}
			knownHash[fieldHash] = struct{}{}
			if fieldName1 == 0 {
				fieldName1 = fieldHash
				fieldDecoder1 = fieldDecoder
			} else if fieldName2 == 0 {
				fieldName2 = fieldHash
				fieldDecoder2 = fieldDecoder
			} else if fieldName3 == 0 {
				fieldName3 = fieldHash
				fieldDecoder3 = fieldDecoder
			} else if fieldName4 == 0 {
				fieldName4 = fieldHash
				fieldDecoder4 = fieldDecoder
			} else if fieldName5 == 0 {
				fieldName5 = fieldHash
				fieldDecoder5 = fieldDecoder
			} else if fieldName6 == 0 {
				fieldName6 = fieldHash
				fieldDecoder6 = fieldDecoder
			} else {
				fieldName7 = fieldHash
				fieldDecoder7 = fieldDecoder
			}
		}
		return &sevenFieldsStructDecoder{typ,
			fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3,
			fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, fieldName6, fieldDecoder6,
			fieldName7, fieldDecoder7}, nil
	case 8:
		var fieldName1 int32
		var fieldName2 int32
		var fieldName3 int32
		var fieldName4 int32
		var fieldName5 int32
		var fieldName6 int32
		var fieldName7 int32
		var fieldName8 int32
		var fieldDecoder1 *structFieldDecoder
		var fieldDecoder2 *structFieldDecoder
		var fieldDecoder3 *structFieldDecoder
		var fieldDecoder4 *structFieldDecoder
		var fieldDecoder5 *structFieldDecoder
		var fieldDecoder6 *structFieldDecoder
		var fieldDecoder7 *structFieldDecoder
		var fieldDecoder8 *structFieldDecoder
		for fieldName, fieldDecoder := range fields {
			fieldHash := calcHash(fieldName)
			_, known := knownHash[fieldHash]
			if known {
				return &generalStructDecoder{typ, fields}, nil
			}
			knownHash[fieldHash] = struct{}{}
			if fieldName1 == 0 {
				fieldName1 = fieldHash
				fieldDecoder1 = fieldDecoder
			} else if fieldName2 == 0 {
				fieldName2 = fieldHash
				fieldDecoder2 = fieldDecoder
			} else if fieldName3 == 0 {
				fieldName3 = fieldHash
				fieldDecoder3 = fieldDecoder
			} else if fieldName4 == 0 {
				fieldName4 = fieldHash
				fieldDecoder4 = fieldDecoder
			} else if fieldName5 == 0 {
				fieldName5 = fieldHash
				fieldDecoder5 = fieldDecoder
			} else if fieldName6 == 0 {
				fieldName6 = fieldHash
				fieldDecoder6 = fieldDecoder
			} else if fieldName7 == 0 {
				fieldName7 = fieldHash
				fieldDecoder7 = fieldDecoder
			} else {
				fieldName8 = fieldHash
				fieldDecoder8 = fieldDecoder
			}
		}
		return &eightFieldsStructDecoder{typ,
			fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3,
			fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, fieldName6, fieldDecoder6,
			fieldName7, fieldDecoder7, fieldName8, fieldDecoder8}, nil
	case 9:
		var fieldName1 int32
		var fieldName2 int32
		var fieldName3 int32
		var fieldName4 int32
		var fieldName5 int32
		var fieldName6 int32
		var fieldName7 int32
		var fieldName8 int32
		var fieldName9 int32
		var fieldDecoder1 *structFieldDecoder
		var fieldDecoder2 *structFieldDecoder
		var fieldDecoder3 *structFieldDecoder
		var fieldDecoder4 *structFieldDecoder
		var fieldDecoder5 *structFieldDecoder
		var fieldDecoder6 *structFieldDecoder
		var fieldDecoder7 *structFieldDecoder
		var fieldDecoder8 *structFieldDecoder
		var fieldDecoder9 *structFieldDecoder
		for fieldName, fieldDecoder := range fields {
			fieldHash := calcHash(fieldName)
			_, known := knownHash[fieldHash]
			if known {
				return &generalStructDecoder{typ, fields}, nil
			}
			knownHash[fieldHash] = struct{}{}
			if fieldName1 == 0 {
				fieldName1 = fieldHash
				fieldDecoder1 = fieldDecoder
			} else if fieldName2 == 0 {
				fieldName2 = fieldHash
				fieldDecoder2 = fieldDecoder
			} else if fieldName3 == 0 {
				fieldName3 = fieldHash
				fieldDecoder3 = fieldDecoder
			} else if fieldName4 == 0 {
				fieldName4 = fieldHash
				fieldDecoder4 = fieldDecoder
			} else if fieldName5 == 0 {
				fieldName5 = fieldHash
				fieldDecoder5 = fieldDecoder
			} else if fieldName6 == 0 {
				fieldName6 = fieldHash
				fieldDecoder6 = fieldDecoder
			} else if fieldName7 == 0 {
				fieldName7 = fieldHash
				fieldDecoder7 = fieldDecoder
			} else if fieldName8 == 0 {
				fieldName8 = fieldHash
				fieldDecoder8 = fieldDecoder
			} else {
				fieldName9 = fieldHash
				fieldDecoder9 = fieldDecoder
			}
		}
		return &nineFieldsStructDecoder{typ,
			fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3,
			fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, fieldName6, fieldDecoder6,
			fieldName7, fieldDecoder7, fieldName8, fieldDecoder8, fieldName9, fieldDecoder9}, nil
	case 10:
		var fieldName1 int32
		var fieldName2 int32
		var fieldName3 int32
		var fieldName4 int32
		var fieldName5 int32
		var fieldName6 int32
		var fieldName7 int32
		var fieldName8 int32
		var fieldName9 int32
		var fieldName10 int32
		var fieldDecoder1 *structFieldDecoder
		var fieldDecoder2 *structFieldDecoder
		var fieldDecoder3 *structFieldDecoder
		var fieldDecoder4 *structFieldDecoder
		var fieldDecoder5 *structFieldDecoder
		var fieldDecoder6 *structFieldDecoder
		var fieldDecoder7 *structFieldDecoder
		var fieldDecoder8 *structFieldDecoder
		var fieldDecoder9 *structFieldDecoder
		var fieldDecoder10 *structFieldDecoder
		for fieldName, fieldDecoder := range fields {
			fieldHash := calcHash(fieldName)
			_, known := knownHash[fieldHash]
			if known {
				return &generalStructDecoder{typ, fields}, nil
			}
			knownHash[fieldHash] = struct{}{}
			if fieldName1 == 0 {
				fieldName1 = fieldHash
				fieldDecoder1 = fieldDecoder
			} else if fieldName2 == 0 {
				fieldName2 = fieldHash
				fieldDecoder2 = fieldDecoder
			} else if fieldName3 == 0 {
				fieldName3 = fieldHash
				fieldDecoder3 = fieldDecoder
			} else if fieldName4 == 0 {
				fieldName4 = fieldHash
				fieldDecoder4 = fieldDecoder
			} else if fieldName5 == 0 {
				fieldName5 = fieldHash
				fieldDecoder5 = fieldDecoder
			} else if fieldName6 == 0 {
				fieldName6 = fieldHash
				fieldDecoder6 = fieldDecoder
			} else if fieldName7 == 0 {
				fieldName7 = fieldHash
				fieldDecoder7 = fieldDecoder
			} else if fieldName8 == 0 {
				fieldName8 = fieldHash
				fieldDecoder8 = fieldDecoder
			} else if fieldName9 == 0 {
				fieldName9 = fieldHash
				fieldDecoder9 = fieldDecoder
			} else {
				fieldName10 = fieldHash
				fieldDecoder10 = fieldDecoder
			}
		}
		return &tenFieldsStructDecoder{typ,
			fieldName1, fieldDecoder1, fieldName2, fieldDecoder2, fieldName3, fieldDecoder3,
			fieldName4, fieldDecoder4, fieldName5, fieldDecoder5, fieldName6, fieldDecoder6,
			fieldName7, fieldDecoder7, fieldName8, fieldDecoder8, fieldName9, fieldDecoder9,
			fieldName10, fieldDecoder10}, nil
	}
	return &generalStructDecoder{typ, fields}, nil
}

type generalStructDecoder struct {
	typ    reflect.Type
	fields map[string]*structFieldDecoder
}

func (decoder *generalStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	if !iter.readObjectStart() {
		return
	}
	fieldBytes := iter.readObjectFieldAsBytes()
	field := *(*string)(unsafe.Pointer(&fieldBytes))
	fieldDecoder := decoder.fields[strings.ToLower(field)]
	if fieldDecoder == nil {
		iter.Skip()
	} else {
		fieldDecoder.Decode(ptr, iter)
	}
	for iter.nextToken() == ',' {
		fieldBytes = iter.readObjectFieldAsBytes()
		field = *(*string)(unsafe.Pointer(&fieldBytes))
		fieldDecoder = decoder.fields[strings.ToLower(field)]
		if fieldDecoder == nil {
			iter.Skip()
		} else {
			fieldDecoder.Decode(ptr, iter)
		}
	}
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%v: %s", decoder.typ, iter.Error.Error())
	}
}

type skipObjectDecoder struct {
	typ reflect.Type
}

func (decoder *skipObjectDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	valueType := iter.WhatIsNext()
	if valueType != Object && valueType != Nil {
		iter.ReportError("skipObjectDecoder", "expect object or null")
		return
	}
	iter.Skip()
}

type oneFieldStructDecoder struct {
	typ          reflect.Type
	fieldHash    int32
	fieldDecoder *structFieldDecoder
}

func (decoder *oneFieldStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	if !iter.readObjectStart() {
		return
	}
	for {
		if iter.readFieldHash() == decoder.fieldHash {
			decoder.fieldDecoder.Decode(ptr, iter)
		} else {
			iter.Skip()
		}
		if iter.isObjectEnd() {
			break
		}
	}
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%v: %s", decoder.typ, iter.Error.Error())
	}
}

type twoFieldsStructDecoder struct {
	typ           reflect.Type
	fieldHash1    int32
	fieldDecoder1 *structFieldDecoder
	fieldHash2    int32
	fieldDecoder2 *structFieldDecoder
}

func (decoder *twoFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	if !iter.readObjectStart() {
		return
	}
	for {
		switch iter.readFieldHash() {
		case decoder.fieldHash1:
			decoder.fieldDecoder1.Decode(ptr, iter)
		case decoder.fieldHash2:
			decoder.fieldDecoder2.Decode(ptr, iter)
		default:
			iter.Skip()
		}
		if iter.isObjectEnd() {
			break
		}
	}
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%v: %s", decoder.typ, iter.Error.Error())
	}
}

type threeFieldsStructDecoder struct {
	typ           reflect.Type
	fieldHash1    int32
	fieldDecoder1 *structFieldDecoder
	fieldHash2    int32
	fieldDecoder2 *structFieldDecoder
	fieldHash3    int32
	fieldDecoder3 *structFieldDecoder
}

func (decoder *threeFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	if !iter.readObjectStart() {
		return
	}
	for {
		switch iter.readFieldHash() {
		case decoder.fieldHash1:
			decoder.fieldDecoder1.Decode(ptr, iter)
		case decoder.fieldHash2:
			decoder.fieldDecoder2.Decode(ptr, iter)
		case decoder.fieldHash3:
			decoder.fieldDecoder3.Decode(ptr, iter)
		default:
			iter.Skip()
		}
		if iter.isObjectEnd() {
			break
		}
	}
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%v: %s", decoder.typ, iter.Error.Error())
	}
}

type fourFieldsStructDecoder struct {
	typ           reflect.Type
	fieldHash1    int32
	fieldDecoder1 *structFieldDecoder
	fieldHash2    int32
	fieldDecoder2 *structFieldDecoder
	fieldHash3    int32
	fieldDecoder3 *structFieldDecoder
	fieldHash4    int32
	fieldDecoder4 *structFieldDecoder
}

func (decoder *fourFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	if !iter.readObjectStart() {
		return
	}
	for {
		switch iter.readFieldHash() {
		case decoder.fieldHash1:
			decoder.fieldDecoder1.Decode(ptr, iter)
		case decoder.fieldHash2:
			decoder.fieldDecoder2.Decode(ptr, iter)
		case decoder.fieldHash3:
			decoder.fieldDecoder3.Decode(ptr, iter)
		case decoder.fieldHash4:
			decoder.fieldDecoder4.Decode(ptr, iter)
		default:
			iter.Skip()
		}
		if iter.isObjectEnd() {
			break
		}
	}
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%v: %s", decoder.typ, iter.Error.Error())
	}
}

type fiveFieldsStructDecoder struct {
	typ           reflect.Type
	fieldHash1    int32
	fieldDecoder1 *structFieldDecoder
	fieldHash2    int32
	fieldDecoder2 *structFieldDecoder
	fieldHash3    int32
	fieldDecoder3 *structFieldDecoder
	fieldHash4    int32
	fieldDecoder4 *structFieldDecoder
	fieldHash5    int32
	fieldDecoder5 *structFieldDecoder
}

func (decoder *fiveFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	if !iter.readObjectStart() {
		return
	}
	for {
		switch iter.readFieldHash() {
		case decoder.fieldHash1:
			decoder.fieldDecoder1.Decode(ptr, iter)
		case decoder.fieldHash2:
			decoder.fieldDecoder2.Decode(ptr, iter)
		case decoder.fieldHash3:
			decoder.fieldDecoder3.Decode(ptr, iter)
		case decoder.fieldHash4:
			decoder.fieldDecoder4.Decode(ptr, iter)
		case decoder.fieldHash5:
			decoder.fieldDecoder5.Decode(ptr, iter)
		default:
			iter.Skip()
		}
		if iter.isObjectEnd() {
			break
		}
	}
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%v: %s", decoder.typ, iter.Error.Error())
	}
}

type sixFieldsStructDecoder struct {
	typ           reflect.Type
	fieldHash1    int32
	fieldDecoder1 *structFieldDecoder
	fieldHash2    int32
	fieldDecoder2 *structFieldDecoder
	fieldHash3    int32
	fieldDecoder3 *structFieldDecoder
	fieldHash4    int32
	fieldDecoder4 *structFieldDecoder
	fieldHash5    int32
	fieldDecoder5 *structFieldDecoder
	fieldHash6    int32
	fieldDecoder6 *structFieldDecoder
}

func (decoder *sixFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	if !iter.readObjectStart() {
		return
	}
	for {
		switch iter.readFieldHash() {
		case decoder.fieldHash1:
			decoder.fieldDecoder1.Decode(ptr, iter)
		case decoder.fieldHash2:
			decoder.fieldDecoder2.Decode(ptr, iter)
		case decoder.fieldHash3:
			decoder.fieldDecoder3.Decode(ptr, iter)
		case decoder.fieldHash4:
			decoder.fieldDecoder4.Decode(ptr, iter)
		case decoder.fieldHash5:
			decoder.fieldDecoder5.Decode(ptr, iter)
		case decoder.fieldHash6:
			decoder.fieldDecoder6.Decode(ptr, iter)
		default:
			iter.Skip()
		}
		if iter.isObjectEnd() {
			break
		}
	}
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%v: %s", decoder.typ, iter.Error.Error())
	}
}

type sevenFieldsStructDecoder struct {
	typ           reflect.Type
	fieldHash1    int32
	fieldDecoder1 *structFieldDecoder
	fieldHash2    int32
	fieldDecoder2 *structFieldDecoder
	fieldHash3    int32
	fieldDecoder3 *structFieldDecoder
	fieldHash4    int32
	fieldDecoder4 *structFieldDecoder
	fieldHash5    int32
	fieldDecoder5 *structFieldDecoder
	fieldHash6    int32
	fieldDecoder6 *structFieldDecoder
	fieldHash7    int32
	fieldDecoder7 *structFieldDecoder
}

func (decoder *sevenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	if !iter.readObjectStart() {
		return
	}
	for {
		switch iter.readFieldHash() {
		case decoder.fieldHash1:
			decoder.fieldDecoder1.Decode(ptr, iter)
		case decoder.fieldHash2:
			decoder.fieldDecoder2.Decode(ptr, iter)
		case decoder.fieldHash3:
			decoder.fieldDecoder3.Decode(ptr, iter)
		case decoder.fieldHash4:
			decoder.fieldDecoder4.Decode(ptr, iter)
		case decoder.fieldHash5:
			decoder.fieldDecoder5.Decode(ptr, iter)
		case decoder.fieldHash6:
			decoder.fieldDecoder6.Decode(ptr, iter)
		case decoder.fieldHash7:
			decoder.fieldDecoder7.Decode(ptr, iter)
		default:
			iter.Skip()
		}
		if iter.isObjectEnd() {
			break
		}
	}
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%v: %s", decoder.typ, iter.Error.Error())
	}
}

type eightFieldsStructDecoder struct {
	typ           reflect.Type
	fieldHash1    int32
	fieldDecoder1 *structFieldDecoder
	fieldHash2    int32
	fieldDecoder2 *structFieldDecoder
	fieldHash3    int32
	fieldDecoder3 *structFieldDecoder
	fieldHash4    int32
	fieldDecoder4 *structFieldDecoder
	fieldHash5    int32
	fieldDecoder5 *structFieldDecoder
	fieldHash6    int32
	fieldDecoder6 *structFieldDecoder
	fieldHash7    int32
	fieldDecoder7 *structFieldDecoder
	fieldHash8    int32
	fieldDecoder8 *structFieldDecoder
}

func (decoder *eightFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	if !iter.readObjectStart() {
		return
	}
	for {
		switch iter.readFieldHash() {
		case decoder.fieldHash1:
			decoder.fieldDecoder1.Decode(ptr, iter)
		case decoder.fieldHash2:
			decoder.fieldDecoder2.Decode(ptr, iter)
		case decoder.fieldHash3:
			decoder.fieldDecoder3.Decode(ptr, iter)
		case decoder.fieldHash4:
			decoder.fieldDecoder4.Decode(ptr, iter)
		case decoder.fieldHash5:
			decoder.fieldDecoder5.Decode(ptr, iter)
		case decoder.fieldHash6:
			decoder.fieldDecoder6.Decode(ptr, iter)
		case decoder.fieldHash7:
			decoder.fieldDecoder7.Decode(ptr, iter)
		case decoder.fieldHash8:
			decoder.fieldDecoder8.Decode(ptr, iter)
		default:
			iter.Skip()
		}
		if iter.isObjectEnd() {
			break
		}
	}
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%v: %s", decoder.typ, iter.Error.Error())
	}
}

type nineFieldsStructDecoder struct {
	typ           reflect.Type
	fieldHash1    int32
	fieldDecoder1 *structFieldDecoder
	fieldHash2    int32
	fieldDecoder2 *structFieldDecoder
	fieldHash3    int32
	fieldDecoder3 *structFieldDecoder
	fieldHash4    int32
	fieldDecoder4 *structFieldDecoder
	fieldHash5    int32
	fieldDecoder5 *structFieldDecoder
	fieldHash6    int32
	fieldDecoder6 *structFieldDecoder
	fieldHash7    int32
	fieldDecoder7 *structFieldDecoder
	fieldHash8    int32
	fieldDecoder8 *structFieldDecoder
	fieldHash9    int32
	fieldDecoder9 *structFieldDecoder
}

func (decoder *nineFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	if !iter.readObjectStart() {
		return
	}
	for {
		switch iter.readFieldHash() {
		case decoder.fieldHash1:
			decoder.fieldDecoder1.Decode(ptr, iter)
		case decoder.fieldHash2:
			decoder.fieldDecoder2.Decode(ptr, iter)
		case decoder.fieldHash3:
			decoder.fieldDecoder3.Decode(ptr, iter)
		case decoder.fieldHash4:
			decoder.fieldDecoder4.Decode(ptr, iter)
		case decoder.fieldHash5:
			decoder.fieldDecoder5.Decode(ptr, iter)
		case decoder.fieldHash6:
			decoder.fieldDecoder6.Decode(ptr, iter)
		case decoder.fieldHash7:
			decoder.fieldDecoder7.Decode(ptr, iter)
		case decoder.fieldHash8:
			decoder.fieldDecoder8.Decode(ptr, iter)
		case decoder.fieldHash9:
			decoder.fieldDecoder9.Decode(ptr, iter)
		default:
			iter.Skip()
		}
		if iter.isObjectEnd() {
			break
		}
	}
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%v: %s", decoder.typ, iter.Error.Error())
	}
}

type tenFieldsStructDecoder struct {
	typ            reflect.Type
	fieldHash1     int32
	fieldDecoder1  *structFieldDecoder
	fieldHash2     int32
	fieldDecoder2  *structFieldDecoder
	fieldHash3     int32
	fieldDecoder3  *structFieldDecoder
	fieldHash4     int32
	fieldDecoder4  *structFieldDecoder
	fieldHash5     int32
	fieldDecoder5  *structFieldDecoder
	fieldHash6     int32
	fieldDecoder6  *structFieldDecoder
	fieldHash7     int32
	fieldDecoder7  *structFieldDecoder
	fieldHash8     int32
	fieldDecoder8  *structFieldDecoder
	fieldHash9     int32
	fieldDecoder9  *structFieldDecoder
	fieldHash10    int32
	fieldDecoder10 *structFieldDecoder
}

func (decoder *tenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	if !iter.readObjectStart() {
		return
	}
	for {
		switch iter.readFieldHash() {
		case decoder.fieldHash1:
			decoder.fieldDecoder1.Decode(ptr, iter)
		case decoder.fieldHash2:
			decoder.fieldDecoder2.Decode(ptr, iter)
		case decoder.fieldHash3:
			decoder.fieldDecoder3.Decode(ptr, iter)
		case decoder.fieldHash4:
			decoder.fieldDecoder4.Decode(ptr, iter)
		case decoder.fieldHash5:
			decoder.fieldDecoder5.Decode(ptr, iter)
		case decoder.fieldHash6:
			decoder.fieldDecoder6.Decode(ptr, iter)
		case decoder.fieldHash7:
			decoder.fieldDecoder7.Decode(ptr, iter)
		case decoder.fieldHash8:
			decoder.fieldDecoder8.Decode(ptr, iter)
		case decoder.fieldHash9:
			decoder.fieldDecoder9.Decode(ptr, iter)
		case decoder.fieldHash10:
			decoder.fieldDecoder10.Decode(ptr, iter)
		default:
			iter.Skip()
		}
		if iter.isObjectEnd() {
			break
		}
	}
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%v: %s", decoder.typ, iter.Error.Error())
	}
}

type structFieldDecoder struct {
	field        *reflect.StructField
	fieldDecoder ValDecoder
}

func (decoder *structFieldDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
	fieldPtr := unsafe.Pointer(uintptr(ptr) + decoder.field.Offset)
	decoder.fieldDecoder.Decode(fieldPtr, iter)
	if iter.Error != nil && iter.Error != io.EOF {
		iter.Error = fmt.Errorf("%s: %s", decoder.field.Name, iter.Error.Error())
	}
}


text:
// Bitcoin Transaction Tool
// Copyright (c) 2017 Coding Enthusiast
// Distributed under the MIT software license, see the accompanying
// file LICENCE or http://www.opensource.org/licenses/mit-license.php.

using BitcoinTransactionTool.Backend.Blockchain.Scripts;
using System;

namespace BitcoinTransactionTool.Backend.Blockchain
{
    public class TxIn : IDeserializable
    {
        /// <summary>
        /// Initializes a new instance of <see cref="TxIn"/> using parameters of the <see cref="ICoin"/>.
        /// </summary>
        public TxIn()
        {
            SetFields();
            Outpoint = new Outpoint();
            SigScript = new SignatureScript();
        }

        /// <summary>
        /// Initializes a new instance of <see cref="TxIn"/> using given parameters.
        /// </summary>
        /// <exception cref="ArgumentNullException"/>
        /// <param name="op">Transaction output</param>
        /// <param name="sigScript">Signature script</param>
        /// <param name="seq">Sequence</param>
        public TxIn(Outpoint op, SignatureScript sigScript, uint seq)
        {
            SetFields();
            if (op == null)
                throw new ArgumentNullException(nameof(op), "Outpoint can not be null!");
            if (sigScript == null)
                throw new ArgumentNullException(nameof(sigScript), "Signature script can not be null!");

            Outpoint = op;
            SigScript = sigScript;
            Sequence = seq;
        }

        public Outpoint Outpoint { get; set; }
        public ISignatureScript SigScript { get; set; }
        // TODO: read this about sequence and probably create a new variable type for it:
        // https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki
        public uint Sequence { get; set; }

        internal int MinSize;
        internal int MaxSize;

        private void SetFields()
        {
            CompactInt temp = new CompactInt(10000 /*coin.ScriptSigMaxLength*/);
            int opSize = new Outpoint().Size;
            MinSize = opSize + 1 + 0 + sizeof(uint);
            MaxSize = opSize + temp.ToByteArray().Length + 10000 + sizeof(uint);
        }

        /// <summary>
        /// Converts this instance into its byte array representation.
        /// </summary>
        /// <exception cref="ArgumentNullException"/>
        /// <returns>An array of bytes</returns>
        public byte[] Serialize()
        {
            if (Outpoint == null)
                throw new ArgumentNullException(nameof(Outpoint), "Outpoint can not be null.");
            if (SigScript == null)
                throw new ArgumentNullException(nameof(SigScript), "Signature script can not be null!");

            return ByteArray.ConcatArrays(
                Outpoint.Serialize(),
                SigScript.Serialize(),
                Sequence.ToByteArray(false)
                );
        }

        /// <summary>
        /// Deserializes the given byte array starting from the specified offset. The return value indicates success.
        /// </summary>
        /// <param name="data">Byte array containing an <see cref="TxIn"/>.</param>
        /// <param name="offset">The offset inside the <paramref name="data"/> to start from.</param>
        /// <param name="error">Error message (null if sucessful, otherwise will contain information about the failure).</param>
        /// <returns>True if deserialization was successful, false if otherwise.</returns>
        public bool TryDeserialize(byte[] data, ref int offset, out string error)
        {
            if (offset < 0)
            {
                error = "Offset can not be negative.";
                return false;
            }
            if (data == null || data.Length - offset < MinSize)
            {
                error = "Data length is not valid.";
                return false;
            }
            // TODO: Outpoint and SigScript could be null, perform a check?

            if (!Outpoint.TryDeserialize(data, ref offset, out error))
            {
                return false;
            }

            if (!SigScript.TryDeserialize(data, ref offset, out error))
            {
                return false;
            }

            Sequence = data.SubArray(offset, sizeof(uint)).ToUInt32(false);
            offset += sizeof(uint);

            error = null;
            return true;
        }

    }
}


text:
using UnityEngine;
using System.Collections;

public class TestImporter : MonoBehaviour
{
	public string[] modelPaths;

	void Start() {
		for (int i = 0; i < modelPaths.Length; ++i) {
			string path = modelPaths [i];
			if (!string.IsNullOrEmpty (path)) {
				path = Application.dataPath + "/Model/" + path + ".fbx";
				GameObject instance = ModelImporter.Importer.Import (path);
			}
		}
	}
}


text:
var assert = require('assert');

module.exports = function() {};

module.exports.prototype = {

    configure: function(requireCamelCaseOrUpperCaseIdentifiers) {
        assert(
            typeof requireCamelCaseOrUpperCaseIdentifiers === 'boolean',
            'requireCamelCaseOrUpperCaseIdentifiers option requires boolean value'
        );
        assert(
            requireCamelCaseOrUpperCaseIdentifiers === true,
            'requireCamelCaseOrUpperCaseIdentifiers option requires true value or should be removed'
        );
    },

    getOptionName: function () {
        return 'requireCamelCaseOrUpperCaseIdentifiers';
    },

    check: function(file, errors) {
        file.iterateTokensByType('Identifier', function(token) {
            var value = token.value;
            if (value.replace(/^_+|_+$/g, '').indexOf('_') > -1 && value.toUpperCase() !== value) {
                errors.add(
                    'All identifiers must be camelCase or UPPER_CASE',
                    token.loc.start.line,
                    token.loc.start.column
                );
            }
        });
    }

};


text:
package com.facebook.buck.thrift;

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

import com.facebook.buck.cli.FakeBuckConfig;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.model.BuildTargetFactory;
import com.facebook.buck.model.ImmutableFlavor;
import com.facebook.buck.python.PythonLibrary;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.BuildRuleParams;
import com.facebook.buck.rules.BuildRuleParamsFactory;
import com.facebook.buck.rules.BuildRuleResolver;
import com.facebook.buck.rules.FakeBuildRule;
import com.facebook.buck.rules.FakeBuildRuleParamsBuilder;
import com.facebook.buck.rules.SourcePath;
import com.facebook.buck.rules.SourcePathResolver;
import com.facebook.buck.rules.TestSourcePath;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;

import org.junit.Test;

import java.nio.file.Path;
import java.nio.file.Paths;

public class ThriftPythonEnhancerTest {

  private static final BuildTarget TARGET = BuildTargetFactory.newInstance("//:test#python");
  private static final FakeBuckConfig BUCK_CONFIG = new FakeBuckConfig();
  private static final ThriftBuckConfig THRIFT_BUCK_CONFIG = new ThriftBuckConfig(BUCK_CONFIG);
  private static final ThriftPythonEnhancer ENHANCER = new ThriftPythonEnhancer(
      THRIFT_BUCK_CONFIG,
      ThriftPythonEnhancer.Type.NORMAL);
  private static final ThriftPythonEnhancer TWISTED_ENHANCER = new ThriftPythonEnhancer(
      THRIFT_BUCK_CONFIG,
      ThriftPythonEnhancer.Type.TWISTED);

  private static FakeBuildRule createFakeBuildRule(
      String target,
      SourcePathResolver resolver,
      BuildRule... deps) {
    return new FakeBuildRule(
        new FakeBuildRuleParamsBuilder(BuildTargetFactory.newInstance(target))
            .setDeps(ImmutableSortedSet.copyOf(deps))
            .build(),
        resolver);
  }

  private static ThriftCompiler createFakeThriftCompiler(
      String target,
      SourcePathResolver resolver) {
    return new ThriftCompiler(
        BuildRuleParamsFactory.createTrivialBuildRuleParams(
            BuildTargetFactory.newInstance(target)),
        resolver,
        new TestSourcePath("compiler"),
        ImmutableList.<String>of(),
        Paths.get("output"),
        new TestSourcePath("source"),
        "language",
        ImmutableSet.<String>of(),
        ImmutableList.<Path>of(),
        ImmutableMap.<Path, SourcePath>of());
  }

  @Test
  public void getLanguage() {
    assertEquals(
        "py",
        ENHANCER.getLanguage());
  }

  @Test
  public void getFlavor() {
    assertEquals(
        ImmutableFlavor.of("py"),
        ENHANCER.getFlavor());
  }

  private ImmutableSet<String> addTwisted(ImmutableSet<String> options) {
    return ImmutableSet.<String>builder()
        .add("twisted")
        .addAll(options)
        .build();
  }

  @Test
  public void getOptions() {
    ThriftConstructorArg arg = new ThriftConstructorArg();
    ImmutableSet<String> options;

    // Test empty options.
    options = ImmutableSet.of();
    arg.pyOptions = Optional.of(options);
    assertEquals(
        options,
        ENHANCER.getOptions(TARGET, arg));
    assertEquals(
        addTwisted(options),
        TWISTED_ENHANCER.getOptions(TARGET, arg));

    // Test set options.
    options = ImmutableSet.of("test", "option");
    arg.pyOptions = Optional.of(options);
    assertEquals(
        options,
        ENHANCER.getOptions(TARGET, arg));
    assertEquals(
        addTwisted(options),
        TWISTED_ENHANCER.getOptions(TARGET, arg));

    // Test absent options.
    arg.pyOptions = Optional.absent();
    assertEquals(
        ImmutableSet.<String>of(),
        ENHANCER.getOptions(TARGET, arg));
    assertEquals(
        addTwisted(ImmutableSet.<String>of()),
        TWISTED_ENHANCER.getOptions(TARGET, arg));
  }

  private void expectImplicitDeps(
      ThriftPythonEnhancer enhancer,
      ImmutableSet<String> options,
      ImmutableSet<BuildTarget> expected) {

    ThriftConstructorArg arg = new ThriftConstructorArg();
    arg.pyOptions = Optional.of(options);

    assertEquals(
        expected,
        enhancer.getImplicitDepsForTargetFromConstructorArg(TARGET, arg));
  }

  @Test
  public void getImplicitDeps() {
    // Setup enhancers which set all appropriate values in the config.
    ImmutableMap<String, BuildTarget> config = ImmutableMap.of(
        "python_library", BuildTargetFactory.newInstance("//:python_library"),
        "python_twisted_library", BuildTargetFactory.newInstance("//:python_twisted_library"));
    ImmutableMap.Builder<String, String> strConfig = ImmutableMap.builder();
    for (ImmutableMap.Entry<String, BuildTarget> ent : config.entrySet()) {
      strConfig.put(ent.getKey(), ent.getValue().toString());
    }
    FakeBuckConfig buckConfig = new FakeBuckConfig(
        ImmutableMap.of("thrift", strConfig.build()));
    ThriftBuckConfig thriftBuckConfig = new ThriftBuckConfig(buckConfig);
    ThriftPythonEnhancer enhancer = new ThriftPythonEnhancer(
        thriftBuckConfig,
        ThriftPythonEnhancer.Type.NORMAL);
    ThriftPythonEnhancer twistedEnhancer = new ThriftPythonEnhancer(
        thriftBuckConfig,
        ThriftPythonEnhancer.Type.TWISTED);

    // With no options we just need to find the python thrift library.
    expectImplicitDeps(
        enhancer,
        ImmutableSet.<String>of(),
        ImmutableSet.of(
            config.get("python_library")));

    // With the twisted enhancer option we also expect the twisted library.
    expectImplicitDeps(
        twistedEnhancer,
        ImmutableSet.of("twisted"),
        ImmutableSet.of(
            config.get("python_library"),
            config.get("python_twisted_library")));
  }

  @Test
  public void createBuildRule() {
    BuildRuleResolver resolver = new BuildRuleResolver();
    SourcePathResolver pathResolver = new SourcePathResolver(resolver);
    BuildRuleParams flavoredParams =
        BuildRuleParamsFactory.createTrivialBuildRuleParams(TARGET);

    // Add a dummy dependency to the constructor arg to make sure it gets through.
    ThriftConstructorArg arg = new ThriftConstructorArg();
    arg.pyOptions = Optional.absent();
    arg.pyBaseModule = Optional.absent();

    // Setup up some thrift inputs to pass to the createBuildRule method.
    ImmutableMap<String, ThriftSource> sources = ImmutableMap.of(
        "test1.thrift", new ThriftSource(
            createFakeThriftCompiler("//:thrift_source1", pathResolver),
            ImmutableList.<String>of(),
            Paths.get("output1")),
        "test2.thrift", new ThriftSource(
            createFakeThriftCompiler("//:thrift_source2", pathResolver),
            ImmutableList.<String>of(),
            Paths.get("output2")));

    // Create a dummy implicit dep to pass in.
    ImmutableSortedSet<BuildRule> deps = ImmutableSortedSet.<BuildRule>of(
        createFakeBuildRule("//:dep", pathResolver));

    // Run the enhancer to create the language specific build rule.
    PythonLibrary library = ENHANCER.createBuildRule(
        flavoredParams,
        resolver,
        arg,
        sources,
        deps);

    // Verify that the top-level default python lib has correct deps.
    assertEquals(deps, library.getDeps());
  }

  @Test
  public void baseModule() {
    BuildTarget target = BuildTargetFactory.newInstance("//test:test");
    BuildRuleResolver resolver = new BuildRuleResolver();
    SourcePathResolver pathResolver = new SourcePathResolver(resolver);
    BuildRuleParams flavoredParams =
        BuildRuleParamsFactory.createTrivialBuildRuleParams(target);

    // Add a dummy dependency to the constructor arg to make sure it gets through.
    ThriftConstructorArg arg = new ThriftConstructorArg();
    arg.pyOptions = Optional.absent();

    // Setup up some thrift inputs to pass to the createBuildRule method.
    ImmutableMap<String, ThriftSource> sources = ImmutableMap.of(
        "test.thrift", new ThriftSource(
            createFakeThriftCompiler("//:thrift_source", pathResolver),
            ImmutableList.<String>of(),
            Paths.get("output")));

    // Verify that not setting the base module parameter defaults to the build target base path.
    arg.pyBaseModule = Optional.absent();
    PythonLibrary normal = ENHANCER.createBuildRule(
        flavoredParams,
        resolver,
        arg,
        sources,
        ImmutableSortedSet.<BuildRule>of());
    for (ImmutableMap.Entry<Path, SourcePath> ent : normal.getSrcs().entrySet()) {
      assertTrue(ent.getKey().toString(), ent.getKey().startsWith(target.getBasePath()));
    }

    // Verify that setting the base module uses it correctly.
    arg.pyBaseModule = Optional.of("blah");
    PythonLibrary baseModule = ENHANCER.createBuildRule(
        flavoredParams,
        resolver,
        arg,
        sources,
        ImmutableSortedSet.<BuildRule>of());
    for (ImmutableMap.Entry<Path, SourcePath> ent : baseModule.getSrcs().entrySet()) {
      assertTrue(ent.getKey().startsWith(Paths.get(arg.pyBaseModule.get())));
    }
  }

  @Test
  public void twistedBaseModule() {
    BuildTarget target = BuildTargetFactory.newInstance("//test:test");
    BuildRuleResolver resolver = new BuildRuleResolver();
    SourcePathResolver pathResolver = new SourcePathResolver(resolver);
    BuildRuleParams flavoredParams =
        BuildRuleParamsFactory.createTrivialBuildRuleParams(target);

    // Add a dummy dependency to the constructor arg to make sure it gets through.
    ThriftConstructorArg arg = new ThriftConstructorArg();
    arg.pyOptions = Optional.absent();

    // Setup up some thrift inputs to pass to the createBuildRule method.
    ImmutableMap<String, ThriftSource> sources = ImmutableMap.of(
        "test.thrift", new ThriftSource(
            createFakeThriftCompiler("//:thrift_source", pathResolver),
            ImmutableList.<String>of(),
            Paths.get("output")));

    // Verify that not setting the base module parameter defaults to the build target base path.
    arg.pyTwistedBaseModule = Optional.absent();
    PythonLibrary normal = TWISTED_ENHANCER.createBuildRule(
        flavoredParams,
        resolver,
        arg,
        sources,
        ImmutableSortedSet.<BuildRule>of());
    for (ImmutableMap.Entry<Path, SourcePath> ent : normal.getSrcs().entrySet()) {
      assertTrue(ent.getKey().toString(), ent.getKey().startsWith(target.getBasePath()));
    }

    // Verify that setting the base module uses it correctly.
    arg.pyTwistedBaseModule = Optional.of("blah");
    PythonLibrary baseModule = TWISTED_ENHANCER.createBuildRule(
        flavoredParams,
        resolver,
        arg,
        sources,
        ImmutableSortedSet.<BuildRule>of());
    for (ImmutableMap.Entry<Path, SourcePath> ent : baseModule.getSrcs().entrySet()) {
      assertTrue(ent.getKey().startsWith(Paths.get(arg.pyTwistedBaseModule.get())));
    }
  }

}


text:
/**********************************************************************************************************************
 * @file    Ramber/XMPP/IM/RosterItem.internal.h
 * @date    2014-07-11
 * @author  Omar Stefan Evans
 * @brief   <# Brief Description#>
 * @details <#Detailed Description#>
 **********************************************************************************************************************/

#import "RosterItem.h"

#include "rambler/XMPP/IM/RosterItem.hpp"

using namespace rambler;

@interface RosterItem ()

@property (readonly, assign) StrongPointer<XMPP::IM::RosterItem const> nativeObject;

- (instancetype)initWithNativeObject:(StrongPointer<XMPP::IM::RosterItem const>)aNativeObject NS_DESIGNATED_INITIALIZER;

@end


text:
package com.google.errorprone.bugpatterns.inject;

import static com.google.errorprone.BugPattern.SeverityLevel.ERROR;
import static com.google.errorprone.bugpatterns.inject.ElementPredicates.isFirstConstructorOfMultiInjectedClass;
import static com.google.errorprone.matchers.InjectMatchers.IS_APPLICATION_OF_GUICE_INJECT;
import static com.google.errorprone.matchers.InjectMatchers.IS_APPLICATION_OF_JAVAX_INJECT;
import static com.google.errorprone.matchers.Matchers.anyOf;
import static com.google.errorprone.util.ASTHelpers.getSymbol;

import com.google.errorprone.BugPattern;
import com.google.errorprone.VisitorState;
import com.google.errorprone.bugpatterns.BugChecker;
import com.google.errorprone.bugpatterns.BugChecker.AnnotationTreeMatcher;
import com.google.errorprone.matchers.Description;
import com.google.errorprone.matchers.Matcher;
import com.google.errorprone.util.ASTHelpers;
import com.sun.source.tree.AnnotationTree;
import com.sun.source.tree.ClassTree;
import com.sun.source.tree.Tree;

/**
 * Matches classes that have two or more constructors annotated with @Inject.
 *
 * @author sgoldfeder@google.com (Steven Goldfeder)
 */
@BugPattern(
    name = "MoreThanOneInjectableConstructor",
    summary =
        "This class has more than one @Inject-annotated constructor. Please remove the @Inject"
            + " annotation from all but one of them.",
    severity = ERROR,
    altNames = {"inject-constructors", "InjectMultipleAtInjectConstructors"})
public class MoreThanOneInjectableConstructor extends BugChecker implements AnnotationTreeMatcher {

  private static final Matcher<AnnotationTree> IS_EITHER_INJECT =
      anyOf(IS_APPLICATION_OF_GUICE_INJECT, IS_APPLICATION_OF_JAVAX_INJECT);

  @Override
  public Description matchAnnotation(AnnotationTree tree, VisitorState state) {
    if (IS_EITHER_INJECT.matches(tree, state)) {
      Tree injectedMember = state.getPath().getParentPath().getParentPath().getLeaf();
      if (isFirstConstructorOfMultiInjectedClass(getSymbol(injectedMember))) {
        return describeMatch(ASTHelpers.findEnclosingNode(state.getPath(), ClassTree.class));
      }
    }
    return Description.NO_MATCH;
  }
}


text:
package org.polaris.framework.common.lob.dao;

import java.io.InputStream;
import java.sql.Blob;

import javax.annotation.Resource;

import org.polaris.framework.common.dao.HibernateTemplate;
import org.polaris.framework.common.lob.vo.BlobContent;
import org.springframework.stereotype.Repository;

/**
 * BlobContent表的DAO类
 *
 * @author wang.sheng
 *
 */
@Repository
public class BlobContentDao
{
	@Resource
	private HibernateTemplate hibernateTemplate;

	public BlobContent getBlobContent(String id)
	{
		return hibernateTemplate.queryForObject("from BlobContent t where t.id=?", new Object[] { id }, BlobContent.class);
	}

	public void delete(String id)
	{
		hibernateTemplate.executeUpdate("delete from BlobContent t where t.id=?", new Object[] { id });
	}

	public BlobContent insert(byte[] bytes, String fileName)
	{
		Blob blob = hibernateTemplate.getCurrentSession().getLobHelper().createBlob(bytes);
		BlobContent blobContent = new BlobContent();
		blobContent.setContent(blob);
		blobContent.setOrignFileName(fileName);
		hibernateTemplate.save(blobContent);
		return blobContent;
	}

	public BlobContent insert(InputStream is, String fileName, long length)
	{
		Blob blob = hibernateTemplate.getCurrentSession().getLobHelper().createBlob(is, length);
		BlobContent blobContent = new BlobContent();
		blobContent.setContent(blob);
		blobContent.setOrignFileName(fileName);
		hibernateTemplate.save(blobContent);
		return blobContent;
	}
}


text:
module ApplicationHelper
  def require_logged_in
    redirect_to root_path and return unless is_authenticated?
  end

  def is_authenticated?
    return !!session[:user_id]
  end

  def current_user
    User.find_by(id: session[:user_id])
  end
end


text:
package java.lang

/* This is a hijacked class. Its instances are primitive numbers.
 * Constructors are not emitted.
 */
final class Float private () extends Number with Comparable[Float] {

  def this(value: scala.Float) = this()
  def this(s: String) = this()

  @inline def floatValue(): scala.Float =
    this.asInstanceOf[scala.Float]

  @inline override def byteValue(): scala.Byte = floatValue.toByte
  @inline override def shortValue(): scala.Short = floatValue.toShort
  @inline def intValue(): scala.Int = floatValue.toInt
  @inline def longValue(): scala.Long = floatValue.toLong
  @inline def doubleValue(): scala.Double = floatValue.toDouble

  @inline override def equals(that: Any): scala.Boolean =
    doubleValue.equals(that)

  @inline override def hashCode(): Int =
    Float.hashCode(floatValue)

  @inline override def compareTo(that: Float): Int =
    Float.compare(floatValue, that.floatValue)

  @inline override def toString(): String =
    Float.toString(floatValue)

  @inline def isNaN(): scala.Boolean =
    Float.isNaN(floatValue)

  @inline def isInfinite(): scala.Boolean =
    Float.isInfinite(floatValue)

}

object Float {
  final val TYPE = classOf[scala.Float]
  final val POSITIVE_INFINITY = 1.0f / 0.0f
  final val NEGATIVE_INFINITY = 1.0f / -0.0f
  final val NaN = 0.0f / 0.0f
  final val MAX_VALUE = scala.Float.MaxValue
  final val MIN_NORMAL = 1.17549435e-38f
  final val MIN_VALUE = scala.Float.MinPositiveValue
  final val MAX_EXPONENT = 127
  final val MIN_EXPONENT = -126
  final val SIZE = 32
  final val BYTES = 4

  @inline def `new`(value: scala.Float): Float = valueOf(value)

  @inline def `new`(value: scala.Double): Float = valueOf(value.toFloat)

  @inline def `new`(s: String): Float = valueOf(s)

  @inline def valueOf(f: scala.Float): Float = f.asInstanceOf[Float]

  @inline def valueOf(s: String): Float = valueOf(parseFloat(s))

  @inline def parseFloat(s: String): scala.Float =
    Double.parseDouble(s).toFloat

  @inline def toString(f: scala.Float): String =
    "" + f

  def toHexString(f: scala.Float): String = {
    val ebits = 8 // exponent size
    val mbits = 23 // mantissa size
    val bias = (1 << (ebits - 1)) - 1

    val bits = floatToIntBits(f)
    val s = bits < 0
    val m = bits & ((1 << mbits) - 1)
    val e = (bits >>> mbits).toInt & ((1 << ebits) - 1) // biased

    val posResult = if (e > 0) {
      if (e == (1 << ebits) - 1) {
        // Special
        if (m != 0) "NaN"
        else "Infinity"
      } else {
        // Normalized
        "0x1." + mantissaToHexString(m) + "p" + (e - bias)
      }
    } else {
      if (m != 0) {
        // Subnormal
        "0x0." + mantissaToHexString(m) + "p-126"
      } else {
        // Zero
        "0x0.0p0"
      }
    }

    if (bits < 0) "-" + posResult else posResult
  }

  @inline
  private def mantissaToHexString(m: Int): String = {
    @inline def padHex6(i: Int): String = {
      val s = Integer.toHexString(i)
      "000000".substring(s.length) + s // 6 zeros
    }

    // The << 1 turns `m` from a 23-bit int into a 24-bit int (multiple of 4)
    val padded = padHex6(m << 1)
    var len = padded.length
    while (len > 1 && padded.charAt(len - 1) == '0')
      len -= 1
    padded.substring(0, len)
  }

  @inline def compare(a: scala.Float, b: scala.Float): scala.Int =
    Double.compare(a, b)

  @inline def isNaN(v: scala.Float): scala.Boolean =
    v != v

  @inline def isInfinite(v: scala.Float): scala.Boolean =
    v == POSITIVE_INFINITY || v == NEGATIVE_INFINITY

  @inline def isFinite(f: scala.Float): scala.Boolean =
    !isNaN(f) && !isInfinite(f)

  @inline def hashCode(value: scala.Float): Int =
    FloatingPointBits.numberHashCode(value)

  @inline def intBitsToFloat(bits: scala.Int): scala.Float =
    FloatingPointBits.intBitsToFloat(bits)

  @inline def floatToIntBits(value: scala.Float): scala.Int =
    FloatingPointBits.floatToIntBits(value)

  @inline def sum(a: scala.Float, b: scala.Float): scala.Float =
    a + b

  @inline def max(a: scala.Float, b: scala.Float): scala.Float =
    Math.max(a, b)

  @inline def min(a: scala.Float, b: scala.Float): scala.Float =
    Math.min(a, b)
}


text:
package org.terracotta.offheapstore.eviction;

import java.util.Map.Entry;
import java.util.concurrent.Callable;

/**
 * Listener interface used to monitor eviction in off-heap caches.
 *
 * @author Chris Dennis
 */
public interface EvictionListener<K, V> {

  /**
   * Called prior to the eviction of a cache mapping.
   * <p>
   * Implementors must be careful to not expose the callable outside the scope
   * of this method.  The behavior of the callable becomes undefined on return
   * from this method.
   *
   * @param callable callable for retrieving the evictee
   */
  void evicting(Callable<Entry<K, V>> callable);
}


text:
<?php

namespace Teadaze;
include('base/init.php');

/**
 * The entry to the framework.
 *
 * This object is called as a front controller. It runs through
 * any framework hooks and sends data to the target controller.
 *
 * The Entry object handles both page generation and dynamic
 * requests to controllers.
 */

class Entry extends CallbackHookable
{
	/** @var DBO $db A DBO object for the framework */
	private $db;

	/** @var array $hooks A list of hook and their hooklines */
	private $hooks;

	private $controllerLoader = null;
	protected $oninitialisedCB = null;
	private $initialiser = null;

	/**
	 * The method for initialising an Entry object
	 *
	 * This method handles the loading the definition
	 * of framework hooks and their hooklines, and also
	 * setting up a new database object
	 *
	 * @method init()
	 * @access public
	 */
	private function init()
	{
		global $hooks;
		global $config;

		if($config['db'] != '') {
			$this->db = DBO::init();

			/* debugging hook - not necessary */
			if(isset($hooks['dbo.onquery']))
			$this->db->setCallback('onquery', $hooks['dbo.onquery']);
		}

		$this->initialiser = new $config['initialiser']();
		$this->controllerLoader = new $config['loaders']['controller']();
		$pluginLoader = new $config['loaders']['plugin']();
		$this->initialiser->setControllerLoader($this->controllerLoader);
		$this->initialiser->setModelLoader( new $config['loaders']['model']());
		$this->initialiser->setViewLoader( new $config['loaders']['view']());
		$this->initialiser->setPluginLoader($pluginLoader);
		$this->hooks = new HookLines($hooks, $pluginLoader);
		if($this->oninitialisedCB)
			call_user_func($this->oninitialisedCB, $this);

	}

	/**
	 * A method for including a configuration or an array of site/config/ configuration files
	 *
	 * This includes any configuration files that relative to site/config/.
	 * If it is a string then it includes a single configuration, otherwise
	 * if it is an array it will sequentially include each config file
	 *
	 * @method includeConfig($config)
	 * @param string|array $config The name or array of names of the configuration file(s)
	 * @access public
	 */
	public function includeConfig($config)
	{
		if(is_array($config)) {
			foreach($config as $c)
				include("site/config/$c.php");
		} else
			include("site/config/$config.php");
	}

	/**
	 * The method called when the Entry object is to handle a request
	 *
	 * This method runs the 'onrequest' hook and then runs
	 * either a full page static request or a dynamic request depending
	 * on whether the dynamic keyword is set as a URL parameter.
	 *
	 * The method returns the fully parsed document
	 *
	 * @method run()
	 * @access public
	 * @return string The complete document for echoing
	 */
	public function run()
	{
		global $config;
		$this->init();
		$url = url_array($_SERVER['REQUEST_URI']);
		if($url == null)
			$url[0] = $config['auto_control'];

		try {
			$this->runHook('onrequest', $url);
			if($url[0] == $config['dynamic_keyword'])
				return $this->runRequest(url_next_dir($url), false);
			else
				return $this->runRequest($url);
		} catch (exception $e) {
			throw new \Exception("Error on run()
$e");
			return null;
		}

	}

	/**
	 * The method for a page requests, the controller to load set by $target
	 *
	 * Here the object will run any controller hooks that are configured,
	 * then load and run the controller, get the view and place it in a
	 * frame, finally returning the template generated by the frame
	 *
	 * @method runRequest(array $target)
	 * @param array $target The target array, generated by the URL
	 * @access private
	 * @return string Fully parsed document
	 */
	private function runRequest($target, $regular = true)
	{
		global $config;
		try {
			while(!$this->runHook($target[0]."Controller", $target))
				continue;
			$this->runHook('preload', $target);

			$controller = $this->controllerLoader->load($target[0]);
			if($regular)
				$controller = $controller->runInit(url_next_dir($target));
			else
				$controller = $controller->runDynamic(url_next_dir($target));

			$view = $controller->getView();
			if(!$view)
				throw new \Exception("No view loaded from {$target[0]}");

			$html = $view->loadTemplate();
			$sinker['html']= &$html;
			$sinker['target']= &$target;

			$this->hooks->run('ondispatch', $sinker);
			return $html;
		}
		catch(exception $e) {
			throw $e;
		}
	}

	/**
	 * The method that is used to run a hookline that is associated with a hook
	 *
	 * This will generate a hookline and sequentially pass the sinker
	 * into each plugin to modify the data. This is a framework sinker so will
	 * have the target set under the 'target' key.
	 *
	 * If the target has changed from the hookline, it will return false so the
	 * new controller can be checked for a hook; otherwise it will return true
	 *
	 * @method runHook(string $hook, array &$target)
	 * @param string $hook The hook to check
	 * @param array $target The target array generated by the URL
	 * @access private
	 * @return boolean True if the hookline has passed successfully; false if the target has changed
	 */
	private function runHook($hook, &$target = null)
	{
		try {
			global $config;
			$sinker = array( 'target' => $target );
			$this->hooks->run($hook, $sinker);
			$ref = 0;
			if($target[0] == $config['dynamic_keyword'])
				$ref = 1;

			if($target && $sinker['target'][$ref] != $target[$ref]) {
				$target = $sinker['target'];
				return false;
			}

		} catch (exception $e) {
			throw new \Exception("Error running hook : $e");
		}

		return true;
	}

	public function getObjectInitialiser() {
		return $this->initialiser;
	}
}