text:
<?php

namespace Vidal\DrugBundle\Entity;

use Doctrine\ORM\EntityRepository;

class ArtCategoryRepository extends EntityRepository
{
	public function typeUrl($type, $url)
	{
		if (!$type) {
			return null;
		}

		return $this->_em->createQuery('
			SELECT c
			FROM VidalDrugBundle:ArtCategory c
			WHERE c.enabled = 1
				AND c.type = :type
				AND c.url = :url
		')->setParameter('type', $type->getId())
			->setParameter('url', $url)
			->getOneOrNullResult();
	}

	public function findByType($type)
	{
		if (!$type) {
			return null;
		}

		return $this->_em->createQuery('
			SELECT c
			FROM VidalDrugBundle:ArtCategory c
			WHERE c.enabled = 1 AND c.type = :type
			ORDER BY c.priority DESC, c.title ASC
		')->setParameter('type', $type->getId())
			->getResult();
	}
}


text:
<?php
return array (
  'Member in these spaces' => 'Membro nesses espaços',
);

redpajama_set_name: RedPajamaGithub


text:
import { Component, OnInit } from "@angular/core";

@Component({
  selector: "amd-about",
  styleUrls: ["./about.component.scss"],
  templateUrl: "./about.component.html",
})
export class AboutComponent implements OnInit {

  constructor() {
    // Do stuff
  }

  public ngOnInit(): void {
    console.log("Hello About");
  }

}


text:
import logging
if __name__ == '__main__':
    logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.utils.domutils
from pyxb.utils import six
from xml.dom import Node

import os.path
xst = six.u('''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:complexType name="XsdWithHyphens">
    <xs:sequence>
        <xs:element name="username" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="xsd-with-hyphens" type="XsdWithHyphens"/>
</xs:schema>
''')

code = pyxb.binding.generate.GeneratePython(schema_text=xst)
#print code

rv = compile(code, 'test', 'exec')
eval(rv)

from pyxb.exceptions_ import *

import unittest

class TestTrac0203 (unittest.TestCase):
    def testBasic (self):
        unbound = XsdWithHyphens('name')
        if sys.version_info[:2] < (2, 7):
            self.assertRaises(pyxb.UnboundElementError, unbound.toxml, 'utf-8', root_only=True)
        else:
            with self.assertRaises(pyxb.UnboundElementError) as cm:
                unbound.toxml('utf-8', root_only=True)
            e = cm.exception
            self.assertEqual(e.instance, unbound)
            self.assertEqual('Instance of type XsdWithHyphens has no bound element for start tag', str(e))

    def testOverride (self):
        unbound = XsdWithHyphens('name')
        xmlt = six.u('<root><username>name</username></root>')
        xmld = xmlt.encode('utf-8')
        self.assertEqual(xmld, unbound.toxml('utf-8', root_only=True, element_name='root'))

if __name__ == '__main__':
    unittest.main()


text:
/*istanbul ignore next*/"use strict";

exports.__esModule = true;

exports.default = function ( /*istanbul ignore next*/_ref) {
  /*istanbul ignore next*/var t = _ref.types;

  return {
    inherits: require("babel-plugin-syntax-exponentiation-operator"),

    visitor: /*istanbul ignore next*/(0, _babelHelperBuilderBinaryAssignmentOperatorVisitor2.default)({
      operator: "**",

      /*istanbul ignore next*/build: function build(left, right) {
        return t.callExpression(t.memberExpression(t.identifier("Math"), t.identifier("pow")), [left, right]);
      }
    })
  };
};

var /*istanbul ignore next*/_babelHelperBuilderBinaryAssignmentOperatorVisitor = require("babel-helper-builder-binary-assignment-operator-visitor");

/*istanbul ignore next*/
var _babelHelperBuilderBinaryAssignmentOperatorVisitor2 = _interopRequireDefault(_babelHelperBuilderBinaryAssignmentOperatorVisitor);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = exports["default"];


text:
package org.folio.okapi.util;

import org.folio.okapi.common.ExtendedAsyncResult;
import org.folio.okapi.common.Failure;
import org.folio.okapi.common.Success;
import io.vertx.core.Handler;
import io.vertx.core.json.Json;
import java.util.LinkedList;
import java.util.List;

public class LockedTypedMap<T> extends LockedStringMap {

  private final Class<T> clazz;

  public LockedTypedMap(Class<T> c) {
    this.clazz = c;
  }

  public void add(String k, String k2, T value, Handler<ExtendedAsyncResult<Void>> fut) {
    String json = Json.encode(value);
    addOrReplace(false, k, k2, json, fut);
  }

  public void put(String k, String k2, T value, Handler<ExtendedAsyncResult<Void>> fut) {
    String json = Json.encode(value);
    addOrReplace(true, k, k2, json, fut);
  }

  public void get(String k, String k2, Handler<ExtendedAsyncResult<T>> fut) {
    getString(k, k2, res -> {
      if (res.failed()) {
        fut.handle(new Failure<>(res.getType(), res.cause()));
      } else {
        fut.handle(new Success<>(Json.decodeValue(res.result(), clazz)));
      }
    });
  }

  public void get(String k, Handler<ExtendedAsyncResult<List<T>>> fut) {
    getString(k, res -> {
      if (res.failed()) {
        fut.handle(new Failure<>(res.getType(), res.cause()));
      } else {
        LinkedList<T> t = new LinkedList<>();
        for (String s : res.result()) {
          t.add((T) Json.decodeValue(s, clazz));
        }
        fut.handle(new Success<>(t));
      }
    });
  }
}


text:
package com.badlogic.gdx.physics.box2d.joints;

import com.badlogic.gdx.physics.box2d.*;
import com.badlogic.gdx.math.*;

public class MouseJointDef extends JointDef
{
    public float dampingRatio;
    public float frequencyHz;
    public float maxForce;
    public final Vector2 target;

    public MouseJointDef() {
        super();
        this.target = new Vector2();
        this.maxForce = 0.0f;
        this.frequencyHz = 5.0f;
        this.dampingRatio = 0.7f;
        this.type = JointType.MouseJoint;
    }
}


text:
.accelerometer-stage {
    -webkit-perspective: 700px;
    -webkit-perspective-origin: 50% 50%;
    width: 200px;
    height: 130px;
}

.accelerometer-box {
    pointer-events:none;
    margin-top: -54px;
    margin-left: -40px;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 108px;
    -webkit-transform-style: preserve-3d;
}

.accelerometer-box section {
    margin-top: -54px;
    margin-left: -40px;
    position: absolute;
    display: block;
    overflow: hidden;
    top: 50%;
    left: 50%;
    -webkit-transform-style: flat;
    -webkit-box-shadow: inset 0px 0px 15px rgba(0, 0, 0, 0.7);
}

.accelerometer-box .front {
    border:15px solid black;
    width: 80px;
    height: 107px;
    background-color: gray;
    -webkit-transform: translate3d(0px, 0px, 10px);
}

.accelerometer-box .back {
    width: 80px;
    height: 107px;
    background-color: black;
    -webkit-transform: rotateY(-180deg) translate3d(0px, 0px, 10px);
}

.accelerometer-box .top {
    overflow: hidden;
    width: 80px;
    height: 20px;
    background-color: #75CE89;
    -webkit-transform: rotateX(-90deg) translate3d(0px, 0px, -10px);
}

.accelerometer-box .bottom {
    overflow: hidden;
    width: 80px;
    height: 20px;
    background-color: #865C6C;
    -webkit-transform: rotateX(90deg) translate3d(0px, 0px, -97px);
}

.accelerometer-box .left {
    width: 20px;
    height: 107px;
    background-color: #7992CB;
    -webkit-transform: rotateY(90deg) translate3d(0px, 0px, 70px);
}

.accelerometer-box .right {
    width: 20px;
    height: 107px;
    background-color: #7992CB;
    -webkit-transform: rotateY(-90deg) translate3d(0px, 0px, 10px);
}

.accelerometer-axis-input-container {
    margin-bottom: 10px;
}

.accelerometer-inputs-cell {
    vertical-align: top;
}

.accelerometer-reset-button {
    width: 100%;
}
/*# sourceMappingURL=accelerometer.css.map */


text:
<?php
namespace Superbull\Super\Repository;

use Psr\Log\LoggerInterface;
use Aura\Sql\ExtendedPdo;

abstract class AbstractRepository
{
    protected $logger;
    protected $pdo;

    public function __construct(
        LoggerInterface $logger,
        ExtendedPdo $pdo
    ) {
        $this->logger = $logger;
        $this->pdo = $pdo;
    }
}


text:
class AdsAnswersQuestionsController < ApplicationController
  before_action :set_ads_answers_question, only: [:show, :edit, :update, :destroy]

  rescue_from ActiveRecord::RecordNotUnique, with: :error_not_unique

  # GET /ads_answers_questions
  # GET /ads_answers_questions.json
  def index
    @ads_answers_questions = AdsAnswersQuestion.all
  end

  # GET /ads_answers_questions/1
  # GET /ads_answers_questions/1.json
  def show
  end

  # GET /ads_answers_questions/new
  def new
    @ads_answers_question = AdsAnswersQuestion.new
  end

  # GET /ads_answers_questions/1/edit
  def edit
  end

  # POST /ads_answers_questions
  # POST /ads_answers_questions.json
  def create
    # begin
      @ads_answers_question = AdsAnswersQuestion.new(ads_answers_question_params)

      respond_to do |format|
        if @ads_answers_question.save
          format.html { redirect_to @ads_answers_question, notice: 'Ads answers question was successfully created.' }
          format.json { render :show, status: :created, location: @ads_answers_question }
        else
          format.html { render :new }
          format.json { render json: @ads_answers_question.errors, status: :unprocessable_entity }
        end
      end
    # rescue => e
    #   Rails.logger.error { "#{e.message} #{e.backtrace.join("\n")}" }
    # end
  end

  # PATCH/PUT /ads_answers_questions/1
  # PATCH/PUT /ads_answers_questions/1.json
  def update
    respond_to do |format|
      if @ads_answers_question.update(ads_answers_question_params)
        format.html { redirect_to @ads_answers_question, notice: 'Ads answers question was successfully updated.' }
        format.json { render :show, status: :ok, location: @ads_answers_question }
      else
        format.html { render :edit }
        format.json { render json: @ads_answers_question.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /ads_answers_questions/1
  # DELETE /ads_answers_questions/1.json
  def destroy
    @ads_answers_question.destroy
    respond_to do |format|
      format.html { redirect_to ads_answers_questions_url, notice: 'Ads answers question was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_ads_answers_question
      @ads_answers_question = AdsAnswersQuestion.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def ads_answers_question_params
      params.require(:ads_answers_question).permit(:ad_id, :answer_id, :question_id)
    end

  protected
    def error_not_unique(exception)
      flash[:alert] = "Esta pregunta y respuesta ya fue seleccionada en el anuncio"
      redirect_to :back

      # render json: {error: exception.message}.to_json, status: 404
      # return

      # render :new

      # respond_to do |format|
      #   format.html { redirect_to :new, alert: "Esta pregunta y respuesta ya fue seleccionada en el anuncio" }
      # end
    end
end


text:
from pycket import impersonators as imp
from pycket import values
from pycket import vector as values_vector
from pycket.cont import continuation, label, loop_label
from pycket.error import SchemeException
from pycket.prims.expose import unsafe, default, expose, subclass_unsafe
from rpython.rlib import jit

@expose("vector")
def vector(args):
    return values_vector.W_Vector.fromelements(args)

@expose("flvector")
def flvector(args):
    return values_vector.W_FlVector.fromelements(args)

@expose("extflvector?", [values.W_Object])
def extflvector(obj):
    return values.w_false

# FIXME: immutable
@expose("vector-immutable")
def vector_immutable(args):
    return values_vector.W_Vector.fromelements(args, immutable=True)

@expose("make-vector", [values.W_Fixnum, default(values.W_Object, values.W_Fixnum.ZERO)])
def make_vector(w_size, w_val):
    size = w_size.value
    if size < 0:
        raise SchemeException("make-vector: expected a positive fixnum")
    return values_vector.W_Vector.fromelement(w_val, size)

@expose("make-flvector", [values.W_Fixnum, default(values.W_Flonum, values.W_Flonum.ZERO)])
def make_vector(w_size, w_val):
    size = w_size.value
    if size < 0:
        raise SchemeException("make-flvector: expected a positive fixnum")
    return values_vector.W_FlVector.fromelement(w_val, size)

@expose("vector-length", [values_vector.W_MVector])
def vector_length(v):
    return values.W_Fixnum(v.length())

@expose("flvector-length", [values_vector.W_FlVector])
def flvector_length(v):
    return values.W_Fixnum(v.length())

@expose("vector-ref", [values.W_MVector, values.W_Fixnum], simple=False)
def vector_ref(v, i, env, cont):
    idx = i.value
    if not (0 <= idx < v.length()):
        raise SchemeException("vector-ref: index out of bounds")
    return v.vector_ref(idx, env, cont)

@expose("flvector-ref", [values_vector.W_FlVector, values.W_Fixnum], simple=False)
def flvector_ref(v, i, env, cont):
    idx = i.value
    if not (0 <= idx < v.length()):
        raise SchemeException("vector-ref: index out of bounds")
    return v.vector_ref(idx, env, cont)

@expose("vector-set!", [values.W_MVector, values.W_Fixnum, values.W_Object], simple=False)
def vector_set(v, i, new, env, cont):
    if v.immutable():
        raise SchemeException("vector-set!: given immutable vector")
    idx = i.value
    if not (0 <= idx < v.length()):
        raise SchemeException("vector-set!: index out of bounds")
    return v.vector_set(idx, new, env, cont)

@expose("flvector-set!", [values_vector.W_FlVector, values.W_Fixnum, values.W_Flonum], simple=False)
def flvector_set(v, i, new, env, cont):
    idx = i.value
    if not (0 <= idx < v.length()):
        raise SchemeException("flvector-set!: index out of bounds")
    return v.vector_set(idx, new, env, cont)

def copy_vector(v, env, cont):
    from pycket.interpreter import return_value
    if isinstance(v, values_vector.W_Vector):
        return return_value(v._make_copy(immutable=True), env, cont)
    len = v.length()
    data = [None] * len
    return copy_vector_loop(v, data, len, 0, env, cont)

@loop_label
def copy_vector_loop(v, data, len, idx, env, cont):
    from pycket.interpreter import return_value
    if idx >= len:
        vector = values_vector.W_Vector.fromelements(data, immutable=True)
        return return_value(vector, env, cont)
    return v.vector_ref(idx, env,
            copy_vector_ref_cont(v, data, len, idx, env, cont))

@continuation
def copy_vector_ref_cont(v, data, len, idx, env, cont, _vals):
    from pycket.interpreter import check_one_val
    val = check_one_val(_vals)
    data[idx] = val
    return copy_vector_loop(v, data, len, idx + 1, env, cont)

@expose("vector->immutable-vector", [values_vector.W_MVector], simple=False)
def vector2immutablevector(v, env, cont):
    from pycket.interpreter import return_value
    if v.immutable():
        return return_value(v, env, cont)
    return copy_vector(v, env, cont)

@expose("vector-copy!",
        [values.W_MVector, values.W_Fixnum, values.W_MVector,
         default(values.W_Fixnum, None), default(values.W_Fixnum, None)],
        simple=False)
def vector_copy(dest, _dest_start, src, _src_start, _src_end, env, cont):
    if dest.immutable():
        raise SchemeException("vector-copy!: given an immutable destination")
    src_start  = _src_start.value if _src_start is not None else 0
    src_end    = _src_end.value if _src_end is not None else src.length()
    dest_start = _dest_start.value

    src_range  = src_end - src_start
    dest_range = dest.length() - dest_start

    if not (0 <= dest_start < dest.length()):
        raise SchemeException("vector-copy!: destination start out of bounds")
    if not (0 <= src_start <= src.length()) or not (0 <= src_start <= src.length()):
        raise SchemeException("vector-copy!: source start/end out of bounds")
    if dest_range < src_range:
        raise SchemeException("vector-copy!: not enough room in target vector")

    return vector_copy_loop(src, src_start, src_end,
                dest, dest_start, 0, env, cont)

@loop_label
def vector_copy_loop(src, src_start, src_end, dest, dest_start, i, env, cont):
    from pycket.interpreter import return_value
    src_idx = i + src_start
    if src_idx >= src_end:
        return return_value(values.w_void, env, cont)
    return src.vector_ref(src_idx, env,
                vector_copy_cont_get(src, src_start, src_end, dest,
                    dest_start, i, env, cont))

@continuation
def goto_vector_copy_loop(src, src_start, src_end, dest, dest_start, next, env, cont, _vals):
    return vector_copy_loop(
            src, src_start, src_end, dest, dest_start, next, env, cont)

@continuation
def vector_copy_cont_get(src, src_start, src_end, dest, dest_start, i, env, cont, _vals):
    from pycket.interpreter import check_one_val
    val  = check_one_val(_vals)
    idx  = i + dest_start
    next = i + 1
    return dest.vector_set(idx, val, env,
                goto_vector_copy_loop(src, src_start, src_end,
                    dest, dest_start, next, env, cont))

# FIXME: Chaperones
@expose("unsafe-vector-ref", [subclass_unsafe(values.W_MVector), unsafe(values.W_Fixnum)], simple=False)
def unsafe_vector_ref(v, i, env, cont):
    from pycket.interpreter import return_value
    if isinstance(v, imp.W_ImpVector) or isinstance(v, imp.W_ChpVector):
        return v.vector_ref(i.value, env, cont)
    else:
        assert type(v) is values_vector.W_Vector
        val = i.value
        assert val >= 0
        return return_value(v.unsafe_ref(val), env, cont)

@expose("unsafe-flvector-ref", [unsafe(values_vector.W_FlVector), unsafe(values.W_Fixnum)])
def unsafe_flvector_ref(v, i):
    return v.unsafe_ref(i.value)

@expose("unsafe-vector*-ref", [unsafe(values_vector.W_Vector), unsafe(values.W_Fixnum)])
def unsafe_vector_star_ref(v, i):
    return v.unsafe_ref(i.value)

# FIXME: Chaperones
@expose("unsafe-vector-set!",
        [subclass_unsafe(values.W_MVector), unsafe(values.W_Fixnum), values.W_Object],
        simple=False)
def unsafe_vector_set(v, i, new, env, cont):
    from pycket.interpreter import return_value
    if isinstance(v, imp.W_ImpVector) or isinstance(v, imp.W_ChpVector):
        return v.vector_set(i.value, new, env, cont)
    else:
        assert type(v) is values_vector.W_Vector
        v.unsafe_set(i.value, new)
        return return_value(values.w_void, env, cont)

@expose("unsafe-vector*-set!",
        [unsafe(values_vector.W_Vector), unsafe(values.W_Fixnum), values.W_Object])
def unsafe_vector_star_set(v, i, new):
    return v.unsafe_set(i.value, new)

@expose("unsafe-flvector-set!",
        [unsafe(values_vector.W_FlVector), unsafe(values.W_Fixnum), unsafe(values.W_Flonum)])
def unsafe_flvector_set(v, i, new):
    return v.unsafe_set(i.value, new)

@expose("unsafe-vector-length", [subclass_unsafe(values.W_MVector)])
def unsafe_vector_length(v):
    return values.W_Fixnum(v.length())

@expose("unsafe-vector*-length", [unsafe(values_vector.W_Vector)])
def unsafe_vector_star_length(v):
    return values.W_Fixnum(v.length())

@expose("unsafe-flvector-length", [unsafe(values_vector.W_FlVector)])
def unsafe_flvector_length(v):
    return values.W_Fixnum(v.length())


text:
=============================
Horizon (OpenStack Dashboard) with Two Factor Authentication
=============================

Horizon is a Django-based project aimed at providing a complete OpenStack
Dashboard along with an extensible framework for building new dashboards
from reusable components. The ``Two Factor Authentication`` provides:

 * Password Authentication
 * OTP Authentication

Password Authentication
=============

Password Authenttication is the default authentication provided by Horizon. Here, user credentials like Username and Password are verified.
If credentials are verified then using OpenStack Keystone v3 OTP authentication plugin will send the OTP value over SMS using the Twilio service.
This OTP is sent to users stored contact number using Twilio API Service. User then gets redirected to the OTP Validation page

OTP Validation
=============

Once the user enters the OTP value into the second template and submits the form Horizon will make an RPC call to Keystone and will include 2 methods: one for password and another for OTP.Upon successful authentication Horizon will grant access to the portal. Upon failure you will display an invalid credentials error message. If authentication fails to the plugin more than 3 times then keystonewill lockout the user for 24 hours where authentication will always fail during the lockout period.


text:
namespace installer {

class TranslationDelegate {
 public:
  virtual ~TranslationDelegate();
  virtual string16 GetLocalizedString(int installer_string_id) = 0;
};

// If we're in Chrome, the installer strings aren't in the binary, but are in
// the localized pak files.  A TranslationDelegate must be provided so we can
// load these strings.
void SetTranslationDelegate(TranslationDelegate* delegate);

// Given a string base id, return the localized version of the string based on
// the system language.  This is used for shortcuts placed on the user's
// desktop.  The string is retrieved from the TranslationDelegate if one has
// been set.  Otherwise, the string is read from the binary's string table.
std::wstring GetLocalizedString(int base_message_id);

// Given the system language, return a url that points to the localized eula.
// The empty string is returned on failure.
std::wstring GetLocalizedEulaResource();

// Returns the language identifier of the translation currently in use.
std::wstring GetCurrentTranslation();

}  // namespace installer.

#endif  // CHROME_INSTALLER_UTIL_L10N_STRING_UTIL_H_


text:
package org.estatio.module.turnover;

import java.util.Set;

import javax.xml.bind.annotation.XmlRootElement;

import com.google.common.collect.Sets;

import org.apache.isis.applib.Module;
import org.apache.isis.applib.ModuleAbstract;
import org.apache.isis.applib.fixturescripts.FixtureScript;

import org.incode.module.fixturesupport.dom.scripts.TeardownFixtureAbstract;

import org.estatio.module.lease.EstatioLeaseModule;
import org.estatio.module.turnover.dom.Turnover;
import org.estatio.module.turnover.dom.TurnoverReportingConfig;
import org.estatio.module.turnover.dom.aggregation.TurnoverReportingConfigLink;

@XmlRootElement(name = "module")
public final class EstatioTurnoverModule extends ModuleAbstract {

    public EstatioTurnoverModule(){}

    @Override
    public Set<Module> getDependencies() {
        return Sets.newHashSet(new EstatioLeaseModule());
    }

    @Override
    public FixtureScript getTeardownFixture() {
        return new TeardownFixtureAbstract() {
            @Override
            protected void execute(final ExecutionContext executionContext) {
                deleteFrom(Turnover.class);
                deleteFrom(TurnoverReportingConfigLink.class);
                deleteFrom(TurnoverReportingConfig.class);
            }
        };
    }
}


text:
<?php

defined('COT_CODE') or die('Wrong URL.');

/**
 * Module Config
 */

$L['cfg_autovalidate'] = 'Autovalidate new';
$L['cfg_autovalidate_hint'] = 'Autovalidate new if poster has admin rights for new category';
$L['cfg_count_admin'] = 'Count Administrators\' hits';
$L['cfg_count_admin_hint'] = '';
$L['cfg_maxlistspernew'] = 'Max. lists per new';
$L['cfg_maxlistspernew_hint'] = ' ';
$L['cfg_order'] = 'Sorting column';
$L['cfg_title_new'] = 'New title tag format';
$L['cfg_title_new_hint'] = 'Options: {TITLE}, {CATEGORY}';
$L['cfg_way'] = 'Sorting direction';
$L['cfg_truncatetext'] = 'Set truncated new text length in list';
$L['cfg_truncatetext_hint'] = 'Zero to disable this feature';
$L['cfg_allowemptytext'] = 'Allow empty new text';
$L['cfg_keywords'] = 'Keywords';

$L['info_desc'] = 'Enables website content through news and new categories';

/**
 * Structure Confing
 */

$L['cfg_order_params'] = array(); // Redefined in cot_new_config_order()
$L['cfg_way_params'] = array($L['Ascending'], $L['Descending']);

/**
 * Admin New Section
 */

$L['adm_queue_deleted'] = 'New was deleted in to the trash can';
$L['adm_valqueue'] = 'Waiting for validation';
$L['adm_validated'] = 'Already validated';
$L['adm_expired'] = 'Expired';
$L['adm_structure'] = 'Structure of the news (categories)';
$L['adm_sort'] = 'Sort';
$L['adm_sortingorder'] = 'Set a default sorting order for the categories';
$L['adm_showall'] = 'Show all';
$L['adm_help_new'] = 'The news that belong to the category "system" are not displayed in the public listings, it\'s to make standalone news.';
$L['adm_fileyesno'] = 'File (yes/no)';
$L['adm_fileurl'] = 'File URL';
$L['adm_filecount'] = 'File hit count';
$L['adm_filesize'] = 'File size';

/**
 * New add and edit
 */

$L['new_addtitle'] = 'Submit new new';
$L['new_addsubtitle'] = 'Fill out all required fields and hit "Sumbit" to continue';
$L['new_edittitle'] = 'New properties';
$L['new_editsubtitle'] = 'Edit all required fields and hit "Sumbit" to continue';

$L['new_aliascharacters'] = 'Characters \'+\', \'/\', \'?\', \'%\', \'#\', \'&\' are not allowed in aliases';
$L['new_catmissing'] = 'The category code is missing';
$L['new_clone'] = 'Clone new';
$L['new_confirm_delete'] = 'Do you really want to delete this new?';
$L['new_confirm_validate'] = 'Do you want to validate this new?';
$L['new_confirm_unvalidate'] = 'Do you really want to put this new back to the validation queue?';
$L['new_drafts'] = 'Drafts';
$L['new_drafts_desc'] = 'News saved in your drafts';
$L['new_notavailable'] = 'This new will be published in ';
$L['new_textmissing'] = 'New text must not be empty';
$L['new_titletooshort'] = 'The title is too short or missing';
$L['new_validation'] = 'Awaiting validation';
$L['new_validation_desc'] = 'Your news which have not been validated by administrator yet';

$L['new_file'] = 'File download';
$L['new_filehint'] = '(Set "Yes" to enable the download module at bottom of the new, and fill up the two fields below)';
$L['new_urlhint'] = '(If File download enabled)';
$L['new_filesize'] = 'Filesize, kB';
$L['new_filesizehint'] = '(If File download enabled)';
$L['new_filehitcount'] = 'File hit count';
$L['new_filehitcounthint'] = '(If File download enabled)';
$L['new_metakeywords'] = 'Meta keywords';
$L['new_metatitle'] = 'Meta title';
$L['new_metadesc'] = 'Meta description';

$L['new_formhint'] = 'Once your submission is done, the new will be placed in the validation queue and will be hidden, awaiting confirmation from a site administrator or global moderator before being displayed in the right section. Check all fields carefully. If you need to change something, you will be able to do that later. But submitting changes puts a new into validation queue again.';

$L['new_newid'] = 'New ID';
$L['new_deletenew'] = 'Delete this new';

$L['new_savedasdraft'] = 'New saved as draft.';

/**
 * New statuses
 */

$L['new_status_draft'] = 'Draft';
$L['new_status_pending'] = 'Pending';
$L['new_status_approved'] = 'Approved';
$L['new_status_published'] = 'Published';
$L['new_status_expired'] = 'Expired';

/**
 * Moved from theme.lang
 */

$L['new_linespernew'] = 'Lines per new';
$L['new_linesinthissection'] = 'Lines in this section';

$Ls['news'] = "news,new";
$Ls['unvalidated_news'] = "unvalidated news,unvalidated new";
$Ls['news_in_drafts'] = "news in drafts,new in drafts";


text:
LASTWATER=$(cat ~/.dotfiles/bitbar/water/log)

# osascript -e "display notification \"1 hour without water $LASTWATER\" with title \"WATER\""

echo "$(date +"%s")000" >> ~/.dotfiles/bitbar/water/log


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Druid - a distributed column store.
  ~ Copyright 2012 - 2015 Metamarkets Group Inc.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>io.druid.extensions</groupId>
    <artifactId>druid-cassandra-storage</artifactId>
    <name>druid-cassandra-storage</name>
    <description>druid-cassandra-storage</description>

    <parent>
        <groupId>io.druid</groupId>
        <artifactId>druid</artifactId>
        <version>0.8.2-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <dependencies>
        <dependency>
            <groupId>io.druid</groupId>
            <artifactId>druid-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.netflix.astyanax</groupId>
            <artifactId>astyanax</artifactId>
            <version>1.0.1</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>

        <!-- Tests -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>


text:
<?php

namespace Honeybeee;

require_once "./Common/Constants.php";

/**
 * Class MySQLDBConnector
 * @package Honeybeee
 */
class MySQLDBConnector implements DBConnectorInterface
{
	/**
	 * CRUD Operation: Create a record in a table.
	 *
	 * Example: Create a recoard and return the last inserted ID.
	 *          The parameters are key/value array.(db column name and insert value)
	 *
	 * $params = [ "scrapdata"=> "http://arclab.tistory.com",
     *				"user" => "admin",
     *				"age" => 30
     *	];
     *
     * 	$dbConnector->createRecord($pdo, "scraplist", $params);
	 *
	 * @param PDO $pdo
	 * @param string $tableName
	 * @param array $params
	 *
	 * @return int
	 */
	public function createRecord($pdo, $tableName, $params) : int
	{
		$lastInsertId = FAILD_LAST_INSERTED_ID;
		$queryResult = PDO_EXCUTE_FAILURE;

		$arraySize = count($params);
		$Keys = array_keys($params);
		$Values = array_values($params);

		$queryValues = [];

		for($i=0; $i<$arraySize; $i++)
		{
			$queryValues[$i] = '?';
		}

		$strKeys = implode(",", $Keys);
		$strValues = implode(",", array_values($queryValues));

		$query = "INSERT INTO ".$tableName."(".$strKeys.") VALUES (".$strValues.")";

		try {
			$stmt = $pdo->prepare($query);
			$pdo->beginTransaction();

			$queryResult = $stmt->execute($Values);

			$lastInsertId = $pdo->lastInsertId();

			$pdo->commit();

		} catch(PDOException $e) {
			$pdo->rollback();
			echo $e->getMessage();
		}

		/*
		log:
		echo $query;
		echo "\n";
		echo "queryResult: ".$queryResult;
		echo "\n";
		echo "lastInsertId: ".$lastInsertId;
		echo "\n\n";
		*/
		return $lastInsertId;
	}
}
?>


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Ingredients extends CI_Model {
	public function __construct()
	{
		parent::__construct();
		$this->load->database();
		$this->db->query('PRAGMA foreign_keys = ON;');
	}

	public function get_ingredient($id)
	{
		$id = (int)$id;

		$query = 'SELECT "ing_id" as id, "ing_name" as name, "ing_available" as available, "ing_stock" as stock FROM "ingredients" WHERE "ing_id"=?;';
		$result = $this->db->query($query, array($id));

		if ($result->num_rows() == 0)
		{
			return NULL;
		}

		return $result->row();
	}

	public function list_ingredients()
	{
		$query = 'SELECT "ing_id" as id, "ing_name" as name, "ing_available" as available, "ing_stock" as stock FROM "ingredients";';

		$result = $this->db->query($query);

		if ($result->num_rows() == 0)
		{
			return array();
		}

		return $result->result();
	}

	public function new_ingredients($ig_name, $available, $stock, $staff)
	{
		if (!isset($staff))
			return FALSE;
		$ig_name = "$ig_name";
		$available = (bool)$available;
		$stock = (int)$stock;
		$staff = (int)$staff;

		$query_ing = 'INSERT INTO "ingredients" ("ing_id", "ing_name", "ing_available", "ing_stock") VALUES (NULL,?, ?, ?);';
		$log_ing = 'INSERT INTO "log_ingredients" ("log_staff_id","log_type","ing_id","ing_name","ing_available","ing_stock") VALUES (?, \'insert\', ?, ?, ?, ?);';

		$this->db->query($query_ing, array($ig_name, $available, $stock));
		$id = $this->db->insert_id();
		$this->db->query($log_ing, array($staff, $id, $ig_name, $available, $stock));
		return $id;
	}

	public function mod_ingredients($id, $ing_name, $available, $stock, $staff)
	{
		if (!isset($staff))
			return FALSE;
		$id = (int)$id;
		$ing_name = "$ing_name";
		$available = (bool)$available;
		$stock = (int)$stock;
		$staff = (int)$staff;

		$query_ing = 'UPDATE "ingredients" SET "ing_name"=?, "ing_available"=?, ing_stock=? WHERE ing_id = ?;';
		$log_ing = 'INSERT INTO "log_ingredients" ("log_staff_id","log_type","ing_id","ing_name","ing_available","ing_stock") VALUES (?, \'modify\', ?, ?, ?, ?);';

		$this->db->query($query_ing, array($ing_name, $available, $stock, $id));
		$this->db->query($log_ing, array($staff, $id, $ing_name, $available, $stock));
		return $id;
	}

	public function del_ingredients($id, $staff)
	{
		if (!isset($staff))
			return FALSE;
		$id = (int)$id;
		$staff = (int)$staff;

		$query_ing = 'DELETE FROM ingredients WHERE ing_id = ?;';
		$log_ing = 'INSERT INTO log_ingredients (log_staff_id,log_type,ing_id,ing_name,ing_available,ing_stock) SELECT ? as s , \'delete\' as t, ? as ident, i.ing_name, i.ing_available, i.ing_stock FROM ingredients AS i WHERE i.ing_id = ?;';

		$this->db->query($log_ing, array($staff, $id, $id));
		$this->db->query($query_ing, array($id));
	}
}
?>


text:
package com.ra4king.circuitsim.simulator;

import java.util.Arrays;

/**
 * @author Roi Atalla
 */
public class Utils {
	public static int[] getFilledArray(int count, int value) {
		int[] array = new int[count];
		Arrays.fill(array, value);
		return array;
	}
}


text: blog creates articles and comments


text:
var React = require("react");
import Icon from './Icon';
import menuHelper from './menuHelper';
var Link = require('react-router').Link;

var VNavItem = React.createClass({

    PropTypes: {
        node: React.PropTypes.object.isRequired,
        onClick: React.PropTypes.func
    },

    getInitialState: function () {
        return {
            collapsed: false
        }
    },

    handleCollapse: function () {
        if (this.props.node.nodes) {
            this.setState({collapsed: !this.state.collapsed});
        }
    },

    /**
     * ReactJS rendering function.
     * @returns {XML}
     */
    render: function () {

        let childrenWrapper = null;
        if (this.props.node.nodes && this.state.collapsed === false) {
            childrenWrapper =

                {menuHelper.createVNavItemsFromNodes(this.props.node.nodes, this.props.onClick)}

;
        }

        let vNavIconTextClass = this.props.node.icon ? "vnav-item-text with-icon" : "vnav-item-text";
        let plusWrapper = this.props.node.nodes ?
             <Icon icon={this.state.collapsed ? "plus" : "minus"}/>
         : null;

        let text = this.props.node.url ? <Link to={this.props.node.url}>{this.props.node.display}</Link> : {this.props.node.display}

        return

                {this.props.node.icon ? <Icon icon={this.props.node.icon}/> : null }

                    {text}

                {plusWrapper}

            {childrenWrapper}

    }
});

export default VNavItem;


text:
#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <arrow-glib/data-type.hpp>
#include <arrow-glib/int64-data-type.h>

G_BEGIN_DECLS

/**
 * SECTION: int64-data-type
 * @short_description: 64-bit integer data type
 *
 * #GArrowInt64DataType is a class for 64-bit integer data type.
 */

G_DEFINE_TYPE(GArrowInt64DataType,                \
              garrow_int64_data_type,             \
              GARROW_TYPE_DATA_TYPE)

static void
garrow_int64_data_type_init(GArrowInt64DataType *object)
{
}

static void
garrow_int64_data_type_class_init(GArrowInt64DataTypeClass *klass)
{
}

/**
 * garrow_int64_data_type_new:
 *
 * Returns: The newly created 64-bit integer data type.
 */
GArrowInt64DataType *
garrow_int64_data_type_new(void)
{
  auto arrow_data_type = arrow::int64();

  GArrowInt64DataType *data_type =
    GARROW_INT64_DATA_TYPE(g_object_new(GARROW_TYPE_INT64_DATA_TYPE,
                                         "data-type", &arrow_data_type,
                                         NULL));
  return data_type;
}

G_END_DECLS


text:
package org.opensmartgridplatform.cucumber.platform.smartmetering;

import org.opensmartgridplatform.cucumber.execution.AppBase;

public class App extends AppBase {

    public static void main(final String[] args) throws Throwable {

        final String[] testClasses = { "org.opensmartgridplatform.cucumber.platform.smartmetering.AcceptanceTests" };
        final App app = new App();
        System.exit(AppBase.run(app, testClasses, args));

    }
}


text:
namespace underworld {

  class Literal : public Common_Expression {
      source_mapping::Source_Range source_point;

  public:
      Literal(const source_mapping::Source_Range &source_point) : source_point(source_point) {}

      virtual ~Literal() {

      }

      Expression_Type get_type() const override {
        return Expression_Type::literal;
      }

      virtual Primitive_Type get_primitive_type() const = 0;

      const source_mapping::Source_Range get_source_point() const override {
        return source_point;
      }
  };

  template<typename T>
  class Literal_Implementation : public Literal {
      T value;

  public:
      Literal_Implementation(T value, const source_mapping::Source_Range &source) :
        value(value), Literal(source) {}

      virtual ~Literal_Implementation() {

      }

      const T &get_value() const {
        return value;
      }
  };

  class Literal_Int : public Literal_Implementation<int> {
  public:
      Literal_Int(int value, const source_mapping::Source_Range &source) :
        Literal_Implementation(value, source) {}

      Primitive_Type get_primitive_type() const override {
        return Primitive_Type::Int;
      }
  };

  class Literal_String : public Literal_Implementation<const std::string> {
  public:
      Literal_String(const std::string &value, const source_mapping::Source_Range &source) :
        Literal_Implementation(value, source) {}

      Primitive_Type get_primitive_type() const override {
        return Primitive_Type::String;
      }
  };

  class Literal_Bool : public Literal_Implementation<bool> {
  public:
      Literal_Bool(const bool &value, const source_mapping::Source_Range &source) :
        Literal_Implementation(value, source) {}

      Primitive_Type get_primitive_type() const override {
        return Primitive_Type::Bool;
      }
  };
}


text:
This is the bank account kata I paired on at the Craftsmenship Meetup

http://www.meetup.com/Software-Craftsmanship-New-York/

## Requirements

- Deposit and Withdraw
- Transfer
- Account statement (date, amount, balance)
- Statement printing
- Statement filters (just deposits, widthdrawal, date)

## The Rules
1. One level of indentation per method
2. Don't use the ELSE keyword (prefer polymophism over if else chains)
3. Wrap all primitives and Strings (don't fall subject to primitive obsession)
4. First class collections
5. One dot per line (Law of Demeter)
6. Don't abbreviate
7. Keep all entities small (~50 lines)
8. No classes with more than two instance variables (highly cohesive)
9. No getters/setters/properties (objects are not bags of properties)


text:
class Spree::Admin::PostsController < Spree::Admin::ResourceController
  helper 'spree/base'

  def new_action
    respond_to do |format|
      format.html { render action: :new, layout: false }
    end
  end

  def update
    respond_to do |format|
      format.html { redirect_to admin_posts_path }
    end
  end

  def create
    respond_to do |format|
      format.html { redirect_to edit_admin_posts_path(@posts) }
    end
  end

  private

  def collection
    @collection ||= Spree::Post.paginate(page: params[:page], per_page: 10)
  end
end


text:
layout: post
title: "galaxy note 1 de at&t"
date: "2015-11-02"
---

Download Candy5.zip
Download 5.1.+ Gapps (optional)
Place Candy5.zip on phones memory or SD card
Boot into recovery (USE MY TWRP (ONLY) in second post or CWM if it's been updated)
FULL wipe! (Dalvik Cache, Cache, System, Factory Data Reset)
Flash Candy5.zip
Boot into system
Flash Gapps
Reboot and Enjoi
http://forum.xda-developers.com/galaxy-note-att/development/rom-t3040558
https://www.androidfilehost.com/?fid=24052804347762740


text:
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.LayoutRules
{
    using System;
    using System.Collections.Immutable;
    using Microsoft.CodeAnalysis;
    using Microsoft.CodeAnalysis.CSharp;
    using Microsoft.CodeAnalysis.CSharp.Syntax;
    using Microsoft.CodeAnalysis.Diagnostics;
    using StyleCop.Analyzers.Helpers;

    /// <summary>
    /// An opening brace within a C# element, statement, or expression is followed by a blank line.
    /// </summary>
    /// <remarks>
    /// <para>To improve the readability of the code, StyleCop requires blank lines in certain situations, and prohibits
    /// blank lines in other situations. This results in a consistent visual pattern across the code, which can improve
    /// recognition and readability of unfamiliar code.</para>
    ///
    /// <para>A violation of this rule occurs when an opening brace is followed by a blank line. For example:</para>
    ///
    /// <code>
    /// public bool Enabled
    /// {
    ///
    ///     get
    ///     {
    ///
    ///         return this.enabled;
    ///     }
    /// }
    /// </code>
    ///
    /// <para>The code above would generate two instances of this violation, since there are two places where opening
    /// braces are followed by blank lines.</para>
    /// </remarks>
    [DiagnosticAnalyzer(LanguageNames.CSharp)]
    internal class SA1505OpeningBracesMustNotBeFollowedByBlankLine : DiagnosticAnalyzer
    {
        /// <summary>
        /// The ID for diagnostics produced by the <see cref="SA1505OpeningBracesMustNotBeFollowedByBlankLine"/>
        /// analyzer.
        /// </summary>
        public const string DiagnosticId = "SA1505";
        private const string HelpLink = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1505.md";
        private static readonly LocalizableString Title = new LocalizableResourceString(nameof(LayoutResources.SA1505Title), LayoutResources.ResourceManager, typeof(LayoutResources));
        private static readonly LocalizableString MessageFormat = new LocalizableResourceString(nameof(LayoutResources.SA1505MessageFormat), LayoutResources.ResourceManager, typeof(LayoutResources));
        private static readonly LocalizableString Description = new LocalizableResourceString(nameof(LayoutResources.SA1505Description), LayoutResources.ResourceManager, typeof(LayoutResources));

        private static readonly DiagnosticDescriptor Descriptor =
            new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.LayoutRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);

        private static readonly Action<SyntaxNodeAnalysisContext> BlockAction = HandleBlock;
        private static readonly Action<SyntaxNodeAnalysisContext> InitializerExpressionAction = HandleInitializerExpression;
        private static readonly Action<SyntaxNodeAnalysisContext> AnonymousObjectCreationExpressionAction = HandleAnonymousObjectCreationExpression;
        private static readonly Action<SyntaxNodeAnalysisContext> SwitchStatementAction = HandleSwitchStatement;
        private static readonly Action<SyntaxNodeAnalysisContext> NamespaceDeclarationAction = HandleNamespaceDeclaration;
        private static readonly Action<SyntaxNodeAnalysisContext> BaseTypeDeclarationAction = HandleBaseTypeDeclaration;
        private static readonly Action<SyntaxNodeAnalysisContext> AccessorListAction = HandleAccessorList;

        /// <inheritdoc/>
        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
            ImmutableArray.Create(Descriptor);

        /// <inheritdoc/>
        public override void Initialize(AnalysisContext context)
        {
            context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);
            context.EnableConcurrentExecution();

            context.RegisterSyntaxNodeAction(BlockAction, SyntaxKind.Block);
            context.RegisterSyntaxNodeAction(InitializerExpressionAction, SyntaxKinds.InitializerExpression);
            context.RegisterSyntaxNodeAction(AnonymousObjectCreationExpressionAction, SyntaxKind.AnonymousObjectCreationExpression);
            context.RegisterSyntaxNodeAction(SwitchStatementAction, SyntaxKind.SwitchStatement);
            context.RegisterSyntaxNodeAction(NamespaceDeclarationAction, SyntaxKind.NamespaceDeclaration);
            context.RegisterSyntaxNodeAction(BaseTypeDeclarationAction, SyntaxKinds.BaseTypeDeclaration);
            context.RegisterSyntaxNodeAction(AccessorListAction, SyntaxKind.AccessorList);
        }

        private static void HandleBlock(SyntaxNodeAnalysisContext context)
        {
            var block = (BlockSyntax)context.Node;
            AnalyzeOpenBrace(context, block.OpenBraceToken);
        }

        private static void HandleInitializerExpression(SyntaxNodeAnalysisContext context)
        {
            var expression = (InitializerExpressionSyntax)context.Node;
            AnalyzeOpenBrace(context, expression.OpenBraceToken);
        }

        private static void HandleAnonymousObjectCreationExpression(SyntaxNodeAnalysisContext context)
        {
            var expression = (AnonymousObjectCreationExpressionSyntax)context.Node;
            AnalyzeOpenBrace(context, expression.OpenBraceToken);
        }

        private static void HandleSwitchStatement(SyntaxNodeAnalysisContext context)
        {
            var switchStatement = (SwitchStatementSyntax)context.Node;
            AnalyzeOpenBrace(context, switchStatement.OpenBraceToken);
        }

        private static void HandleNamespaceDeclaration(SyntaxNodeAnalysisContext context)
        {
            var namespaceDeclaration = (NamespaceDeclarationSyntax)context.Node;
            AnalyzeOpenBrace(context, namespaceDeclaration.OpenBraceToken);
        }

        private static void HandleBaseTypeDeclaration(SyntaxNodeAnalysisContext context)
        {
            var typeDeclaration = (BaseTypeDeclarationSyntax)context.Node;
            AnalyzeOpenBrace(context, typeDeclaration.OpenBraceToken);
        }

        private static void HandleAccessorList(SyntaxNodeAnalysisContext context)
        {
            var accessorList = (AccessorListSyntax)context.Node;
            AnalyzeOpenBrace(context, accessorList.OpenBraceToken);
        }

        private static void AnalyzeOpenBrace(SyntaxNodeAnalysisContext context, SyntaxToken openBraceToken)
        {
            var nextToken = openBraceToken.GetNextToken();
            if (nextToken.IsMissingOrDefault())
            {
                return;
            }

            if ((GetLine(nextToken) - GetLine(openBraceToken)) < 2)
            {
                // there will be no blank lines when the opening brace and the following token are not at least two lines apart.
                return;
            }

            var separatingTrivia = TriviaHelper.MergeTriviaLists(openBraceToken.TrailingTrivia, nextToken.LeadingTrivia);

            // skip everything until the first end of line (as this is considered part of the line of the opening brace)
            var startIndex = 0;
            while ((startIndex < separatingTrivia.Count) && !separatingTrivia[startIndex].IsKind(SyntaxKind.EndOfLineTrivia))
            {
                startIndex++;
            }

            startIndex = (startIndex == separatingTrivia.Count) ? 0 : startIndex + 1;

            var done = false;
            var eolCount = 0;
            for (var i = startIndex; !done && (i < separatingTrivia.Count); i++)
            {
                switch (separatingTrivia[i].Kind())
                {
                case SyntaxKind.WhitespaceTrivia:
                    break;
                case SyntaxKind.EndOfLineTrivia:
                    eolCount++;
                    break;
                default:
                    done = true;
                    break;
                }
            }

            if (eolCount > 0)
            {
                context.ReportDiagnostic(Diagnostic.Create(Descriptor, openBraceToken.GetLocation()));
            }
        }

        private static int GetLine(SyntaxToken token)
        {
            return token.GetLineSpan().StartLinePosition.Line;
        }
    }
}


text:
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.client import Client

from profiles.models import Profile
from protocols.models import Protocol, Step, Action, Component

from organization.models import Organization, Membership
from workflow.models import Workflow
from experiment.models import Experiment
from schedule.models import Calendar
from organization.tests.core import AutoBaseTest
from django.utils import simplejson as json
from experiment.models import Experiment

class ExperimentViewTests(AutoBaseTest):

	def setUp(self):
		super(ExperimentViewTests, self).setUp()

		self.user = self.createUserInstance(username="testuser1", password="pass", email="test1@example.com")
		self.user2 = self.createUserInstance(username="testuser2", password="pass", email="test2@example.com")
		self.user3 = self.createUserInstance(username="testuser3", password="pass", email="test3@example.com")
		self.profile = self.createModelInstance(Profile, user=self.user)
		self.profile2 = self.createModelInstance(Profile, user=self.user2)
		self.profile3 = self.createModelInstance(Profile, user=self.user3)
		self.org = self.createModelInstance(Organization, name="TestOrg", slug="testorg")
		self.org2 = self.createModelInstance(Organization, name="Test2Org", slug="test2org")
		self.member = self.createModelInstance(Membership, user=self.user, org=self.org)
		self.member2 = self.createModelInstance(Membership, user=self.user2, org=self.org)
		self.member3 = self.createModelInstance(Membership, user=self.user3, org=self.org2)
		self.protocol = self.createModelInstance(Protocol, name="Test1", owner=self.org, author=self.user)
		self.protocol2 = self.createModelInstance(Protocol, name="Test2", owner=self.org, author=self.user2)
		self.protocol3 = self.createModelInstance(Protocol, name="Test3", owner=self.org, author=self.user2, published=True)
		self.protocol4 = self.createModelInstance(Protocol, name="Test4", owner=self.org2, author=self.user3)
		self.workflow = self.createModelInstance(Workflow, user=self.user, name="TestFlow", data={'meta':{},'protocols':[1]}, owner=self.org)
		self.workflow2 = self.createModelInstance(Workflow, user=self.user2, name="TestFlow2", data={'meta':{},'protocols':[3,2]}, owner=self.org)
		self.workflow3 = self.createModelInstance(Workflow, user=self.user3, name="TestFlow3", data={'meta':{},'protocols':[4]}, owner=self.org2)
		self.experiment = self.createModelInstance(Experiment, owner=self.org, user=self.user, name="Exp1", workflow=self.workflow)
		self.experiment2 = self.createModelInstance(Experiment, owner=self.org, user=self.user2, name="Exp2", workflow=self.workflow2)
		self.experiment3 = self.createModelInstance(Experiment, owner=self.org2, user=self.user3, name="Exp3", workflow=self.workflow3)

	def test_experiment_detail(self):
		# testing context for detail view
		c = Client()
		c.login(username="testuser1", password="pass")
		resp = c.get('/testorg/experiments/1-exp1/')
		self.assertEqual(resp.status_code, 200)
		self.assertEqual(resp.context['experiment'],self.experiment)
		self.assertEqual(resp.context['workflow'], self.workflow)
		self.assertEqual(resp.context['organization'],self.org)
		resp = c.get('/test2org/experiments/1-exp1/')
		self.assertEqual(resp.status_code, 404)
		resp = c.get('/testorg/experiments/2-exp2/')
		self.assertEqual(resp.status_code, 404)

	def test_experiment_create(self):
		c = Client()
		c.login(username="testuser1", password="pass")
		resp = c.get('/testorg/experiments/create/')
		self.assertEqual(resp.status_code, 200)
		self.assertEqual(resp.context['form'].fields['workflows'].choices, [(1,self.workflow)])
		resp = c.get('/test2org/experiments/create/')
		self.assertEqual(resp.status_code, 404)

		# no fields
		resp = c.post('/testorg/experiments/create/')
		self.assertEqual(resp.status_code, 200)
		self.assertEqual(resp.context['form'].errors, {'name':[u'This field is required.'],'workflows':[u'This field is required.']})

		# Send junk POST data.
		resp = c.post('/testorg/experiments/create/', {'foo': 'bar'})
		self.assertEqual(resp.status_code, 200)
		self.assertEqual(resp.context['form'].errors, {'name':[u'This field is required.'],'workflows':[u'This field is required.']})

		# test post check status and redirect location
		resp = c.post('/testorg/experiments/create/', {'name':'exp2', 'workflows':1})
		self.assertEqual(resp.status_code, 302)
		print resp['location']
		self.assertEqual(resp['location'],'http://testserver/testorg/experiments/4-exp2/')


text:
/* *INDENT-OFF* */

SDL_MIR_MODULE(MIR_CLIENT)
SDL_MIR_SYM(MirDisplayConfiguration*,mir_connection_create_display_config,(MirConnection *connection))
SDL_MIR_SYM(MirSurface *,mir_connection_create_surface_sync,(MirConnection *connection, MirSurfaceParameters const *params))
SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats))
SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection))
SDL_MIR_SYM(MirBool,mir_connection_is_valid,(MirConnection *connection))
SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection))
SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name))
SDL_MIR_SYM(void,mir_display_config_destroy,(MirDisplayConfiguration* display_configuration))
SDL_MIR_SYM(MirEGLNativeWindowType,mir_surface_get_egl_native_window,(MirSurface *surface))
SDL_MIR_SYM(char const *,mir_surface_get_error_message,(MirSurface *surface))
SDL_MIR_SYM(void,mir_surface_get_graphics_region,(MirSurface *surface, MirGraphicsRegion *graphics_region))
SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *parameters))
SDL_MIR_SYM(MirBool,mir_surface_is_valid,(MirSurface *surface))
SDL_MIR_SYM(void,mir_surface_release_sync,(MirSurface *surface))
SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, MirEventDelegate const *event_handler))
SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_type,(MirSurface *surface, MirSurfaceType type))
SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_state,(MirSurface *surface, MirSurfaceState state))
SDL_MIR_SYM(void,mir_surface_swap_buffers_sync,(MirSurface *surface))

