text:
Gerenciar Mesas-Redondas

                    <?php if($success!=null): ?>

                            <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
                            <?php echo $success; ?>

                    <?php endif; ?>

                    <?php if($error!=null): ?>

                            <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
                            <?php echo $error; ?>

                    <?php endif; ?>

Calendário das Mesas-Redondas

Adicionar dia/turno

                    <?php echo form_open(base_url('dashboard/roundtable/createdayshift'), array('id' => 'formCreateRoundTableDayShift','novalidate' => '','class' => 'waiting')); ?>

                                    Dia *
                                    <input type="number" class="form-control" placeholder="Dia" name="day" value="<?php echo $popform['day']; ?>">

<?php if($validation!=null): ?> <?php echo $validation['day']; ?> <?php endif; ?>

                                    Mês *
                                    <select class="form-control" name="month" >
                                        <option value="1">Janeiro</option>
                                        <option value="2">Fevereiro</option>
                                        <option value="3">Março</option>
                                        <option value="4">Abril</option>
                                        <option value="5">Maio</option>
                                        <option value="6">Junho</option>
                                        <option value="7">Julho</option>
                                        <option value="8">Agosto</option>
                                        <option value="9">Setembro</option>
                                        <option value="10">Outubro</option>
                                        <option value="11">Novembro</option>
                                        <option value="12">Dezembro</option>
                                    </select>

                                    Ano *
                                    <input type="number" class="form-control" placeholder="Ano" name="year" value="<?php echo $popform['year']; ?>">

<?php if($validation!=null): ?> <?php echo $validation['year']; ?> <?php endif; ?>

                                    Turno *
                                    <select class="form-control" name="shift">
                                        <option value="matutino">Matutino</option>
                                        <option value="vespertino">Vespertino</option>
                                        <option value="noturno">Noturno</option>
                                    </select>

                                <button type="submit" class="btn btn-block btn-large btn-success">  Adicionar Dia/Turno</button>

                    </form>

Calendário

                        <?php function print_day($date,$list){ ?>

<?php echo date("d/m/Y", strtotime($date));  ?>

                                    <?php foreach($list as $e): ?>

                                                        <?php if($e['shift']=='matutino'): ?>
                                                             Manhã
                                                        <?php elseif($e['shift']=='vespertino'): ?>
                                                             Tarde
                                                        <?php elseif($e['shift']=='noturno'): ?>
                                                             Noite
                                                        <?php endif; ?>

                                                    <?php echo form_open(base_url('dashboard/roundtable/deletedayshift'), array('id' => 'formDeleteDayShiftRoundTable','novalidate' => '','class' => 'waiting','style' => 'display:inline-block;')); ?>
                                                        <input style="display:none;" name="id" value="<?php echo $e['id']; ?>" />
                                                        <button type="submit" style="display:inline-block;margin-left:10px; padding:0px;border:none;background-color:white;color:blue;font-size:12px;">
                                                            Remover Turno
                                                        </button>
                                                    </form>

                                                        <?php if(count($e['roundtables'])==0): ?>

                                                                Ainda não há mesas-redondas consolidadas para este dia/turno.

                                                        <?php else: ?>

                                                            <?php foreach($e['roundtables'] as $m): ?>

                                                                <?php echo $m->title; ?>
                                                                <a style="cursor:pointer;" data-toggle="modal" data-target="#modalRoundTableDetails" data-data="<?php echo $m->id; ?>"> Mais Informações

                                                            <?php endforeach; ?>
                                                        <?php endif; ?>

                                    <?php endforeach; ?>

                <?php } ?>

                <?php if (!count($rtdss)): ?>

Ainda não há dias/turnos cadastrados para o calendário.

                <?php else: ?>

                    <?php

                        $date = "";
                        $list = array();
                        $tempdate = "";
                        $templist = array();
                        $count = 0;

                    ?>

                    <?php foreach($rtdss as $rtds): ?>

                        <?php

                            if($date==""){ // Just first time
                                $date = $rtds["date"];
                                $list[] = array("id" => $rtds["id"], "date" => $rtds["date"], "shift" => $rtds["shift"], "roundtables" => $rtds["ownRoundtableList"]);
                                continue;
                            }else if($date==$rtds["date"]){
                                $list[] = array("id" => $rtds["id"], "date" => $rtds["date"], "shift" => $rtds["shift"], "roundtables" => $rtds["ownRoundtableList"]);
                                continue;
                            }else{

                                $templist = array();
                                $tempdate = $date;

                                // Passing elements from $list to $templist and ordering $templist by shift

                                $shiftordered = array('matutino','vespertino','noturno');

                                for( $i=0, $j=0 ; ; ++$i ){

                                    if($j==count($shiftordered))
                                        break;

                                    if($i==count($list) && $j<count($shiftordered)){
                                        ++$j;
                                        $i=-1;
                                        continue;
                                    }

                                    if($list[$i]['shift']==$shiftordered[$j]){
                                        $templist[] = $list[$i];
                                        ++$j;
                                        $i=-1;
                                    }

                                }

                                // Cleaning $list array, and put new elements of date, and def new date
                                $list = array();
                                $list[] = array("id" => $rtds["id"], "date" => $rtds["date"], "shift" => $rtds["shift"], "roundtables" => $rtds["ownRoundtableList"]);
                                $date  = $rtds["date"];

                            }
                        ?>

                        <?php print_day($tempdate,$templist); ?>

                        <?php if( $count++ > 2 ): ?>

                            <?php $count = 0; ?>

                        <?php endif; ?>

                    <?php endforeach; ?>

                    <?php print_day($date,$list); // Print the last one ?>

                <?php endif; ?>

Mesas-Redondas Cadastradas

 <a href="<?php echo base_url('dashboard/roundtable/manage'); ?>" >Todos as mesas-redondas | <a href="<?php echo base_url('dashboard/roundtable/manage/consolidated'); ?>">Mesas-redondas consolidadas | <a href="<?php echo base_url('dashboard/roundtable/manage/noconsolidated'); ?>">Mesas-redondas não consolidadas

                                Consolidar?
                                Título
                                Turno
                                Editar
                                Detalhes

                        <?php foreach ($rts as $rt): ?>

                                    <?php if($rt->consolidated=='yes'): ?>

                                        <a class="btn btn-block btn-danger" data-target=".modal-roundtable-confirm-operation" data-toggle="modal" data-id="<?php echo $rt->id; ?>">Desconsolidar

                                    <?php else: ?>
                                        <button type="button" class="btn btn-block btn-success" data-target="#modalConsolidateRoundTable" data-toggle="modal" data-data="<?php echo $rt->id; ?>">
                                            Consolidar
                                        </button>
                                    <?php endif; ?>

                                <?php echo $rt->title; ?>
                                <?php echo $rt->shift; ?>

                                    <?php if($rt->consolidated=='no'): ?>
                                        A mesa-redonda não está consolidada.
                                    <?php else: ?>
                                        <a class="btn btn-block btn-success" style="cursor:pointer;" data-toggle="modal" data-target=".modal-roundtable-edit-info" data-data="<?php echo $rt->id; ?>">

                                    <?php endif; ?>

                                    <button id="openRoundTableDetails" data-target="#modalRoundTableDetails" style="display:none;"></button>
                                    <button type="button" class="btn btn-block btn-success" data-toggle="modal" data-target="#modalRoundTableDetails" data-data="<?php echo $rt->id; ?>">

                                    </button>

                        <?php endforeach ?>

                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Detalhes

                    Carregando...

                    <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>

    <input id="rt-details" style="display:none;" value="<?php echo base_url('dashboard/roundtable/retrievedetails') ?>" />

                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Consolidar Mesa-Redonda

                    Carregando...

                    <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>

    <input id="rt-consolidateRoundTable" value="<?php echo base_url('dashboard/roundtable/retrieveconsolidation'); ?>" style="display:none" />

redpajama_set_name: RedPajamaGithub


text:
package se.sics.veloxj;

import java.util.Vector;
import java.util.logging.*;

public class VeloxApp {
    private String name;
    private VeloxTable<VeloxString> strings;
    private VeloxTable<VeloxSymbol> symbols;
    private VeloxTable<VeloxSymbol> internalSymbols;
    private VeloxTable<VeloxExpression> expressions;

    public VeloxApp(String name) throws VeloxException {
	this.name = name;
	strings = new VeloxTable<VeloxString>();
	symbols = new VeloxTable<VeloxSymbol>();
	internalSymbols = VeloxCompiler.getInternalSymbols();
	expressions = new VeloxTable<VeloxExpression>();

	/* Insert an empty top-level expression. */
	expressions.insert(new VeloxExpression());
    }

    public String getName() {
	return name;
    }

    public VeloxTable<VeloxString> getStringTable() {
	return strings;
    }

    public VeloxTable<VeloxSymbol> getSymbolTable() {
	return symbols;
    }

    public VeloxTable<VeloxExpression> getExpressionTable() {
	return expressions;
    }

    public void addExpression(VeloxExpression expression) throws VeloxException {
	VeloxExpression topExpression = expressions.get(0);
	topExpression.addArgument(expression);
	processExpression(expression);
    }

    private void processExpression(VeloxExpression expression) throws VeloxException {
	Vector<VeloxObject> arguments = expression.getArguments();
	for(int i = 0; i < arguments.size(); i++) {
	    VeloxObject obj = arguments.elementAt(i);

	    if (obj instanceof VeloxExpression) {
		/* Replace the actual expression with a reference to the
		   placement of the expression in the expression table. */
		int exprID = expressions.find((VeloxExpression)obj);
		if (exprID < 0) {
		    exprID = expressions.insert((VeloxExpression)obj);
		}
		arguments.setElementAt((VeloxObject)new VeloxExpressionRef(exprID), i);
		VeloxCompiler.logger.finer("Replace an expression at argument " +
					   i + " to a reference to ID " +
					   exprID);
		processExpression((VeloxExpression)obj);
	    } else if (obj instanceof VeloxString) {
		int stringID = strings.find((VeloxString)obj);
		if (stringID < 0) {
		    stringID = strings.insert((VeloxString)obj);
		}
		arguments.set(i, new VeloxStringRef(stringID));
	    } else if (obj instanceof VeloxSymbol) {
		int symbolID = internalSymbols.find((VeloxSymbol)obj);
		if (symbolID >= 0) {
		    /* The symbol is defined by Velox. */
		    VeloxCompiler.logger.finest("Found Velox symbol "+
						obj.getObject());
		    arguments.set(i, new VeloxSymbolRef(symbolID, false));
		} else {
		    /* The symbol is defined by the application. */
		    symbolID = symbols.find((VeloxSymbol)obj);
		    if (symbolID < 0) {
			symbolID = symbols.insert((VeloxSymbol)obj);
		    }
		    arguments.set(i, new VeloxSymbolRef(symbolID, true));
		}
	    }
	}
    }

    public String getDefaultRepresentation() {
        StringBuilder buf = new StringBuilder();

	for (VeloxExpression expression : expressions.vectorize()) {
	    buf.append(expression.getDefaultRepresentation());
	    buf.append('\n');
	}

	if (buf.charAt(buf.length() - 1) == '\n') {
	    return buf.substring(0, buf.length() - 1).toString();
        } else {
	    return buf.toString();
        }
    }
}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime;
using System.Text;
using System.Text.RegularExpressions;
using System.Reflection;
using System.IO;
using System.Linq;

