text:
var worker = function(){
	/**
		priorityqueuejs
		https://github.com/janogonzalez/priorityqueuejs
		MIT
	*/

	/**
	 * Initializes a new empty `PriorityQueue` with the given `comparator(a, b)`
	 * function, uses `.DEFAULT_COMPARATOR()` when no function is provided.
	 *
	 * The comparator function must return a positive number when `a > b`, 0 when
	 * `a == b` and a negative number when `a < b`.
	 *
	 * @param {Function}
	 * @return {PriorityQueue}
	 * @api public
	 */
	function PriorityQueue(comparator) {
	  this._comparator = comparator || PriorityQueue.DEFAULT_COMPARATOR;
	  this._elements = [];
	}

	/**
	 * Compares `a` and `b`, when `a > b` it returns a positive number, when
	 * it returns 0 and when `a < b` it returns a negative number.
	 *
	 * @param {String|Number} a
	 * @param {String|Number} b
	 * @return {Number}
	 * @api public
	 */
	PriorityQueue.DEFAULT_COMPARATOR = function(a, b) {
	  if (typeof a === 'number' && typeof b === 'number') {
	    return a - b;
	  } else {
	    a = a.toString();
	    b = b.toString();

	    if (a == b) return 0;

	    return (a > b) ? 1 : -1;
	  }
	};

	/**
	 * Returns whether the priority queue is empty or not.
	 *
	 * @return {Boolean}
	 * @api public
	 */
	PriorityQueue.prototype.isEmpty = function() {
	  return this.size() === 0;
	};

	/**
	 * Peeks at the top element of the priority queue.
	 *
	 * @return {Object}
	 * @throws {Error} when the queue is empty.
	 * @api public
	 */
	PriorityQueue.prototype.peek = function() {
	  if (this.isEmpty()) throw new Error('PriorityQueue is empty');

	  return this._elements[0];
	};

	/**
	 * Dequeues the top element of the priority queue.
	 *
	 * @return {Object}
	 * @throws {Error} when the queue is empty.
	 * @api public
	 */
	PriorityQueue.prototype.deq = function() {
	  var first = this.peek();
	  var last = this._elements.pop();
	  var size = this.size();

	  if (size === 0) return first;

	  this._elements[0] = last;
	  var current = 0;

	  while (current < size) {
	    var largest = current;
	    var left = (2 * current) + 1;
	    var right = (2 * current) + 2;

	    if (left < size && this._compare(left, largest) >= 0) {
	      largest = left;
	    }

	    if (right < size && this._compare(right, largest) >= 0) {
	      largest = right;
	    }

	    if (largest === current) break;

	    this._swap(largest, current);
	    current = largest;
	  }

	  return first;
	};

	/**
	 * Enqueues the `element` at the priority queue and returns its new size.
	 *
	 * @param {Object} element
	 * @return {Number}
	 * @api public
	 */
	PriorityQueue.prototype.enq = function(element) {
	  var size = this._elements.push(element);
	  var current = size - 1;

	  while (current > 0) {
	    var parent = Math.floor((current - 1) / 2);

	    if (this._compare(current, parent) <= 0) break;

	    this._swap(parent, current);
	    current = parent;
	  }

	  return size;
	};

	/**
	 * Returns the size of the priority queue.
	 *
	 * @return {Number}
	 * @api public
	 */
	PriorityQueue.prototype.size = function() {
	  return this._elements.length;
	};

	/**
	 *  Iterates over queue elements
	 *
	 *  @param {Function} fn
	 */
	PriorityQueue.prototype.forEach = function(fn) {
	  return this._elements.forEach(fn);
	};

	/**
	 * Compares the values at position `a` and `b` in the priority queue using its
	 * comparator function.
	 *
	 * @param {Number} a
	 * @param {Number} b
	 * @return {Number}
	 * @api private
	 */
	PriorityQueue.prototype._compare = function(a, b) {
	  return this._comparator(this._elements[a], this._elements[b]);
	};

	/**
	 * Swaps the values at position `a` and `b` in the priority queue.
	 *
	 * @param {Number} a
	 * @param {Number} b
	 * @api private
	 */
	PriorityQueue.prototype._swap = function(a, b) {
	  var aux = this._elements[a];
	  this._elements[a] = this._elements[b];
	  this._elements[b] = aux;
	};

	var JaroWinkler = {
		weight: 0.1,

		get: function(str1, str2){
			str1 = str1.toLowerCase();
			str2 = str2.toLowerCase();

			var jaroDist = this.jaro(str1, str2);

			// count the number of matching characters up to 4
			var matches = 0;
			for(var i = 0; i < 4; i++) {
				if(str1[i]==str2[i])
					matches += 1;
				else
					break;
			}

			return jaroDist + (matches * this.weight * (1 - jaroDist));
		},

		jaro: function(str1, str2){
			if(str1 == str2)
				return 1;
			else if(!str1.length || !str2.length)
				return 0;
			else{
				var matchWindow = Math.max(0, Math.floor((Math.max(str1.length, str2.length) / 2) - 1)),
					str1Flags = {},
					str2Flags = {},
					matches = 0;

				for(var i = 0; i < str1.length; i++){
					var start = i > matchWindow ? i - matchWindow : 0,
						end = i + matchWindow < str2.length ? i + matchWindow : str2.length - 1;

					for(var j = start; j < end + 1; j++){
						if(!str2Flags[j] && str2[j] == str1[i]){
							str1Flags[i] = str2Flags[j] = true;
							matches++;
							break;
						}
					}
				}

				if(!matches){
					return 0;
				}
				else{
					var transpositions = 0,
						str2Offset = 0;

					for(var i = 0; i < str1.length; i++){
						if(str1Flags[i]){
							for(var j = str2Offset; j < str2.length; j++){
								if(str2Flags[j]){
									str2Offset = j + 1;
									break;
								}
							}
							if(str1[i] != str2[j])
								transpositions += 1;
						}
					}

					transpositions /= 2;

					return ((matches / str1.length) + (matches / str2.length) + ((matches - transpositions) / matches)) / 3;
				}
			}
		}
	}

	var _items;

	self.addEventListener('message', function(e) {
	  var data = e.data;
	  switch (data.cmd) {
	    case 'setData':
	      _items = data.items;
	      break;
	    case 'search':
	      var results = runSearch(data.searchTerms, _items, data.opts)
	      self.postMessage({ threadID: data.threadID, results: results })
	      break;
	    case 'stop':
	      self.postMessage('stopped');
	      self.close();
	      break;
	  	default:
	  	  break;
	  };
	}, false);

	function runSearch(searchTerms, items, opts){
		var queue = new PriorityQueue(function(a,b) { return b.dist - a.dist }),
			results = [],
			minDist = 0,
			cache = {};

		for(var i = 0; i < items.length; i++){
			var item = items[i],
				totalDist = 0,
				flagged = {};

			for(var j = 0; j < searchTerms.length; j++){
				var searchTerm = searchTerms[j],
					maxDist = 0,
					flagPos;

				cache[searchTerm] = cache[searchTerm] || {}

				for(var k = 0; k < item._searchValues.length; k++){
					var searchValue = item._searchValues[k],
						curDist;

					if(searchTerm == searchValue){
						if(!flagged[j]){
							flagPos = j;
							maxDist = 1.1
							break;
						}
					}
					else if(cache[searchTerm][searchValue])
						curDist = cache[searchTerm][searchValue]
					else
						curDist = cache[searchTerm][searchValue] = JaroWinkler.get(searchTerm, searchValue)

					if(curDist > maxDist && (!flagged[j] || curDist > flagged[j])){
						flagPos = j;
						maxDist = curDist;
					}
				}

				flagged[flagPos] = maxDist;
				totalDist += maxDist;
			}

			if(queue.size() < opts.maxItems){
				if(totalDist < minDist)
					minDist = totalDist;
				queue.enq({ item: item, dist: totalDist })
			}
			else if(totalDist > minDist){
				queue.deq()
				minDist = queue.peek().dist;
				queue.enq({ item: item, dist: totalDist })
			}
		}

		while(queue.size()){
			var _res = queue.deq();
			_res.item._score = _res.dist;
			results.unshift(_res.item)
		}

		return results;
	}
}

module.exports = worker;


text:
Spring 2016, Timothy Middelkoop, Ph.D.

## First Week

Introduction, syllabus, expectations, and overview of R.

 * Download and install R https://cran.rstudio.com/
  * Direct link for windows 64 bit https://cran.rstudio.com/bin/windows/base/R-3.2.3-win.exe
 * Download and install RStudio http://www.rstudio.com/products/rstudio/download/
  * Direct link for windows 64 bit https://download1.rstudio.org/RStudio-0.99.491.exe
 * Optional Download and install Git support https://git-scm.com/downloads
  * Direct link for windows 64 bit https://github.com/git-for-windows/git/releases/download/v2.7.0.windows.1/Git-2.7.0-64-bit.exe . When installing and on the "Adjusting your PATH Environment" screen select "Use Git from the Windows Command Prompt"
  * In Windows select Tools -> Global Options -> Git/SVN -> Git Execututable.  If it does not show "C:/Program Files/Git/bin/git.exe" then push browse and select "This PC -> C: -> Program Files -> Git -> bin -> git" (or git.exe).  Select OK and Apply and restart RStudio.  Use instructions below for Github project
  * In OSX select Tools -> Global Options -> Git/SVN -> Git Execututable (Browse).  Press "Command + Shift + G" and enter "/usr/bin" in the pop up then select git then press Apply and OK The Git Executeable should now read "/usr/bin/git". Press Apply.  Restart Rstudio and install "Developer Tools Software".  Restart RStudio again.  Use instuctions below for Github project.
  * To download/clone in RStudio using git select File > New Project > Version Control > Git and enter "https://github.com/MiddelkoopT/Stats-2016-Spring" in Repository URL.
 * Optional Download and install MikTeX for RStudio PDF support http://miktex.org/download/
  * Direct link for windows 64 bit http://mirrors.ctan.org/systems/win32/miktex/setup/basic-miktex-x64.exe
  * When installing select "Install for anyone on the computer" and select "Letter" paper when asked.

## Using RStudio

 * Download and install the above software, Linux and Mac are supported as well.
 * Obtain a copy of the GitHub project by either downloading the zip (easiest), using the GitHub client (simplest when it works, press "clone in desktop"), or installing Git directly (best, clone inside RStudio).
  * To download/clone in RStudio using git select File > New Project > Version Control > Git and enter "https://github.com/MiddelkoopT/Stats-2016-Spring" in Repository URL.
 * Open RStudio and open the project (File > Open Project) and select Stats-2016-Spring/Stats-2016-Spring.Rproj (Windows will often hide the Rproj)
 * To view a Rmd file push the "Knit HTML" button.  To open it up inside RStudio click the down arrow to the right of "Knit HTML" and select "View in Pane."

## Resources

 * R in data carpentry and software carpentry
    * http://swcarpentry.github.io/r-novice-inflammation/
    * http://swcarpentry.github.io/r-novice-gapminder/
    * http://www.datacarpentry.org/R-ecology/
 * R tutorial/stats http://www.cyclismo.org/tutorial/R/
 * R project introduction http://cran.r-project.org/doc/manuals/R-intro.html

## Notes for Students

 * You are an engineer not a technician.
 * Work smarter not harder

Do's

 * Use units (you are an engineer).
 * Understand everything.
 * Be Precise (sample, population)
 * Think about it yourself first, try it yourself first.
 * Do it yourself the first time. (tables, calculate, then use the function)
 * Ask why.

Don'ts

 * Don't guess.
 * Don't use your calculator.
 * Don't copy and paste.
 * Don't reuse variable names. Just don't.

There are no stupid questions.

There are no proofs, but I expect you to understand where everything comes from (just not necessarily why)

## References

 * "Applied Statistics and Probability for Engineers," 5th Edition By Douglas C. Montgomery and George C. Runger.  March 2010. http://www.wiley.com/WileyCDA/WileyTitle/productCd-EHEP001610,subjectCd-ST23.html
 * "EZ-101 Statistics (EZ-101 Study Keys)," 2nd Edition By Martin Sternstein Ph.D, Barron's Educational Series October 1, 2005. 978-0764129155
 * FE Reference Handbook: http://ncees.org/exams/study-materials/download-fe-supplied-reference-handbook/