SDL_MIR_MODULE(XKBCOMMON)
SDL_MIR_SYM(int,xkb_keysym_to_utf8,(xkb_keysym_t keysym, char *buffer, size_t size))

/* *INDENT-ON* */

/* vi: set ts=4 sw=4 expandtab: */


text:
package org.hisp.dhis.expression;

import static org.hisp.dhis.expression.Expression.SEPARATOR;
import static org.hisp.dhis.expression.ExpressionService.DAYS_SYMBOL;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.constant.Constant;
import org.hisp.dhis.constant.ConstantService;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategory;
import org.hisp.dhis.dataelement.DataElementCategoryCombo;
import org.hisp.dhis.dataelement.DataElementCategoryOption;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementOperand;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.datavalue.DataValueService;
import org.hisp.dhis.indicator.Indicator;
import org.hisp.dhis.indicator.IndicatorType;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.Period;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import com.google.common.collect.Lists;

/**
 * @author Lars Helge Overland
 */
public class ExpressionServiceTest
    extends DhisSpringTest
{
    @Autowired
    private ExpressionService expressionService;

    @Autowired
    private DataElementService dataElementService;

    @Autowired
    private DataElementCategoryService categoryService;

    @Autowired
    private ConstantService constantService;

    @Autowired
    private DataValueService dataValueService;

    @Autowired
    private OrganisationUnitService organisationUnitService;

    @Autowired
    private OrganisationUnitGroupService organisationUnitGroupService;

    private DataElementCategoryOption categoryOptionA;
    private DataElementCategoryOption categoryOptionB;
    private DataElementCategoryOption categoryOptionC;
    private DataElementCategoryOption categoryOptionD;

    private DataElementCategory categoryA;
    private DataElementCategory categoryB;

    private DataElementCategoryCombo categoryCombo;

    private DataElement dataElementA;
    private DataElement dataElementB;
    private DataElement dataElementC;
    private DataElement dataElementD;
    private DataElement dataElementE;

    private Period period;

    private OrganisationUnit unitA;
    private OrganisationUnit unitB;
    private OrganisationUnit unitC;

    private DataElementCategoryOptionCombo categoryOptionCombo;

    private Constant constantA;

    private OrganisationUnitGroup groupA;

    private String expressionA;
    private String expressionB;
    private String expressionC;
    private String expressionD;
    private String expressionE;
    private String expressionF;
    private String expressionG;
    private String expressionH;

    private String descriptionA;
    private String descriptionB;

    private Set<DataElement> dataElements = new HashSet<>();

    private Set<DataElementCategoryOptionCombo> optionCombos = new HashSet<>();

    // -------------------------------------------------------------------------
    // Fixture
    // -------------------------------------------------------------------------

    @Override
    public void setUpTest()
        throws Exception
    {
        categoryOptionA = new DataElementCategoryOption( "Under 5" );
        categoryOptionB = new DataElementCategoryOption( "Over 5" );
        categoryOptionC = new DataElementCategoryOption( "Male" );
        categoryOptionD = new DataElementCategoryOption( "Female" );

        categoryService.addDataElementCategoryOption( categoryOptionA );
        categoryService.addDataElementCategoryOption( categoryOptionB );
        categoryService.addDataElementCategoryOption( categoryOptionC );
        categoryService.addDataElementCategoryOption( categoryOptionD );

        categoryA = new DataElementCategory( "Age" );
        categoryB = new DataElementCategory( "Gender" );

        categoryA.getCategoryOptions().add( categoryOptionA );
        categoryA.getCategoryOptions().add( categoryOptionB );
        categoryB.getCategoryOptions().add( categoryOptionC );
        categoryB.getCategoryOptions().add( categoryOptionD );

        categoryService.addDataElementCategory( categoryA );
        categoryService.addDataElementCategory( categoryB );

        categoryCombo = new DataElementCategoryCombo( "Age and gender" );
        categoryCombo.getCategories().add( categoryA );
        categoryCombo.getCategories().add( categoryB );

        categoryService.addDataElementCategoryCombo( categoryCombo );

        dataElementA = createDataElement( 'A' );
        dataElementB = createDataElement( 'B' );
        dataElementC = createDataElement( 'C' );
        dataElementD = createDataElement( 'D' );
        dataElementE = createDataElement( 'E', categoryCombo );

        dataElementService.addDataElement( dataElementA );
        dataElementService.addDataElement( dataElementB );
        dataElementService.addDataElement( dataElementC );
        dataElementService.addDataElement( dataElementD );
        dataElementService.addDataElement( dataElementE );

        categoryOptionCombo = categoryService.getDefaultDataElementCategoryOptionCombo();

        categoryOptionCombo.getId();
        optionCombos.add( categoryOptionCombo );

        period = createPeriod( getDate( 2000, 1, 1 ), getDate( 2000, 2, 1 ) );

        unitA = createOrganisationUnit( 'A' );
        unitB = createOrganisationUnit( 'B' );
        unitC = createOrganisationUnit( 'C' );

        organisationUnitService.addOrganisationUnit( unitA );
        organisationUnitService.addOrganisationUnit( unitB );
        organisationUnitService.addOrganisationUnit( unitC );

        constantA = new Constant( "ConstantA", 2.0 );

        constantService.saveConstant( constantA );

        groupA = createOrganisationUnitGroup( 'A' );
        groupA.addOrganisationUnit( unitA );
        groupA.addOrganisationUnit( unitB );
        groupA.addOrganisationUnit( unitC );

        organisationUnitGroupService.addOrganisationUnitGroup( groupA );

        expressionA = "#{" + dataElementA.getUid() + SEPARATOR + categoryOptionCombo.getUid() + "}+#{" + dataElementB.getUid() + SEPARATOR
            + categoryOptionCombo.getUid() + "}";
        expressionB = "#{" + dataElementC.getUid() + SEPARATOR + categoryOptionCombo.getUid() + "}-#{" + dataElementD.getUid() + SEPARATOR
            + categoryOptionCombo.getUid() + "}";
        expressionC = "#{" + dataElementA.getUid() + SEPARATOR + categoryOptionCombo.getUid() + "}+#{" + dataElementE.getUid() + "}-10";
        expressionD = "#{" + dataElementA.getUid() + SEPARATOR + categoryOptionCombo.getUid() + "}+" + DAYS_SYMBOL;
        expressionE = "#{" + dataElementA.getUid() + SEPARATOR + categoryOptionCombo.getUid() + "}*C{" + constantA.getUid() + "}";
        expressionF = "#{" + dataElementA.getUid() + SEPARATOR + categoryOptionCombo.getUid() + "}";
        expressionG = expressionF + "+#{" + dataElementB.getUid() + "}-#{" + dataElementC.getUid() + "}";
        expressionH = "#{" + dataElementA.getUid() + SEPARATOR + categoryOptionCombo.getUid() + "}*OUG{" + groupA.getUid() + "}";

        descriptionA = "Expression A";
        descriptionB = "Expression B";

        dataElements.add( dataElementA );
        dataElements.add( dataElementB );
        dataElements.add( dataElementC );
        dataElements.add( dataElementD );
        dataElements.add( dataElementE );

        dataValueService.addDataValue( createDataValue( dataElementA, period, unitA, "10", categoryOptionCombo, categoryOptionCombo ) );
        dataValueService.addDataValue( createDataValue( dataElementB, period, unitA, "5", categoryOptionCombo, categoryOptionCombo ) );
    }

    // -------------------------------------------------------------------------
    // Business logic tests
    // -------------------------------------------------------------------------

    @Test
    public void testExplodeExpressionA()
    {
        categoryService.generateOptionCombos( categoryCombo );

        String actual = expressionService.explodeExpression( expressionC );

        Set<DataElementCategoryOptionCombo> categoryOptionCombos = categoryCombo.getOptionCombos();

        assertTrue( actual.contains( "#{" + dataElementA.getUid() + SEPARATOR + categoryOptionCombo.getUid() + "}" ) );

        for ( DataElementCategoryOptionCombo categoryOptionCombo : categoryOptionCombos )
        {
            assertTrue( actual.contains( "#{" + dataElementE.getUid() + SEPARATOR + categoryOptionCombo.getUid() + "}" ) );
        }
    }

    @Test
    public void testExplodeExpressionB()
    {
        assertEquals( "1", expressionService.explodeExpression( "1" ) );
        assertEquals( "2+6/4", expressionService.explodeExpression( "2+6/4" ) );
    }

    @Test
    public void testGetDataElementsInExpression()
    {
        Set<DataElement> dataElements = expressionService.getDataElementsInExpression( expressionA );

        assertTrue( dataElements.size() == 2 );
        assertTrue( dataElements.contains( dataElementA ) );
        assertTrue( dataElements.contains( dataElementB ) );

        dataElements = expressionService.getDataElementsInExpression( expressionG );

        assertEquals( 3, dataElements.size() );
        assertTrue( dataElements.contains( dataElementA ) );
        assertTrue( dataElements.contains( dataElementB ) );
        assertTrue( dataElements.contains( dataElementC ) );
    }

    @Test
    public void testGetDataElementsInIndicators()
    {
        Indicator inA = createIndicator( 'A', null );
        inA.setNumerator( expressionA );

        Set<DataElement> dataElements = expressionService.getDataElementsInIndicators( Lists.newArrayList( inA ) );

        assertTrue( dataElements.size() == 2 );
        assertTrue( dataElements.contains( dataElementA ) );
        assertTrue( dataElements.contains( dataElementB ) );

        Indicator inG = createIndicator( 'G', null );
        inG.setNumerator( expressionG );

        dataElements = expressionService.getDataElementsInIndicators( Lists.newArrayList( inG ) );

        assertEquals( 3, dataElements.size() );
        assertTrue( dataElements.contains( dataElementA ) );
        assertTrue( dataElements.contains( dataElementB ) );
        assertTrue( dataElements.contains( dataElementC ) );
    }

    @Test
    public void testGetDataElementTotalsInIndicators()
    {
        Indicator inG = createIndicator( 'G', null );
        inG.setNumerator( expressionG );

        Set<DataElement> dataElements = expressionService.getDataElementTotalsInIndicators( Lists.newArrayList( inG ) );

        assertEquals( 2, dataElements.size() );
        assertTrue( dataElements.contains( dataElementB ) );
        assertTrue( dataElements.contains( dataElementC ) );
    }

    @Test
    public void testGetDataElementWithOptionCombosInIndicators()
    {
        Indicator inG = createIndicator( 'G', null );
        inG.setNumerator( expressionG );

        Set<DataElement> dataElements = expressionService.getDataElementWithOptionCombosInIndicators( Lists.newArrayList( inG ) );

        assertEquals( 1, dataElements.size() );
        assertTrue( dataElements.contains( dataElementA ) );
    }

    @Test
    public void testGetDataElementTotalUids()
    {
        Set<String> uids = new HashSet<>();
        Set<String> empty = new HashSet<>();

        uids.add( dataElementB.getUid() );
        uids.add( dataElementC.getUid() );

        assertEquals( uids, expressionService.getDataElementTotalUids( expressionG ) );
        assertEquals( empty, expressionService.getDataElementTotalUids( expressionA ) );
    }

    @Test
    public void testGetOperandsInExpression()
    {
        Set<DataElementOperand> operands = expressionService.getOperandsInExpression( expressionA );

        assertNotNull( operands );
        assertEquals( 2, operands.size() );

        DataElementOperand operandA = new DataElementOperand( dataElementA.getUid(), categoryOptionCombo.getUid() );
        DataElementOperand operandB = new DataElementOperand( dataElementB.getUid(), categoryOptionCombo.getUid() );

        assertTrue( operands.contains( operandA ) );
        assertTrue( operands.contains( operandB ) );

        operands = expressionService.getOperandsInExpression( expressionG );

        assertNotNull( operands );
        assertEquals( 1, operands.size() );

        assertTrue( operands.contains( operandA ) );
    }

    @Test
    public void testGetOptionCombosInExpression()
    {
        Set<DataElementCategoryOptionCombo> optionCombos = expressionService.getOptionCombosInExpression( expressionG );

        assertNotNull( optionCombos );
        assertEquals( 1, optionCombos.size() );

        assertTrue( optionCombos.contains( categoryOptionCombo ) );
    }

    @Test
    public void testExpressionIsValid()
    {
        assertEquals( ExpressionService.VALID, expressionService.expressionIsValid( expressionA ) );
        assertEquals( ExpressionService.VALID, expressionService.expressionIsValid( expressionB ) );
        assertEquals( ExpressionService.VALID, expressionService.expressionIsValid( expressionC ) );
        assertEquals( ExpressionService.VALID, expressionService.expressionIsValid( expressionD ) );
        assertEquals( ExpressionService.VALID, expressionService.expressionIsValid( expressionE ) );
        assertEquals( ExpressionService.VALID, expressionService.expressionIsValid( expressionH ) );

        expressionA = "#{NonExistingUid" + SEPARATOR + categoryOptionCombo.getUid() + "} + 12";

        assertEquals( ExpressionService.DATAELEMENT_DOES_NOT_EXIST, expressionService.expressionIsValid( expressionA ) );

        expressionA = "#{" + dataElementA.getUid() + SEPARATOR + 999 + "} + 12";

        assertEquals( ExpressionService.CATEGORYOPTIONCOMBO_DOES_NOT_EXIST, expressionService
            .expressionIsValid( expressionA ) );

        expressionA = "#{" + dataElementA.getUid() + SEPARATOR + categoryOptionCombo.getUid() + "} + ( 12";

        assertEquals( ExpressionService.EXPRESSION_NOT_WELL_FORMED, expressionService.expressionIsValid( expressionA ) );

        expressionA = "12 x 4";

        assertEquals( ExpressionService.EXPRESSION_NOT_WELL_FORMED, expressionService.expressionIsValid( expressionA ) );

        expressionA = "12 + C{999999}";

        assertEquals( ExpressionService.CONSTANT_DOES_NOT_EXIST, expressionService.expressionIsValid( expressionA ) );

        expressionA = "12 + OUG{999999}";

        assertEquals( ExpressionService.OU_GROUP_DOES_NOT_EXIST, expressionService.expressionIsValid( expressionA ) );
    }

    @Test
    public void testGetExpressionDescription()
    {
        String description = expressionService.getExpressionDescription( expressionA );

        assertEquals( "DataElementA+DataElementB", description );

        description = expressionService.getExpressionDescription( expressionD );

        assertEquals( "DataElementA+" + ExpressionService.DAYS_DESCRIPTION, description );

        description = expressionService.getExpressionDescription( expressionE );

        assertEquals( "DataElementA*ConstantA", description );

        description = expressionService.getExpressionDescription( expressionH );

        assertEquals( "DataElementA*OrganisationUnitGroupA", description );
    }

    @Test
    public void testGenerateExpressionMap()
    {
        Map<DataElementOperand, Double> valueMap = new HashMap<>();
        valueMap.put( new DataElementOperand( dataElementA.getUid(), categoryOptionCombo.getUid() ), new Double( 12 ) );
        valueMap.put( new DataElementOperand( dataElementB.getUid(), categoryOptionCombo.getUid() ), new Double( 34 ) );

        Map<String, Double> constantMap = new HashMap<>();
        constantMap.put( constantA.getUid(), 2.0 );

        Map<String, Integer> orgUnitCountMap = new HashMap<>();
        orgUnitCountMap.put( groupA.getUid(), groupA.getMembers().size() );

        assertEquals( "12.0+34.0", expressionService.generateExpression( expressionA, valueMap, constantMap, null, null, null ) );
        assertEquals( "12.0+5", expressionService.generateExpression( expressionD, valueMap, constantMap, null, 5, null ) );
        assertEquals( "12.0*2.0", expressionService.generateExpression( expressionE, valueMap, constantMap, null, null, null ) );
        assertEquals( "12.0*3", expressionService.generateExpression( expressionH, valueMap, constantMap, orgUnitCountMap, null, null ) );
    }

    @Test
    public void testGenerateExpressionMapNullIfNoValues()
    {
        Map<DataElementOperand, Double> valueMap = new HashMap<>();

        Map<String, Double> constantMap = new HashMap<>();

        assertNull( expressionService.generateExpression( expressionA, valueMap, constantMap, null, null, MissingValueStrategy.SKIP_IF_ANY_VALUE_MISSING ) );
        assertNull( expressionService.generateExpression( expressionD, valueMap, constantMap, null, 5, MissingValueStrategy.SKIP_IF_ANY_VALUE_MISSING ) );
        assertNotNull( expressionService.generateExpression( expressionE, valueMap, constantMap, null, null, MissingValueStrategy.NEVER_SKIP ) );
    }

    @Test
    public void testGetExpressionValue()
    {
        Expression expA = createExpression( 'A', expressionA, null, null );
        Expression expD = createExpression( 'D', expressionD, null, null );
        Expression expE = createExpression( 'E', expressionE, null, null );
        Expression expH = createExpression( 'H', expressionH, null, null );

        Map<DataElementOperand, Double> valueMap = new HashMap<>();
        valueMap.put( new DataElementOperand( dataElementA.getUid(), categoryOptionCombo.getUid() ), new Double( 12 ) );
        valueMap.put( new DataElementOperand( dataElementB.getUid(), categoryOptionCombo.getUid() ), new Double( 34 ) );

        Map<String, Double> constantMap = new HashMap<>();
        constantMap.put( constantA.getUid(), 2.0 );

        Map<String, Integer> orgUnitCountMap = new HashMap<>();
        orgUnitCountMap.put( groupA.getUid(), groupA.getMembers().size() );

        assertEquals( 46d, expressionService.getExpressionValue( expA, valueMap, constantMap, null, null ), DELTA );
        assertEquals( 17d, expressionService.getExpressionValue( expD, valueMap, constantMap, null, 5 ), DELTA );
        assertEquals( 24d, expressionService.getExpressionValue( expE, valueMap, constantMap, null, null ), DELTA );
        assertEquals( 36d, expressionService.getExpressionValue( expH, valueMap, constantMap, orgUnitCountMap, null ), DELTA );
    }

    @Test
    public void testGetIndicatorValue()
    {
        IndicatorType indicatorType = new IndicatorType( "A", 100, false );
        Indicator indicatorA = createIndicator( 'A', indicatorType );
        indicatorA.setNumerator( expressionE );
        indicatorA.setDenominator( expressionF );

        Map<DataElementOperand, Double> valueMap = new HashMap<>();
        valueMap.put( new DataElementOperand( dataElementA.getUid(), categoryOptionCombo.getUid() ), new Double( 12 ) );
        valueMap.put( new DataElementOperand( dataElementB.getUid(), categoryOptionCombo.getUid() ), new Double( 34 ) );

        Map<String, Double> constantMap = new HashMap<>();
        constantMap.put( constantA.getUid(), 2.0 );

        assertEquals( 200d, expressionService.getIndicatorValue( indicatorA, period, valueMap, constantMap, null, null ), DELTA );
    }

    // -------------------------------------------------------------------------
    // CRUD tests
    // -------------------------------------------------------------------------

    @Test
    public void testAddGetExpression()
    {
        Expression expression = new Expression( expressionA, descriptionA, dataElements );

        int id = expressionService.addExpression( expression );

        expression = expressionService.getExpression( id );

        assertEquals( expressionA, expression.getExpression() );
        assertEquals( descriptionA, expression.getDescription() );
        assertEquals( dataElements, expression.getDataElementsInExpression() );
    }

    @Test
    public void testUpdateExpression()
    {
        Expression expression = new Expression( expressionA, descriptionA, dataElements );

        int id = expressionService.addExpression( expression );

        expression = expressionService.getExpression( id );

        assertEquals( expressionA, expression.getExpression() );
        assertEquals( descriptionA, expression.getDescription() );

        expression.setExpression( expressionB );
        expression.setDescription( descriptionB );

        expressionService.updateExpression( expression );

        expression = expressionService.getExpression( id );

        assertEquals( expressionB, expression.getExpression() );
        assertEquals( descriptionB, expression.getDescription() );
    }

    @Test
    public void testDeleteExpression()
    {
        Expression exprA = new Expression( expressionA, descriptionA, dataElements );
        Expression exprB = new Expression( expressionB, descriptionB, dataElements );

        int idA = expressionService.addExpression( exprA );
        int idB = expressionService.addExpression( exprB );

        assertNotNull( expressionService.getExpression( idA ) );
        assertNotNull( expressionService.getExpression( idB ) );

        expressionService.deleteExpression( exprA );

        assertNull( expressionService.getExpression( idA ) );
        assertNotNull( expressionService.getExpression( idB ) );

        expressionService.deleteExpression( exprB );

        assertNull( expressionService.getExpression( idA ) );
        assertNull( expressionService.getExpression( idB ) );
    }

    @Test
    public void testGetAllExpressions()
    {
        Expression exprA = new Expression( expressionA, descriptionA, dataElements );
        Expression exprB = new Expression( expressionB, descriptionB, dataElements );

        expressionService.addExpression( exprA );
        expressionService.addExpression( exprB );

        Collection<Expression> expressions = expressionService.getAllExpressions();

        assertTrue( expressions.size() == 2 );
        assertTrue( expressions.contains( exprA ) );
        assertTrue( expressions.contains( exprB ) );
    }
}