namespace Cortex.Grammar
{
  public class AdvanceableProduction : ICloneable, IEnumerable<string>, IAdvanceableProduction
  {
#if GATHERING_STATS
    public static long DeleteCount = 0L;
    public static long InstanceCount = 0L;
#endif
    private int current, min;
    private Production prod;

    public int Max { get { return prod.Count; } }
    public int Min { get { return min; } }
    public int Position { get { return current; } }
    public SemanticRule Rule { get { return prod.Rule; } }
    public string Current
    {
      get
      {
        if(current < Max && current >= min)
          return prod[current];
        else
          return null;
      }
    }
    public int Count { get { return prod.Count; } }
    public Production Target { get { return prod; } }
    public bool HasNext { get { return current < Max; } }
    public bool HasPrevious { get { return current >= min; } }

    public AdvanceableProduction(Production p, int start)
    {
#if GATHERING_STATS
      InstanceCount++;
#endif
      current = start;
      min = start;
      prod = p;
    }
    public AdvanceableProduction(Production p) : this(p, 0) { }
    public AdvanceableProduction(AdvanceableProduction adv)
      : this(adv.Target, adv.Min)
    {
      current = adv.Position;
    }
#if GATHERING_STATS
    ~AdvanceableProduction()
    {
      DeleteCount++;

    }
#endif
    public object Clone()
    {
      return new AdvanceableProduction(this);
    }
    public override bool Equals(object other)
    {
      AdvanceableProduction p = (AdvanceableProduction)other;
      return p.current == current && p.min == min && p.Max == Max &&
        p.prod.Equals(this.prod);
    }
    public override int GetHashCode()
    {
      return min.GetHashCode() + current.GetHashCode() + Max.GetHashCode() + prod.GetHashCode();
    }
    public string this[int index]
    {
      get
      {
        if(index < min || index > Max)
          throw new ArgumentException("Given index is out of range");
        else
          return prod[index];
      }
    }
    IAdvanceableProduction IAdvanceableProduction.FunctionalNext()
    {
      return FunctionalNext();
    }
    IAdvanceableProduction IAdvanceableProduction.FunctionalPrevious()
    {
      return FunctionalPrevious();
    }
    public AdvanceableProduction FunctionalNext()
    {
      var adp = (AdvanceableProduction)Clone();
      adp.Next();
      return adp;
    }
    public AdvanceableProduction FunctionalPrevious()
    {
      var adp = (AdvanceableProduction)Clone();
      adp.Previous();
      return adp;
    }
    public bool Next()
    {
      bool result = HasNext;
      if(result)
        current++;
      return result && current < Max;
    }
    public bool Previous()
    {
      bool result = HasPrevious;
      if(result)
        current--;
      return result && current >= min;
    }
    public void Reset()
    {
      current = min;
    }
    public IEnumerator<string> GetEnumerator()
    {
      return new Enumerator(this);
    }
    IEnumerator IEnumerable.GetEnumerator()
    {
      return GetEnumerator();
    }

    public class Enumerator : IEnumerator<string>
    {
#if GATHERING_STATS
      public static long InstanceCount = 0L,
             DeleteCount = 0L;
#endif
      private int min;
      private int start;
      private int max;
      private Production target;
      public Enumerator(AdvanceableProduction prod)
      {
#if GATHERING_STATS
        InstanceCount++;
#endif
        min = prod.Min;
        start = prod.Min - 1;
        max = prod.Max;
        target = prod.prod;
      }
#if GATHERING_STATS
      ~Enumerator()
      {
        DeleteCount++;
      }
#endif
      object IEnumerator.Current { get { return Current; } }
      public string Current { get { return target[start]; } }
      public bool MoveNext()
      {
        start++;
        return start < max;
      }
      public void Reset()
      {
        start = min - 1;
      }
      public void Dispose()
      {
        min = -1;
        start = -1;
        max = -1;
        target = null;
      }
    }
    public static implicit operator Production(AdvanceableProduction prod)
    {
      return prod.prod;
    }
    public override string ToString()
    {
      StringBuilder sb = new StringBuilder();
      for(int i = 0; i < Min; i++)
        sb.Append(prod[i]);
      sb.Append("!");
      for(int i = Min; i < current; i++)
        sb.AppendFormat("{0} ", prod[i]);
      sb.Append("@");
      for(int i = current; i < Max; i++)
        sb.AppendFormat("{0} ", prod[i]);
      return sb.ToString();
    }
  }
}


text:
require 'readable_interface/version'

module ReadableInterface
  def readable_interface(name, options = {})
    define_writter(name, options)
    define_reader(name, options)
  end

  private

  def define_writter(name, options)
    singleton_class = class << self; self; end
    singleton_class.send(:define_method, name) do |value|
      instance_variable_set("@_#{name}", value)
    end
  end

  def define_reader(name, options)
    define_method(name) do
      self.class.instance_variable_get("@_#{name}") || fail(NotImplementedError, options[:message])
    end
  end
end


text:
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace TSF.UmlCanvas.Addins {
  class SubmissionForm : Form {
    public SubmissionForm() {
      InitializeComponent();
    }

    private System.ComponentModel.IContainer components = null;

    internal string diagramID {
      get { return this.diagramIDTextBox.Text;  }
      set { this.diagramIDTextBox.Text = value; }
    }

    internal string user {
      get { return this.userTextBox.Text;  }
      set { this.userTextBox.Text = value; }
    }

    internal string password {
      get { return this.passwordTextBox.Text;  }
      set { this.passwordTextBox.Text = value; }
    }

    internal string description {
      get { return this.descriptionTextBox.Text;  }
      set { this.descriptionTextBox.Text = value; }
    }

    protected override void Dispose(bool disposing) {
      if (disposing && (components != null)){
        components.Dispose();
      }
      base.Dispose(disposing);
    }

    private void InitializeComponent() {
      this.diagramIDLabel     = new System.Windows.Forms.Label();
      this.diagramIDTextBox   = new System.Windows.Forms.TextBox();

      this.userLabel          = new System.Windows.Forms.Label();
      this.userTextBox        = new System.Windows.Forms.TextBox();

      this.passwordLabel      = new System.Windows.Forms.Label();
      this.passwordTextBox    = new System.Windows.Forms.TextBox();

      this.descriptionLabel   = new System.Windows.Forms.Label();
      this.descriptionTextBox = new System.Windows.Forms.TextBox();

      this.saveButton         = new System.Windows.Forms.Button();
      this.cancelButton       = new System.Windows.Forms.Button();

      this.SuspendLayout();

      this.diagramIDLabel.AutoSize = true;
      this.diagramIDLabel.Location = new System.Drawing.Point(249, 51);
      this.diagramIDLabel.Name = "DiagramIDLabel";
      this.diagramIDLabel.Size = new System.Drawing.Size(60, 13);
      this.diagramIDLabel.TabIndex = 10;
      this.diagramIDLabel.Text = "Diagram ID";

      this.diagramIDTextBox.Location = new System.Drawing.Point(252, 69);
      this.diagramIDTextBox.Name = "diagramIDTextBox";
      this.diagramIDTextBox.Size = new System.Drawing.Size(100, 20);
      this.diagramIDTextBox.TabIndex = 1;

      this.userLabel.AutoSize = true;
      this.userLabel.Location = new System.Drawing.Point(12, 8);
      this.userLabel.Name = "userLabel";
      this.userLabel.Size = new System.Drawing.Size(29, 13);
      this.userLabel.TabIndex = 11;
      this.userLabel.Text = "User";

      this.userTextBox.Location = new System.Drawing.Point(12, 26);
      this.userTextBox.Name = "userTextBox";
      this.userTextBox.Size = new System.Drawing.Size(140, 20);
      this.userTextBox.TabIndex = 2;

      this.passwordLabel.AutoSize = true;
      this.passwordLabel.Location = new System.Drawing.Point(9, 51);
      this.passwordLabel.Name = "passwordLabel";
      this.passwordLabel.Size = new System.Drawing.Size(53, 13);
      this.passwordLabel.TabIndex = 12;
      this.passwordLabel.Text = "Password";

      this.passwordTextBox.Location = new System.Drawing.Point(12, 69);
      this.passwordTextBox.Name = "passwordTextBox";
      this.passwordTextBox.Size = new System.Drawing.Size(140, 20);
      this.passwordTextBox.TabIndex = 3;
      this.passwordTextBox.UseSystemPasswordChar = true;

      this.descriptionLabel.AutoSize = true;
      this.descriptionLabel.Location = new System.Drawing.Point(9, 94);
      this.descriptionLabel.Name = "descriptionLabel";
      this.descriptionLabel.Size = new System.Drawing.Size(65, 13);
      this.descriptionLabel.TabIndex = 14;
      this.descriptionLabel.Text = "Description";

      this.descriptionTextBox.Location = new System.Drawing.Point(12, 112);
      this.descriptionTextBox.Name = "descriptionTextBox";
      this.descriptionTextBox.Size = new System.Drawing.Size(400, 20);
      this.descriptionTextBox.TabIndex = 5;

      /*
      user        12,08 - 12,26
      password     9,51 - 12,69       id 249,51 - 252,69
      description  9,94 - 12,112
      */

      this.saveButton.Anchor =
        ((System.Windows.Forms.AnchorStyles)
          ((System.Windows.Forms.AnchorStyles.Bottom
            | System.Windows.Forms.AnchorStyles.Right)));
      this.saveButton.DialogResult = System.Windows.Forms.DialogResult.OK;
      this.saveButton.Location = new System.Drawing.Point(516, 161);
      this.saveButton.Name = "saveButton";
      this.saveButton.Size = new System.Drawing.Size(75, 23);
      this.saveButton.TabIndex = 6;
      this.saveButton.Text = "Save";
      this.saveButton.UseVisualStyleBackColor = true;

      this.cancelButton.Anchor =
        ((System.Windows.Forms.AnchorStyles)
          ((System.Windows.Forms.AnchorStyles.Bottom
            | System.Windows.Forms.AnchorStyles.Right)));
      this.cancelButton.DialogResult =
        System.Windows.Forms.DialogResult.Cancel;
      this.cancelButton.Location = new System.Drawing.Point(426, 161);
      this.cancelButton.Name = "cancelButton";
      this.cancelButton.Size = new System.Drawing.Size(75, 23);
      this.cancelButton.TabIndex = 7;
      this.cancelButton.Text = "Cancel";
      this.cancelButton.UseVisualStyleBackColor = true;

      this.AcceptButton = this.saveButton;
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.CancelButton = this.cancelButton;
      this.ClientSize = new System.Drawing.Size(603, 200);
      this.Controls.Add(this.diagramIDLabel);
      this.Controls.Add(this.diagramIDTextBox);
      this.Controls.Add(this.userLabel);
      this.Controls.Add(this.userTextBox);
      this.Controls.Add(this.passwordLabel);
      this.Controls.Add(this.passwordTextBox);
      this.Controls.Add(this.descriptionLabel);
      this.Controls.Add(this.descriptionTextBox);
      this.Controls.Add(this.saveButton);
      this.Controls.Add(this.cancelButton);
      this.Name = "SubmissionForm";
      this.Text = "SubmissionForm";
      this.ResumeLayout(false);
      this.PerformLayout();
    }

    private System.Windows.Forms.Label   diagramIDLabel;
    private System.Windows.Forms.TextBox diagramIDTextBox;

    private System.Windows.Forms.Label   userLabel;
    private System.Windows.Forms.TextBox userTextBox;

    private System.Windows.Forms.Label   passwordLabel;
    private System.Windows.Forms.TextBox passwordTextBox;

    private System.Windows.Forms.Label   descriptionLabel;
    private System.Windows.Forms.TextBox descriptionTextBox;

    private System.Windows.Forms.Button saveButton;
    private System.Windows.Forms.Button cancelButton;
  }
}