## Links
 * RSS Feed for the Gihub Repository: https://github.com/MiddelkoopT/Stats-2016-Spring/commits/master.atom

redpajama_set_name: RedPajamaGithub


text:
import { IDatabaseChanges } from "./IDatabaseChanges";
import { IDisposable } from "../../Types/Contracts";

export interface IConnectableChanges<T extends IDatabaseChanges> extends IDisposable {

    connected: boolean;

    ensureConnectedNow(): Promise<IDatabaseChanges>;

    on(type: "connectionStatus", handler: () => void);
    on(type: "error", handler: (error: Error) => void);

    off(type: "connectionStatus", handler: () => void);
    off(type: "error", handler: (error: Error) => void);
}


text:
MediaAppPageHandler::MediaAppPageHandler(
    chromeos::MediaAppUI* media_app_ui,
    mojo::PendingReceiver<media_app_ui::mojom::PageHandler> receiver)
    : receiver_(this, std::move(receiver)), media_app_ui_(media_app_ui) {}

MediaAppPageHandler::~MediaAppPageHandler() = default;

void MediaAppPageHandler::OpenFeedbackDialog(
    OpenFeedbackDialogCallback callback) {
  auto error_message = media_app_ui_->delegate()->OpenFeedbackDialog();
  std::move(callback).Run(std::move(error_message));
}


text:
package org.apache.hadoop.hive.ql.optimizer.topnkey;

import java.util.Collections;
import java.util.List;
import java.util.Stack;

import org.apache.hadoop.hive.ql.exec.Operator;
import org.apache.hadoop.hive.ql.exec.OperatorFactory;
import org.apache.hadoop.hive.ql.exec.ReduceSinkOperator;
import org.apache.hadoop.hive.ql.exec.RowSchema;
import org.apache.hadoop.hive.ql.exec.TopNKeyOperator;
import org.apache.hadoop.hive.ql.lib.Node;
import org.apache.hadoop.hive.ql.lib.SemanticNodeProcessor;
import org.apache.hadoop.hive.ql.lib.NodeProcessorCtx;
import org.apache.hadoop.hive.ql.parse.SemanticException;
import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;
import org.apache.hadoop.hive.ql.plan.OperatorDesc;
import org.apache.hadoop.hive.ql.plan.ReduceSinkDesc;
import org.apache.hadoop.hive.ql.plan.TopNKeyDesc;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * TopNKeyProcessor is a processor for TopNKeyOperator.
 * A TopNKeyOperator will be placed before any ReduceSinkOperator which has a topN property >= 0.
 */
public class TopNKeyProcessor implements SemanticNodeProcessor {
  private static final Logger LOG = LoggerFactory.getLogger(TopNKeyProcessor.class);
  private float efficiencyThreshold;
  private long checkEfficiencyNumBatches;
  private int maxTopNAllowed;
  private int maxNumberOfPartitions;

  public TopNKeyProcessor() {
  }

  public TopNKeyProcessor(int maxTopNAllowed, float efficiencyThreshold, long checkEfficiencyNumBatches, int maxNumberOfPartitions) {
    this.maxTopNAllowed = maxTopNAllowed;
    this.efficiencyThreshold = efficiencyThreshold;
    this.checkEfficiencyNumBatches = checkEfficiencyNumBatches;
    this.maxNumberOfPartitions = maxNumberOfPartitions;
  }

  @Override
  public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
                        Object... nodeOutputs) throws SemanticException {

    // Get ReduceSinkOperator
    ReduceSinkOperator reduceSinkOperator = (ReduceSinkOperator) nd;
    ReduceSinkDesc reduceSinkDesc = reduceSinkOperator.getConf();

    // Check whether the reduce sink operator contains top n
    if (reduceSinkDesc.getTopN() < 0 || !reduceSinkDesc.isOrdering()) {
      return null;
    }

    if (reduceSinkDesc.getTopN() > maxTopNAllowed) {
      return null;
    }

    // Check whether there already is a top n key operator
    Operator<? extends OperatorDesc> parentOperator = reduceSinkOperator.getParentOperators().get(0);
    if (parentOperator instanceof TopNKeyOperator) {
      return null;
    }

    List<ExprNodeDesc> partitionCols = Collections.emptyList();
    if (reduceSinkDesc.isPTFReduceSink()) {
      // All keys are partition keys or no keys at all
      // Note: partition cols are prefix of key cols
      if (reduceSinkDesc.getPartitionCols().size() >= reduceSinkDesc.getKeyCols().size()) {
        return null;
      }

      partitionCols = reduceSinkDesc.getPartitionCols();
    }

    TopNKeyDesc topNKeyDesc = new TopNKeyDesc(reduceSinkDesc.getTopN(), reduceSinkDesc.getOrder(),
    reduceSinkDesc.getNullOrder(), reduceSinkDesc.getKeyCols(), partitionCols,
      efficiencyThreshold, checkEfficiencyNumBatches, maxNumberOfPartitions);

    copyDown(reduceSinkOperator, topNKeyDesc);
    reduceSinkDesc.setTopN(-1);
    return null;
  }

  public static Operator<? extends OperatorDesc> copyDown(Operator<? extends OperatorDesc> child, OperatorDesc operatorDesc) {
    final List<Operator<? extends OperatorDesc>> parents = child.getParentOperators();

    final Operator<? extends OperatorDesc> newOperator =
        OperatorFactory.getAndMakeChild(
            child.getCompilationOpContext(), operatorDesc,
            new RowSchema(parents.get(0).getSchema()), child.getParentOperators());

    newOperator.getChildOperators().add(child);

    for (Operator<? extends OperatorDesc> parent : parents) {
      parent.removeChild(child);
    }
    child.getParentOperators().clear();
    child.getParentOperators().add(newOperator);

    return newOperator;
  }
}


text:
<?php
namespace App\View\Helper;

use Cake\View\Helper;

class AdminBreadcrumbHelper extends Helper
{
	public $helpers = ['Html'];

    public function breadcrumb()
    {
		$breadcrumb = $this->Html->link(__('Home',true),'/admin', ['class' => 'breadcrumb-item']);

		if ($this->request->controller !== 'Home') {
			if ($this->request->action !== 'index') {
				$breadcrumb .= $this->Html->link(__($this->request->controller,true),'/admin/'.$this->request->controller, ['class' => 'breadcrumb-item']);
				$breadcrumb .= $this->Html->link(__($this->request->action,true),'/admin/'.$this->request->action, ['class' => 'breadcrumb-item active']);
			} else {
				$breadcrumb .= $this->Html->link(__($this->request->controller,true),'/admin/'.$this->request->controller, ['class' => 'breadcrumb-item active']);
			}

		}

		return $breadcrumb;
    }
}


text:
thank you for submitting art!
Back to ERR Artist Collective


text:
package com.giyeok.jparser

import com.giyeok.jparser.utils.UnicodeUtil
import com.giyeok.jparser.Inputs.CharsGrouping

import scala.collection.immutable.ListSet

object Symbols {

    sealed trait Symbol {
        val id: Int = Symbol.getId(this)
    }

    object Symbol {
        private var symbolsMap: Map[Symbol, Int] = Map()
        private var counter = 0

        def getId(sp: Symbol): Int = {
            symbolsMap get sp match {
                case Some(i) => i
                case None =>
                    counter += 1
                    symbolsMap += ((sp, counter))
                    counter
            }
        }
    }

    // AtomicSymbol은 매칭이 되거나/안되거나 - 한 번 lift된 symbolProgress에서 derive가 되거나 하는 일은 생기지 않음
    sealed trait AtomicSymbol extends Symbol

    sealed trait Terminal extends AtomicSymbol {
        def accept(input: Inputs.Input): Boolean

        def acceptTermGroup(termGroup: Inputs.TermGroupDesc): Boolean
    }

    object Terminals {

        import Inputs._

        sealed trait CharacterTerminal extends Terminal

        sealed trait VirtualTerminal extends Terminal

        case object Any extends Terminal {
            def accept(input: Input) = true

            def acceptTermGroup(termGroup: TermGroupDesc) = true
        }

        case object AnyChar extends CharacterTerminal {
            def accept(input: Input): Boolean = input match {
                case Character(_) => true
                case _ => false
            }

            def acceptTermGroup(termGroup: TermGroupDesc): Boolean = termGroup match {
                case _: CharacterTermGroupDesc => true
                case _ => false
            }
        }

        case class ExactChar(char: Char) extends CharacterTerminal {
            override val hashCode: Int = char.hashCode

            def accept(input: Input): Boolean = input match {
                case Character(c) if char == c => true
                case _ => false
            }

            def acceptTermGroup(termGroup: TermGroupDesc): Boolean = {
                assert(!termGroup.isEmpty)
                termGroup match {
                    case CharsGroup(baseUnicodeCategories, excludingChars, additionalChars) if baseUnicodeCategories.isEmpty && excludingChars.isEmpty && (additionalChars == Set(char)) =>
                        true
                    case group: CharacterTermGroupDesc =>
                        assert({
                            val intersect = group intersect CharsGroup(Set(), Set(), Set(char))
                            intersect.isEmpty || intersect == group
                        })
                        false
                    case _: VirtualTermGroupDesc => false
                }
            }
        }

        case class Chars(chars: Set[Char]) extends CharacterTerminal {
            override val hashCode: Int = chars.hashCode

            def accept(input: Input): Boolean = input match {
                case Character(c) if chars contains c => true
                case _ => false
            }

            def acceptTermGroup(termGroup: TermGroupDesc): Boolean = {
                assert(!termGroup.isEmpty)
                termGroup match {
                    case CharsGroup(baseUnicodeCategories, excludingChars, additionalChars) if baseUnicodeCategories.isEmpty && excludingChars.isEmpty && (additionalChars subsetOf chars) =>
                        // 사실 subsetOf일 필요도 없고 additionalChars contains chars.head 로만 해도 상관 없음
                        true
                    case group: CharacterTermGroupDesc =>
                        assert({
                            val intersect = group intersect CharsGroup(Set(), Set(), chars)
                            intersect.isEmpty || intersect == group
                        })
                        false
                    case _: VirtualTermGroupDesc => false
                }

            }
        }

        case class Unicode(categories: Set[Int]) extends CharacterTerminal {
            override val hashCode: Int = categories.hashCode

            def accept(input: Input): Boolean =
                input match {
                    case Character(c) if categories contains c.getType => true
                    case _ => false
                }

            def acceptTermGroup(termGroup: TermGroupDesc): Boolean = {
                assert(!termGroup.isEmpty)
                termGroup match {
                    case CharsGroup(baseUnicodeCategories, excludingChars, additionalChars) if (baseUnicodeCategories subsetOf categories) && (additionalChars forall {
                        categories contains _.getType
                    }) =>
                        true
                    case group: CharacterTermGroupDesc =>
                        assert({
                            val intersect = group intersect CharsGroup(categories, Set(), Set())
                            intersect.isEmpty || intersect == group
                        })
                        false
                    case _: VirtualTermGroupDesc => false
                }
            }
        }

        case class ExactVirtual(name: String) extends VirtualTerminal {
            def accept(input: Input): Boolean = input match {
                case Virtual(n) if n == name => true
                case _ => false
            }

            def acceptTermGroup(termGroup: TermGroupDesc): Boolean = {
                assert(!termGroup.isEmpty)
                termGroup match {
                    case VirtualsGroup(virtualNames) if virtualNames == Set(name) => true
                    case VirtualsGroup(virtualNames) if virtualNames contains name => throw new AssertionError("Invalid AbstractInput")
                    case _ => false
                }
            }
        }

        case class Virtuals(names: Set[String]) extends VirtualTerminal {
            override val hashCode: Int = names.hashCode

            def accept(input: Input): Boolean = input match {
                case Virtual(n) if names contains n => true
                case _ => false
            }

            def acceptTermGroup(termGroup: TermGroupDesc): Boolean = {
                assert(!termGroup.isEmpty)
                termGroup match {
                    case VirtualsGroup(virtualNames) if virtualNames subsetOf names => true
                    case VirtualsGroup(virtualNames) if (virtualNames intersect names).nonEmpty =>
                        throw new AssertionError("Invalid AbstractInput")
                    case _ => false
                }
            }
        }