text:
Setting Up Your Geospatial Python Environment

1. Installing virtualenv and virtualenvwrapper
1. Installing pyproj and NumPy
1. Installing shapely, matplotlib, and descartes
1. Installing pyshp, geojson, and pandas
1. Installing SciPy, PySAL, and IPython
1. Installing GDAL and OGR
1. Installing GeoDjango and PostgreSQL with PostGIS


text:
dojo.provide("mwe.box2d.CircleEntity");

dojo.require('mwe.box2d.Entity');

dojo.declare("mwe.box2d.CircleEntity", [mwe.box2d.Entity], {
	radius: 1,

    constructor: function(/* Object */args){
        dojo.safeMixin(this, args);
    },
    draw: function(ctx){

      ctx.fillStyle = this.color;
      ctx.beginPath();
      ctx.arc(this.x * SCALE, this.y * SCALE, this.radius * SCALE, 0, Math.PI * 2, true);
      ctx.closePath();
      ctx.fill();

      ctx.strokeStyle = '#000000';
      ctx.beginPath();
      ctx.arc(this.x * SCALE, this.y * SCALE, this.radius * SCALE, 0, Math.PI * 2, true);
      ctx.closePath();
      ctx.stroke();

      this.inherited(arguments);
    }
});


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.github</groupId>
    <artifactId> Mp3-Arranger</artifactId>
    <description>A Simple Mp3 File Arranger</description>
    <packaging>jar</packaging>
    <version>0.1-SNAPSHOT</version>
    <name>mp3 arenger</name>
    <url>https://github.com/iamaamir/Mp3-Arranger</url>
    <licenses>
	<license>
	    <name>Apache License 2.0</name>
	    <url>http://www.apache.org/licenses</url>
	</license>
    </licenses>

    <issueManagement>
	<system>github</system>
	<url>https://github.com/iamaamir/Mp3-Arranger/issues</url>
    </issueManagement>

    <scm>
	<connection>scm:git://github.com/iamaamir/Mp3-Arranger.git</connection>
	<url>https://github.com/iamaamir/Mp3-Arranger</url>
    </scm>

    <properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.mpatric</groupId>
            <artifactId>mp3agic</artifactId>
            <version>0.8.1</version>
        </dependency>
    </dependencies>

    <build>
	<plugins>
	    <!-- disable jar bundling as we use the assembly plugin for that which includes all deps -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
	    <!-- assembles one single runnable jar -->
	    <plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-assembly-plugin</artifactId>
		<version>2.4</version>
		<configuration>
		    <descriptorRefs>
			<descriptorRef>jar-with-dependencies</descriptorRef>
		    </descriptorRefs>
		    <archive>
			<manifest>
			    <mainClass>Mp3Arranger.GUI</mainClass>
			</manifest>
		    </archive>
		</configuration>
		<executions>
		    <execution>
			<phase>install</phase>
			<goals>
			    <goal>single</goal>
			</goals>
		    </execution>
		    <execution>
			<id>pkg</id>
			<phase>package</phase>
			<goals>
			    <goal>single</goal>
			</goals>
		    </execution>
		</executions>
	    </plugin>
	    <plugin>
		<artifactId>maven-compiler-plugin</artifactId>
		<version>3.1</version>
		<configuration>
		    <source>1.7</source>
		    <target>1.7</target>
		</configuration>
	    </plugin>
	</plugins>
    </build>