text:
package org.spoofax.interpreter.library.ssl;

import org.spoofax.interpreter.core.IContext;
import org.spoofax.interpreter.core.InterpreterException;
import org.spoofax.interpreter.library.AbstractPrimitive;
import org.spoofax.interpreter.stratego.Strategy;
import org.spoofax.interpreter.terms.IStrategoTerm;
import org.spoofax.terms.util.TermUtils;

public class SSL_strlen extends AbstractPrimitive {

    protected SSL_strlen() {
        super("SSL_strlen", 0, 1);
    }

    @Override
    public boolean call(IContext env, Strategy[] sargs, IStrategoTerm[] targs) throws InterpreterException {

        if(!TermUtils.isString(targs[0]))
            return false;

        String s = TermUtils.toJavaString(targs[0]);
        env.setCurrent(env.getFactory().makeInt(s.length()));
        return true;
    }
}


text:
package testing

import (
	"os"
)

// MkTmpdir creates a temporary directory based upon the prefix passed in.
// If successful, it returns the temporary directory path. The directory can be
// deleted with a call to "os.RemoveAll(...)".
// In case of error, it'll return an empty string and the error.
func MkTmpdir(prefix string) (string, error) {
	tmpDir, err := os.MkdirTemp(os.TempDir(), prefix)
	if err != nil {
		return "", err
	}
	return tmpDir, nil
}