        def compare(t1: Terminal, t2: Terminal): Int = (t1, t2) match {
            case (Any, _) => -1
            case (_, Any) => 1
            case (AnyChar, _) => -1
            case (_, AnyChar) => -1
            case (Unicode(c1), Unicode(c2)) => if (c1.min != c2.min) c1.min - c2.min else c1.max - c2.max
            case (Unicode(_), _) => -1
            case (_, Unicode(_)) => 1
            case (ExactChar(c1), ExactChar(c2)) => c1 - c2
            case (Chars(c1), ExactChar(c2)) => c1.min - c2
            case (ExactChar(c1), Chars(c2)) => c1 - c2.min
            case (Chars(c1), Chars(c2)) => if (c1.min != c2.min) c1.min - c2.min else c1.max - c2.max
            case _ => -1
        }
    }

    val Any = Terminals.Any
    val AnyChar = Terminals.AnyChar
    val ExactChar = Terminals.ExactChar
    val Chars = Terminals.Chars
    val Unicode = Terminals.Unicode

    case object Start extends AtomicSymbol

    case class Nonterminal(name: String) extends AtomicSymbol {
        override val hashCode: Int = (classOf[Nonterminal], name).hashCode
    }

    case class Sequence(seq: Seq[AtomicSymbol]) extends Symbol {
        override val hashCode: Int = (classOf[Sequence], seq).hashCode
    }

    def Sequence(elems: AtomicSymbol*): Sequence = Sequence(elems)

    case class OneOf(syms: ListSet[AtomicSymbol]) extends AtomicSymbol {
        override val hashCode: Int = (classOf[OneOf], syms).hashCode
    }

    case class Repeat(sym: AtomicSymbol, lower: Int) extends AtomicSymbol {
        override val hashCode: Int = (classOf[Repeat], sym, lower).hashCode

        val baseSeq: Symbol = if (lower == 1) sym else Sequence((0 until lower) map { _ => sym })
        val repeatSeq = Sequence(Seq(this, sym))
    }

    case class Except(sym: AtomicSymbol, except: AtomicSymbol) extends AtomicSymbol {
        override val hashCode: Int = (classOf[Except], sym, except).hashCode
    }

    sealed trait Lookahead extends AtomicSymbol

    case class LookaheadIs(lookahead: AtomicSymbol) extends Lookahead {
        override val hashCode: Int = (classOf[LookaheadIs], lookahead).hashCode
    }

    case class LookaheadExcept(except: AtomicSymbol) extends Lookahead {
        override val hashCode: Int = (classOf[LookaheadExcept], except).hashCode
    }

    case class Proxy(sym: Symbol) extends AtomicSymbol {
        override val hashCode: Int = (classOf[Proxy], sym).hashCode
    }

    case class Join(sym: AtomicSymbol, join: AtomicSymbol) extends AtomicSymbol {
        assert(sym != join)
        override val hashCode: Int = (classOf[Join], sym, join).hashCode
    }

    case class Longest(sym: AtomicSymbol) extends AtomicSymbol {
        override val hashCode: Int = (classOf[Longest], sym).hashCode
    }

    implicit class ShortStringSymbols(sym: Symbol) {
        // TODO improve short string

        def toShortString: String = sym match {
            case Any => "<any>"
            case AnyChar => "<any>"
            case ExactChar(c) => s"'${UnicodeUtil.toReadable(c)}'"
            case chars: Terminals.Chars => "{" + chars.chars.groupedString + "}"
            case Unicode(c) => s"<unicode ${(c.toSeq.sorted map UnicodeUtil.categoryCodeToName) mkString ", "}>"
            case Start => "<start>"
            case s: Nonterminal => s.name
            case s: Sequence => "seq [" + (s.seq map (_.toShortString) mkString " ") + "]"
            case s: OneOf if s.syms.size == 2 && s.syms.contains(Proxy(Sequence(Seq()))) =>
                s"${(s.syms - Proxy(Sequence(Seq()))).head.toShortString}?"
            case s: OneOf => "{" + (s.syms map (_.toShortString) mkString "|") + "}"
            case Repeat(sym, 0) => s"${sym.toShortString}*"
            case Repeat(sym, 1) => s"${sym.toShortString}+"
            case Repeat(sym, lower) => s"${sym.toShortString}[$lower-]"
            case s: Except => s"${s.sym.toShortString}-${s.except.toShortString}"
            case LookaheadIs(lookahead) => s"la_is ${lookahead.toShortString}"
            case LookaheadExcept(except) => s"la_except ${except.toShortString}"
            case Proxy(sym) => s"(${sym.toShortString})"
            case Join(sym, join) => s"${sym.toShortString}&${join.toShortString}"
            case Longest(sym) => s"<${sym.toShortString}>"
        }
    }

}


text:
package org.workcraft.plugins.dtd.tools;

import org.workcraft.dom.Node;
import org.workcraft.dom.visual.HitMan;
import org.workcraft.dom.visual.VisualModel;
import org.workcraft.utils.DesktopApi;
import org.workcraft.gui.events.GraphEditorMouseEvent;
import org.workcraft.gui.tools.GraphEditor;
import org.workcraft.gui.tools.SelectionTool;
import org.workcraft.plugins.dtd.*;
import org.workcraft.plugins.dtd.utils.DtdUtils;
import org.workcraft.workspace.WorkspaceEntry;

import java.awt.event.MouseEvent;

public class DtdSelectionTool extends SelectionTool {

    private VisualSignal swappingSignal = null;

    public DtdSelectionTool() {
        super(false, false, false, false);
    }

    @Override
    public void setPermissions(final GraphEditor editor) {
        WorkspaceEntry we = editor.getWorkspaceEntry();
        we.setCanModify(true);
        we.setCanSelect(true);
        we.setCanCopy(true);
    }

    @Override
    public void mouseClicked(GraphEditorMouseEvent e) {
        boolean processed = false;
        WorkspaceEntry we = e.getEditor().getWorkspaceEntry();
        VisualDtd dtd = (VisualDtd) e.getModel();
        if ((e.getButton() == MouseEvent.BUTTON1) && (e.getClickCount() > 1)) {
            Node node = HitMan.hitFirstInCurrentLevel(e.getPosition(), dtd);
            if (node instanceof VisualSignal) {
                VisualSignal signal = (VisualSignal) node;
                Signal.State state = getLastState(dtd, signal);
                TransitionEvent.Direction direction = getDesiredDirection(state, e.getKeyModifiers());
                if (direction != null) {
                    we.saveMemento();
                    dtd.appendSignalEvent(signal, direction);
                }
                processed = true;
            }
        }
        if (!processed) {
            super.mouseClicked(e);
        }
    }

    @Override
    public void startDrag(GraphEditorMouseEvent e) {
        GraphEditor editor = e.getEditor();
        VisualModel model = editor.getModel();
        if (e.getButtonModifiers() == MouseEvent.BUTTON1_DOWN_MASK) {
            Node hitNode = HitMan.hitFirstInCurrentLevel(e.getStartPosition(), model);
            if ((swappingSignal == null) && e.isExtendKeyDown() &&
                    (hitNode instanceof VisualSignal) && (model instanceof VisualDtd)) {
                swappingSignal = (VisualSignal) hitNode;
            }
        }
        super.startDrag(e);
    }

    @Override
    public void mouseMoved(GraphEditorMouseEvent e) {
        super.mouseMoved(e);
        GraphEditor editor = e.getEditor();
        VisualModel model = editor.getModel();
        if (swappingSignal != null) {
            if ((e.isExtendKeyDown()) && (e.getButtonModifiers() == MouseEvent.BUTTON1_DOWN_MASK)) {
                Node node = HitMan.hitFirstInCurrentLevel(e.getPosition(), model);
                if (node instanceof VisualSignal) {
                    VisualSignal visualSignal = (VisualSignal) node;
                    double y = visualSignal.getY();
                    visualSignal.setY(swappingSignal.getY());
                    swappingSignal.setY(y);
                }
            } else {
                swappingSignal = null;
            }
        }
    }

    private Signal.State getLastState(VisualDtd dtd, VisualSignal signal) {
        VisualExitEvent exit = signal.getVisualSignalExit();
        VisualEvent event = DtdUtils.getPrevVisualEvent(dtd, exit);
        return DtdUtils.getNextState(event.getReferencedComponent());
    }

    private TransitionEvent.Direction getDesiredDirection(Signal.State state, int mask) {
        if (state == Signal.State.UNSTABLE) {
            switch (mask) {
            case MouseEvent.SHIFT_DOWN_MASK:
                return TransitionEvent.Direction.RISE;
            case MouseEvent.CTRL_DOWN_MASK:
                return TransitionEvent.Direction.FALL;
            default:
                return TransitionEvent.Direction.STABILISE;
            }
        }
        if (state == Signal.State.HIGH) {
            switch (mask) {
            case MouseEvent.SHIFT_DOWN_MASK | MouseEvent.CTRL_DOWN_MASK:
                return TransitionEvent.Direction.DESTABILISE;
            default:
                return TransitionEvent.Direction.FALL;
            }
        }
        if (state == Signal.State.LOW) {
            switch (mask) {
            case MouseEvent.SHIFT_DOWN_MASK | MouseEvent.CTRL_DOWN_MASK:
                return TransitionEvent.Direction.DESTABILISE;
            default:
                return TransitionEvent.Direction.RISE;
            }
        }
        if (state == Signal.State.STABLE) {
            return TransitionEvent.Direction.DESTABILISE;
        }
        return null;
    }

    @Override
    public String getHintText(final GraphEditor editor) {
        return "Double-click on signal to add an event. In unstable state hold Shift to rise, " +
                DesktopApi.getMenuKeyName() + " to fall; in high/low state hold Shift-" +
                DesktopApi.getMenuKeyName() + " to destabilise. Hold Alt/AltGr to swap signals.";
    }

}


text:
require File.expand_path('../../spec_helper', __FILE__)

describe 'Backup Configuration' do

  specify 'Models may be preconfigured' do
    create_config <<-EOS
      preconfigure 'MyModel' do
        archive :archive_a do |archive|
          archive.add '~/test_data/dir_a'
        end
        compress_with Gzip
      end
    EOS

    create_model :my_backup, <<-EOS
      MyModel.new(:my_backup, 'a description') do
        archive :archive_b do |archive|
          archive.add '~/test_data/dir_a'
        end
        store_with Local
      end
    EOS

    job = backup_perform :my_backup

    expect( job.package.exist? ).to be_true
    expect( job.package ).to match_manifest(%q[
      - my_backup/archives/archive_a.tar.gz
      - my_backup/archives/archive_b.tar.gz
    ])
  end

  specify 'Command line path options may be set in config.rb' do
    alt_config_path = BackupSpec::ALT_CONFIG_PATH
    config_file = File.join(alt_config_path, 'my_config.rb')

    create_config <<-EOS, config_file
      root_path BackupSpec::ALT_CONFIG_PATH
      tmp_path 'my_tmp'
    EOS

    create_model :my_backup, <<-EOS, config_file
      Model.new(:my_backup, 'a description') do
        archive :my_archive do |archive|
          archive.add '~/test_data/dir_a'
        end
        store_with Local
      end
    EOS

    # path to config.rb and models is set on the command line
    job = backup_perform :my_backup, '--config-file', config_file

    expect( job.package.exist? ).to be_true
    expect( job.package ).to match_manifest(%q[
      - my_backup/archives/my_archive.tar
    ])

    # without setting root_path in config.rb,
    # these would still be based on the default root_path (~/Backup)
    expect( Backup::Config.tmp_path ).to eq(
      File.join(alt_config_path, 'my_tmp')
    )
    expect( Backup::Config.data_path ).to eq(
      File.join(alt_config_path, Backup::Config::DEFAULTS[:data_path])
    )
  end

end


text:
import React from 'react';
import { connect } from 'react-redux';
import { IntlProvider, addLocaleData } from 'react-intl';
import en from 'react-intl/locale-data/en';
import es from 'react-intl/locale-data/es';
import ru from 'react-intl/locale-data/ru';
import fr from 'react-intl/locale-data/fr';
import it from 'react-intl/locale-data/it';
import ko from 'react-intl/locale-data/ko';
import zh from 'react-intl/locale-data/zh';
import pl from 'react-intl/locale-data/pl';
import ja from 'react-intl/locale-data/ja';
import { DEFAULT_LANGUAGE } from 'app/client_config';
import tt from 'counterpart';

addLocaleData([...en, ...es, ...ru, ...fr, ...it, ...ko, ...zh, ...pl, ...ja]);