</project>


text:
<!--

    Copyright 2005-2015 The Kuali Foundation

    Licensed under the Educational Community License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.opensource.org/licenses/ecl2.php

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<?xml version="1.0" encoding="UTF-8"?><!--
  ~ Copyright 2006-2012 The Kuali Foundation
  ~
  ~ Licensed under the Educational Community License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.opensource.org/licenses/ecl2.php
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<spring:beans xmlns="http://www.kuali.org/schema" xmlns:spring="http://www.springframework.org/schema/beans"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.kuali.org/schema http://www.kuali.org/krad/schema.xsd">
  <dataObjectEntry id="Book" parent="Book-parentBean"/>
  <dataObjectEntry abstract="true" dataObjectClass="edu.sampleu.bookstore.bo.Book" id="Book-parentBean"
                   objectLabel="Book" parent="DataObjectEntry" titleAttribute="id">
    <collections>
      <spring:bean parent="CollectionDefinition">
        <spring:property name="elementLabel" value="Author"/>
        <spring:property name="label" value="Authors"/>
        <spring:property name="name" value="authors"/>
        <spring:property name="shortLabel" value="Authors"/>
      </spring:bean>
    </collections>
    <attributes>
      <ref bean="Book-id"/>
      <ref bean="Book-title"/>
      <ref bean="Book-typeCode"/>
      <ref bean="Book-isbn"/>
      <ref bean="Book-publisher"/>
      <ref bean="Book-publicationDate"/>
      <ref bean="Book-price"/>
      <ref bean="Book-rating"/>
      <ref bean="Book-bookType-name"/>
    </attributes>
    <primaryKeys>
      <value>id</value>
    </primaryKeys>
  </dataObjectEntry>
  <attributeDefinition id="Book-id" parent="Book-id-parentBean"/>
  <attributeDefinition abstract="true" description="ID identifying the book." id="Book-id-parentBean" label="Book ID"
                       maxLength="14" name="id" parent="AttributeReferenceDummy-genericSystemId" shortLabel="ID"
                       summary="ID identifying the book.">
    <validChractersConstraint>
      <numericPatternConstraint parent="NumericPatternConstraint"/>
    </validChractersConstraint>
    <control>
      <hiddenControl parent="Uif-HiddenControl"/>
    </control>
  </attributeDefinition>
  <attributeDefinition id="Book-title" parent="Book-title-parentBean"/>
  <attributeDefinition abstract="true" description="Title identifying the book." forceUppercase="false"
                       id="Book-title-parentBean" label="Book Title" maxLength="100" name="title"
                       parent="AttributeDefinition" required="true" shortLabel="Title"
                       summary="Title identifying the book.">
    <validChractersConstraint>
      <spring:bean parent="AnyCharacterPatternConstraint">
        <spring:property name="allowWhitespace" value="true"/>
      </spring:bean>
    </validChractersConstraint>
    <control>
      <textControl parent="Uif-TextControl" size="50"/>
    </control>
  </attributeDefinition>
  <attributeDefinition id="Book-typeCode" parent="Book-typeCode-parentBean"/>
  <attributeDefinition abstract="true" description="Book Type of the book." id="Book-typeCode-parentBean"
                       label="Book Type" name="typeCode" parent="AttributeDefinition" shortLabel="Type"
                       summary="Book Type of the book.">
    <control>
      <selectControl parent="Uif-DropdownControl"/>
    </control>
    <optionFinder>
      <spring:bean class="edu.sampleu.bookstore.document.keyvalue.BookTypeKeyValues"/>
    </optionFinder>
  </attributeDefinition>
  <attributeDefinition id="Book-isbn" parent="Book-isbn-parentBean"/>
  <attributeDefinition abstract="true" description="ISBN of the book." id="Book-isbn-parentBean" label="ISBN"
                       maxLength="24" name="isbn" parent="AttributeDefinition" shortLabel="ISBN"
                       summary="ISBN of the book.">
    <validChractersConstraint>
      <validCharactersConstraint messageKey="error.invalidISBN" parent="ValidCharactersConstraint"
                                 value="^(97(8|9))?\d{9}(\d|X)$"/>
    </validChractersConstraint>
    <control>
      <textControl parent="Uif-TextControl" size="24"/>
    </control>
  </attributeDefinition>
  <attributeDefinition id="Book-publisher" parent="Book-publisher-parentBean"/>
  <attributeDefinition abstract="true" description="Publisher of the book." id="Book-publisher-parentBean"
                       label="Publisher" maxLength="100" name="publisher" parent="AttributeDefinition"
                       shortLabel="Publisher" summary="Publisher of the book.">
    <validChractersConstraint>
      <spring:bean parent="AnyCharacterPatternConstraint">
        <spring:property name="allowWhitespace" value="true"/>
      </spring:bean>
    </validChractersConstraint>
    <control>
      <textControl parent="Uif-TextControl" size="50"/>
    </control>
  </attributeDefinition>
  <attributeDefinition id="Book-publicationDate" parent="Book-publicationDate-parentBean"/>
  <attributeDefinition abstract="true" description="Publication date of the book."
                       formatterClass="org.kuali.rice.core.web.format.DateFormatter"
                       id="Book-publicationDate-parentBean" label="Publication Date" name="publicationDate"
                       parent="AttributeDefinition" shortLabel="Pub Date" summary="Publication date of the book.">
    <control>
      <textControl parent="Uif-DateControl"/>
    </control>
  </attributeDefinition>
  <attributeDefinition id="Book-price" parent="Book-price-parentBean"/>
  <attributeDefinition abstract="true" description="Price of the book." forceUppercase="false"
                       id="Book-price-parentBean" label="Price" maxLength="10" name="price" parent="AttributeDefinition"
                       required="false" shortLabel="Price" summary="Price of the book.">
    <validChractersConstraint>
      <spring:bean parent="FloatingPointPatternConstraint">
        <spring:property name="allowNegative" value="false"/>
      </spring:bean>
    </validChractersConstraint>
    <oldControl>
      <spring:bean parent="CurrencyControlDefinition">
        <spring:property name="formattedMaxLength" value="26"/>
        <spring:property name="size" value="10"/>
      </spring:bean>
    </oldControl>
    <control>
      <textControl parent="Uif-TextControl" size="10"/>
    </control>
  </attributeDefinition>
  <attributeDefinition id="Book-rating" parent="Book-rating-parentBean"/>
  <attributeDefinition abstract="true" description="Rating of the book." forceUppercase="false"
                       id="Book-rating-parentBean" label="Rating" maxLength="2" name="rating"
                       parent="AttributeDefinition" required="false" shortLabel="Rating" summary="Rating of the book.">
    <validChractersConstraint>
      <numericPatternConstraint parent="NumericPatternConstraint"/>
    </validChractersConstraint>
    <control>
      <textControl parent="Uif-TextControl" size="10"/>
    </control>
  </attributeDefinition>
  <attributeDefinition id="Book-bookType-name" parent="Book-bookType-name-parentBean"/>
  <attributeDefinition abstract="true" id="Book-bookType-name-parentBean" label="Book Type" maxLength="100"
                       name="bookType.name" parent="BookType-name" shortLabel="Type">
    <validationPattern>
      <spring:bean parent="AnyCharacterValidationPattern"/>
    </validationPattern>
    <control>
      <textControl parent="Uif-TextControl" size="50"/>
    </control>
  </attributeDefinition>
  <inquiryView dataObjectClassName="edu.sampleu.bookstore.bo.Book" headertext="Book Inquiry" id="Book-InquiryView"
               parent="Uif-InquiryView">
    <items>
      <group headertext="Book Information" layoutManager.numberOfColumns="2" parent="Uif-Disclosure-GridSection">
        <items>
          <inputField parent="Uif-InputField" propertyName="id"/>
          <inputField parent="Uif-InputField" propertyName="title"/>
          <inputField parent="Uif-InputField" propertyName="isbn"/>
          <inputField parent="Uif-InputField" propertyName="bookType.name"/>
          <inputField parent="Uif-InputField" propertyName="price"/>
          <inputField parent="Uif-InputField" propertyName="rating"/>
        </items>
      </group>
      <group headertext="Publishing Information" layoutManager.numberOfColumns="2" parent="Uif-Disclosure-GridSection">
        <items>
          <inputField parent="Uif-InputField" propertyName="publisher"/>
          <inputField parent="Uif-InputField" propertyName="publicationDate"/>
        </items>
      </group>
      <collectionGroup collectionObjectClass="edu.sampleu.bookstore.bo.Author" headertext="Authors"
                       layoutManager.summaryTitle="Author" parent="Uif-Disclosure-StackedCollectionSection"
                       propertyName="authors">
        <items>
          <inputField parent="Uif-InputField" propertyName="authorName"/>
          <inputField parent="Uif-InputField" propertyName="email"/>
          <inputField parent="Uif-InputField" propertyName="phoneNbr"/>
          <inputField parent="Uif-InputField" propertyName="extension.accountNumber"/>
          <inputField parent="Uif-InputField" propertyName="extension.bankName"/>
          <inputField parent="Uif-InputField" propertyName="active"/>
        </items>
        <layoutManager.summaryFields>
          <value>authorName</value>
        </layoutManager.summaryFields>
      </collectionGroup>
    </items>
  </inquiryView>
  <lookupView dataObjectClassName="edu.sampleu.bookstore.bo.Book" headertext="Book Lookup" id="Book-LookupView"
              parent="Uif-LookupView">
    <criteriaFields>
      <lookupInputField parent="Uif-LookupCriteriaInputField" propertyName="title"/>
      <lookupInputField parent="Uif-LookupCriteriaInputField" propertyName="bookType.name"/>
      <lookupInputField parent="Uif-LookupCriteriaInputField" propertyName="isbn"/>
      <lookupInputField parent="Uif-LookupCriteriaInputField" propertyName="publisher"/>
      <lookupInputField parent="Uif-LookupCriteriaInputField" propertyName="publicationDate"/>
      <lookupInputField parent="Uif-LookupCriteriaInputField" propertyName="rating"/>
    </criteriaFields>
    <resultFields>
      <inputField parent="Uif-DataField" propertyName="id"/>
      <inputField parent="Uif-DataField" propertyName="title"/>
      <inputField parent="Uif-DataField" propertyName="bookType.name"/>
      <inputField parent="Uif-DataField" propertyName="isbn"/>
      <inputField parent="Uif-DataField" propertyName="publisher"/>
      <inputField parent="Uif-DataField" propertyName="price"/>
    </resultFields>
  </lookupView>