// MkTmpdirOrDie does the same work as "MkTmpdir", except in case of
// errors, it'll trigger a panic.
func MkTmpdirOrDie(prefix string) string {
	tmpDir, err := MkTmpdir(prefix)
	if err != nil {
		panic(err)
	}
	return tmpDir
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package de.dplatz.padersprinter.entity;

import java.time.LocalTime;

/**
 *
 * @author daniel.platz
 */
public class Leg {

    private final LocalTime startTime;
    private final LocalTime endTime;
    private final String startLocation;
    private final String endLocation;
    private final Transport transport;

    public Leg(Transport transport, LocalTime startTime, String startLocation, LocalTime endTime, String endLocation) {
        this.startTime = startTime;
        this.endTime = endTime;
        this.startLocation = startLocation;
        this.endLocation = endLocation;
        this.transport = transport;
    }

    public LocalTime getStartTime() {
        return startTime;
    }

    public LocalTime getEndTime() {
        return endTime;
    }

    public String getStartLocation() {
        return startLocation;
    }

    public String getEndLocation() {
        return endLocation;
    }

    public Transport getTransport() {
        return transport;
    }

    @Override
    public String toString() {
        return "Leg{" + "startTime=" + startTime + ", endTime=" + endTime + ", startLocation=" + startLocation + ", endLocation=" + endLocation + ", transport=" + transport + '}';
    }
}


text:
cd ../..
CUR=$(pwd)
cp $CUR/Monkeyrunner_TestCpp.py $ANDROID_HOME/tools
cp $CUR/ReportManager.py $ANDROID_HOME/tools

cd ../..
PROJECT_HOME=$(pwd)
#cp -r samples/TestCpp/proj.android/obj $ANDROID_HOME/tools
cd samples/Cpp/TestCpp/proj.android/bin

#Copy test apk to tools directory.
CUR=$(pwd)
cp $CUR/TestCpp-debug-8.apk $ANDROID_HOME/tools
cp $CUR/TestCpp-debug-10.apk $ANDROID_HOME/tools
cp $CUR/TestCpp-debug-11.apk $ANDROID_HOME/tools
cp $CUR/TestCpp-debug-12.apk $ANDROID_HOME/tools
cp $CUR/TestCpp-debug-13.apk $ANDROID_HOME/tools

#Enter tools directory.
cd $ANDROID_HOME/tools

#If monkeyrunner test failed,it automatically exit and make ERRORLEVEL nonzero.

#Running monkeyrunner test(debug,API level:8)
mv TestCpp-debug-8.apk TestCpp-debug.apk
monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk
if [ $? != 0 ]; then
    python ReportManager.py
    exit 1
fi
rm TestCpp-debug.apk

#Running monkeyrunner test(debug,API level:10)
mv TestCpp-debug-10.apk TestCpp-debug.apk
monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk
if [ $? != 0 ]; then
    python ReportManager.py
    exit 1
fi
rm TestCpp-debug.apk

#Running monkeyrunner test(debug,API level:11)
mv TestCpp-debug-11.apk TestCpp-debug.apk
monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk
if [ $? != 0 ]; then
    python ReportManager.py
    exit 1
fi
rm TestCpp-debug.apk

#Running monkeyrunner test(debug,API level:12)
mv TestCpp-debug-12.apk TestCpp-debug.apk
monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk
if [ $? != 0 ]; then
    python ReportManager.py
    exit 1
fi
rm TestCpp-debug.apk

#Running monkeyrunner test(debug,API level:13)
mv TestCpp-debug-13.apk TestCpp-debug.apk
monkeyrunner Monkeyrunner_TestCpp.py TestCpp-debug.apk
if [ $? != 0 ]; then
    python ReportManager.py
    exit 1
fi
rm TestCpp-debug.apk

rm Monkeyrunner_TestCpp.py
rm ReportManager.py

#Monkeyrunner success!
echo Monkeyrunner Test Success!

#Clean project files.
cd $PROJECT_HOME

git checkout -f
git clean -df -x

#End


text:
<?php
$TRANSLATIONS = array(
"Unable to load list from App Store" => "Ekki tókst að hlaða lista frá forrita síðu",
"Authentication error" => "Villa við auðkenningu",
"Group already exists" => "Hópur er þegar til",
"Unable to add group" => "Ekki tókst að bæta við hóp",
"Email saved" => "Netfang vistað",
"Invalid email" => "Ógilt netfang",
"Unable to delete group" => "Ekki tókst að eyða hóp",
"Unable to delete user" => "Ekki tókst að eyða notenda",
"Language changed" => "Tungumáli breytt",
"Invalid request" => "Ógild fyrirspurn",
"Admins can't remove themself from the admin group" => "Stjórnendur geta ekki fjarlægt sjálfa sig úr stjórnendahóp",
"Unable to add user to group %s" => "Ekki tókst að bæta notenda við hópinn %s",
"Unable to remove user from group %s" => "Ekki tókst að fjarlægja notanda úr hópnum %s",
"Disable" => "Gera óvirkt",
"Enable" => "Virkja",
"Please wait...." => "Andartak....",
"Updating...." => "Uppfæri...",
"Error" => "Villa",
"Update" => "Uppfæra",
"Updated" => "Uppfært",
"Saving..." => "Er að vista ...",
"deleted" => "eytt",
"undo" => "afturkalla",
"Groups" => "Hópar",
"Group Admin" => "Hópstjóri",
"Delete" => "Eyða",
"__language_name__" => "__nafn_tungumáls__",
"Security Warning" => "Öryggis aðvörun",
"More" => "Meira",
"Less" => "Minna",
"Version" => "Útgáfa",
"Developed by the ownCloud community, the source code is licensed under the AGPL." => "Þróað af ownCloud samfélaginu, forrita kóðinn er skráðu með AGPL.",
"Add your App" => "Bæta við forriti",
"More Apps" => "Fleiri forrit",
"Select an App" => "Veldu forrit",
"See application page at apps.owncloud.com" => "Skoða síðu forrits hjá apps.owncloud.com",
"-licensed by " => "-leyfi skráð af ",
"User Documentation" => "Notenda handbók",
"Administrator Documentation" => "Stjórnenda handbók",
"Online Documentation" => "Handbók á netinu",
"Forum" => "Vefspjall",
"Bugtracker" => "Villubókhald",
"Commercial Support" => "Borgaður stuðningur",
"You have used %s of the available %s" => "Þú hefur notað %s af tiltæku %s",
"Password" => "Lykilorð",
"Your password was changed" => "Lykilorði þínu hefur verið breytt",
"Unable to change your password" => "Ekki tókst að breyta lykilorðinu þínu",
"Current password" => "Núverandi lykilorð",
"New password" => "Nýtt lykilorð",
"Change password" => "Breyta lykilorði",
"Email" => "Netfang",
"Your email address" => "Netfangið þitt",
"Fill in an email address to enable password recovery" => "Sláðu inn netfangið þitt til að virkja endurheimt á lykilorði",
"Language" => "Tungumál",
"Help translate" => "Hjálpa við þýðingu",
"WebDAV" => "WebDAV",
"Encryption" => "Dulkóðun",
"Create" => "Búa til",
"Default Storage" => "Sjálfgefin gagnageymsla",
"Unlimited" => "Ótakmarkað",
"Other" => "Annað",
"Username" => "Notendanafn",
"Storage" => "gagnapláss",
"Default" => "Sjálfgefið"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>getTypedList (Dia)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />

     # File Dia/Dia.rb, line 270
270:   def getTypedList(type)
271:     list = @typedList[type] ;
272:     if(list.nil?)
273:       list = [] ;
274:       @typedList[type] = list ;
275:     end
276:     return list ;
277:   end


text:
#ifndef __CAMERA_CAMERA_UTILS_H__
#define __CAMERA_CAMERA_UTILS_H__

#include <camera/NdkCameraManager.h>
#include <camera/NdkCameraError.h>

/*
 * A set of macros to call into Camera APIs. The API is grouped with a few
 * objects, with object name as the prefix of function names.
 */
#define CALL_CAMERA(func)                                             \
  {                                                                   \
    camera_status_t status = func;                                    \
    ASSERT(status == ACAMERA_OK, "%s call failed with code: %#x, %s", \
           __FUNCTION__, status, GetErrorStr(status));                \
  }
#define CALL_MGR(func) CALL_CAMERA(ACameraManager_##func)
#define CALL_DEV(func) CALL_CAMERA(ACameraDevice_##func)
#define CALL_METADATA(func) CALL_CAMERA(ACameraMetadata_##func)
#define CALL_CONTAINER(func) CALL_CAMERA(ACaptureSessionOutputContainer_##func)
#define CALL_OUTPUT(func) CALL_CAMERA(ACaptureSessionOutput_##func)
#define CALL_TARGET(func) CALL_CAMERA(ACameraOutputTarget_##func)
#define CALL_REQUEST(func) CALL_CAMERA(ACaptureRequest_##func)
#define CALL_SESSION(func) CALL_CAMERA(ACameraCaptureSession_##func)

/*
 * A few debugging functions for error code strings etc
 */
const char* GetErrorStr(camera_status_t err);
const char* GetTagStr(acamera_metadata_tag_t tag);
void PrintMetadataTags(int32_t entries, const uint32_t* pTags);
void PrintLensFacing(ACameraMetadata_const_entry& lensData);
void PrintCameras(ACameraManager* cameraMgr);
void PrintCameraDeviceError(int err);

void PrintRequestMetadata(ACaptureRequest* req);
#endif  // __CAMERA_CAMERA_UTILS_H__


text:
module.exports =
{
    mode:   "01",
    pid:    "12",
    name:   "air_stat",
    description: "Commanded Secondary Air Status",

    min:    0,
    max:    0,
    unit:   "Bit Encoded",

    bytes:  1,
    convertToUseful: function( byteA )
    {
        /*
         1	Upstream
         2	Downstream of catalytic converter
         4	From the outside atmosphere or off
         8	Pump commanded on for diagnostics
         */
        //return parseInt( byteA, 2 );

        var byteAvalue = parseInt( byteA, 16 );

        switch ( byteAvalue )
        {
            case 1:
                return {value : 1, name : "Upstream"};
                break;

            case 2:
                return {value : 2, name : "Downstream of catalytic converter"};
                break;

            case 4:
                return {value : 4, name : "From the outside atmosphere or off"};
                break;

            case 8:
                return {value : 8, name : "Pump commanded on for diagnostics"};
                break;

            default :
                return {value : byteAvalue, name : "Invalid response"};
        }
    }
};


text:
    <canvas class="little-panel" baseChart
            [datasets]="lineChartData"
            [labels]="lineChartLabels"
            [options]="lineChartOptions"
            [colors]="lineChartColors"
            [legend]="lineChartLegend"
            [chartType]="lineChartType"
            (chartHover)="chartHovered($event)"
            (chartClick)="chartClicked($event)"></canvas>


text:
package Chapter3;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
import javax.print.*;
import javax.print.attribute.*;
import javax.print.attribute.standard.*;
import javax.print.event.*;
import javax.swing.*;
import javax.swing.event.*;

public class ImagePrinter extends JFrame
{
  private String filename;
  private BufferedImage image;
  private JTextArea statusTA;
  private PrintService printServices[];
  private PrintRequestAttributeSet attributeSet;

  public ImagePrinter( String filename ) throws IOException {
    super( "ImagePrinter" );
    this.filename = filename;

    setupAttributeSet();
    findPrinters();
    loadImage( filename );
    setupGUI();

    showStatus( "Ready." );
  }

  private void setupAttributeSet() {
    // The required attributes of the printer(s) we
    // will display in the printer list
    attributeSet = new HashPrintRequestAttributeSet();
    attributeSet.add( new Copies( 1 ) );
  }

  private void doPrint( int service ) {
    try {
      PrintService ps = printServices[service];

      DocPrintJob job = ps.createPrintJob();

      job.addPrintJobListener( new PrintJobListener() {
        public void printDataTransferCompleted(
            PrintJobEvent pje ) {
          showStatus( "Transfer Completed." );
        }
        public void printJobCanceled( PrintJobEvent pje ) {
          showStatus( "Print Job Canceled." );
        }
        public void printJobCompleted( PrintJobEvent pje ) {
          showStatus( "Print Job Completed." );
        }
        public void printJobFailed( PrintJobEvent pje ) {
          showStatus( "Print Job Failed." );
        }
        public void printJobNoMoreEvents( PrintJobEvent pje ) {
        }
        public void printJobRequiresAttention( PrintJobEvent pje ) {
          showStatus( "Print Job Requires Attention." );
        }
      } );

      FileInputStream fin = new FileInputStream( filename );
      Doc doc = new SimpleDoc( fin,
                               DocFlavor.INPUT_STREAM.GIF, null );

      job.print( doc, attributeSet );

      fin.close();
    } catch( IOException ie ) {
      ie.printStackTrace();
    } catch( PrintException pe ) {
      pe.printStackTrace();
    }
  }

  private void findPrinters() {
    printServices =
      PrintServiceLookup.lookupPrintServices(
        DocFlavor.INPUT_STREAM.GIF, attributeSet );

    if (printServices.length==0)
      throw new RuntimeException(
        "No printer services available." );
  }

  private void loadImage( String filename ) throws IOException {
    image = ImageIO.read( new File( filename ) );
  }

  private void setupGUI() {
    setBackground( Color.white );
    JPanel panel0 = new JPanel();
    panel0.setBorder(
      BorderFactory.createEmptyBorder( 10, 10, 10, 10 ) );
    panel0.setLayout( new BorderLayout() );

    JPanel printerPanel = new JPanel();
    printerPanel.setLayout( new BorderLayout() );
    printerPanel.setBorder(
      BorderFactory.createTitledBorder(
        BorderFactory.createLineBorder( Color.black ),
        "Select Printer" ) );

    String printServiceNames[] = new String[printServices.length];
    for (int i=0; i<printServices.length; ++i) {
      printServiceNames[i] = printServices[i].getName();
    }
    final JList printerList = new JList( printServiceNames );
    printerList.addListSelectionListener(
      new ListSelectionListener() {
        public void valueChanged( ListSelectionEvent lse ) {
          if (!lse.getValueIsAdjusting()) {
            int ind = printerList.getSelectedIndex();
            if (ind==-1) {
              showStatus( "No printer selected." );
            } else {
              String printerName = printServices[ind].getName();
              showStatus( printerName+" selected." );
            }
          }
        }
      } );
    printerList.setSelectionMode(
      ListSelectionModel.SINGLE_SELECTION );
    printerList.setPreferredSize( new Dimension( 20, 80 ) );

    printerPanel.add( printerList, BorderLayout.CENTER );

    JButton printButton = new JButton( "Print" );
    JPanel buttonPanel = new JPanel();
    buttonPanel.setBorder(
      BorderFactory.createEmptyBorder( 5, 5, 5, 5 ) );
    buttonPanel.setLayout( new BorderLayout() );
    printButton.addActionListener( new ActionListener() {
      public void actionPerformed( ActionEvent ae ) {
        int ind = printerList.getSelectedIndex();
        if (ind==-1) {
          showStatus( "No printer selected." );
        } else {
          doPrint( ind );
        }
      }
    } );
    buttonPanel.add( printButton, BorderLayout.CENTER );

    JPanel rightPanel = new JPanel();
    rightPanel.setLayout( new BorderLayout() );
    rightPanel.add( printerPanel, BorderLayout.CENTER );
    rightPanel.add( buttonPanel, BorderLayout.SOUTH );

    JPanel imagePanel = new JPanel();
    imagePanel.setLayout( new BorderLayout() );
    imagePanel.setBorder(
      BorderFactory.createTitledBorder(
        BorderFactory.createLineBorder( Color.black ),
        "Image" ) );

    ImageCanvas imageCanvas = new ImageCanvas( image );
    imageCanvas.setPreferredSize( new Dimension( 140, 80 ) );
    imageCanvas.setMinimumSize( new Dimension( 140, 80 ) );
    imagePanel.add( imageCanvas, BorderLayout.CENTER );

    JPanel panel1 = new JPanel();
    panel1.setLayout( new BoxLayout( panel1, BoxLayout.X_AXIS ) );
    panel1.add( imagePanel );
    panel1.add( rightPanel );

    JPanel statusPanel = new JPanel();
    statusPanel.setLayout( new BorderLayout() );
    statusPanel.setBorder(
      BorderFactory.createTitledBorder(
        BorderFactory.createLineBorder( Color.black ),
        "Status" ) );

    statusTA = new JTextArea( 6, 80 );
    statusTA.setEditable( false );
    JScrollPane statusSP = new JScrollPane( statusTA,
      JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
      JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
    statusPanel.add( statusSP, BorderLayout.CENTER );
    panel0.add( statusPanel, BorderLayout.SOUTH );

    panel0.add( panel1, BorderLayout.CENTER );

    getContentPane().setBackground( Color.white );
    getContentPane().add( panel0, BorderLayout.CENTER );

    setSize( 450, 350 );

    addWindowListener( new WindowListener() {
      public void windowActivated( WindowEvent we ) {
      }
      public void windowClosed( WindowEvent we ) {
      }
      public void windowClosing( WindowEvent we ) {
        System.exit( 0 );
      }
      public void windowDeactivated( WindowEvent we ) {
      }
      public void windowDeiconified( WindowEvent we ) {
      }
      public void windowIconified( WindowEvent we ) {
      }
      public void windowOpened( WindowEvent we ) {
      }
    } );
  }

  private void showStatus( String status ) {
    statusTA.setText( statusTA.getText()+status+"\n" );
  }

  static class ImageCanvas extends JPanel
  {
    private BufferedImage image;
    public ImageCanvas( BufferedImage image ) {
      this.image = image;
    }
    public void paintComponent( Graphics g ) {
      int width = getWidth();
      int height = getHeight();
      g.drawImage( image, 0, 0, width, height, null );
    }
  }

  static public void main( String args[] ) throws IOException {
    if (args.length != 1) {
      System.err.println(
        "Usage: java ImagePrinter <image filename>" );
      System.exit( 1 );
    }

    String filename = args[0];
    if (!filename.toLowerCase().endsWith( ".gif" ))
      throw new RuntimeException(
        "Image must be a gif: "+filename );

    ImagePrinter ip = new ImagePrinter( filename );
    ip.setVisible( true );
  }
}


text:
package v2

import (
	"os"

	"code.cloudfoundry.org/cli/cf/cmd"
	"code.cloudfoundry.org/cli/commands"
	"code.cloudfoundry.org/cli/commands/flags"
)

type RestartAppInstanceCommand struct {
	RequiredArgs    flags.AppInstance `positional-args:"yes"`
	usage           interface{}       `usage:"CF_NAME restart-app-instance APP_NAME INDEX"`
	relatedCommands interface{}       `related_commands:"restart"`
}

func (_ RestartAppInstanceCommand) Setup(config commands.Config, ui commands.UI) error {
	return nil
}

func (_ RestartAppInstanceCommand) Execute(args []string) error {
	cmd.Main(os.Getenv("CF_TRACE"), os.Args)
	return nil
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<assembly>
    <id>gridlib</id>
	<baseDirectory></baseDirectory>
	<formats>
		<format>tar.gz</format>
	</formats>
	<fileSets>
        <fileSet>
            <directory>src/main/resources</directory>
            <outputDirectory></outputDirectory>
            <includes>
                <include>grid-library.xml</include>
            </includes>
            <filtered>true</filtered>
        </fileSet>
	</fileSets>
    <dependencySets>
        <dependencySet>
            <outputDirectory>lib</outputDirectory>
            <unpack>false</unpack>
            <includes>
               <include>org.jruby:jruby-complete</include>
            </includes>
        </dependencySet>
  </dependencySets>
</assembly>


text:
using Premotion.Mansion.Core.Collections;
using Premotion.Mansion.Core.Data;
using Premotion.Mansion.Core.ScriptTags.Stack;
using Premotion.Mansion.Core.Scripting.TagScript;

namespace Premotion.Mansion.Core.ScriptTags.Repository
{
	/// <summary>
	/// Retrieves a child nodes from the repository.
	/// </summary>
	[ScriptTag(Constants.NamespaceUri, "loopNodeset")]
	public class LoopNodesetTag : LoopBaseTag
	{
		/// <summary>
		/// Gets the loop set.
		/// </summary>
		/// <param name="context">The request context.</param>
		/// <returns>Returns the <see cref="Dataset"/> on which to loop.</returns>
		protected override Dataset GetLoopset(IMansionContext context)
		{
			var loopset = GetRequiredAttribute<Nodeset>(context, "source");
			End = loopset.RowCount;
			return loopset;
		}
	}
}


text:
/**
 * (c)2015  Create at: 2015-09-02 16:45
 * @author Scm <ejbscm@hotmail.com>
 * @docauthor Scm <ejbscm@hotmail.com>
 * @filepath namespace.js
 *
 * Eui.js may be freely distributed under the MIT license.
 * @namespace Eui
 */
(function($) {

	/**
	 * 默认命名空间.
	 * @memberof Eui
	 * @name #namespace
	 * @type {String}
	 * @default 'mui'
	 */
	$.namespace = 'mui';

	/**
	 * 样式类的前缀.
	 * @memberof Eui
	 * @name #classNamePrefix
	 * @type {String}
	 * @default 'mui-'
	 */
	$.classNamePrefix = $.namespace + '-';

	/**
	 * 样式选择器的前缀.
	 * @memberof Eui
	 * @alias #classSelectorPrefix
	 * @type {String}
	 * @default '.mui-'
	 */
	$.classSelectorPrefix = '.' + $.classNamePrefix;

	/**
	 * 返回最终的样式名称.
	 * @alias #className
	 * @memberof Eui
	 * @param {String} className
	 * @returns {String} 默认{@link $.classNamePrefix|classNamePrefix} + className
	 */
	$.className = function(className) {
		return $.classNamePrefix + className;
	};

	/**
	 * 返回最终的classSelector.
	 * @alias #classSelector
	 * @memberof Eui
	 * @param {String} classSelector
	 * @returns {String}
	 */
	$.classSelector = function(classSelector) {
		return classSelector.replace(/\./g, $.classSelectorPrefix);
	};

	//
	// 返回最终的eventName.
	// @param {String} event
	// @param {Boolean} module
	// @returns {String}
	//
	$.eventName = function(event, module) {
		return event + ($.namespace ? ('.' + $.namespace) : '') + ( module ? ('.' + module) : '');
	};
})(Eui);


text:
package com.aspose.cells.examples.rows_cloumns;

import com.aspose.cells.Cells;
import com.aspose.cells.Workbook;
import com.aspose.cells.Worksheet;
import com.aspose.cells.examples.Utils;

public class SettingHeightAllRows {
	public static void main(String[] args) throws Exception {
		// The path to the documents directory.
		String dataDir = Utils.getSharedDataDir(SettingHeightAllRows.class) + "rows_cloumns/";

		// Instantiating a Workbook object
		Workbook workbook = new Workbook(dataDir + "book1.xls");

		// Accessing the first worksheet in the Excel file
		Worksheet worksheet = workbook.getWorksheets().get(0);
		Cells cells = worksheet.getCells();

		// Setting the height of all rows in the worksheet to 15
		worksheet.getCells().setStandardHeight(15f);

		// Saving the modified Excel file in default (that is Excel 2003) format
		workbook.save(dataDir + "SettingHeightAllRows_out.xls");
	}
}


text:
import {EventEmitter} from "@angular/core";

export interface GlobalModel {
    description?: string;
    tags?: string[];
    terminal?: string;
    filesTree: FileNode[];
    config: ConfigNode;
}

export interface MenuItem {
    label?: string;
    icon?: string;
    command?: (event?: any) => void;
    url?: string;
    routerLink?: any;
    eventEmitter?: EventEmitter<any>;
    items?: MenuItem[];
    expanded?: boolean;
}

export interface FileNode {
    // inherited
    label?: string;
    data?: any;
    icon?: any;
    expanded?: boolean;
    expandedIcon?: any;
    collapsedIcon?: any;
    children?: FileNode[];
    leaf?: boolean;
    // new fields
    id: string;
    parentId?: string;
}

export interface ConfigNode {
    language: string;
    languageMode: string,
    initialNode: string,
    javaClasses: string[]
}


text:
from realtime.signals.earthquake import *  # noqa
from realtime.signals.flood import *  # noqa
from realtime.signals.ash import *  # noqa

__author__ = 'Rizky Maulana Nugraha <lana.pcfre@gmail.com>'
__date__ = '12/4/15'


text:
package com.envyleague.cricket.config;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;

@Configuration
public class AppConfig {
    Logger log = LoggerFactory.getLogger(AppConfig.class);

    @Bean
    public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() {
        MappingJackson2HttpMessageConverter jsonConverter = new MappingJackson2HttpMessageConverter();
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        jsonConverter.setObjectMapper(objectMapper);
        return jsonConverter;
    }
}


text:
require 'test_helper'

module Ershou
  class Admin::TopicsHelperTest < ActionView::TestCase
  end
end


text:
class Second {
  public String getSecond() {
    return "I Second That.";
  }
}


text:
package org.gradle.tests2;

import org.junit.Test;

public class Test2_3 {
    @Test
    public void myTest() throws Exception {
        Thread.sleep(5);
    }
}


text:
@interface SearchResultsViewController : BaseTableTableViewController

@end


text:
#region License

#endregion

#region Imports

using System;
using System.Reflection;

using NUnit.Framework;
using Spring.Messaging;

#endregion

namespace Spring
{
    /// <summary>
    /// Unit tests for all of the exception classes in the Spring.Data library...
    /// </summary>
    /// <author>Rick Evans</author>
    [TestFixture]
    public sealed class MessagingExceptionTests : ExceptionsTest
    {
        [TestFixtureSetUp]
        public void FixtureSetUp ()
        {
            AssemblyToCheck = Assembly.GetAssembly(typeof(MessagingException));
        }
    }
}


text:
We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution,
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult [GitHub Help] for more
information on using pull requests.

[GitHub Help]: https://help.github.com/articles/about-pull-requests/

## Development setup

When working on the Firebase CLI, you will want to [fork the project](https://help.github.com/articles/fork-a-repo/), clone the forked repository, and then use `npm link` to globally link your working directory. This allows you to use the firebase command anywhere with your work-in-progress code.

```
git clone <your_forked_repo>
cd firebase-tools # navigate to your local repository
npm link
npm test # runs linter and tests
```

Now, whenever you run the firebase command, it is executing against the code in your working directory. This is great for manual testing.


text:
package org.apache.cassandra.stress;

import static com.google.common.base.Charsets.UTF_8;

import java.io.*;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.util.*;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;

import org.apache.cassandra.client.ClientLibrary;
import org.apache.cassandra.config.CFMetaData;
import org.apache.cassandra.config.ConfigurationException;
import org.apache.cassandra.db.ColumnFamilyType;
import org.apache.cassandra.db.marshal.*;
import org.apache.cassandra.thrift.*;
import org.apache.cassandra.utils.ByteBufferUtil;
import org.apache.cassandra.utils.FBUtilities;
import org.apache.cassandra.utils.LamportClock;
import org.apache.commons.cli.*;
import org.apache.commons.lang.StringUtils;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;

public class Session implements Serializable
{
    // command line options
    public static final Options availableOptions = new Options();

    public static final String DEFAULT_COMPARATOR = "AsciiType";
    public static final String DEFAULT_VALIDATOR  = "BytesType";

    private static InetAddress localInetAddress;

    public final AtomicInteger operations;
    public final AtomicInteger keys;
    public final AtomicInteger columnCount;
    public final AtomicLong    bytes;
    public final AtomicLong    latency;
    public final ConcurrentLinkedQueue<Long> latencies;

    static
    {
        availableOptions.addOption("h",  "help",                 false,  "Show this help message and exit");
        availableOptions.addOption("n",  "num-keys",             true,   "Number of keys, default:1000000");
        availableOptions.addOption("F",  "num-different-keys",   true,   "Number of different keys (if < NUM-KEYS, the same key will re-used multiple times), default:NUM-KEYS");
        availableOptions.addOption("N",  "skip-keys",            true,   "Fraction of keys to skip initially, default:0");
        availableOptions.addOption("t",  "threads",              true,   "Number of threads to use, default:50");
        availableOptions.addOption("c",  "columns",              true,   "Number of columns per key, default:5");
        availableOptions.addOption("S",  "column-size",          true,   "Size of column values in bytes, default:34");
        availableOptions.addOption("C",  "cardinality",          true,   "Number of unique values stored in columns, default:50");
        availableOptions.addOption("d",  "nodes",                true,   "Host nodes (comma separated), default:locahost");
        availableOptions.addOption("D",  "nodesfile",            true,   "File containing host nodes (one per line)");
        availableOptions.addOption("s",  "stdev",                true,   "Standard Deviation Factor, default:0.1");
        availableOptions.addOption("r",  "random",               false,  "Use random key generator (STDEV will have no effect), default:false");
        availableOptions.addOption("f",  "file",                 true,   "Write output to given file");
        availableOptions.addOption("p",  "port",                 true,   "Thrift port, default:9160");
        availableOptions.addOption("m",  "unframed",             false,  "Use unframed transport, default:false");
        availableOptions.addOption("o",  "operation",            true,   "Operation to perform (INSERT, READ, RANGE_SLICE, INDEXED_RANGE_SLICE, MULTI_GET, COUNTER_ADD, COUNTER_GET), default:INSERT");
        availableOptions.addOption("u",  "supercolumns",         true,   "Number of super columns per key, default:1");
        availableOptions.addOption("y",  "family-type",          true,   "Column Family Type (Super, Standard), default:Standard");
        availableOptions.addOption("K",  "keep-trying",          true,   "Retry on-going operation N times (in case of failure). positive integer, default:10");
        availableOptions.addOption("k",  "keep-going",           false,  "Ignore errors inserting or reading (when set, --keep-trying has no effect), default:false");
        availableOptions.addOption("i",  "progress-interval",    true,   "Progress Report Interval (seconds), default:10");
        availableOptions.addOption("g",  "keys-per-call",        true,   "Number of keys to get_range_slices or multiget per call, default:1000");
        availableOptions.addOption("l",  "replication-factor",   true,   "Replication Factor to use when creating needed column families, default:1");
        availableOptions.addOption("L",  "enable-cql",           false,  "Perform queries using CQL (Cassandra Query Language).");
        availableOptions.addOption("e",  "consistency-level",    true,   "Consistency Level to use (ONE, QUORUM, LOCAL_QUORUM, EACH_QUORUM, ALL, ANY), default:ONE");
        availableOptions.addOption("x",  "create-index",         true,   "Type of index to create on needed column families (KEYS)");
        availableOptions.addOption("R",  "replication-strategy", true,   "Replication strategy to use (only on insert if keyspace does not exist), default:org.apache.cassandra.locator.SimpleStrategy");
        availableOptions.addOption("O",  "strategy-properties",  true,   "Replication strategy properties in the following format <dc_name>:<num>,<dc_name>:<num>,...");
        availableOptions.addOption("W",  "no-replicate-on-write",false,  "Set replicate_on_write to false for counters. Only counter add with CL=ONE will work");
        availableOptions.addOption("V",  "average-size-values",  false,  "Generate column values of average rather than specific size");
        availableOptions.addOption("T",  "send-to",              true,   "Send this as a request to the stress daemon at specified address.");
        availableOptions.addOption("I",  "compression",          true,   "Specify the compression to use for sstable, default:no compression");
        availableOptions.addOption("Q",  "query-names",          true,   "Comma-separated list of column names to retrieve from each row.");
        availableOptions.addOption("Z",  "compaction-strategy",  true,   "CompactionStrategy to use.");
        availableOptions.addOption("U",  "comparator",           true,   "Column Comparator to use. Currently supported types are: TimeUUIDType, AsciiType, UTF8Type.");

        availableOptions.addOption("A",  "num-dependencies",     true,   "Number of dependencies to attach to each operation.");

        availableOptions.addOption("",  "just-create-keyspace",  false,   "Only create the keyspace and then exit");

        availableOptions.addOption("",  "stress-index",      true,       "Index of this stress client out of STRESS-COUNT.  Allows for disjoint INSERTS on different servers.");
        availableOptions.addOption("",  "stress-count",      true,       "Total number of coordinating stress clients");

        availableOptions.addOption("",  "write-fraction",             true,   "Fraction of ops to be writes, 0-1");
        availableOptions.addOption("",  "columns-per-key-read",       true,   "");
        availableOptions.addOption("",  "columns-per-key-write",      true,   "");
        availableOptions.addOption("",  "keys-per-read",              true,   "");
        availableOptions.addOption("",  "keys-per-write",             true,   "");
        availableOptions.addOption("",  "write-transaction-fraction", true,   "Fraction of ops to be transactions, 0-1");

        availableOptions.addOption("",  "num-servers",             true,   "The number of servers in each cluster, required for write-txn workload");
        availableOptions.addOption("",  "keys-per-server",         true,   "The number of keys to write on each server in a write txn");
        availableOptions.addOption("",  "servers-per-txn",         true,   "The number of servers to include in each write txn");

        availableOptions.addOption("",  "server-index",         true,   "Index of the server (out of num-servers) to load for DYNAMIC_ONE_SERVER");
    }

    private int numKeys          = 1000 * 1000;
    private int numDifferentKeys = numKeys;
    private float skipKeys       = 0;
    private int threads          = 50;
    private int columns          = 5;
    private int columnSize       = 34;
    private int cardinality      = 50;
    private String[] nodes       = new String[] { "127.0.0.1" };
    private boolean random       = false;
    private boolean unframed     = false;
    private int retryTimes       = 10;
    private int port             = 9160;
    private int superColumns     = 1;
    private String compression   = null;
    private String compactionStrategy = null;

    private int progressInterval  = 10;
    private int keysPerCall       = 1000;
    private boolean replicateOnWrite = true;
    private boolean ignoreErrors  = false;
    private boolean enable_cql    = false;

    private final String outFileName;

    private IndexType indexType = null;
    private Stress.Operations operation = Stress.Operations.INSERT;
    private ColumnFamilyType columnFamilyType = ColumnFamilyType.Standard;
    private ConsistencyLevel consistencyLevel = ConsistencyLevel.ONE;
    private String replicationStrategy = "org.apache.cassandra.locator.SimpleStrategy";
    private final Map<String, String> replicationStrategyOptions = new HashMap<String, String>();

    // if we know exactly column names that we want to read (set by -Q option)
    public final List<ByteBuffer> columnNames;

    public final boolean averageSizeValues;

    // required by Gaussian distribution.
    protected int   mean;
    protected float sigma;

    public final InetAddress sendToDaemon;
    public final String comparator;
    public final boolean timeUUIDComparator;

    //COPS specific microbenchmarking options
    private int numDependencies = 0;
    private final Set<Dep> pregeneratedDependencies = new HashSet<Dep>();

    private int stressIndex = 0;
    private int stressCount = 1;
    private final int keysOffset = 0;

    private boolean justCreateKeyspace = false;

    //COPS dynamic workload generator options
    Map<String, Integer> localServerIPAndPorts = new HashMap<String, Integer>(); //we'll piggyback this off hosts and just use that and assume 9160 for the port
    private double write_fraction = -1;
    //value size already an option
    private int columns_per_key_read = 0;
    private int columns_per_key_write = 0;
    private int keys_per_read = 0;
    private int keys_per_write = 0;
    private double write_transaction_fraction = -1;

    // for write txn experiment where we want to control the exact number of keys being accessed on each server
    private int num_servers = 0;
    private int keys_per_server = 0;
    private int servers_per_txn = 0;

    private int server_index = -1;
    private static ArrayList<ArrayList<ByteBuffer>> generatedKeysByServer;

    public Session(String[] arguments) throws IllegalArgumentException
    {
        float STDev = 0.1f;
        CommandLineParser parser = new PosixParser();

        try
        {
            CommandLine cmd = parser.parse(availableOptions, arguments);

            if (cmd.getArgs().length > 0)
            {
                System.err.println("Application does not allow arbitrary arguments: " + StringUtils.join(cmd.getArgList(), ", "));
                System.exit(1);
            }

            if (cmd.hasOption("h"))
                throw new IllegalArgumentException("help");

            if (cmd.hasOption("n"))
                numKeys = Integer.parseInt(cmd.getOptionValue("n"));

            if (cmd.hasOption("F"))
                numDifferentKeys = Integer.parseInt(cmd.getOptionValue("F"));
            else
                numDifferentKeys = numKeys;

            if (cmd.hasOption("N"))
                skipKeys = Float.parseFloat(cmd.getOptionValue("N"));

            if (cmd.hasOption("t"))
                threads = Integer.parseInt(cmd.getOptionValue("t"));

            if (cmd.hasOption("c"))
                columns = Integer.parseInt(cmd.getOptionValue("c"));

            if (cmd.hasOption("S"))
                columnSize = Integer.parseInt(cmd.getOptionValue("S"));

            if (cmd.hasOption("C"))
                cardinality = Integer.parseInt(cmd.getOptionValue("C"));

            if (cmd.hasOption("d"))
                nodes = cmd.getOptionValue("d").split(",");

            if (cmd.hasOption("D"))
            {
                try
                {
                    String node = null;
                    List<String> tmpNodes = new ArrayList<String>();
                    BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(cmd.getOptionValue("D"))));
                    while ((node = in.readLine()) != null)
                    {
                        if (node.length() > 0)
                            tmpNodes.add(node);
                    }
                    nodes = tmpNodes.toArray(new String[tmpNodes.size()]);
                    in.close();
                }
                catch(IOException ioe)
                {
                    throw new RuntimeException(ioe);
                }
            }

            if (cmd.hasOption("s"))
                STDev = Float.parseFloat(cmd.getOptionValue("s"));

            if (cmd.hasOption("r"))
                random = true;

            outFileName = (cmd.hasOption("f")) ? cmd.getOptionValue("f") : null;

            if (cmd.hasOption("p"))
                port = Integer.parseInt(cmd.getOptionValue("p"));

            if (cmd.hasOption("m"))
                unframed = Boolean.parseBoolean(cmd.getOptionValue("m"));

            if (cmd.hasOption("o"))
                operation = Stress.Operations.valueOf(cmd.getOptionValue("o").toUpperCase());

            if (cmd.hasOption("u"))
                superColumns = Integer.parseInt(cmd.getOptionValue("u"));

            if (cmd.hasOption("y"))
                columnFamilyType = ColumnFamilyType.valueOf(cmd.getOptionValue("y"));

            if (cmd.hasOption("K"))
            {
                retryTimes = Integer.valueOf(cmd.getOptionValue("K"));

                if (retryTimes <= 0)
                {
                    throw new RuntimeException("--keep-trying option value should be > 0");
                }
            }

            if (cmd.hasOption("k"))
            {
                retryTimes = 1;
                ignoreErrors = true;
            }

            if (cmd.hasOption("i"))
                progressInterval = Integer.parseInt(cmd.getOptionValue("i"));

            if (cmd.hasOption("g"))
                keysPerCall = Integer.parseInt(cmd.getOptionValue("g"));

            if (cmd.hasOption("e"))
                consistencyLevel = ConsistencyLevel.valueOf(cmd.getOptionValue("e").toUpperCase());

            if (cmd.hasOption("x"))
                indexType = IndexType.valueOf(cmd.getOptionValue("x").toUpperCase());

            if (cmd.hasOption("R"))
                replicationStrategy = cmd.getOptionValue("R");

            if (cmd.hasOption("l"))
                replicationStrategyOptions.put("replication_factor", String.valueOf(Integer.parseInt(cmd.getOptionValue("l"))));
            else if (replicationStrategy.endsWith("SimpleStrategy"))
                replicationStrategyOptions.put("replication_factor", "1");

            if (cmd.hasOption("L"))
                enable_cql = true;

            if (cmd.hasOption("O"))
            {
                String[] pairs = StringUtils.split(cmd.getOptionValue("O"), ',');

                for (String pair : pairs)
                {
                    String[] keyAndValue = StringUtils.split(pair, ':');

                    if (keyAndValue.length != 2)
                        throw new RuntimeException("Invalid --strategy-properties value.");

                    replicationStrategyOptions.put(keyAndValue[0], keyAndValue[1]);
                }
            }

            if (cmd.hasOption("W"))
                replicateOnWrite = false;

            if (cmd.hasOption("I"))
                compression = cmd.getOptionValue("I");

            averageSizeValues = cmd.hasOption("V");

            try
            {
                sendToDaemon = cmd.hasOption("send-to")
                                ? InetAddress.getByName(cmd.getOptionValue("send-to"))
                                : null;
            }
            catch (UnknownHostException e)
            {
                throw new RuntimeException(e);
            }

            if (cmd.hasOption("Q"))
            {
                AbstractType comparator = TypeParser.parse(DEFAULT_COMPARATOR);

                String[] names = StringUtils.split(cmd.getOptionValue("Q"), ",");
                columnNames = new ArrayList<ByteBuffer>(names.length);

                for (String columnName : names)
                    columnNames.add(comparator.fromString(columnName));
            }
            else
            {
                columnNames = null;
            }

            if (cmd.hasOption("Z"))
            {
                compactionStrategy = cmd.getOptionValue("Z");

                try
                {
                    // validate compaction strategy class
                    CFMetaData.createCompactionStrategy(compactionStrategy);
                }
                catch (ConfigurationException e)
                {
                    System.err.println(e.getMessage());
                    System.exit(1);
                }
            }

            if (cmd.hasOption("U"))
            {
                AbstractType parsed = null;

                try
                {
                    parsed = TypeParser.parse(cmd.getOptionValue("U"));
                }
                catch (ConfigurationException e)
                {
                    System.err.println(e.getMessage());
                    System.exit(1);
                }

                comparator = cmd.getOptionValue("U");
                timeUUIDComparator = parsed instanceof TimeUUIDType;

                if (!(parsed instanceof TimeUUIDType || parsed instanceof AsciiType || parsed instanceof UTF8Type))
                {
                    System.err.println("Currently supported types are: TimeUUIDType, AsciiType, UTF8Type.");
                    System.exit(1);
                }
            }
            else
            {
                comparator = null;
                timeUUIDComparator = false;
            }

            //num-dependencies
            if (cmd.hasOption("A"))
            {
                numDependencies = Integer.parseInt(cmd.getOptionValue("A"));
                for (int i = 0; i < numDependencies; ++i) {
                    //we'll just include dummy dependencies, this is for microbenchmarks so they shouldn't be checked
                    ByteBuffer locator_key = ByteBufferUtil.bytes(String.valueOf(i));
                    long timestamp = i;
                    pregeneratedDependencies.add(new Dep(locator_key, timestamp));
                }
            }

            if (cmd.hasOption("stress-index")) {
                stressIndex = Integer.parseInt(cmd.getOptionValue("stress-index"));
                if (stressIndex < 0)
                    throw new RuntimeException("Invalid --stress-index value");
            }
            if (cmd.hasOption("stress-count")) {
                stressCount = Integer.parseInt(cmd.getOptionValue("stress-count"));
                if (stressCount <= 0)
                    throw new RuntimeException("Invalid --stress-count value");
            }

            if (cmd.hasOption("just-create-keyspace")) {
                justCreateKeyspace = true;
            }

            if (cmd.hasOption("write-fraction")) {
                write_fraction = Double.parseDouble(cmd.getOptionValue("write-fraction"));
                if (write_fraction < 0 || write_fraction > 1)
                    throw new RuntimeException("Invalid --write-fraction value");
            }
            if (cmd.hasOption("columns-per-key-read")) {
                columns_per_key_read = Integer.parseInt(cmd.getOptionValue("columns-per-key-read"));
                if (columns_per_key_read <= 0)
                    throw new RuntimeException("Invalid columns-per-key-read value");
            }
            if (cmd.hasOption("columns-per-key-write")) {
                columns_per_key_write = Integer.parseInt(cmd.getOptionValue("columns-per-key-write"));
                if (columns_per_key_write <= 0)
                    throw new RuntimeException("Invalid columns-per-key-write value");
            }
            if (cmd.hasOption("keys-per-read")) {
                keys_per_read = Integer.parseInt(cmd.getOptionValue("keys-per-read"));
                if (keys_per_read <= 0)
                    throw new RuntimeException("Invalid keys-per-read value");
            }
            if (cmd.hasOption("keys-per-write")) {
                keys_per_write = Integer.parseInt(cmd.getOptionValue("keys-per-write"));
                if (keys_per_write <= 0)
                    throw new RuntimeException("Invalid keys-per-write value");
            }
            if (cmd.hasOption("write-transaction-fraction")) {
                write_transaction_fraction = Double.parseDouble(cmd.getOptionValue("write-transaction-fraction"));
                if (write_transaction_fraction < 0 || write_transaction_fraction > 1)
                    throw new RuntimeException("Invalid --write-transaction-fraction value");
            }

            if (cmd.hasOption("num-servers")) {
                num_servers = Integer.parseInt(cmd.getOptionValue("num-servers"));
                if (num_servers <= 0)
                    throw new RuntimeException("Invalid num-servers value");
            }
            if (cmd.hasOption("keys-per-server")) {
                keys_per_server = Integer.parseInt(cmd.getOptionValue("keys-per-server"));
                if (keys_per_server <= 0)
                    throw new RuntimeException("Invalid key-per-server value");
            }
            if (cmd.hasOption("servers-per-txn")) {
                servers_per_txn = Integer.parseInt(cmd.getOptionValue("servers-per-txn"));
                if (servers_per_txn <= 0)
                    throw new RuntimeException("Invalid servers-per-txn value");
            }
            if (cmd.hasOption("server-index")) {
                server_index = Integer.parseInt(cmd.getOptionValue("server-index"));
                if (server_index < 0)
                    throw new RuntimeException("Invalid server-index value");
            }
        }
        catch (ParseException e)
        {
            throw new IllegalArgumentException(e.getMessage(), e);
        }
        catch (ConfigurationException e)
        {
            throw new IllegalStateException(e.getMessage(), e);
        }

        if (operation == Stress.Operations.DYNAMIC || operation == Stress.Operations.DYNAMIC_ONE_SERVER) {
            //Must set all dynamic workload parameters or none
            if (! (write_fraction >= 0 && columns_per_key_read != 0 && columns_per_key_write != 0
                    && keys_per_read != 0 && keys_per_write != 0 && write_transaction_fraction >= 0
                    && columnSize != 34)) {
                throw new RuntimeException("All dynamic options must be set");
            }

            if (operation == Stress.Operations.DYNAMIC_ONE_SERVER) {
                if (num_servers == 0 || server_index == -1) {
                    throw new RuntimeException("Dynamic One Server requires num-servers, and server-index");
                }
                //DYNAMIC_ONE_SERVER should get a numDifferentKeys==totalKeys written in the system, just like normal dynamic...
                dynamicOneServerGenerateKeysForEachServer(num_servers, numDifferentKeys);
            }
        }

        if (operation == Stress.Operations.WRITE_TXN || operation == Stress.Operations.BATCH_MUTATE) {
            if (num_servers == 0 || keys_per_server == 0 || servers_per_txn == 0 || numKeys == 0 || columns_per_key_write == 0) {
                throw new RuntimeException("Write txn required num-servers, keys-per-server, servers-per-txn, columns-per-key-write, num-keys, and num-different-keys options");
            }
            assert servers_per_txn <= num_servers;
            generateKeysForEachServer(num_servers, numDifferentKeys);
        }

        for (String node : nodes) {
            localServerIPAndPorts.put(node, 9160);
        }

        if (justCreateKeyspace) {
            this.createKeySpaces();
            System.exit(0);
        }

        mean  = numDifferentKeys / 2;
        sigma = numDifferentKeys * STDev;

        operations = new AtomicInteger();
        keys = new AtomicInteger();
        columnCount = new AtomicInteger();
        bytes = new AtomicLong();
        latency = new AtomicLong();
        latencies = new ConcurrentLinkedQueue<Long>();
    }

    public int getCardinality()
    {
        return cardinality;
    }

    public int getColumnSize()
    {
        return columnSize;
    }

    public boolean isUnframed()
    {
        return unframed;
    }

    public int getColumnsPerKey()
    {
        return columns;
    }

    public ColumnFamilyType getColumnFamilyType()
    {
        return columnFamilyType;
    }

    public int getNumKeys()
    {
        return numKeys;
    }

    public int getNumDifferentKeys()
    {
        return numDifferentKeys;
    }

    public int getKeysOffset()
    {
        return numDifferentKeys*stressIndex;
    }

    public int getThreads()
    {
        return threads;
    }

    public float getSkipKeys()
    {
        return skipKeys;
    }

    public int getSuperColumns()
    {
        return superColumns;
    }

    public int getKeysPerThread()
    {
        return numKeys / threads;
    }

    public int getTotalKeysLength()
    {
        //return Integer.toString(numDifferentKeys*stressCount).length();
	return 10;
    }

    public int getNumTotalKeys()
    {
        return numDifferentKeys*stressCount;
    }

    public ConsistencyLevel getConsistencyLevel()
    {
        return consistencyLevel;
    }

    public int getRetryTimes()
    {
        return retryTimes;
    }

    public boolean ignoreErrors()
    {
        return ignoreErrors;
    }

    public Stress.Operations getOperation()
    {
        return operation;
    }

    public PrintStream getOutputStream()
    {
        try
        {
            return (outFileName == null) ? System.out : new PrintStream(new FileOutputStream(outFileName));
        }
        catch (FileNotFoundException e)
        {
            throw new RuntimeException(e.getMessage(), e);
        }
    }

    public int getProgressInterval()
    {
        return progressInterval;
    }

    public boolean useRandomGenerator()
    {
        return random;
    }

    public int getKeysPerCall()
    {
        return keysPerCall;
    }

    // required by Gaussian distribution
    public int getMean()
    {
        return mean;
    }

    // required by Gaussian distribution
    public float getSigma()
    {
        return sigma;
    }

    public boolean isCQL()
    {
        return enable_cql;
    }

    public Set<Dep> getPregeneratedDependencies()
    {
        return pregeneratedDependencies;
    }

    public double getWrite_fraction()
    {
        return write_fraction;
    }

    public int getColumns_per_key_read()
    {
        return columns_per_key_read;
    }

    public int getColumns_per_key_write()
    {
        return columns_per_key_write;
    }

    public int getKeys_per_read()
    {
        return keys_per_read;
    }

    public int getKeys_per_write()
    {
        return keys_per_write;
    }

    public double getWrite_transaction_fraction()
    {
        return write_transaction_fraction;
    }

    public int getNum_servers()
    {
        return num_servers;
    }

    public int getKeys_per_server()
    {
        return keys_per_server;
    }

    public int getServers_per_txn()
    {
        return servers_per_txn;
    }

    public int getServerIndex()
    {
        assert server_index != -1;
        return server_index;
    }

    /**
     * Create Keyspace1 with Standard1 and Super1 column families
     */
    public void createKeySpaces()
    {
        KsDef keyspace = new KsDef();
        String defaultComparator = comparator == null ? DEFAULT_COMPARATOR : comparator;

        // column family for standard columns
        CfDef standardCfDef = new CfDef("Keyspace1", "Standard1");
        Map<String, String> compressionOptions = new HashMap<String, String>();
        if (compression != null)
            compressionOptions.put("sstable_compression", compression);

        standardCfDef.setComparator_type(defaultComparator)
                     .setDefault_validation_class(DEFAULT_VALIDATOR)
                     .setCompression_options(compressionOptions);

        standardCfDef.setCaching("all");

        standardCfDef.setRead_repair_chance(0);

        if (indexType != null)
        {
            ColumnDef standardColumn = new ColumnDef(ByteBufferUtil.bytes("C1"), "BytesType");
            standardColumn.setIndex_type(indexType).setIndex_name("Idx1");
            standardCfDef.setColumn_metadata(Arrays.asList(standardColumn));
        }

        // column family with super columns
        CfDef superCfDef = new CfDef("Keyspace1", "Super1").setColumn_type("Super");
        superCfDef.setComparator_type(DEFAULT_COMPARATOR)
                  .setSubcomparator_type(defaultComparator)
                  .setDefault_validation_class(DEFAULT_VALIDATOR)
                  .setCompression_options(compressionOptions)
                  .setRead_repair_chance(0);

        // column family for standard counters
        CfDef counterCfDef = new CfDef("Keyspace1", "Counter1");
        counterCfDef.setDefault_validation_class("CounterColumnType")
                    .setReplicate_on_write(replicateOnWrite)
                    .setCompression_options(compressionOptions)
                    .setRead_repair_chance(0);

        // column family with counter super columns
        CfDef counterSuperCfDef = new CfDef("Keyspace1", "SuperCounter1");
        counterSuperCfDef.setDefault_validation_class("CounterColumnType")
                         .setReplicate_on_write(replicateOnWrite)
                         .setColumn_type("Super")
                         .setCompression_options(compressionOptions)
                         .setRead_repair_chance(0);

        keyspace.setName("Keyspace1");
        keyspace.setStrategy_class(replicationStrategy);

        if (!replicationStrategyOptions.isEmpty())
        {
            keyspace.setStrategy_options(replicationStrategyOptions);
        }

        if (compactionStrategy != null)
        {
            standardCfDef.setCompaction_strategy(compactionStrategy);
            superCfDef.setCompaction_strategy(compactionStrategy);
            counterCfDef.setCompaction_strategy(compactionStrategy);
            counterSuperCfDef.setCompaction_strategy(compactionStrategy);
        }

        keyspace.setCf_defs(new ArrayList<CfDef>(Arrays.asList(standardCfDef, superCfDef, counterCfDef, counterSuperCfDef)));

        Cassandra.Client client = getClient(false);

        try
        {
            client.system_add_keyspace(keyspace);
	    int sleepTime = 5;
            System.out.println(String.format("Created keyspaces. Sleeping %ss for propagation.", sleepTime));
            Thread.sleep(sleepTime * 1000); // seconds
        }
        catch (InvalidRequestException e)
        {
            System.err.println("Unable to create stress keyspace: " + e.getWhy());
        }
        catch (Exception e)
        {
            System.err.println(e.getMessage());
        }
    }

    public ClientLibrary getClientLibrary()
    {
	// Allow use of client library with other consistency levels for micro-benchmarks
        //if (this.getConsistencyLevel() != ConsistencyLevel.LOCAL_QUORUM) {
        //    throw new RuntimeException("Session.getClientLibrary is only meant for use with consistency level LOCAL_QUORUM");
        //}

        try {
            return new ClientLibrary(localServerIPAndPorts, "Keyspace1", this.getConsistencyLevel());
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e.getMessage());
        }
    }

    public ByteBuffer getRandGeneratedKey(int serverNum)
    {
        int serverKeyCount = generatedKeysByServer.get(serverNum).size();
        return generatedKeysByServer.get(serverNum).get(Stress.randomizer.nextInt(serverKeyCount));
    }

    private void generateKeysForEachServer(int numServers, int totalNumKeys)
    {
        int keysPerServer = totalNumKeys/numServers;

        generatedKeysByServer = new ArrayList<ArrayList<ByteBuffer>>(numServers);
        for (int i = 0; i < numServers; i++)
        {
            generatedKeysByServer.add(new ArrayList<ByteBuffer>(keysPerServer));
        }

        // Assuming we're using the random partitioner, which we are.
        // We need to generate keys for servers by randomly generating keys
        // and then matching them to whatever their md5 maps to.
        boolean allServersFull;
        Random randomizer = new Random();
        do {
            String randKeyStr = String.format("%0" + (getTotalKeysLength()) + "d", randomizer.nextInt(10*(getNumDifferentKeys() - 1)));
            ByteBuffer randKey = ByteBuffer.wrap(randKeyStr.getBytes(UTF_8));
            double hashedRandKey = FBUtilities.hashToBigInteger(randKey).doubleValue();

            //Cassandra's keyspace is [0, 2**127)
            double keyrangeSize = Math.pow(2, 127) / numServers;
            int serverIndex = (int) (hashedRandKey / keyrangeSize);
            if (generatedKeysByServer.get(serverIndex).size() < keysPerServer) {
                generatedKeysByServer.get(serverIndex).add(randKey);
            }

            allServersFull = true;
            for (int i = 0; i < numServers; i++) {
                //System.out.println("Server " + i + " has " + generatedKeysByServer.get(i).size() + " keys");
                if (generatedKeysByServer.get(i).size() < keysPerServer) {
                    allServersFull = false;
                    break;
                }
            }
        } while (!allServersFull);
    }

    private void dynamicOneServerGenerateKeysForEachServer(int numServers, int numPopulatedKeys)
    {
        generatedKeysByServer = new ArrayList<ArrayList<ByteBuffer>>(numServers);
        for (int i = 0; i < numServers; i++)
        {
            generatedKeysByServer.add(new ArrayList<ByteBuffer>());
        }

        // Assuming we're using the random partitioner, which we are.
        // We need to generate keys for servers by randomly generating keys
        // and then matching them to whatever their md5 maps to.
        for (int keyI = 0; keyI < numPopulatedKeys; keyI++)
        {
            String keyStr = String.format("%0" + (getTotalKeysLength()) + "d", keyI);
            ByteBuffer key = ByteBuffer.wrap(keyStr.getBytes(UTF_8));
            double hashedKey = FBUtilities.hashToBigInteger(key).doubleValue();

            //Cassandra's keyspace is [0, 2**127)
            double keyrangeSize = Math.pow(2, 127) / numServers;
            int serverIndex = (int) (hashedKey / keyrangeSize);
            generatedKeysByServer.get(serverIndex).add(key);
        }
    }

    /**
     * Thrift client connection with Keyspace1 set.
     * @return cassandra client connection
     */
    public Cassandra.Client getClient()
    {
        return getClient(true);
    }
    /**
     * Thrift client connection
     * @param setKeyspace - should we set keyspace for client or not
     * @return cassandra client connection
     */
    public Cassandra.Client getClient(boolean setKeyspace)
    {
        // random node selection for fake load balancing
        String currentNode = nodes[Stress.randomizer.nextInt(nodes.length)];

        TSocket socket = new TSocket(currentNode, port);
        TTransport transport = (isUnframed()) ? socket : new TFramedTransport(socket);
        Cassandra.Client client = new Cassandra.Client(new TBinaryProtocol(transport));

        try
        {
            transport.open();

            if (setKeyspace)
            {
                client.set_keyspace("Keyspace1", LamportClock.sendTimestamp());
            }
        }
        catch (InvalidRequestException e)
        {
            throw new RuntimeException(e.getWhy());
        }
        catch (Exception e)
        {
            throw new RuntimeException(e.getMessage());
        }

        return client;
    }

    public static InetAddress getLocalAddress()
    {
        if (localInetAddress == null)
        {
            try
            {
                localInetAddress = InetAddress.getLocalHost();
            }
            catch (UnknownHostException e)
            {
                throw new RuntimeException(e);
            }
        }

        return localInetAddress;
    }
}


text:
#include "defs.h"

#include <sched.h>

#ifndef CSIGNAL
# define CSIGNAL 0x000000ff
#endif

#include "xlat/clone_flags.h"

#if defined IA64
# define ARG_FLAGS	0
# define ARG_STACK	1
# define ARG_STACKSIZE	(tcp->scno == __NR_clone2 ? 2 : -1)
# define ARG_PTID	(tcp->scno == __NR_clone2 ? 3 : 2)
# define ARG_CTID	(tcp->scno == __NR_clone2 ? 4 : 3)
# define ARG_TLS	(tcp->scno == __NR_clone2 ? 5 : 4)
#elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32
# define ARG_STACK	0
# define ARG_FLAGS	1
# define ARG_PTID	2
# define ARG_CTID	3
# define ARG_TLS	4
#elif defined X86_64 || defined X32
/* x86 personality processes have the last two arguments flipped. */
# define ARG_FLAGS	0
# define ARG_STACK	1
# define ARG_PTID	2
# define ARG_CTID	((current_personality != 1) ? 3 : 4)
# define ARG_TLS	((current_personality != 1) ? 4 : 3)
#elif defined ALPHA || defined TILE || defined OR1K || defined RISCV
# define ARG_FLAGS	0
# define ARG_STACK	1
# define ARG_PTID	2
# define ARG_CTID	3
# define ARG_TLS	4
#else
# define ARG_FLAGS	0
# define ARG_STACK	1
# define ARG_PTID	2
# define ARG_TLS	3
# define ARG_CTID	4
#endif

#if defined I386 || defined X86_64 || defined X32
extern void print_user_desc(struct tcb *, long);
#endif /* I386 || X86_64 || X32 */

SYS_FUNC(clone)
{
	if (exiting(tcp)) {
		const char *sep = "|";
		unsigned long flags = tcp->u_arg[ARG_FLAGS];
		tprints("child_stack=");
		printaddr(tcp->u_arg[ARG_STACK]);
		tprints(", ");
#ifdef ARG_STACKSIZE
		if (ARG_STACKSIZE != -1)
			tprintf("stack_size=%#lx, ",
				tcp->u_arg[ARG_STACKSIZE]);
#endif
		tprints("flags=");
		if (!printflags(clone_flags, flags &~ CSIGNAL, NULL))
			sep = "";
		if ((flags & CSIGNAL) != 0)
			tprintf("%s%s", sep, signame(flags & CSIGNAL));
		if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID
			      |CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0)
			return 0;
		if (flags & CLONE_PARENT_SETTID) {
			tprints(", parent_tidptr=");
			printaddr(tcp->u_arg[ARG_PTID]);
		}
		if (flags & CLONE_SETTLS) {
#if defined I386 || defined X86_64 || defined X32
# ifndef I386
			if (current_personality == 1)
# endif
			{
				tprints(", tls=");
				print_user_desc(tcp, tcp->u_arg[ARG_TLS]);
			}
# ifndef I386
			else
# endif
#endif /* I386 || X86_64 || X32 */
			{
				tprints(", tls=");
				printaddr(tcp->u_arg[ARG_TLS]);
			}
		}
		if (flags & (CLONE_CHILD_SETTID|CLONE_CHILD_CLEARTID)) {
			tprints(", child_tidptr=");
			printaddr(tcp->u_arg[ARG_CTID]);
		}
	}
	/* TODO on syscall entry:
	 * We can clear CLONE_PTRACE here since it is an ancient hack
	 * to allow us to catch children, and we use another hack for that.
	 * But CLONE_PTRACE can conceivably be used by malicious programs
	 * to subvert us. By clearing this bit, we can defend against it:
	 * in untraced execution, CLONE_PTRACE should have no effect.
	 *
	 * We can also clear CLONE_UNTRACED, since it allows to start
	 * children outside of our control. At the moment
	 * I'm trying to figure out whether there is a *legitimate*
	 * use of this flag which we should respect.
	 */
	return 0;
}

SYS_FUNC(setns)
{
	printfd(tcp, tcp->u_arg[0]);
	tprints(", ");
	printflags(clone_flags, tcp->u_arg[1], "CLONE_???");

	return RVAL_DECODED;
}

SYS_FUNC(unshare)
{
	printflags_long(clone_flags, tcp->u_arg[0], "CLONE_???");
	return RVAL_DECODED;
}

SYS_FUNC(fork)
{
	return RVAL_DECODED | RVAL_UDECIMAL;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
    <!--
         This file has been generated by the EasyExtends bundle ( http://sonata-project.org/easy-extends )

         References :
            xsd                  : https://github.com/doctrine/doctrine2/blob/master/doctrine-mapping.xsd
            xml mapping          : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/xml-mapping/en
            association mapping  : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/association-mapping/en
    -->
    <entity
        name="Application\Sonata\MediaBundle\Entity\Gallery"
        table="media__gallery">
        <one-to-many field="children" target-entity="Gallery" mapped-by="parent" nullable="true"/>
        <many-to-one field="parent" target-entity="Gallery" inversed-by="children" nullable="true"/>
        <id name="id" type="integer" column="id">
            <generator strategy="AUTO"/>
        </id>
        <field name="authorization" type="string" />
        <field name="minRole" type="string" />
    </entity>
</doctrine-mapping>