tt.registerTranslations('en', require('counterpart/locales/en'));
tt.registerTranslations('en', require('app/locales/en.json'));

tt.registerTranslations('es', require('app/locales/counterpart/es'));
tt.registerTranslations('es', require('app/locales/es.json'));

tt.registerTranslations('ru', require('counterpart/locales/ru'));
tt.registerTranslations('ru', require('app/locales/ru.json'));

tt.registerTranslations('fr', require('app/locales/counterpart/fr'));
tt.registerTranslations('fr', require('app/locales/fr.json'));

tt.registerTranslations('it', require('app/locales/counterpart/it'));
tt.registerTranslations('it', require('app/locales/it.json'));

tt.registerTranslations('ko', require('app/locales/counterpart/ko'));
tt.registerTranslations('ko', require('app/locales/ko.json'));

tt.registerTranslations('zh', require('app/locales/counterpart/zh'));
tt.registerTranslations('zh', require('app/locales/zh.json'));

tt.registerTranslations('pl', require('app/locales/counterpart/pl'));
tt.registerTranslations('pl', require('app/locales/pl.json'));

tt.registerTranslations('ja', require('app/locales/counterpart/ja'));
tt.registerTranslations('ja', require('app/locales/ja.json'));

if (process.env.NODE_ENV === 'production') {
    tt.setFallbackLocale('en');
}

class Translator extends React.Component {
    render() {
        const language = this.props.locale;
        tt.setLocale(language);
        return (
            <IntlProvider
                // to ensure dynamic language change, "key" property with same "locale" info must be added
                // see: https://github.com/yahoo/react-intl/wiki/Components#multiple-intl-contexts
                key={language}
                locale={language}
                defaultLocale={DEFAULT_LANGUAGE}
            >
                {this.props.children}
            </IntlProvider>
        );
    }
}

export default connect((state, ownProps) => {
    const locale = state.app.getIn(['user_preferences', 'locale']);
    return { ...ownProps, locale };
})(Translator);

export const FormattedHTMLMessage = ({ id, params, className }) => (
    <div
        className={'FormattedHTMLMessage' + (className ? ` ${className}` : '')}
        dangerouslySetInnerHTML={{ __html: tt(id, params) }}
    />
);


text:
var socket = new SockJS('/ws');
var keymap = require('./keymap');
var canvas = document.getElementById('canvas-screen');
var context = canvas.getContext('2d');

var shifting = false;
var ctrling = false;
var alting = false;

function send(event, data) {
  var payload = {
    event: event,
    data: data
  };

  socket.send(JSON.stringify(payload));
}

function qemukey(keycode) {
  var mapping = keymap[keycode];
  if (!mapping) return null;

  if (mapping == 'shift') {
    shifting = true;
    return null;
  } else if (mapping == 'ctrl') {
    ctrling = true;
    return null;
  } else if (mapping == 'alt') {
    alting = true;
    return null;
  }

  var prefix = '';
  if (shifting) prefix += 'shift-';
  if (ctrling) prefix += 'ctrl-';
  if (alting) prefix += 'alt-';

  return prefix + mapping;
}

$('#canvas-screen').mousedown(function(e) {
  e.preventDefault();
  var offset = $(this).offset();
  var x = (e.pageX - offset.left).toFixed(0);
  var y = (e.pageY - offset.top).toFixed(0);
  var button = e.which;
  if (button == 3) button = 4;

  var data = {
    x: x,
    y: y,
    button: button
  };

  send('pointer', data);
});

$('#canvas-screen').mouseup(function(e) {
  e.preventDefault();
  var offset = $(this).offset();
  var x = (e.pageX - offset.left).toFixed(0);
  var y = (e.pageY - offset.top).toFixed(0);

  var data = {
    x: x,
    y: y,
    button: 0
  };

  send('pointer', data);
});

$('#canvas-screen').mousemove(function(e) {
  e.preventDefault();
  var offset = $(this).offset();
  var x = (e.pageX - offset.left).toFixed(0);
  var y = (e.pageY - offset.top).toFixed(0);
  var button = e.which;
  if (button == 3) button = 4;

  var data = {
    x: x,
    y: y,
    button: button
  };

  send('pointer', data);
});

$(document).keydown(function(e) {
  e.preventDefault();
  var key = qemukey(e.which);
  if (key) send('key', key);
});

$(document).keyup(function(e) {
  var keycode = e.which;
  var mapping = keymap[keycode];

  if (mapping == 'shift') {
    shifting = false;
  } else if (mapping == 'ctrl') {
    ctrling = false;
  } else if (mapping == 'alt') {
    alting = false;
  }
});

function handleFrameUpdate(data) {
  var frame = data.frame;
  var image = context.createImageData(data.width, data.height);

  for (var s = 0, d = 0, len = data.width * data.height * 4; d < len; ++d) {
    if (d % 4 == 3) {
      image.data[d] = 0xff;
    } else {
      image.data[d] = frame[s];
      ++s;
    }
  }

  context.putImageData(image, data.x, data.y);
}

socket.onmessage = function(e) {
  var payload = JSON.parse(e.data);

  switch (payload.event) {
    case 'count':
      $('#online-count').text(payload.data.count);
      break;
    case 'frame':
        handleFrameUpdate(payload.data);
      break;
    default:
  }
};

var x = canvas.width / 2;
var y = canvas.height / 2;

context.font = '30pt Tahoma';
context.textAlign = 'center';
context.fillStyle = 'black';
context.fillText('Loading screen...', x, y);


text:
/* draw.h */
/* http://sfml-dev.org/tutorials/1.6/graphics-sprite.php */

/* forward declations */
bool initDraw(int &_argc, char **_argv);
bool loopDraw();
void termDraw();

/* class */
class Draw {
private:
    //void initBar();
protected:
public:
    /* variables */
    unsigned int viewY;
    int sel;
    sf::Font font;
    sf::View view;

    /* main functions */
    Draw();
    void build();
    ~Draw();
    void clean();
    void loop();

    /* other */
    void setText(const char *_text);
    void drawBar();
    void updateBar();
    void setTitle(const char *_title);
    void drawSpr(sf::Sprite *spr);
    void selHMiddle();
    void selVMiddle();
    void selTop();
    void selBottom();
    void selEnd();
    void selBegin();
    void selBeginTop();
    void selBeginBottom();
    void scrollDown();
    void scrollUp();

    /* grid */
    int getWidth();
    int getHeight();

    /* draw */
    void drawAlbums();
    void drawStatus();
} _draw;
Draw *draw;


text:
package org.apache.gobblin.test;

/**
 * Every nth call has a different latency than the default latency
 */
public class NthTimingType implements TimingType {
  private final int n;
  private final long defaultTimeMillis;
  private final long nthTimeMillis;
  private int currentNum;

  public NthTimingType(int n, long defaultTimeMillis, long nthTimeMillis) {
    this.n = n;
    this.defaultTimeMillis = defaultTimeMillis;
    this.nthTimeMillis = nthTimeMillis;
    this.currentNum = 0;
  }

  @Override
  public long nextTimeMillis() {
    currentNum++;
    if (currentNum % n == 0) {
      return nthTimeMillis;
    } else {
      return defaultTimeMillis;
    }
  }
}


text:
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module    : QTreeWidgetItem.hs
    Copyright : (c) David Harley 2010
    Project   : qtHaskell
    Version   : 1.1.4
    Modified  : 2010-09-02 17:02:36

    Warning   : this file is machine generated - do not modify.
--}
-----------------------------------------------------------------------------

module Qtc.Enums.Gui.QTreeWidgetItem (
 QTreeWidgetItemItemType
 , ChildIndicatorPolicy, eShowIndicator, eDontShowIndicator, eDontShowIndicatorWhenChildless
 )
 where

import Qtc.Classes.Base
import Qtc.ClassTypes.Core (QObject, TQObject, qObjectFromPtr)
import Qtc.Core.Base (Qcs, connectSlot, qtc_connectSlot_int, wrapSlotHandler_int)
import Qtc.Enums.Base
import Qtc.Enums.Classes.Core

data CQTreeWidgetItemItemType a = CQTreeWidgetItemItemType a
type QTreeWidgetItemItemType = QEnum(CQTreeWidgetItemItemType Int)

ieQTreeWidgetItemItemType :: Int -> QTreeWidgetItemItemType
ieQTreeWidgetItemItemType x = QEnum (CQTreeWidgetItemItemType x)

instance QEnumC (CQTreeWidgetItemItemType Int) where
 qEnum_toInt (QEnum (CQTreeWidgetItemItemType x)) = x
 qEnum_fromInt x = QEnum (CQTreeWidgetItemItemType x)
 withQEnumResult x
   = do
     ti <- x
     return $ qEnum_fromInt $ fromIntegral ti
 withQEnumListResult x
   = do
     til <- x
     return $ map qEnum_fromInt til

instance Qcs (QObject c -> QTreeWidgetItemItemType -> IO ()) where
 connectSlot _qsig_obj _qsig_nam _qslt_obj _qslt_nam _handler
  = do
    funptr  <- wrapSlotHandler_int slotHandlerWrapper_int
    stptr   <- newStablePtr (Wrap _handler)
    withObjectPtr _qsig_obj $ \cobj_sig ->
      withCWString _qsig_nam $ \cstr_sig ->
      withObjectPtr _qslt_obj $ \cobj_slt ->
      withCWString _qslt_nam $ \cstr_slt ->
      qtc_connectSlot_int cobj_sig cstr_sig cobj_slt cstr_slt (toCFunPtr funptr) (castStablePtrToPtr stptr)
    return ()
  where
    slotHandlerWrapper_int :: Ptr fun -> Ptr () -> Ptr (TQObject c) -> CInt -> IO ()
    slotHandlerWrapper_int funptr stptr qobjptr cint
      = do qobj <- qObjectFromPtr qobjptr
           let hint = fromCInt cint
           if (objectIsNull qobj)
            then do when (stptr/=ptrNull)
                      (freeStablePtr (castPtrToStablePtr stptr))
                    when (funptr/=ptrNull)
                      (freeHaskellFunPtr (castPtrToFunPtr funptr))
            else _handler qobj (qEnum_fromInt hint)
           return ()

instance QeType QTreeWidgetItemItemType where
 eType
  = ieQTreeWidgetItemItemType $ 0
instance QeUserType QTreeWidgetItemItemType where
 eUserType
  = ieQTreeWidgetItemItemType $ 1000

data CChildIndicatorPolicy a = CChildIndicatorPolicy a
type ChildIndicatorPolicy = QEnum(CChildIndicatorPolicy Int)

ieChildIndicatorPolicy :: Int -> ChildIndicatorPolicy
ieChildIndicatorPolicy x = QEnum (CChildIndicatorPolicy x)

instance QEnumC (CChildIndicatorPolicy Int) where
 qEnum_toInt (QEnum (CChildIndicatorPolicy x)) = x
 qEnum_fromInt x = QEnum (CChildIndicatorPolicy x)
 withQEnumResult x
   = do
     ti <- x
     return $ qEnum_fromInt $ fromIntegral ti
 withQEnumListResult x
   = do
     til <- x
     return $ map qEnum_fromInt til

instance Qcs (QObject c -> ChildIndicatorPolicy -> IO ()) where
 connectSlot _qsig_obj _qsig_nam _qslt_obj _qslt_nam _handler
  = do
    funptr  <- wrapSlotHandler_int slotHandlerWrapper_int
    stptr   <- newStablePtr (Wrap _handler)
    withObjectPtr _qsig_obj $ \cobj_sig ->
      withCWString _qsig_nam $ \cstr_sig ->
      withObjectPtr _qslt_obj $ \cobj_slt ->
      withCWString _qslt_nam $ \cstr_slt ->
      qtc_connectSlot_int cobj_sig cstr_sig cobj_slt cstr_slt (toCFunPtr funptr) (castStablePtrToPtr stptr)
    return ()
  where
    slotHandlerWrapper_int :: Ptr fun -> Ptr () -> Ptr (TQObject c) -> CInt -> IO ()
    slotHandlerWrapper_int funptr stptr qobjptr cint
      = do qobj <- qObjectFromPtr qobjptr
           let hint = fromCInt cint
           if (objectIsNull qobj)
            then do when (stptr/=ptrNull)
                      (freeStablePtr (castPtrToStablePtr stptr))
                    when (funptr/=ptrNull)
                      (freeHaskellFunPtr (castPtrToFunPtr funptr))
            else _handler qobj (qEnum_fromInt hint)
           return ()