</spring:beans>


text:
FontManager* FontManager::fontManager = NULL;

FontManager* FontManager::getInstance() {
	if (FontManager::fontManager == NULL)
		FontManager::fontManager = new FontManager();
	return FontManager::fontManager;
}

FontManager::FontManager() {
	fonts = std::vector<Font*>();
}

FontManager::~FontManager() {

}

bool FontManager::addFont(char* name, char* fontFilePath) {
	Font* newFont = new Font(name, fontFilePath);

	if (newFont->isCreated()) {
		fonts.push_back(newFont);
		return true;
	}
	else {
		delete newFont;
		return false;
	}
}

Font* FontManager::getFont(int index) {
	return fonts[index];
}

Font* FontManager::getFont(char* name) {
	for (unsigned int i = 0; i < fonts.size(); i++) {
		if (strcmp(name, fonts[i]->getName()) == 0)
			return fonts[i];
	}
	return NULL;
}

int FontManager::getFontCount() {
	return fonts.size();
}


text:
<TITLE>get_temporary_buffer()</TITLE>
<LINK REL=StyleSheet HREF="../rw.css" TYPE="text/css" TITLE="Rogue Wave Standard Stylesheet">

Rogue Wave C++ Standard Library Reference Guide

get_temporary_buffer()

Module:  Standard C++ Library   Library:  General utilities