eShowIndicator :: ChildIndicatorPolicy
eShowIndicator
  = ieChildIndicatorPolicy $ 0
eDontShowIndicator :: ChildIndicatorPolicy
eDontShowIndicator
  = ieChildIndicatorPolicy $ 1
eDontShowIndicatorWhenChildless :: ChildIndicatorPolicy
eDontShowIndicatorWhenChildless
  = ieChildIndicatorPolicy $ 2


text:
const render = require('preact-render-to-string')
const decache = require('decache')
const path = require('path')

const defaultOptions = {
  cache: true,
  doctype: '<!DOCTYPE html>'
}

function clearRequireCache (entries) {
  for (let i = 0; i < entries.length; i += 1) {
    decache(entries[i])
  }
}

function compileLayout (Element, context, options) {
  const layoutPath = path.join(options.layoutPath, options.layout)
  const LayoutElement = require(layoutPath)
  const Layout = LayoutElement.default || LayoutElement

  if (!options.cache) {
    clearRequireCache([options.filename, layoutPath])
  }

  return `${options.doctype}${render(Layout({ children: Element(context) }))}`
}

exports.compile = (template, compileOptions) => (context) => {
  const options = Object.assign(defaultOptions, compileOptions)

  const ViewElement = require(options.filename)
  const Element = ViewElement.default || ViewElement

  if (typeof options.beforeRender === 'function') {
    options.beforeRender()
  }

  if (options.layout) {
    return compileLayout(Element, context, options)
  }

  if (!options.cache) {
    clearRequireCache([options.filename])
  }

  return `${options.doctype}${render(Element(context))}`
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: zh
 * Date: 16-12-14
 * Time: 上午9:53
 */

namespace api\controllers;

use common\models\Advertisement;

class AdsController extends BaseController
{
    public function actionIndex()
    {
        return Advertisement::find()->all();
    }

    public function actionPretty()
    {
        /** @var Advertisement[] $ads */
        $ads = Advertisement::find()->all();
        $pretty_ads = [];
        $name_list = Advertisement::getPositionList();
        foreach ($ads as $ad) {
            $pretty_ads[$ad->position]['name'] = $name_list[$ad->position];
            $pretty_ads[$ad->position]['images'][] = $ad->image;
        }
        return $pretty_ads;
    }
}


text:
/* -*- mode: C++; c-basic-offset: 4; tab-width: 8; -*-
 * vi: set shiftwidth=4 tabstop=8:
 * :indentSize=4:tabSize=8:
 */

#include "gtest/gtest.h"
#include "file_index.h"
#include "intersect.h"
#include <iterator>

TEST(regex_index, does_filter_non_empty_lines)
{
    auto fi = std::make_shared<file_index>("test.txt");
    auto ri = std::make_shared<regex_index>("\\w");
    fi->parse_all(ri);
    ASSERT_GE(ri->size(), 3u);
}

TEST(regex_index, i_flag)
{
    auto fi = std::make_shared<file_index>("test.txt");
    auto ri = std::make_shared<regex_index>("/this is line #10./i");
    fi->parse_all(ri);
    ASSERT_EQ(1u, ri->size());
}

TEST(regex_index, not_flag)
{
    auto fi = std::make_shared<file_index>("test.txt");
    auto ri = std::make_shared<regex_index>("/#/!");
    fi->parse_all(ri);
    ASSERT_GE(ri->size(), 3u);
}

TEST(regex_index, intersect_works)
{
    auto fi = std::make_shared<file_index>("test.txt");

    auto a = std::make_shared<regex_index>("/#/!");
    fi->parse_all(a);

    auto b = std::make_shared<regex_index>("contains");
    fi->parse_all(b);

    lineNum_vector_intersect_vector_t v = { std::make_pair(a->lineNum_vector().begin(), a->lineNum_vector().end()),
					    std::make_pair(b->lineNum_vector().begin(), b->lineNum_vector().end()) };
    lineNum_vector_t s;
    ASSERT_EQ(1u, multiple_set_intersect(v.begin(), v.end(), std::back_insert_iterator<lineNum_vector_t>(s)));
    ASSERT_EQ(1u, s.size());

    auto c = std::make_shared<regex_index>("this does not match anything");
    fi->parse_all(c);
    ASSERT_EQ(0u, c->size());

    v[1] = std::make_pair(c->lineNum_vector().begin(), c->lineNum_vector().end());
    s.clear();
    ASSERT_EQ(0u, multiple_set_intersect(v.begin(), v.end(), std::back_insert_iterator<lineNum_vector_t>(s)));
    ASSERT_EQ(0u, s.size());
}


text:
package ca.ualberta.CMPUT301F13T02.chooseyouradventure.test;

import android.test.AndroidTestCase;
import android.test.RenamingDelegatingContext;
import android.util.Log;

import ca.ualberta.CMPUT301F13T02.chooseyouradventure.Comment;
import ca.ualberta.CMPUT301F13T02.chooseyouradventure.DBHandler;
import ca.ualberta.CMPUT301F13T02.chooseyouradventure.Decision;
import ca.ualberta.CMPUT301F13T02.chooseyouradventure.HandlerException;
import ca.ualberta.CMPUT301F13T02.chooseyouradventure.Page;
import ca.ualberta.CMPUT301F13T02.chooseyouradventure.Story;
import ca.ualberta.CMPUT301F13T02.chooseyouradventure.TextTile;

/* This is the class which enables local storage of stories */

public class TestDBHandler extends AndroidTestCase {

	//Test if the DB Handler actually works
	DBHandler handler;

	public void setUp() {
		handler = new DBHandler(new RenamingDelegatingContext(getContext(), "test"));
	}

	public void testUpdateStory() throws HandlerException {
		//try {
		//Create 2 pages
		Page page1 = new Page();
		page1.addTile(new TextTile("test1"));
		page1.addTile(new TextTile("test2"));
		page1.addComment(new Comment("LOLz I CN HAZ CHEEZBUERGR?", null));

		Page page2 = new Page();
		page2.addTile(new TextTile("test3"));
		page2.addTile(new TextTile("test4"));
		page2.addDecision(new Decision("Go second", page2));
		page2.addDecision(new Decision("Go first", page1));

		//Create story
		Story story1 = new Story();
		story1.setId("testUpdate");
		story1.addPage(page1);
		story1.addPage(page2);
		handler.addStory(story1);

		Page page3 = new Page();
		story1.addPage(page3);
		handler.updateStory(story1);

		//Get same story
		Story story2 = handler.getStory("testUpdate");

		//Compare
		assertTrue(story1.equals(story2));
		//}
		//catch (HandlerException e) {
		//e.printStackTrace();
		//fail();
		//}
	}

	/**
	 * Tests adding a comment to a page
	 * @throws HandlerException
	 */
	public void testAddComment() throws HandlerException {
		//TODO: Implement if a local copy of a comment is not made before
		//this should get called
		Story story = new Story();
		Page p = new Page();
		story.setId("bbbb");
		story.addPage(p);
		handler.addStory(story);
		Comment c = new Comment("The comment", null);
		story.getPages().get(0).addComment(c);

		handler.addComment(story, p, c);
		Story s = handler.getStory("bbbb");
		int l = s.getPages().size();
		assertTrue(l>0);

		Log.d("TestAddComment: ", "aaaaaaaa");

		l = s.getPages().get(0).getComments().size();
		assertTrue(l>0);

		Comment d = s.getPages().get(0).getComments().get(0);
		assertTrue(c.equals(d));

	}

	/**
	 * Tests the updateStory function
	 */
	public void testAddStory() {
		try {
			//Create 2 pages
			Page page1 = new Page();
			page1.addTile(new TextTile("test1"));
			page1.addTile(new TextTile("test2"));

			Page page2 = new Page();
			page2.addTile(new TextTile("test3"));
			page2.addTile(new TextTile("test4"));

			//Create story
			Story story1 = new Story();
			story1.setId("test");
			story1.addPage(page1);
			story1.addPage(page2);
			handler.addStory(story1);

			//Get same story
			Story story2 = handler.getStory(story1.getId());

			//Compare
			assertTrue(story1.equals(story2));
		}
		catch (HandlerException e) {
			e.printStackTrace();
			fail();
		}
	}

	/**
	 * Test the getAllStories method
	 */
	public void testGetAllStories() {
		try {
			handler.getAllStories();
		}
		catch (HandlerException e) {
			e.printStackTrace();
			fail();
		}
	}
}


text:
<resources>

     <dimen name="slidingmenu_offset">300dp</dimen>

    <integer name="num_cols">1</integer>

    <dimen name="padding_small">8dp</dimen>
    <dimen name="padding_medium">16dp</dimen>
    <dimen name="padding_large">16dp</dimen>
    <dimen name="inner_image_width">160dp</dimen>
    <dimen name="inner_image_height">180dp</dimen>
    <dimen name="outer_image_width">165dp</dimen>
    <dimen name="text_size_med">20sp</dimen>
    <dimen name="outer_image_height">185dp</dimen>
    <dimen name="layout_width">165dp</dimen>
    <dimen name="layout_height">185dp</dimen>
    <dimen name="profile_img_width">200dp</dimen>
    <dimen name="profile_img_height">225dp</dimen>
    <dimen name="profile_layout_width">116dp</dimen>
    <dimen name="profile_layout_height">134dp</dimen>
    <dimen name="outer_profile_small_image_width">141dp</dimen>
    <dimen name="outer_profile_small_image_height">169dp</dimen>
    <dimen name="profile_img_small_width">111dp</dimen>
    <dimen name="profile_img_small_height">129dp</dimen>
    <dimen name="margin_top_int_value">40dp</dimen>
    <dimen name="action_bar_height">96dp</dimen>
    <dimen name="action_bar_height_separator">72dp</dimen>
    <dimen name="font_large">22dp</dimen>

</resources>


text:
function [mGal] = nmps22mGal(nmps2)
% Convert acceleration from nanometers per square-second to milligalileos
% Chad A. Greene 2012
mGal = nmps2*1e-4;


text:
      <select data-dojo-attach-point="languageSelect"
        data-dojo-attach-event="onchange: _onLanguageChange"></select>

      ${i18nIso.gemet.concept.searchLabel}
      <input id="${id}_searchText" type="text" size="30" data-dojo-attach-point="searchText">

      ${i18nIso.gemet.searching}

      <button class="gxeButton" data-dojo-attach-point="cancelButton"
        data-dojo-attach-event="onclick: _onCancelClick">${i18nBase.general.cancel}</button>


text:
package io.joynr.accesscontrol.primarykey;

import java.io.Serializable;

import joynr.infrastructure.DacTypes.Role;

/**
 * A key consisting of uid, role
 */
public class UserRoleKey implements Serializable {
    private static final long serialVersionUID = -5375570298012028755L;

    // these constants have to match field names so EhCache ReflectionAttributeExtractor may do it's magic
    public static final String USER_ID = "uid";
    public static final String ROLE = "role";
    private final String uid;
    private final Role role;

    public UserRoleKey(String uid, Role role) {
        this.uid = uid;
        this.role = role;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashcode = 1;
        hashcode = prime * hashcode + ((role == null) ? 0 : role.hashCode());
        hashcode = prime * hashcode + ((uid == null) ? 0 : uid.hashCode());
        return hashcode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        UserRoleKey other = (UserRoleKey) obj;
        if (role == null) {
            if (other.role != null) {
                return false;
            }
        } else if (!role.equals(other.role)) {
            return false;
        }
        if (uid == null) {
            if (other.uid != null) {
                return false;
            }
        } else if (!uid.equals(other.uid)) {
            return false;
        }
        return true;
    }
}


text:
---
uid: SolidEdgeDraft.BlockLabelOriginLocationConstants.igBlockLabelUnderRight
summary: Block Label Position Under Right
remarks:
---


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.08.09 at 09:22:32 PM IST
//

package com.pacificmetrics.ims.apip.qti.item;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *                 The OutcomeCondition complexType is the container for the sequence of outcome conditions to be applied. The condition is structured as an 'If..ElseIf..ElseIf..Else' sequence. Each clause as its own outcome rule construct.
 *
 *
 *
Java class for OutcomeCondition.Type complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="OutcomeCondition.Type">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}outcomeIf"/>
 *         <element ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}outcomeElseIf" maxOccurs="unbounded" minOccurs="0"/>
 *         <element ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}outcomeElse" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "OutcomeCondition.Type", propOrder = {
    "outcomeIf",
    "outcomeElseIves",
    "outcomeElse"
})
@XmlRootElement(name = "outcomeCondition")
public class OutcomeCondition {

    @XmlElement(required = true)
    protected OutcomeIfType outcomeIf;
    @XmlElement(name = "outcomeElseIf")
    protected List<OutcomeIfType> outcomeElseIves;
    protected OutcomeElse outcomeElse;

    /**
     * Gets the value of the outcomeIf property.
     *
     * @return
     *     possible object is
     *     {@link OutcomeIfType }
     *
     */
    public OutcomeIfType getOutcomeIf() {
        return outcomeIf;
    }

    /**
     * Sets the value of the outcomeIf property.
     *
     * @param value
     *     allowed object is
     *     {@link OutcomeIfType }
     *
     */
    public void setOutcomeIf(OutcomeIfType value) {
        this.outcomeIf = value;
    }

    /**
     * Gets the value of the outcomeElseIves property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the outcomeElseIves property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getOutcomeElseIves().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link OutcomeIfType }
     *
     *
     */
    public List<OutcomeIfType> getOutcomeElseIves() {
        if (outcomeElseIves == null) {
            outcomeElseIves = new ArrayList<OutcomeIfType>();
        }
        return this.outcomeElseIves;
    }

    /**
     * Gets the value of the outcomeElse property.
     *
     * @return
     *     possible object is
     *     {@link OutcomeElse }
     *
     */
    public OutcomeElse getOutcomeElse() {
        return outcomeElse;
    }

    /**
     * Sets the value of the outcomeElse property.
     *
     * @param value
     *     allowed object is
     *     {@link OutcomeElse }
     *
     */
    public void setOutcomeElse(OutcomeElse value) {
        this.outcomeElse = value;
    }

}


text:
package org.cinchapi.concourse.server;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Set;

import org.cinchapi.concourse.Constants;
import org.cinchapi.concourse.annotate.NonPreference;
import org.cinchapi.concourse.config.ConcourseConfiguration;
import org.cinchapi.concourse.server.io.FileSystem;
import org.cinchapi.concourse.util.Networking;

import ch.qos.logback.classic.Level;

import com.google.common.base.Throwables;
import com.google.common.collect.Sets;

/**
 * Contains configuration and state that must be accessible to various parts of
 * the Server.
 *
 * @author Jeff Nelson
 */
public final class GlobalState extends Constants {
    // ========================================================================
    // =========================== SYSTEM METADATA ============================
    /**
     * A flag to indicate if the program is running from Eclipse. This flag has
     * a value of {@code true} if the JVM is launched with the
     * {@code -Declipse=true} flag.
     */
    private static final boolean RUNNING_FROM_ECLIPSE = System
            .getProperty("eclipse") != null
            && System.getProperty("eclipse").equals("true") ? true : false;

    // ========================================================================
    // ============================ PREFERENCES ================================
    /*
     * INSTRUCTIONS FOR ADDING CONFIGURATION PREFERENCES
     * 1. Create the appropriately named static variable and assigned it a
     * default value.
     * 2. Find the PREF READING BLOCK and attempt to read the value from the
     * prefs file, while supplying the variable you made in Step 1 as the
     * defaultValue.
     * 3. Add a placeholder for the new preference to the stock concourse.prefs
     * file in conf/concourse.prefs.
     */

    /**
     * The absolute path to the directory where the Database record and index
     * files are stored. For optimal performance, the Database should be
     * placed on a separate disk partition (ideally a separate physical device)
     * from the buffer_directory.
     */
    public static String DATABASE_DIRECTORY = System.getProperty("user.home")
            + File.separator + "concourse" + File.separator + "db";

    /**
     * The absolute path to the directory where the Buffer data is stored.
     * For optimal write performance, the Buffer should be placed on a
     * separate disk partition (ideally a separate physical device) from
     * the database_directory.
     */
    public static String BUFFER_DIRECTORY = System.getProperty("user.home")
            + File.separator + "concourse" + File.separator + "buffer";

    /**
     * The size for each page in the Buffer. During reads, Buffer pages
     * are individually locked, so it is desirable to have several smaller
     * pages as opposed to few larger ones. Nevertheless, be sure to balance
     * the desire to maximize lock granularity with the risks of having too
     * many open buffer files simultaneously.
     */
    public static int BUFFER_PAGE_SIZE = 8192;

    /**
     * The listener port (1-65535) for client connections. Choose a port between
     * 49152 and 65535 to minimize the possibility of conflicts with other
     * services on this host.
     */
    public static int CLIENT_PORT = 1717;

    /**
     * The port on which the ShutdownRunner listens. Choose a port between
     * 49152 and 65535 to minimize the possibility of conflicts with other
     * services on this host.
     */
    public static int SHUTDOWN_PORT = 3434;

    /**
     * The listener port (1-65535) for management connections via JMX. Choose a
     * port between 49152 and 65535 to minimize the possibility of conflicts
     * with other services on this host.
     */
    public static int JMX_PORT = 9010;

    /**
     * The amount of memory that is allocated to the Concourse Server JVM.
     * Concourse requires a minimum heap size of 256MB to start, but much
     * more is recommended to ensure that read and write operations avoid
     * expensive disk seeks where possible. Concourse generally sets both
     * the initial and maximum heap sizes to the specified value, so there
     * must be enough system memory available for Concourse Server to start.
     */
    public static long HEAP_SIZE = 1024 * 1024 * 1024; // NOTE: This is handled
                                                       // by Tanuki before the
                                                       // server starts

    /**
     * The listener port (1-65535) for HTTP/S connections. Choose a
     * port between 49152 and 65535 to minimize the possibility of conflicts
     * with other services on this host. A value of 0 indicates that the
     * Concourse HTTP Server is disabled.
     */
    public static int HTTP_PORT = 0;

    /**
     * The default environment that is automatically loaded when the server
     * starts and is used whenever a client does not specify an environment for
     * its connection.
     */
    public static String DEFAULT_ENVIRONMENT = "default";

    /**
     *

     * The amount of runtime information logged by the system. The options below
     * are listed from least to most verbose. In addition to the indicated types
     * of information, each level also logs the information for each less
     * verbose level (i.e. ERROR only prints error messages, but INFO prints
     * info, warn and error messages).
     *

     *

     *

     *
ERROR: critical information when the system reaches
     * a potentially fatal state and may not operate normally.

     *
WARN: useful information when the system reaches a
     * less than ideal state but can continue to operate normally.

     *
INFO: status information about the system that can
     * be used for sanity checking.

     *
DEBUG: detailed information about the system that
     * can be used to diagnose bugs.

     *

     *

     *

     * Logging is important, but may cause performance degradation. Only use the
     * DEBUG level for staging environments or instances when detailed
     * information to diagnose a bug. Otherwise use the WARN or INFO levels.
     *

     */
    public static Level LOG_LEVEL = Level.INFO;

    /**
     * Whether log messages should also be printed to the console.
     */
    public static boolean ENABLE_CONSOLE_LOGGING = RUNNING_FROM_ECLIPSE ? true
            : false;

    static {
        ConcourseConfiguration config;
        try {
            String devPrefs = "conf" + File.separator + "concourse.prefs.dev";
            String defaultPrefs = "conf" + File.separator + "concourse.prefs";
            if(FileSystem.hasFile(devPrefs)) {
                config = ConcourseConfiguration.loadConfig(devPrefs);
            }
            else {
                config = ConcourseConfiguration.loadConfig(defaultPrefs);
            }
        }
        catch (Exception e) {
            config = null;
        }
        if(config != null) {
            // =================== PREF READING BLOCK ====================
            DATABASE_DIRECTORY = config.getString("database_directory",
                    DATABASE_DIRECTORY);

            BUFFER_DIRECTORY = config.getString("buffer_directory",
                    BUFFER_DIRECTORY);

            BUFFER_PAGE_SIZE = (int) config.getSize("buffer_page_size",
                    BUFFER_PAGE_SIZE);

            CLIENT_PORT = config.getInt("client_port", CLIENT_PORT);

            SHUTDOWN_PORT = config.getInt("shutdown_port",
                    Networking.getCompanionPort(CLIENT_PORT, 2));

            JMX_PORT = config.getInt("jmx_port", JMX_PORT);

            HEAP_SIZE = config.getSize("heap_size", HEAP_SIZE);

            HTTP_PORT = config.getInt("http_port", HTTP_PORT);

            LOG_LEVEL = Level.valueOf(config.getString("log_level",
                    LOG_LEVEL.toString()));

            ENABLE_CONSOLE_LOGGING = config.getBoolean(
                    "enable_console_logging", ENABLE_CONSOLE_LOGGING);

            DEFAULT_ENVIRONMENT = config.getString("default_environment",
                    DEFAULT_ENVIRONMENT);
            // =================== PREF READING BLOCK ====================
        }
    }

    /**
     * The list of words that are omitted from search indexes to increase speed
     * and improve space efficiency.
     */
    @NonPreference
    public static final Set<String> STOPWORDS = Sets.newHashSet();
    static {
        try {
            BufferedReader reader = new BufferedReader(new FileReader("conf"
                    + File.separator + "stopwords.txt"));
            String line = null;
            while ((line = reader.readLine()) != null) {
                STOPWORDS.add(line);
            }
            reader.close();
        }
        catch (IOException e) {
            throw Throwables.propagate(e);
        }
    }

    /**
     * The file which contains the credentials used by the
     * {@link org.cinchapi.concourse.security.AccessManager}.
     * This file is typically located in the root of the server installation.
     */
    @NonPreference
    public static String ACCESS_FILE = ".access";

    /**
     * The name of the cookie where the HTTP auth token is stored.
     */
    @NonPreference
    public static String HTTP_AUTH_TOKEN_COOKIE = "concoursedb_auth_token";

    /**
     * The name of the attribute where the {@link AccessToken} component of an
     * AuthToken is temporarily stored for each HTTP Request. This information
     * is used for validation after URL rewriting occurs.
     */
    @NonPreference
    public static final String HTTP_ACCESS_TOKEN_ATTRIBUTE = "org.cinchapi.concourse.server.http.AccessTokenAttribute";

    /**
     * The name of the attribute where the environment component of an
     * AuthToken is temporarily stored for each HTTP Request. This information
     * is used for validation after URL rewriting occurs.
     */
    @NonPreference
    public static final String HTTP_ENVIRONMENT_ATTRIBUTE = "org.cinchapi.concourse.server.http.EnvironmentAttribute";

    /**
     * The name of the cookie where the HTTP transaction token is stored.
     */
    @NonPreference
    public static final String HTTP_TRANSACTION_TOKEN_COOKIE = "concoursedb_transaction_token";

    /**
     * The name of the attribute where the transaction token is temporarily
     * stored for each HTTP request.
     */
    @NonPreference
    public static final String HTTP_TRANSACTION_TOKEN_ATTRIBUTE = "org.cinchapi.concourse.server.http.TransactionTokenAttribute";

    // ========================================================================

}


text:
__author__ = "Jwely"

import math
import numpy