Function

Local Index

Summary

Synopsis

Description

See Also

Standards Conformance

Local Index

No Entries

Summary

Function template for efficient allocation of temporary storage.

Synopsis

#include <memory>

namespace std {
  template <class T>
  pair<T*, ptrdiff_t> get_temporary_buffer(ptrdiff_t);

}

Description

Specializations of the <SAMP>get_temporary_buffer()</SAMP> function template attempt to allocate a region of storage sufficiently large to store at least <SAMP>n</SAMP> adjacent objects of type<SAMP> T.</SAMP>

On success, the function returns a pair containing the beginning address of the allocated but uninitialized region of storage and its size in units of <SAMP>sizeof(T))</SAMP>. On failure, the function returns a pair of <SAMP>0</SAMP> values.

It is not specified how the storage is allocated, however, it can be assumed that the function is at least as efficient as allocating the storage dynamically, for example, by calling operator <SAMP>new</SAMP>.

The function is thread-safe but the allocated storage must be returned by a call to <SAMP>return_temporary_buffer()</SAMP> made from the same thread as the one that obtained it.

See Also

allocator, pair, <SAMP>return_temporary_buffer()</SAMP>

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 20.4.3


text:
// Created by Ron 'Maxwolf' McDowell (ron.mcdowell@gmail.com)
// Timestamp 01/03/2016@1:50 AM