class LambOseenVortex:
    def __init__(self, circulation_strength, viscosity):
        """
        Creates a Lamb Oseen vortex
        :param circulation_strength:    The circulation strength of the vortex
        :param viscosity:               The kinematic viscosity in units of (m^2/s)
                                        is about 0.154 for air at room temperature
        :return:
        """

        self.circulation_strength = circulation_strength
        self.viscosity = viscosity
        pass

    def _get_vtheta_by_vthetamax(self, r_array, vtheta_max, core_radius):
        """
        Alternative method to obtain lamb-oseen profile by Vtheta_max
        :param vtheta_max:  the maximum azimuthal velocity
        :param core_radius: the radius of the core in meters!
        """

        a = 1.25643
        rmax = a ** 0.5 * core_radius

        vtheta = vtheta_max * (1 + 1 / (2 * a)) * (rmax / r_array) * (1 - numpy.exp(-a * r_array ** 2 / rmax ** 2))
        return vtheta

    def _get_vtheta_standard(self, r_array, core_radius=None, time=None):
        """
        returns array of vtheta values for input r_array and other parameters. uses
        core_radius input if available, otherwise a time input is required.

        :param r_array:     array of radial points for which to compute vtheta
        :param core_radius: the radius of the core in meters!
        :param time:        the age of the vortex in seconds, or downstream distance / free stream
        """

        gamma = self.circulation_strength

        if core_radius is not None:
            time = core_radius / (4 * self.viscosity)       # compute time
        elif time is not None:
            core_radius = (4 * self.viscosity * time)       # compute core radius
        else:
            raise Exception("must use core_radius or time parameter")

        # find vtheta
        exponent = (-1.0 * (r_array / core_radius) ** 2)
        vtheta = gamma / (2 * math.pi * r_array) * (1 - numpy.exp(exponent))
        return vtheta

    def get_vtheta(self, r_array, vtheta_max=None, core_radius=None, time=None, verbose=True):
        """
        Get the vtheta profile with one of a few input combinations
        1) with vtheta_max and core_radius
        2) with core radius only
        3) with the age of the vortex

        the first option relies upon nothing except the inputs, the second and third options depend
        upon the time variant nature of the vortex and the viscosity and circulation strength attributes
        of the LambOseenVortex instance.

        :param r_array:     array of radial points for which to compute vtheta
        :param vtheta_max:  the maximum azimuthal velocity
        :param core_radius: the radius of the core in meters!
        :param time:        the age of the vortex in seconds, or downstream distance / free stream
        :param verbose:     set to false to suppress information outputs.
        :return:
        """
        if vtheta_max is None:
            vtheta = self._get_vtheta_standard(r_array, core_radius, time)
        elif vtheta_max is not None and core_radius is not None:
            vtheta = self._get_vtheta_by_vthetamax(r_array, vtheta_max, core_radius)
        else:
            raise Exception("Invalid input combination")

        if verbose:
            print("Lamb-Oseen vortex core radius at time {0}s is {1}m".format(time, core_radius))

        return vtheta


text:
#!/bin/sh

#

## This example shows how to invoke mjpg-streamer from the command line

export LD_LIBRARY_PATH="$(pwd)"
#./mjpg_streamer -i "input_uvc.so --help"

./mjpg_streamer -i "./input_uvc.so -q 55" -o "./output_http.so -w ./www"
#./mjpg_streamer -i "./input_uvc.so -d /dev/video0" -i "./input_uvc.so -d /dev/video1" -o "./output_http.so -w ./www"
#valgrind ./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"

#./mjpg_streamer -i "./input_uvc.so" -o "./output_udp.so -p 2001"

## pwd echos the current path you are working at,
## the backticks open a subshell to execute the command pwd first
## the exported variable name configures ldopen() to search a certain
## folder for *.so modules
#export LD_LIBRARY_PATH=`pwd`

## this is the minimum command line to start mjpg-streamer with webpages
## for the input-plugin default parameters are used
#./mjpg_streamer -o "output_http.so -w `pwd`/www"

## to query help for the core:
# ./mjpg_streamer --help

## to query help for the input-plugin "input_uvc.so":
# ./mjpg_streamer --input "input_uvc.so --help"

## to query help for the output-plugin "output_file.so":
# ./mjpg_streamer --output "output_file.so --help"

## to query help for the output-plugin "output_http.so":
# ./mjpg_streamer --output "output_http.so --help"

## to specify a certain device, framerage and resolution for the input plugin:
# ./mjpg_streamer -i "input_uvc.so -d /dev/video2 -r 320x240 -f 10"

## to start both, the http-output-plugin and write to files every 15 second:
# mkdir pics
# ./mjpg_streamer -o "output_http.so -w `pwd`/www" -o "output_file.so -f pics -d 15000"

## to protect the webserver with a username and password (!! can easily get sniffed and decoded, it is just base64 encoded !!)
# ./mjpg-streamer -o "output_http.so -w ./www -c UsErNaMe:SeCrEt"

## If you want to track down errors, use this simple testpicture plugin as input source.
## to use the testpicture input plugin instead of a webcam or folder:
#./mjpg_streamer -i "input_testpicture.so -r 320x240 -d 500" -o "output_http.so -w www"

## The input_file.so plugin watches a folder for new files, it does not matter where
## the JPEG files orginate from. For instance it is possible to grab the desktop and
## store the files to a folder:
# mkdir -p /tmp/input
# while true; do xwd -root | convert - -scale 640 /tmp/input/bla.jpg; sleep 0.5; done &
## Then the files can be read from the folder "/tmp/input" and served via HTTP
# ./mjpg_streamer -i "input_file.so -f /tmp/input -r" -o "output_http.so -w www"

## To upload files to a FTP server (edit the script first)
# ./mjpg_streamer -i input_testpicture.so -o "output_file.so --command plugins/output_file/examples/ftp_upload.sh"

## To create a control only interface useful for controlling the pan/tilt throug
## a webpage while another program streams video/audio, like skype.
#./mjpg_streamer -i "./input_control.so" -o "./output_http.so -w ./www"


text:
<#
.SYNOPSIS
    This script takes care of loading my powershell profile onto the system I am currently working on.
.DESCRIPTION
    See synopsis.
.EXAMPLE
    Add-Profile
#>

function Add-Profile {
    $Username = $Env:USERNAME
    $ProfilePath = "C:\Users\$Username\Documents\playingwithpowershell\profile\cbbps_profile.ps1"
    # Test the Profile Path
    if (-not (Test-Path -Path $ProfilePath)) {
        Throw 'Could not locate the given profile, check your path..'
    }

    if (-not (Test-Path -Path $profile)) {
        New-Item -Path $profile -force
    }
    # Make sure the

    Copy-Item -Path $ProfilePath -Destination $profile -Force
}

Add-Profile


text:
import commondns
import hashlib

dnssec_status = {
    "GETDNS_DNSSEC_SECURE" : 400,
    "GETDNS_DNSSEC_BOGUS" : 401,
    "GETDNS_DNSSEC_INDETERMINATE" : 402,
    "GETDNS_DNSSEC_INSECURE" : 403,
    "GETDNS_DNSSEC_NOT_PERFORMED" : 404
}

def buildOtrFingerprintHostname(jid):
    """
    Build the hostname where the OTR fingerprint should be stored in a
    text record if it has been published. Don't forget, it's always
    possible that the name will not exist.
    """
    parts = jid.split('@')
    hostname  = hashlib.sha224(parts[0]).hexdigest()
    hostname += "._otrfingerprint."
    hostname += parts[1]
    hostname += ".iain.getdnsapi.net"
    return hostname

def lookupOtrFingerprintRecords(hostname):
    """
    TODO: Update
    """
    records = []
    for record, dnssec_valid in commondns.lookupTextRecords(hostname):
        if record[0:7] == "v=otr1 ":
            records.append((record, dnssec_valid))
    return records

def parseOtrFingerprintRecord(value):
    """
    Extract fingerprints from an OTR fingerprint record's value.
    """
    parts = value.split(" ")
    fingerprints = []
    for part in parts:
        if part[0:2] == "f:":
            fingerprints.append(part[2:])
    return fingerprints

def getOtrFingerprints(jid):
    """
    Returns a list of tuples containing OTR fingerprints published in
    DNS for a Jabber ID and whether or not DNSSEC validation was
    successfully performed for each fingerprint.
    """
    hostname = buildOtrFingerprintHostname(jid)
    records = lookupOtrFingerprintRecords(hostname)
    fingerprints = []
    for record, dnssec_valid in records:
        for fingerprint in parseOtrFingerprintRecord(record):
            fingerprints.append((fingerprint, dnssec_valid))
    return fingerprints


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<meta http-equiv="Content-Language" content="pl" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

	<title>Docs For Class Form</title>
	<link rel="stylesheet" type="text/css" href="../media/style.css">

API Doc

Manual

Coyote-F

Todo List

      Packages:

              Coyote-F

                        Files:

				abstract.class.php

			abstract.class.php

			abstract.class.php

			abstract.class.php

			abstract.class.php

			abstract.class.php

			acl.class.php

			array.class.php

			array.helper.php

			atom.class.php

			atom.class.php

			benchmark.class.php

			box.helper.php

			breadcrumb.helper.php

			button.class.php

			cache.class.php

			checkbox.class.php

			checkbox.class.php

			config.class.php

			config.class.php

			confirm_box.php

			context.class.php

			controller.class.php

			core.class.php

			csv.class.php

			db.class.php

			db.class.php

			db.php

			debug.class.php

			debug.php

			default.php

			default.php

			description.class.php

			dispatcher.class.php

			docs.php

			eaccelerator.class.php

			email.class.php

			email.class.php

			equal.class.php

			errors.class.php

			Exception.php

			feed.class.php

			fieldset.class.php

			file.class.php

			file.class.php

			file.class.php

			file.class.php

			FileNotFoundException.php

			filter.class.php

			float.class.php

			foo.php

			form.class.php

			form.helper.php

			forms.class.php

			forms.php

			ftp.class.php

			gpc.class.php

			hash.class.php

			hidden.class.php

			hidden.class.php

			html.helper.php

			image.class.php

			index.php

			index.php

			index.php

			information_box.php

			ini.class.php

			input.class.php

			input.class.php

			input.class.php

			int.class.php

			Kopia time.helper.php

			label.class.php

			lang.class.php

			layout.php

			load.class.php

			loader.php

			log.class.php

			manual.php

			match.class.php

			model.class.php

			mysql.class.php

			nip.class.php

			notempty.class.php

			option.class.php

			option.class.php

			orm.class.php

			output.class.php

			pagination.class.php

			password.class.php

			password.class.php

			pdo.class.php

			php.class.php

			postgres.php

			profiler.class.php

			radio.class.php

			radio.class.php

			regon.class.php

			replace.class.php

			router.class.php

			rss.class.php

			rss.class.php

			select.class.php

			select.class.php

			session.class.php

			sort.helper.php

			sql.helper.php

			string.class.php

			submit.class.php

			submit.class.php

			system.helper.php

			tag.class.php

			test.php

			text.class.php

			text.class.php

			text.helper.php

			textarea.class.php

			textarea.class.php

			time.helper.php

			trigger.class.php

			TriggerException.class.php

			unit_test.class.php

			upload.class.php

			upload.class.php

			url.class.php

			url.helper.php

			validate.class.php

			view.class.php

			xhtml.class.php

			xml.class.php

			xss.class.php

			zip.class.php

            Interfaces:

		    		ICache

	    		IConfig

	    		IContext

	    		IDB

	    		IElement

	    		IFilter

	    		ISession

	    		IValidate

	    		IView

	    		IZip

                  Classes:

		    		Acl

	    		Benchmark

	    		Box

	    		Breadcrumb

	    		Cache

	    		Cache_EAccelerator

	    		Cache_File

	    		Config

	    		ConfigFileNotFoundException

	    		Config_INI

	    		Config_PHP

	    		Config_XML

	    		Context

	    		Controller

	    		Cookie

	    		Core

	    		Db

	    		Db_Abstract

	    		Db_Controller

	    		Db_Mysql

	    		Db_PDO

	    		Db_Profiler

	    		Db_Profiler_Query

	    		Db_Result

	    		Debug

	    		DirNotFoundException

	    		DirNotWriteable

	    		Dispatcher

	    		Element_Abstract

	    		Element_Checkbox

	    		Element_File

	    		Element_Hidden

	    		Element_Option

	    		Element_Password

	    		Element_Radio

	    		Element_Select

	    		Element_Submit

	    		Element_Text

	    		Element_Textarea

	    		Email

	    		Feed

	    		Feed_Abstract

	    		Feed_Atom

	    		Feed_Element_Atom

	    		Feed_Element_Rss

	    		Feed_Rss

	    		FileExistsException

	    		FileNotFoundException

	    		FileSendingFailedException

	    		Filter

	    		Filter_Input

	    		Filter_Replace

	    		Filter_XSS

	    		Foo

	    		Form

	    		Forms

	    		Forms_Controller

	    		Form_Decorator_Abstract

	    		Form_Decorator_Description

	    		Form_Decorator_Errors

	    		Form_Decorator_Fieldset

	    		Form_Decorator_Form

	    		Form_Decorator_Label

	    		Form_Decorator_Tag

	    		Form_Element_Abstract

	    		Form_Element_Button

	    		Form_Element_Checkbox

	    		Form_Element_File

	    		Form_Element_Hash

	    		Form_Element_Hidden

	    		Form_Element_Option

	    		Form_Element_Password

	    		Form_Element_Radio

	    		Form_Element_Select

	    		Form_Element_Submit

	    		Form_Element_Text

	    		Form_Element_Textarea

	    		Ftp

	    		FtpCouldNotConnectException

	    		FtpCouldNotLoginException

	    		Get

	    		Gpc

	    		Html

	    		Image

	    		index

	    		Input

	    		Lang

	    		Lang_Abstract

	    		Lang_Array

	    		Lang_CSV

	    		Load

	    		Loader

	    		Log

	    		Model

	    		Mysql_Result

	    		Orm

	    		Output

	    		Pagination

	    		Pdo_Result

	    		Post

	    		Router

	    		Server

	    		Session

	    		Session_Db

	    		Session_File

	    		Sort

	    		Sql

	    		SQLCouldNotConnectException

	    		SQLCouldNotSelectDbException

	    		SQLQueryException

	    		Sql_Query

	    		Test

	    		Text

	    		Time

	    		Trigger

	    		TriggerException

	    		Unit_test

	    		Upload

	    		Url

	    		Validate

	    		Validate_Abstract

	    		Validate_Email

	    		Validate_Equal

	    		Validate_Float

	    		Validate_Int

	    		Validate_Match

	    		Validate_Nip

	    		Validate_NotEmpty

	    		Validate_Regon

	    		Validate_String

	    		Validate_Upload

	    		Validate_Url

	    		View

	    		View_Config

	    		View_XHTML

	    		Zip

	    		Zip_Gz

	    		Zip_Zip

Class: Form

Source Location: /helper/form.helper.php

Klasa Form

Przegląd klasy

					Class Overview

													| Method Summary | Methods Detail

Helper ulatwiajacy tworzenie znacznikow HTML odpowiadajacych za formularze

			Located in /helper/form.helper.php [line 12]

Methods

button

checkbox

close

day

file

hidden

hour

input

minute

month

open

openMultipart

optgroup

option

password

radio

reset

select

submit

text

textarea

year

[ Top ]

Method Summary

			Class Overview
									    					| Method Summary | Methods Detail

static
											string

					button()
					Generuje znacznik <input type="button">

static
											string

					checkbox()
					Generuje znacznik <input type="checkbox">

static
											string

					close()
					Generuje znacznik zamykajacy </form>

static
											string

					day()
					Generuje znacznik <select> zawierajacy liste dni miesiaca

static
											string

					file()
					Generuje znacznik <input type="file">

static
											string

					hidden()
					Generuje znacznik <input type="hidden">

static
											string

					input()
					Generuje znacznik <input>

static
											string

					minute()
					Generuje znacznik <select> zawierajacy liste minut (1-59)

static
											string

					month()
					Generuje znacznik <select> zawierajacy liste miesiecy

static
											string

					open()
					Generuje znacznik otwierajacy <form>

static
											string

					openMultipart()
					Generuje znacznik otwierajacy <form> z atrybutem enctype

static
											string

					optgroup()
					Generuje znacznik <optgroup>

static
											string

					option()
					Generuje znacznik <option>

static
											string

					password()
					Generuje znacznik <input type="password">

static
											string

					radio()
					Generuje znacznik <input type="radio">

static
											string

					reset()
					Generuje znacznik <input type="reset">

static
											string

					select()
					Generuje znacznik <select>

static
											string

					submit()
					Generuje znacznik <input type="submit">

static
											string

					text()
					Generuje znacznik <input type="text">

static
											string

					textarea()
					Generuje znacznik <textarea>

static
											string

					year()
					Generuje znacznik <select> zawierajacy liste lat

string
										hour()
					Generuje znacznik <select> zawierajacy liste godzin (00-23)

[ Top ]

Methods

			Class Overview
																			| Method Summary | Methods Detail

	static method button  [line 142]

		static string button(
[string
$name = ''], [string
$value = ''], [mixed
$attributes = array()]
)

Generuje znacznik <input type="button">

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola

				mixed

				$attributes:

				 Dodatkowe atrybuty

	API Tags:

    Access:  	public

[ Top ]

	static method checkbox  [line 181]

		static string checkbox(
string
$name, [string
$value = ''], [
$checked = false], [mixed
$attributes = array()]
)

Generuje znacznik <input type="checkbox">

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola

				mixed

				$attributes:

				 Dodatkowe atrybuty

				$checked:

	API Tags:

    Access:  	public

[ Top ]

	static method close  [line 30]

		static string close(
)

Generuje znacznik zamykajacy </form>

	API Tags:

    Access:  	public

[ Top ]

	static method day  [line 356]

		static string day(
[string
$name = 'day'], [mixed|bool
$select = false], [mixed
$attributes = array()]
)

Generuje znacznik <select> zawierajacy liste dni miesiaca

			Parameters:

				string

				$name:

				 Nazwa znacznika HTML

				mixed|bool

				$select:

				 Oznacza pozycje, ktora bedzie domyslnie zaznaczona (atrybut select)

				mixed

				$attributes:

				 Dodatkowe atrybuty dla znacznika

	API Tags:

    Access:  	public

[ Top ]

	static method file  [line 129]

		static string file(
string
$name, [string
$value = ''], [mixed
$attributes = array()]
)

Generuje znacznik <input type="file">

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola

				mixed

				$attributes:

				 Dodatkowe atrybuty

	API Tags:

    Access:  	public

[ Top ]

	static method hidden  [line 103]

		static string hidden(
string
$name, [string
$value = ''], [mixed
$attributes = array()]
)

Generuje znacznik <input type="hidden">

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola

				mixed

				$attributes:

				 Dodatkowe atrybuty

	API Tags:

    Access:  	public

[ Top ]

	static method input  [line 57]

		static string input(
string
$name, [string
$value = ''], [mixed
$attributes = array()]
)

Generuje znacznik <input>

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola

				mixed

				$attributes:

				 Dodatkowe atrybuty

	API Tags:

    Access:  	public

[ Top ]

	static method minute  [line 391]

		static string minute(
[string
$name = 'minute'], [mixed|bool
$select = false], [mixed
$attributes = array()]
)

Generuje znacznik <select> zawierajacy liste minut (1-59)

			Parameters:

				string

				$name:

				 Nazwa znacznika HTML

				mixed|bool

				$select:

				 Oznacza pozycje, ktora bedzie domyslnie zaznaczona (atrybut select)

				mixed

				$attributes:

				 Dodatkowe atrybuty dla znacznika

	API Tags:

    Access:  	public

[ Top ]

	static method month  [line 324]

		static string month(
[string
$name = 'month'], [mixed|bool
$select = false], [mixed
$attributes = array()]
)

Generuje znacznik <select> zawierajacy liste miesiecy

			Parameters:

				string

				$name:

				 Nazwa znacznika HTML

				mixed|bool

				$select:

				 Oznacza pozycje, ktora bedzie domyslnie zaznaczona (atrybut select)

				mixed

				$attributes:

				 Dodatkowe atrybuty dla znacznika

	API Tags:

    Access:  	public

[ Top ]

	static method open  [line 20]

		static string open(
string
$url, [mixed
$attributes = array()]
)

Generuje znacznik otwierajacy <form>

			Parameters:

				string

				$url:

				 Adres do skryptu obslugi formularza

				mixed

				$attributes:

				 Atrybuty dla znacznika HTML

	API Tags:

    Access:  	public

[ Top ]

	static method openMultipart  [line 41]

		static string openMultipart(
string
$url, [mixed
$attributes = array()]
)

Generuje znacznik otwierajacy <form> z atrybutem enctype

			Parameters:

				string

				$url:

				 Adres do skryptu obslugi formularza

				mixed

				$attributes:

				 Atrybuty dla znacznika HTML

	API Tags:

    Access:  	public

[ Top ]

	static method optgroup  [line 282]

		static string optgroup(
mixed
$value
)

Generuje znacznik <optgroup>

			Parameters:

				mixed

				$value:

				 Tablica asocjacyjna

	API Tags:

    Access:  	public

[ Top ]

	static method option  [line 252]

		static string option(
mixed
$value, [mixed|bool
$selected = false], [mixed
$include_key = true], [mixed
$attributes = array()]
)

Generuje znacznik <option>

			Parameters:

				mixed

				$value:

				 Tablica asocjacyjna key => $value

				mixed|bool

				$selected:

				 Nazwa klucza (lub tablica) okreslajacego, ktore pozycje beda domyslnie zaznczone

				mixed

				$include_key:

				 Domyslnie TRUE - oznacza generowanie znacznika z atrybutem value

				mixed

				$attributes:

				 Tablica dodatkowych atrybutow

	API Tags:

    Access:  	public

[ Top ]

	static method password  [line 116]

		static string password(
string
$name, [string
$value = ''], [mixed
$attributes = array()]
)

Generuje znacznik <input type="password">

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola

				mixed

				$attributes:

				 Dodatkowe atrybuty

	API Tags:

    Access:  	public

[ Top ]

	static method radio  [line 198]

		static string radio(
string
$name, [string
$value = ''], [
$checked = false], [mixed
$attributes = array()]
)

Generuje znacznik <input type="radio">

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola

				mixed

				$attributes:

				 Dodatkowe atrybuty

				$checked:

	API Tags:

    Access:  	public

[ Top ]

	static method reset  [line 168]

		static string reset(
[string
$name = 'reset'], [string
$value = ''], [mixed
$attributes = array()]
)

Generuje znacznik <input type="reset">

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola

				mixed

				$attributes:

				 Dodatkowe atrybuty

	API Tags:

    Access:  	public

[ Top ]

	static method select  [line 233]

		static string select(
string
$name, [string
$value = ''], [mixed
$attributes = array()]
)

Generuje znacznik <select>

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola (znacznik <option>)

				mixed

				$attributes:

				 Dodatkowe atrybuty

	API Tags:

    Access:  	public

[ Top ]

	static method submit  [line 155]

		static string submit(
[string
$name = ''], [string
$value = ''], [mixed
$attributes = array()]
)

Generuje znacznik <input type="submit">

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola

				mixed

				$attributes:

				 Dodatkowe atrybuty

	API Tags:

    Access:  	public

[ Top ]

	static method text  [line 81]

		static string text(
string
$name, [string
$value = ''], [mixed
$attributes = array()]
)

Generuje znacznik <input type="text">

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola

				mixed

				$attributes:

				 Dodatkowe atrybuty

	API Tags:

    Access:  	public

[ Top ]

	static method textarea  [line 215]

		static string textarea(
string
$name, [string
$value = ''], [mixed
$attributes = array()]
)

Generuje znacznik <textarea>

			Parameters:

				string

				$name:

				 Nazwa pola

				string

				$value:

				 Wartosc dla pola

				mixed

				$attributes:

				 Dodatkowe atrybuty

	API Tags:

    Access:  	public

[ Top ]

	static method year  [line 302]

		static string year(
[string
$name = 'year'], [mixed|bool
$select = false], [int
$start = 1920], [int
$end = 0], [mixed
$attributes = array()]
)

Generuje znacznik <select> zawierajacy liste lat

			Parameters:

				string

				$name:

				 Nazwa znacznika HTML

				mixed|bool

				$select:

				 Oznacza pozycje, ktora bedzie domyslnie zaznaczona (atrybut select)

				int

				$start:

				 Rok poczatkowy (pierwsza pozycja na liscie)

				int

				$end:

				 Rok koncowy (domyslnie zero - aktualny rok)

				mixed

				$attributes:

				 Dodatkowe atrybuty dla znacznika

	API Tags:

    Access:  	public

[ Top ]

	hour  [line 374]

		string hour(
[string
$name = 'hour'], [mixed|bool
$select = false], [mixed
$attributes = array()]
)

Generuje znacznik <select> zawierajacy liste godzin (00-23)

			Parameters:

				string

				$name:

				 Nazwa znacznika HTML

				mixed|bool

				$select:

				 Oznacza pozycje, ktora bedzie domyslnie zaznaczona (atrybut select)

				mixed

				$attributes:

				 Dodatkowe atrybuty dla znacznika

	API Tags:

    Access:  	public

[ Top ]

		    Documentation generated on Tue, 22 Jun 2010 16:42:58 +0200 by phpDocumentor 1.4.0a2