using System;
using WolfCurses.Window;
using WolfCurses.Window.Form;
using WolfCurses.Window.Form.Input;

namespace OregonTrailDotNet.Window.Travel.Hunt.Help
{
    /// <summary>
    ///     Shown when the player does not have enough bullets to go hunting, this prevents them from wasting the time of
    ///     loading the game mode just so nothing can happen until it times out. Rather than letting the player suffer from
    ///     that mistake we will just tell them they don't have enough.
    /// </summary>
    [ParentWindow(typeof(Travel))]
    public sealed class NoAmmo : InputForm<TravelInfo>
    {
        /// <summary>
        ///     Initializes a new instance of the <see cref="InputForm{T}" /> class.
        ///     This constructor will be used by the other one
        /// </summary>
        /// <param name="window">The window.</param>
        // ReSharper disable once UnusedMember.Global
        public NoAmmo(IWindow window) : base(window)
        {
        }

        /// <summary>
        ///     Fired when dialog prompt is attached to active game Windows and would like to have a string returned.
        /// </summary>
        /// <returns>
        ///     The dialog prompt text.<see cref="string" />.
        /// </returns>
        protected override string OnDialogPrompt()
        {
            return $"{Environment.NewLine}You need more bullets{Environment.NewLine}" +
                   $"to go hunting.{Environment.NewLine}{Environment.NewLine}";
        }

        /// <summary>
        ///     Fired when the dialog receives favorable input and determines a response based on this. From this method it is
        ///     common to attach another state, or remove the current state based on the response.
        /// </summary>
        /// <param name="reponse">The response the dialog parsed from simulation input buffer.</param>
        protected override void OnDialogResponse(DialogResponse reponse)
        {
            ClearForm();
        }
    }
}