text:
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using Jabberwocky.Glass.Mvc.Attributes;
using Sitecore.Mvc.Extensions;
using Sitecore.Mvc.Helpers;
using Sitecore.Mvc.Presentation;

namespace Jabberwocky.Glass.Mvc.Util
{
	public class CustomSitecoreHelper : SitecoreHelper
	{
		public CustomSitecoreHelper(HtmlHelper htmlHelper) : base(htmlHelper)
		{
		}

		public override HtmlString FormHandler(string controller, string action)
		{
			if (controller.IsEmptyOrNull())
				controller = GetValueFromCurrentRendering("Controller");
			if (action.IsEmptyOrNull())
				action = GetValueFromCurrentRendering("Controller Action");
			if (controller.IsEmptyOrNull())
				return new HtmlString(string.Empty);

			string str = HtmlHelper.Hidden(ValidateFormHandlerAttribute.FormHandlerControllerHiddenInput, controller).ToString();
			if (!action.IsEmptyOrNull())
				str += HtmlHelper.Hidden(ValidateFormHandlerAttribute.FormHandlerActionHiddenInput, action).ToString();

			return new HtmlString(str);
		}

		protected override Rendering GetRendering(string renderingType, object parameters, params string[] defaultValues)
		{
			Rendering rendering = new Rendering { RenderingType = renderingType };
			int index = 0;
			while (index < defaultValues.Length - 1)
			{
				rendering[defaultValues[index]] = defaultValues[index + 1];
				index += 2;
			}

			// Setup existing parameters from Rendering object in Sitecore (if we can grab the rendering by path or ID)
			if (rendering.RenderingItemPath != null)
			{
				var renderingItem = rendering.RenderingItem;
				if (renderingItem != null)
				{
					rendering.Caching.Cacheable = renderingItem.Caching.Cacheable;
					rendering.Caching.VaryByData = renderingItem.Caching.VaryByData;
					rendering.Caching.VaryByDevice = renderingItem.Caching.VaryByDevice;
					rendering.Caching.VaryByLogin = renderingItem.Caching.VaryByLogin;
					rendering.Caching.VaryByParameters = renderingItem.Caching.VaryByParm;
					rendering.Caching.VaryByQueryString = renderingItem.Caching.VaryByQueryString;
					rendering.Caching.VaryByUser = renderingItem.Caching.VaryByUser;
				}
			}

			// Override any default/existing parameters with those explicitly passed in
			if (parameters != null)
			{
				TypeHelper.GetProperties(parameters).Each(pair => rendering.Properties[pair.Key] = pair.Value.ValueOrDefault(o => o.ToString()));
			}

			return rendering;
		}

		public virtual HtmlString DynamicPlaceholder(string dynamicKey)
		{
			var currentRenderingId = RenderingContext.Current.Rendering.UniqueId;
			return Placeholder(string.Format("{0}_{1}", dynamicKey, currentRenderingId));
		}
	}
}

redpajama_set_name: RedPajamaGithub


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

<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<link rel="stylesheet" href="../../../../boost.css" type="text/css"/>
<link rel="stylesheet" href="ublas.css" type="text/css" />

<title>Boost Basic Linear Algebra</title>

Basic Linear Algebra Library

uBLAS is a C++ template class library that provides BLAS level 1, 2, 3
functionality for dense, packed and sparse matrices. The design and implementation unify mathematical notation via
operator overloading and efficient code generation via expression templates.

Functionality

uBLAS provides templated C++ classes for dense, unit and sparse vectors, dense, identity, triangular, banded,
symmetric, hermitian and sparse matrices. Views into vectors and matrices can be constructed via ranges, slices,
adaptor classes and indirect arrays. The library covers the usual basic linear algebra operations on vectors and matrices: reductions like
different norms, addition and subtraction of vectors and matrices and multiplication with a scalar, inner and outer
products of vectors, matrix vector and matrix matrix products and triangular solver. The glue between containers, views
and expression templated operations is a mostly STL conforming iterator interface.

Documentation

<big>Overview</big>

Rationale

Functionality

Overview of Matrix- and Vector-Types

Overview of Matrix and Vector Operations

Effective uBLAS and further information

Macros and Preprocessor Options

Vector

Vector

Unit Vector

Zero Vector

Scalar Vector

Sparse Vector

Mapped Vector

Compressed Vector

Coordinate Vector

Vector Proxies

Vector Range

Vector Slice

Vector Expressions

Vector Expression

Vector References

Vector Operations

Vector Reductions

Matrix

Matrix

Identity Matrix

Zero Matrix

Scalar Matrix

Triangular Matrix

Triangular Matrix

Triangular Adaptor

Symmetric Matrix

Symmetric Matrix

Symmetric Adaptor

Hermitian Matrix

Hermitian Matrix

Hermitian Adaptor

Banded Matrix

Banded Matrix

Banded Adaptor

Sparse Matrix

Mapped Matrix

Compressed Matrix

Coordinate Matrix

Matrix Proxies

Matrix Row

Matrix Column

Vector Range

Vector Slice

Matrix Range

Matrix Slice

Matrix Expressions

Matrix Expression

Matrix References

Matrix Operations

Matrix Vector Operations

Matrix Matrix Operations

Storage and special containers

Unbounded Array

Bounded Array

Range

Slice

Sparse Storage

Default Standard Map

Map Array

Operations & Functions

Special Products

BLAS

uBLAS Concept definitions

Container Concepts

Vector

Matrix

Expression Concepts

Scalar Expression

Vector Expression

Matrix Expression

Storage Concept

Iterator Concepts

Indexed Bidirectional Iterator

Indexed Random Access Iterator

Indexed Bidirectional Column/Row Iterator

Indexed Random Access Column/Row Iterator

Known limitations:

The implementation assumes a linear memory address model.

Tuning was focussed on dense matrices.

Further Information

Project Location and Download

The latest stable release of uBLAS is part of the Boost libraries.

Documentation and Discussion

Visit the Effective
uBLAS wiki for up to date information and contributions.

There is also an active uBLAS mailing list where uBLAS specific user and
development questions are answered.

uBLAS and Boost Project

There is also an active uBLAS mailing list where uBLAS specific from the
latest uBLAS project code. You can view the Boost
CVS archive directly. You will find the library here. Documentation and test
programs reside here.

Authors and Credits

uBLAS initially was written by Joerg Walter and Mathias Koch. We would like to thank all, which supported and
contributed to the development of this library: David Abrahams, Ed Brey, Fernando Cacciola, Juan Jose Gomez Cadenas,
Beman Dawes, Matt Davies, Bob Fletcher, Kresimir Fresl, Joachim Kessel, Patrick Kowalzick, Toon Knapen, Hendrik Kueck,
John Maddock, Jens Maurer, Alexei Novakov, Gary Powell, Joachim Pyras, Peter Schmitteckert, Jeremy Siek, Markus Steffl,
Michael Stevens, Benedikt Weber, Martin Weiser, Gunter Winkler, Marc Zimmermann, Marco Guazzone, Nasos Iliopoulus, the members of Boost and all others contributors around the world. I promise I will try to add their names to this list.

This library is currently maintained by David Bellot.

Frequently Asked Questions

Q: Should I use uBLAS for new projects?

A: At the time of writing (09/2012) there are a lot of good matrix libraries available, e.g.,
MTL4,
armadillo,
eigen. uBLAS offers a stable, well tested set of vector and
matrix classes, the typical operations for linear algebra and solvers for triangular systems of equations. uBLAS offers
dense, structured and sparse matrices - all using similar interfaces. And finally uBLAS offers good (but not outstanding)
performance. On the other side, the last major improvement of uBLAS was in 2008 and no significant change was committed
since 2009. So one should ask himself some questions to aid the decision: Availability? uBLAS is part of boost
and thus available in many environments. Easy to use? uBLAS is easy to use for simple things, but needs decent
C++ knowledge when you leave the path. Performance? There are faster alternatives. Cutting edge? uBLAS
is more than 10 years old and missed all new stuff from C++11.

Q: I'm running the uBLAS dense vector and matrix benchmarks. Why do I see a significant performance difference
between the native C and library implementations?

A: uBLAS distinguishes debug mode (size and type conformance checks enabled, expression templates disabled) and release
mode (size and type conformance checks disabled, expression templates enabled). Please check, if the preprocessor
symbol NDEBUG of cassert is defined. NDEBUG enables release mode, which in turn
uses expression templates. You can optionally define BOOST_UBLAS_NDEBUG to disable all bounds, structure
and similar checks of uBLAS.

Q: I've written some uBLAS tests, which try to incorrectly assign different matrix types or overrun vector and
matrix dimensions. Why don't I get a compile time or runtime diagnostic?

A: uBLAS distinguishes debug mode (size and type conformance checks enabled, expression templates disabled) and release
mode (size and type conformance checks disabled, expression templates enabled). Please check, if the preprocessor
symbol NDEBUG of cassert is defined. NDEBUG disables debug mode, which is needed
to get size and type conformance checks.

Q: I've written some uBLAS benchmarks to measure the performance of matrix chain multiplications like prod (A,
prod (B, C)) and see a significant performance penalty due to the use of expression templates. How can I disable
expression templates?

A: You do not need to disable expression templates. Please try reintroducing temporaries using either prod
(A, matrix_type (prod (B, C))) or prod (A,
prod<matrix_type > (B, C)).

Copyright (©) 2000-2011 Joerg Walter, Mathias Koch, Gunter Winkler, David Bellot

Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
).


text:
swift-persist
=============

Swift library for persistent storage on iOS and OS X

What is this?
-------------
A helper for easily accessing persistently stored data using a shared Singleton written in Swift. Use it for any kind of data. Check out the [test project][3] for more details on usage.

Installation
-----------------
Possible ways of installation to your project:

 - using [Cocapods][1] (works with CocoaPods 0.36 or newer)

 - copy the [PersistentStorage][2] class directly to your project

###Podfile###

```
pod 'swift-persist', '~> 0.1'
```

###Used technologies###
-----------------

 - iOS >= 7.0
 - swift

  [1]:http://cocoapods.org
  [2]:https://github.com/vasarhelyia/swift-persist/blob/master/PersistentStorage.swift
  [3]:https://github.com/vasarhelyia/swift-persist/tree/master/SwiftStorageTest


text:
package com.cisco.axl.api._8;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for LImeRouteFilterElement complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="LImeRouteFilterElement">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence minOccurs="0">
 *         <element name="name" type="{http://www.cisco.com/AXL/API/8.0}String50" minOccurs="0"/>
 *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="elementType" type="{http://www.cisco.com/AXL/API/8.0}XViprFilterElement" minOccurs="0"/>
 *         <element name="imeRouteFilterGroupName" type="{http://www.cisco.com/AXL/API/8.0}XFkType" minOccurs="0"/>
 *       </sequence>
 *       <attribute name="uuid" type="{http://www.cisco.com/AXL/API/8.0}XUUID" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "LImeRouteFilterElement", propOrder = {
    "name",
    "description",
    "elementType",
    "imeRouteFilterGroupName"
})
public class LImeRouteFilterElement {

    protected String name;
    protected String description;
    protected String elementType;
    protected XFkType imeRouteFilterGroupName;
    @XmlAttribute
    protected String uuid;

    /**
     * Gets the value of the name property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setName(String value) {
        this.name = value;
    }

    /**
     * Gets the value of the description property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the value of the description property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDescription(String value) {
        this.description = value;
    }

    /**
     * Gets the value of the elementType property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getElementType() {
        return elementType;
    }

    /**
     * Sets the value of the elementType property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setElementType(String value) {
        this.elementType = value;
    }

    /**
     * Gets the value of the imeRouteFilterGroupName property.
     *
     * @return
     *     possible object is
     *     {@link XFkType }
     *
     */
    public XFkType getImeRouteFilterGroupName() {
        return imeRouteFilterGroupName;
    }

    /**
     * Sets the value of the imeRouteFilterGroupName property.
     *
     * @param value
     *     allowed object is
     *     {@link XFkType }
     *
     */
    public void setImeRouteFilterGroupName(XFkType value) {
        this.imeRouteFilterGroupName = value;
    }

    /**
     * Gets the value of the uuid property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getUuid() {
        return uuid;
    }

    /**
     * Sets the value of the uuid property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setUuid(String value) {
        this.uuid = value;
    }

}


text:
require 'simplecov'
require 'simplecov-vim/formatter'
require 'codeclimate-test-reporter'
require 'simple_docx_generator'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  CodeClimate::TestReporter::Formatter
]
SimpleCov.start do
  add_filter '/lib/'
end


text:
package client;

import client.graphics.Hud;
import client.states.GameMenu;
import client.states.GamePlay;
import managers.ImageManager;
import sprites.Actor;

import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferStrategy;
import java.awt.image.BufferedImage;
import javax.swing.*;

// Created by Aunmag on 24.09.2016.

public class Application implements Runnable {

    private JFrame frame;
    private Canvas canvas;
    private Robot robot;
    private int width;
    private int height;
    private int screenWidth;
    private int screenHeight;
    private Thread thread;
    private Input input;
    private BufferStrategy bs;
    private Graphics2D g;
    private Graphics2D hud;
    private boolean isFullscreenMode = true;
    private int mouseLastX;

    // Time:
    private double d = 0;
    private long tLast = System.nanoTime();
    private long tPass;
    private long tCurrent;

    public Application() {

        try {
            robot = new Robot();
        } catch (AWTException e) {
            e.printStackTrace();
        }

    }

    private void updateGraphics() {

        bs = canvas.getBufferStrategy();

        Client.setBs(bs);

        hud = (Graphics2D) bs.getDrawGraphics();
        hud.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        hud.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
        hud.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED);
        hud.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED);
        hud.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
        hud.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
        hud.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);

        Client.setHud(hud);

    }

    private void tick() {

        if (!Client.isRunning()) {
            return;
        }

        if (Client.isGamePlay()) {

            if (Client.getMouseX() != mouseLastX) {
                double mouseSpeed = (Client.getMouseX() - mouseLastX) / 3.8;
                Client.getPlayer().setDegrees(Client.getPlayer().getDegrees() + (mouseSpeed % 360));
                int putMouseX = screenWidth / 2;
                int putMouseY = screenHeight / 2;
                robot.mouseMove(putMouseX, putMouseY);
                mouseLastX = width / 2;
            }

            Client.getPlayer().isMovingForward = input.keys[KeyEvent.VK_W];
            Client.getPlayer().isMovingBack = input.keys[KeyEvent.VK_S];
            Client.getPlayer().isMovingLeft = input.keys[KeyEvent.VK_A];
            Client.getPlayer().isMovingRight = input.keys[KeyEvent.VK_D];
            Client.getPlayer().isRunning = input.keys[KeyEvent.VK_SHIFT];
            Client.getPlayer().isAttacking = input.mouseButtons[MouseEvent.BUTTON1];

            if (input.keys[KeyEvent.VK_ADD]) {
                Client.setZoom(Client.getZoom() + Client.getZoom() * 0.01);
            }
            if (input.keys[KeyEvent.VK_SUBTRACT]) {
                Client.setZoom(Client.getZoom() - Client.getZoom() * 0.01);
            }

            GamePlay.tick();
            Client.setPlayerPosition(Client.getPlayer().x, Client.getPlayer().y);
            Client.setPlayerRadians(Client.getPlayer().getRadians());
        } else {
            Client.getGameMenu().tick();
        }

        input.reset();

    }

    private void render() {

        updateGraphics();

//        // DELETE:
//        Client.getG().setColor(Color.BLACK);
//        Client.getG().fillRect(0, 0, width, height);

        if (Client.isGamePlay()) {
            g = (Graphics2D) bs.getDrawGraphics();
            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
            g.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED);
            g.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED);
            g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
            Client.setG(g);
            double zoom = Client.getZoom();
            Client.getG().scale(zoom, zoom);
            double xCenter = width / (zoom * 2);
            double yCenter = (height - 8) / zoom;
            Client.setGX(Client.getPlayer().x - xCenter);
            Client.setGY(Client.getPlayer().y - yCenter);
            Client.getG().rotate(Math.toRadians(-Client.getPlayer().getDegrees() - 90), xCenter, yCenter);
            GamePlay.render();
            Client.getG().dispose();
        } else {
            Client.getGameMenu().render();
        }

        Client.getHud().dispose();
        bs.show();

    }

    // Runnable methods:

    @Override public void run() {

        // Create display:

        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // get display size
        screenWidth = (int) screenSize.getWidth();
        screenHeight = (int) screenSize.getHeight();

        if (isFullscreenMode) {
            width = screenWidth;
            height = screenHeight;
        } else {
            width = 1280;
            height = 720;
        }

        Client.setScreenResolution(width, height);

        frame = new JFrame(Client.getTitle() + " v" + Client.getVersion());
        frame.setSize(width, height);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setResizable(false);
        frame.setUndecorated(true); // disable OS windowed shell
        frame.setLocationRelativeTo(null);
        if (isFullscreenMode) {
            frame.setExtendedState(JFrame.MAXIMIZED_BOTH); // fullscreen mode
        }
        frame.setVisible(true);
        canvas = new Canvas();
        canvas.setPreferredSize(new Dimension(width, height));
        canvas.setMaximumSize(new Dimension(width, height));
        canvas.setMinimumSize(new Dimension(width, height));
        canvas.setFocusable(false);
        frame.add(canvas);
        frame.pack();
        Client.setFrame(frame);
        canvas.createBufferStrategy(2);

        input = new Input(frame, canvas);
        Client.setInput(input);

        updateGraphics();

        Client.setGameMenu(new GameMenu());

        ImageManager.cacheImages();
        Actor.loadSounds();

        while (Client.isRunning()) {
            tCurrent = System.nanoTime();
            tPass = tCurrent - tLast;
            tLast = tCurrent;
            d += tPass / Client.getTTick();
            if (d >= 1) {
                Client.setT(tCurrent);
                Client.setD(d);
                tick();
                render();
                d -= 1;
                if (Client.isPerformanceData()) {
                    Client.tPerformanceAverage.addValue(System.nanoTime() - tCurrent);
                }
            }
        }

        stop();

    }

    public synchronized void start() {

        if (Client.isRunning()) {
            return;
        }

        Client.setIsRunning(true);
        thread = new Thread(this);
        thread.start();

    }

    public synchronized void stop() {

        Client.setIsRunning(false);

        frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));

        try {
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

}


text:
package ru.appliedtech.application.lang;

/**
 * Transforms one object to another (for coding in functional style)
 * @author Igor Pavlenko
 * @param <P>
 * @param <Q>
 */
public interface ITransformer<P, Q>
{
	/**
	 * Transforms one object to another (for functional-style coding)
	 * @param object The source
	 * @return The result.
	 */
	Q transform(P object);
}


text:
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// This file was auto-generated via go generate.
// DO NOT UPDATE MANUALLY

/*
Tidy tidies the Vanadium repository by removing unused envelopes and binaries.

Usage:
   tidy [flags] <command>

The tidy commands are:
   binary      Binary sub-command tidies a specified binaryd
   application Application sub-command tidies a specified applicationd
   help        Display help for commands or topics

The global flags are:
 -alsologtostderr=true
   log to standard error as well as files
 -log_backtrace_at=:0
   when logging hits line file:N, emit a stack trace
 -log_dir=
   if non-empty, write log files to this directory
 -logtostderr=false
   log to standard error instead of files
 -max_stack_buf_size=4292608
   max size in bytes of the buffer to use for logging stack traces
 -metadata=<just specify -metadata to activate>
   Displays metadata for the program and exits.
 -stderrthreshold=2
   logs at or above this threshold go to stderr
 -time=false
   Dump timing information to stderr before exiting the program.
 -v=0
   log level for V logs
 -v23.credentials=
   directory to use for storing security credentials
 -v23.i18n-catalogue=
   18n catalogue files to load, comma separated
 -v23.namespace.root=[/(dev.v.io:r:vprod:service:mounttabled)@ns.dev.v.io:8101]
   local namespace root; can be repeated to provided multiple roots
 -v23.proxy=
   object name of proxy service to use to export services across network
   boundaries
 -v23.tcp.address=
   address to listen on
 -v23.tcp.protocol=wsh
   protocol to listen with
 -v23.vtrace.cache-size=1024
   The number of vtrace traces to store in memory.
 -v23.vtrace.collect-regexp=
   Spans and annotations that match this regular expression will trigger trace
   collection.
 -v23.vtrace.dump-on-shutdown=true
   If true, dump all stored traces on runtime shutdown.
 -v23.vtrace.sample-rate=0
   Rate (from 0.0 to 1.0) to sample vtrace traces.
 -v23.vtrace.v=0
   The verbosity level of the log messages to be captured in traces
 -vmodule=
   comma-separated list of globpattern=N settings for filename-filtered logging
   (without the .go suffix).  E.g. foo/bar/baz.go is matched by patterns baz or
   *az or b* but not by bar/baz or baz.go or az or b.*
 -vpath=
   comma-separated list of regexppattern=N settings for file pathname-filtered
   logging (without the .go suffix).  E.g. foo/bar/baz.go is matched by patterns
   foo/bar/baz or fo.*az or oo/ba or b.z but not by foo/bar/baz.go or fo*az

Tidy binary - Binary sub-command tidies a specified binaryd

Binary sub-command removes all binaries from a specified binaryd that are not
referenced by an applicationd envelope stored in the specified applicationd.

Usage:
   tidy binary [flags] <applicationd> <binaryd>

<applicationd> is the name or endpoint of the applicationd instance sourcing the
envelopes. <binaryd> is the name or endpoint of a binaryd instance to clean up.

Tidy application - Application sub-command tidies a specified applicationd

Application sub-command uses the Tidy RPC to clean up outdated envelopes from
the specified appilcationd. Call this before tidying a binaryd instance for
maximum tidiness.

Usage:
   tidy application [flags] <applicationd>

<applicationd> is the name or endpoint of the applicationd instance to tidy.

Tidy help - Display help for commands or topics

Help with no args displays the usage of the parent command.

Help with args displays the usage of the specified sub-command or help topic.

"help ..." recursively displays help for all commands and topics.

Usage:
   tidy help [flags] [command/topic ...]

[command/topic ...] optionally identifies a specific sub-command or help topic.

The tidy help flags are:
 -style=compact
   The formatting style for help output:
      compact   - Good for compact cmdline output.
      full      - Good for cmdline output, shows all global flags.
      godoc     - Good for godoc processing.
      shortonly - Only output short description.
   Override the default by setting the CMDLINE_STYLE environment variable.
 -width=<terminal width>
   Format output to this target width in runes, or unlimited if width < 0.
   Defaults to the terminal width if available.  Override the default by setting
   the CMDLINE_WIDTH environment variable.
*/
package main


text:
package com.wamdy.com.datascrapt.rule.impl;

import java.util.Collection;

import com.wamdy.com.datascrapt.rule.Rule;

public class MapReadRule<K, V> implements Rule {
    /**
     * 读取记录类型,支持层级对象和Map
     */
    private Class<? extends K> keyClass;
    private Class<? extends V> valueClass;
    /**
     * 读取规则集
     */
    private Collection<Rule> keyRules;
    /**
     * 读取规则集
     */
    private Collection<Rule> valueRules;
    public Class<? extends K> getKeyClass() {
        return keyClass;
    }
    public void setKeyClass(Class<? extends K> keyClass) {
        this.keyClass = keyClass;
    }
    public Class<? extends V> getValueClass() {
        return valueClass;
    }
    public void setValueClass(Class<? extends V> valueClass) {
        this.valueClass = valueClass;
    }

    public Collection<Rule> getKeyRules() {
        return keyRules;
    }

    public void setKeyRules(Collection<Rule> keyRules) {
        this.keyRules = keyRules;
    }

    public Collection<Rule> getValueRules() {
        return valueRules;
    }

    public void setValueRules(Collection<Rule> valueRules) {
        this.valueRules = valueRules;
    }

}


text:
test_description='git merge

Testing pull.* configuration parsing.'

. ./test-lib.sh

test_expect_success 'setup' '
	echo c0 >c0.c &&
	git add c0.c &&
	git commit -m c0 &&
	git tag c0 &&
	echo c1 >c1.c &&
	git add c1.c &&
	git commit -m c1 &&
	git tag c1 &&
	git reset --hard c0 &&
	echo c2 >c2.c &&
	git add c2.c &&
	git commit -m c2 &&
	git tag c2 &&
	git reset --hard c0 &&
	echo c3 >c3.c &&
	git add c3.c &&
	git commit -m c3 &&
	git tag c3
'

test_expect_success 'merge c1 with c2' '
	git reset --hard c1 &&
	test -f c0.c &&
	test -f c1.c &&
	test ! -f c2.c &&
	test ! -f c3.c &&
	git merge c2 &&
	test -f c1.c &&
	test -f c2.c
'

test_expect_success 'fast-forward pull succeeds with "true" in pull.ff' '
	git reset --hard c0 &&
	test_config pull.ff true &&
	git pull . c1 &&
	test "$(git rev-parse HEAD)" = "$(git rev-parse c1)"
'

test_expect_success 'pull.ff=true overrides merge.ff=false' '
	git reset --hard c0 &&
	test_config merge.ff false &&
	test_config pull.ff true &&
	git pull . c1 &&
	test "$(git rev-parse HEAD)" = "$(git rev-parse c1)"
'

test_expect_success 'fast-forward pull creates merge with "false" in pull.ff' '
	git reset --hard c0 &&
	test_config pull.ff false &&
	git pull . c1 &&
	test "$(git rev-parse HEAD^1)" = "$(git rev-parse c0)" &&
	test "$(git rev-parse HEAD^2)" = "$(git rev-parse c1)"
'

test_expect_success 'pull prevents non-fast-forward with "only" in pull.ff' '
	git reset --hard c1 &&
	test_config pull.ff only &&
	test_must_fail git pull . c3
'

test_expect_success 'merge c1 with c2 (ours in pull.twohead)' '
	git reset --hard c1 &&
	git config pull.twohead ours &&
	git merge c2 &&
	test -f c1.c &&
	! test -f c2.c
'

test_expect_success 'merge c1 with c2 and c3 (recursive in pull.octopus)' '
	git reset --hard c1 &&
	git config pull.octopus "recursive" &&
	test_must_fail git merge c2 c3 &&
	test "$(git rev-parse c1)" = "$(git rev-parse HEAD)"
'

test_expect_success 'merge c1 with c2 and c3 (recursive and octopus in pull.octopus)' '
	git reset --hard c1 &&
	git config pull.octopus "recursive octopus" &&
	git merge c2 c3 &&
	test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
	test "$(git rev-parse c1)" = "$(git rev-parse HEAD^1)" &&
	test "$(git rev-parse c2)" = "$(git rev-parse HEAD^2)" &&
	test "$(git rev-parse c3)" = "$(git rev-parse HEAD^3)" &&
	git diff --exit-code &&
	test -f c0.c &&
	test -f c1.c &&
	test -f c2.c &&
	test -f c3.c
'

conflict_count()
{
	{
		git diff-files --name-only
		git ls-files --unmerged
	} | wc -l
}

# c4 - c5
#    \ c6
#
# There are two conflicts here:
#
# 1) Because foo.c is renamed to bar.c, recursive will handle this,
# resolve won't.
#
# 2) One in conflict.c and that will always fail.

test_expect_success 'setup conflicted merge' '
	git reset --hard c0 &&
	echo A >conflict.c &&
	git add conflict.c &&
	echo contents >foo.c &&
	git add foo.c &&
	git commit -m c4 &&
	git tag c4 &&
	echo B >conflict.c &&
	git add conflict.c &&
	git mv foo.c bar.c &&
	git commit -m c5 &&
	git tag c5 &&
	git reset --hard c4 &&
	echo C >conflict.c &&
	git add conflict.c &&
	echo secondline >> foo.c &&
	git add foo.c &&
	git commit -m c6 &&
	git tag c6
'

# First do the merge with resolve and recursive then verify that
# recursive is chosen.

test_expect_success 'merge picks up the best result' '
	git config --unset-all pull.twohead &&
	git reset --hard c5 &&
	test_must_fail git merge -s resolve c6 &&
	resolve_count=$(conflict_count) &&
	git reset --hard c5 &&
	test_must_fail git merge -s recursive c6 &&
	recursive_count=$(conflict_count) &&
	git reset --hard c5 &&
	test_must_fail git merge -s recursive -s resolve c6 &&
	auto_count=$(conflict_count) &&
	test $auto_count = $recursive_count &&
	test $auto_count != $resolve_count
'

test_expect_success 'merge picks up the best result (from config)' '
	git config pull.twohead "recursive resolve" &&
	git reset --hard c5 &&
	test_must_fail git merge -s resolve c6 &&
	resolve_count=$(conflict_count) &&
	git reset --hard c5 &&
	test_must_fail git merge -s recursive c6 &&
	recursive_count=$(conflict_count) &&
	git reset --hard c5 &&
	test_must_fail git merge c6 &&
	auto_count=$(conflict_count) &&
	test $auto_count = $recursive_count &&
	test $auto_count != $resolve_count
'

test_expect_success 'merge errors out on invalid strategy' '
	git config pull.twohead "foobar" &&
	git reset --hard c5 &&
	test_must_fail git merge c6
'

test_expect_success 'merge errors out on invalid strategy' '
	git config --unset-all pull.twohead &&
	git reset --hard c5 &&
	test_must_fail git merge -s "resolve recursive" c6
'

test_done


text:
using System.Windows;
using System.Windows.Controls;
using Sigma.Core.Monitors.Synchronisation;
using Sigma.Core.Monitors.WPF.ViewModel.Parameterisation;
using Sigma.Core.Utils;

namespace Sigma.Core.Monitors.WPF.View.Parameterisation.Defaults
{
	/// <summary>
	/// Sigmas way of displaying objects.
	/// </summary>
	[ParameterVisualiser(typeof(object), Priority = VisualiserPriority.Lower)]
	public partial class SigmaTextBlock
	{
		/// <summary>
		/// The object that is currently being displayed (without updating the displayed information)
		/// </summary>
		protected object _Object;

		/// <summary>
		/// The object that is being displayed (toString is called).
		/// </summary>
		public virtual object Object
		{
			get { return _Object; }
			set
			{
				_Object = value;
				string text = value?.ToString() ?? "null";
				TextBlock.Text = Prefix + text + Postfix;
			}
		}

		/// <summary>
		/// The text that is visualised.
		/// </summary>
		public string Text => TextBlock.Text;

		/// <summary>
		/// This string will be added before the displayed string.
		/// </summary>
		public string Prefix
		{
			get { return (string) GetValue(PrefixProperty); }
			set { SetValue(PrefixProperty, value); }
		}

		public static readonly DependencyProperty PrefixProperty =
			DependencyProperty.Register("Prefix", typeof(string), typeof(SigmaTextBox), new PropertyMetadata(""));

		/// <summary>
		/// This string will be added after the displayed string.
		/// </summary>
		public string Postfix
		{
			get { return (string) GetValue(PostfixProperty); }
			set { SetValue(PostfixProperty, value); }
		}

		public static readonly DependencyProperty PostfixProperty =
			DependencyProperty.Register("Postfix", typeof(string), typeof(SigmaTextBox), new PropertyMetadata(""));

		/// <summary>
		/// The fully resolved key to access the synchandler.
		/// </summary>
		public override string Key { get; set; }

		/// <summary>
		/// The registry for which the visualiser displays values. (e.g. operators registry)
		/// </summary>
		public override IRegistry Registry { get; set; }

		/// <summary>
		/// The SynchronisationHandler that is used to sync the parameter with the training process.
		/// </summary>
		public override ISynchronisationHandler SynchronisationHandler { get; set; }

		/// <summary>
		/// Determines whether the parameter is editable or not.
		/// </summary>
		public override bool IsReadOnly { get; set; } = true;

		/// <summary>
		/// This boolean determines whether there are unsaved changes or not.
		/// <c>True</c> if there are other changes, <c>false</c> otherwise.
		/// </summary>
		public override bool Pending { get; set; }

		/// <summary>
		/// This boolean determines whether a synchronisation erroered or not.
		/// <c>True</c> if there are errors, <c>false</c> otherwise.
		/// </summary>
		public override bool Errored { get; set; }

		/// <summary>
		/// Create a new default textblock that can display parameters (i.e. objects).
		/// </summary>
		public SigmaTextBlock()
		{
			InitializeComponent();

			DataContext = this;
		}

		/// <summary>
		/// Force the visualiser to update its value (i.e. display the value that is stored).
		/// </summary>
		public override void Read()
		{
			SynchronisationHandler.SynchroniseUpdate(Registry, Key, Object, newObj => Dispatcher.Invoke(() => Object = newObj));
		}

		/// <summary>
		/// Force the visualiser to store its value (i.e. write the value that is displayed to the registry).
		/// </summary>
		public override void Write()
		{
			Pending = true;
			SynchronisationHandler.SynchroniseSet(Registry, Key, Object, val => Pending = false, e => Errored = true);
		}
	}
}


text:
@implementation VisitorB

@end


text:
<?php

namespace ProxyManager;

use ProxyManager\Autoloader\AutoloaderInterface;
use ProxyManager\Autoloader\Autoloader;
use ProxyManager\FileLocator\FileLocator;
use ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy;
use ProxyManager\GeneratorStrategy\GeneratorStrategyInterface;
use ProxyManager\Inflector\ClassNameInflectorInterface;
use ProxyManager\Inflector\ClassNameInflector;

/**
 * Base configuration class for the proxy manager - serves as micro disposable DIC/facade
 *
 * @author Marco Pivetta <ocramius@gmail.com>
 * @license MIT
 */
class Configuration
{
    const DEFAULT_PROXY_NAMESPACE = 'ProxyManagerGeneratedProxy';

    /**
     * @var bool
     */
    protected $autoGenerateProxies = true;

    /**
     * @var string|null
     */
    protected $proxiesTargetDir;

    /**
     * @var string
     */
    protected $proxiesNamespace = self::DEFAULT_PROXY_NAMESPACE;

    /**
     * @var \ProxyManager\GeneratorStrategy\GeneratorStrategyInterface|null
     */
    protected $generatorStrategy;

    /**
     * @var callable|null
     */
    protected $proxyAutoloader;

    /**
     * @var \ProxyManager\Inflector\ClassNameInflectorInterface|null
     */
    protected $classNameInflector;

    /**
     * @param bool $autoGenerateProxies
     */
    public function setAutoGenerateProxies($autoGenerateProxies)
    {
        $this->autoGenerateProxies = (bool) $autoGenerateProxies;
    }

    /**
     * @return bool
     */
    public function doesAutoGenerateProxies()
    {
        return $this->autoGenerateProxies;
    }

    /**
     * @param \ProxyManager\Autoloader\AutoloaderInterface $proxyAutoloader
     */
    public function setProxyAutoloader(AutoloaderInterface $proxyAutoloader)
    {
        $this->proxyAutoloader = $proxyAutoloader;
    }

    /**
     * @return \ProxyManager\Autoloader\AutoloaderInterface
     */
    public function getProxyAutoloader()
    {
        if (null === $this->proxyAutoloader) {
            $this->proxyAutoloader = new Autoloader(
                new FileLocator($this->getProxiesTargetDir()),
                $this->getClassNameInflector()
            );
        }

        return $this->proxyAutoloader;
    }

    /**
     * @param string $proxiesNamespace
     */
    public function setProxiesNamespace($proxiesNamespace)
    {
        $this->proxiesNamespace = $proxiesNamespace;
    }

    /**
     * @return string
     */
    public function getProxiesNamespace()
    {
        return $this->proxiesNamespace;
    }

    /**
     * @param string $proxiesTargetDir
     */
    public function setProxiesTargetDir($proxiesTargetDir)
    {
        $this->proxiesTargetDir = (string) $proxiesTargetDir;
    }

    /**
     * @return null|string
     */
    public function getProxiesTargetDir()
    {
        if (null === $this->proxiesTargetDir) {
            $this->proxiesTargetDir = sys_get_temp_dir();
        }

        return $this->proxiesTargetDir;
    }

    /**
     * @param \ProxyManager\GeneratorStrategy\GeneratorStrategyInterface $generatorStrategy
     */
    public function setGeneratorStrategy(GeneratorStrategyInterface $generatorStrategy)
    {
        $this->generatorStrategy = $generatorStrategy;
    }

    /**
     * @return \ProxyManager\GeneratorStrategy\GeneratorStrategyInterface
     */
    public function getGeneratorStrategy()
    {
        if (null === $this->generatorStrategy) {
            $this->generatorStrategy = new FileWriterGeneratorStrategy(new FileLocator($this->getProxiesTargetDir()));
        }

        return $this->generatorStrategy;
    }

    /**
     * @param \ProxyManager\Inflector\ClassNameInflectorInterface $classNameInflector
     */
    public function setClassNameInflector(ClassNameInflectorInterface $classNameInflector)
    {
        $this->classNameInflector = $classNameInflector;
    }

    /**
     * @return \ProxyManager\Inflector\ClassNameInflectorInterface
     */
    public function getClassNameInflector()
    {
        if (null === $this->classNameInflector) {
            $this->classNameInflector = new ClassNameInflector($this->getProxiesNamespace());
        }

        return $this->classNameInflector;
    }
}


text:
module ActionLinkHelper
  def translate_action(klass_or_obj, action)
    i18nk = (klass_or_obj.respond_to?(:model_name) ? klass_or_obj : klass_or_obj.class).model_name.i18n_key
    t("action_links.#{action}", default: :"action_links.models.#{i18nk}.#{action}")
  end

  # Generates a link like "Create Option Set" given a klass
  # options[:js] - if true, the link just points to # with expectation that js will bind to it
  def create_link(klass, options = {})
    href = options[:js] ? "#" : dynamic_path(klass, action: :new)
    link_to(translate_action(klass, :new), href, class: "create_#{klass.model_name.param_key}")
  end

  # returns the html for an action icon using font awesome and the mappings defined in IconHelper
  def action_link(action, href, options = {})
    label = t("actions.#{action}")
    options[:class] = Array.wrap(options[:class])
    options[:class] << "action-link" << "action-link-#{action.to_s.dasherize}"
    options[:class] = options[:class].join(" ")
    options[:title] ||= label

    if options.delete(:label) == false
      link_to(icon_tag(action), href, options)
    else
      link_to(icon_tag(action) << label, href, options)
    end
  end

  # creates a link to a batch operation
  def batch_op_link(options)
    link_to(options[:name], "#", data: options.slice(:path, :confirm), class: "batch-link batch-submit-link")
  end
end


text:
package cz.etnetera.seb.event.impl;

import cz.etnetera.seb.Seb;
import cz.etnetera.seb.event.SebEvent;
import cz.etnetera.seb.listener.SebListener;

public class OnReportEvent extends SebEvent {

	protected String label;

	public OnReportEvent with(String label) {
		this.label = label;
		return this;
	}

	@Override
	protected void notifySpecific(SebListener listener) {
		listener.onReport(this);
	}

	public String getLabel() {
		return label;
	}

	@Override
	protected String generateLabel() {
		return context.getUtils().join(Seb.LABEL_DELIMITER, super.generateLabel(), label);
	}

}


text:
'use strict';

(function () {
    /**
     * @ngdoc provider
     * @name $websocketProvider
     * @module ngWebsocket
     * @description
     * HTML5 WebSocket provider for AngularJS
     */
    function $websocketProvider () {
        var wsp = this;

        wsp.$$config = {
            lazy: false,
            reconnect: true,
            reconnectInterval: 2000,
            mock: false,
            enqueue: false,
            protocols: null
        };

        wsp.$setup = function (cfg) {
            cfg = cfg || {};
            wsp.$$config = angular.extend({}, wsp.$$config, cfg);

            return wsp;
        };

        wsp.$get = ['$http', function ($http) {
            return new $websocketService(wsp.$$config, $http);
        }];
    }

    /**
     * @ngdoc service
     * @name $websocketService
     * @module ngWebsocketService
     * @description
     * HTML5 Websocket service for AngularJS
     */
    function $websocketService (cfg, $http) {
        var wss = this;

        wss.$$websocketList = {};
        wss.$$config = cfg || {};

        wss.$get = function (url) {
            return wss.$$websocketList[url];
        };

        wss.$new = function (cfg) {
            cfg = cfg || {};

            // Url or url + protocols initialization
            if (typeof cfg === 'string') {
                cfg = {url: cfg};

                // url + protocols
                if (arguments.length > 1) {
                    if (typeof arguments[1] === 'string' && arguments[1].length > 0) cfg.protocols = [arguments[1]];
                    else if (typeof arguments[1] === 'object' && arguments[1].length > 0) cfg.protocols = arguments[1];
                }
            }

            // If the websocket already exists, return that instance
            var ws = wss.$get(cfg.url);
            if (typeof ws === 'undefined') {
                var wsCfg = angular.extend({}, wss.$$config, cfg);

                ws = new $websocket(wsCfg, $http);
                wss.$$websocketList[wsCfg.url] = ws;
            }

            return ws;
        };
    }

    /**
     * @ngdoc class
     * @name $websocket
     * @module ngWebsocket
     * @description
     * HTML5 Websocket wrapper class for AngularJS
     */
    function $websocket (cfg, $http) {
        var me = this;

        if (typeof cfg === 'undefined' || (typeof cfg === 'object' && typeof cfg.url === 'undefined')) throw new Error('An url must be specified for WebSocket');

        me.$$eventMap = {};
        me.$$ws = undefined;
        me.$$reconnectTask = undefined;
        me.$$reconnectCopy = true;
        me.$$queue = [];
        me.$$config = {
            url: undefined,
            lazy: false,
            reconnect: true,
            reconnectInterval: 2000,
            enqueue: false,
            mock: false,
            protocols: null
        };

        me.$$fireEvent = function () {
            var args = [];

            Array.prototype.push.apply(args, arguments);

            var event = args.shift(),
                handlers = me.$$eventMap[event];

            if (typeof handlers !== 'undefined') {
                for (var i = 0; i < handlers.length; i++) {
                    if (typeof handlers[i] === 'function') handlers[i].apply(me, args);
                }
            }
        };

        me.$$init = function (cfg) {

            if (cfg.mock) {
                me.$$ws = new $$mockWebsocket(cfg.mock, $http);
            }
            else if (cfg.protocols) {
                me.$$ws = new WebSocket(cfg.url, cfg.protocols);
            }
            else {
                me.$$ws = new WebSocket(cfg.url);
            }

            me.$$ws.onmessage = function (message) {
                try {
                    var decoded = JSON.parse(message.data);
                    me.$$fireEvent(decoded.event, decoded.data);
                    me.$$fireEvent('$message', decoded);
                }
                catch (err) {
                    me.$$fireEvent('$message', message.data);
                }
            };

            me.$$ws.onerror = function (error) {
                me.$$fireEvent('$error', error);
            };

            me.$$ws.onopen = function () {
                // Clear the reconnect task if exists
                if (me.$$reconnectTask) {
                    clearInterval(me.$$reconnectTask);
                    delete me.$$reconnectTask;
                }

                // Flush the message queue
                if (me.$$config.enqueue && me.$$queue.length > 0) {
                    while (me.$$queue.length > 0) {
                        if (me.$ready()) me.$$send(me.$$queue.shift());
                        else break;
                    }
                }

                me.$$fireEvent('$open');
            };

            me.$$ws.onclose = function () {
                // Activate the reconnect task
                if (me.$$config.reconnect && !me.$$reconnectTask) {
                    me.$$reconnectTask = setInterval(function () {
                        if (me.$status() === me.$CLOSED) me.$open();
                    }, me.$$config.reconnectInterval);
                }

                me.$$fireEvent('$close');
            };

            return me;
        };

        me.$CONNECTING = 0;
        me.$OPEN = 1;
        me.$CLOSING = 2;
        me.$CLOSED = 3;

        // TODO: it doesn't refresh the view (maybe $apply on something?)
        /*me.$bind = function (event, scope, model) {
         me.$on(event, function (message) {
         model = message;
         scope.$apply();
         });
         };*/

        me.$on = function () {
            var handlers = [];

            Array.prototype.push.apply(handlers, arguments);

            var event = handlers.shift();
            if (typeof event !== 'string' || handlers.length === 0) throw new Error('$on accept two parameters at least: a String and a Function or an array of Functions');

            me.$$eventMap[event] = me.$$eventMap[event] || [];
            for (var i = 0; i < handlers.length; i++) {
                me.$$eventMap[event].push(handlers[i]);
            }

            return me;
        };

        me.$un = function (event) {
            if (typeof event !== 'string') throw new Error('$un needs a String representing an event.');

            if (typeof me.$$eventMap[event] !== 'undefined') delete me.$$eventMap[event];

            return me;
        };

        me.$$send = function (message) {
            if (me.$ready()) me.$$ws.send(JSON.stringify(message));
            else if (me.$$config.enqueue) me.$$queue.push(message);
        };

        me.$emit = function (event, data) {
            if (typeof event !== 'string') throw new Error('$emit needs two parameter: a String and a Object or a String');

            var message = {
                event: event,
                data: data
            };

            me.$$send(message);

            return me;
        };

        me.$open = function () {
            me.$$config.reconnect = me.$$reconnectCopy;

            if (me.$status() !== me.$OPEN) me.$$init(me.$$config);
            return me;
        };

        me.$close = function () {
            if (me.$status() !== me.$CLOSED) me.$$ws.close();

            if (me.$$reconnectTask) {
                clearInterval(me.$$reconnectTask);
                delete me.$$reconnectTask;
            }

            me.$$config.reconnect = false;

            return me;
        };

        me.$status = function () {
            if (typeof me.$$ws === 'undefined') return me.$CLOSED;
            else return me.$$ws.readyState;
        };

        me.$ready = function () {
            return me.$status() === me.$OPEN;
        };

        me.$mockup = function () {
            return me.$$config.mock;
        };

        // setup
        me.$$config = angular.extend({}, me.$$config, cfg);
        me.$$reconnectCopy = me.$$config.reconnect;

        if (!me.$$config.lazy) me.$$init(me.$$config);

        return me;
    }

    function $$mockWebsocket (cfg, $http) {
        cfg = cfg || {};

        var me = this,
            openTimeout = cfg.openTimeout || 500,
            closeTimeout = cfg.closeTimeout || 1000,
            messageInterval = cfg.messageInterval || 2000,
            fixtures = cfg.fixtures || {},
            messageQueue = [];

        me.CONNECTING = 0;
        me.OPEN = 1;
        me.CLOSING = 2;
        me.CLOSED = 3;

        me.readyState = me.CONNECTING;

        me.send = function (message) {
            if (me.readyState === me.OPEN) {
                messageQueue.push(message);
                return me;
            }
            else throw new Error('WebSocket is already in CLOSING or CLOSED state.');
        };

        me.close = function () {
            if (me.readyState === me.OPEN) {
                me.readyState = me.CLOSING;

                setTimeout(function () {
                    me.readyState = me.CLOSED;

                    me.onclose();
                }, closeTimeout);
            }

            return me;
        };

        me.onmessage = function () {};
        me.onerror = function () {};
        me.onopen = function () {};
        me.onclose = function () {};

        setInterval(function () {
            if (messageQueue.length > 0) {
                var message = messageQueue.shift(),
                    msgObj = JSON.parse(message);

                switch (msgObj.event) {
                    case '$close':
                        me.close();
                        break;
                    default:
                        // Check for a custom response
                        if (typeof fixtures[msgObj.event] !== 'undefined') {
                            msgObj.data = fixtures[msgObj.event].data || msgObj.data;
                            msgObj.event = fixtures[msgObj.event].event || msgObj.event;
                        }

                        message = JSON.stringify(msgObj);

                        me.onmessage({
                            data: message
                        });
                }
            }
        }, messageInterval);

        var start = function (fixs) {
            fixs = fixs || {};
            fixs = fixs instanceof Error ? {} : fixs;

            fixtures = fixs;

            setTimeout(function () {
                me.readyState = me.OPEN;
                me.onopen();
            }, openTimeout);
        };

        // Get fixtures from a server or a file if it's a string
        if (typeof fixtures === 'string') {
            $http.get(fixtures)
                .success(start)
                .error(start);
        }
        else start(fixtures);

        return me;
    }

    /**
     * @ngdoc module
     * @name $websocket
     * @module ngWebsocket
     * @description
     * HTML5 WebSocket module for AngularJS
     */
    angular
        .module('ngWebsocket', [])
        .provider('$websocket', $websocketProvider);
})();


text:
<?php

namespace Oro\Bundle\EmailBundle\Migrations\Schema\v1_15;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Type;
use Oro\Bundle\EmailBundle\Entity\InternalEmailOrigin;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\ParametrizedSqlMigrationQuery;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;

class OroEmailBundle implements Migration
{
    /**
     * {@inheritDoc}
     */
    public function up(Schema $schema, QueryBag $queries)
    {
        self::addEmailFolderFields($schema);
        self::addEmailOriginFields($schema);
        self::updateMailboxName($schema, $queries);
        self::updateEmailRecipientConstraint($schema);
    }

    /**
     * @param Schema $schema
     *
     * @throws \Doctrine\DBAL\Schema\SchemaException
     */
    public static function addEmailFolderFields(Schema $schema)
    {
        $emailFolderTable = $schema->getTable('oro_email_folder');

        $emailFolderTable->addColumn('sync_enabled', 'boolean', ['default' => false]);
        $emailFolderTable->addColumn('parent_folder_id', 'integer', ['notnull' => false]);
        $emailFolderTable->addForeignKeyConstraint(
            $emailFolderTable,
            ['parent_folder_id'],
            ['id'],
            ['onDelete' => 'CASCADE', 'onUpdate' => null],
            'FK_EB940F1C421FFFC'
        );
    }

    /**
     * @param Schema $schema
     *
     * @throws \Doctrine\DBAL\Schema\SchemaException
     */
    public static function addEmailOriginFields(Schema $schema)
    {
        $table = $schema->getTable('oro_email_origin');

        $table->addColumn('mailbox_name', 'string', ['length' => 64, 'notnull' => true, 'default' => '']);
        $table->addIndex(['mailbox_name'], 'IDX_mailbox_name', []);
    }

    /**
     * @param Schema   $schema
     * @param QueryBag $queries
     */
    public static function updateMailboxName(Schema $schema, QueryBag $queries)
    {
        $table = $schema->getTable('oro_email_origin');
        $sql = 'UPDATE oro_email_origin SET mailbox_name = %s WHERE name = :name';

        $queries->addQuery(
            new ParametrizedSqlMigrationQuery(
                sprintf($sql, "'" . InternalEmailOrigin::MAILBOX_NAME . "'"),
                ['name' => 'internalemailorigin'],
                ['name' => Type::STRING]
            )
        );

        if ($table->hasColumn('imap_user')) {
            $queries->addQuery(new ParametrizedSqlMigrationQuery(
                sprintf($sql, 'imap_user'),
                ['name' => 'imapemailorigin'],
                ['name' => Type::STRING]
            ));
            $queries->addQuery(new ParametrizedSqlMigrationQuery(
                sprintf($sql, 'imap_user'),
                ['name' => 'useremailorigin'],
                ['name' => Type::STRING]
            ));
        }

        if ($table->hasColumn('ews_user_email')) {
            $queries->addQuery(new ParametrizedSqlMigrationQuery(
                sprintf($sql, 'ews_user_email'),
                ['name' => 'ewsemailorigin'],
                ['name' => Type::STRING]
            ));
        }
    }

    /**
     * @param Schema $schema
     *
     * @throws \Doctrine\DBAL\Schema\SchemaException
     */
    public static function updateEmailRecipientConstraint(Schema $schema)
    {
        $table = $schema->getTable('oro_email_recipient');

        $table->removeForeignKey('FK_7DAF9656A832C1C9');
        $table->addForeignKeyConstraint(
            $schema->getTable('oro_email'),
            ['email_id'],
            ['id'],
            ['onDelete' => 'CASCADE', 'onUpdate' => null],
            'FK_7DAF9656A832C1C9'
        );
    }
}


text:
using System;

class DrunkenNumbers
{
    static void Main()
    {
        int numberOfRounds = int.Parse(Console.ReadLine());

        int totalMitkoBeers = 0;
        int totalVladkoBeers = 0;

        for (int i = 0; i < numberOfRounds; i++)
        {
            int drunkenNumber = int.Parse(Console.ReadLine());

            if (drunkenNumber < 0)
            {
                drunkenNumber = drunkenNumber * (-1);
            }

            string drunkenNumStr = drunkenNumber.ToString();

            if (drunkenNumStr.Length % 2 == 0)
            {
                for (int m = 0; m < drunkenNumStr.Length / 2; m++)
                {
                    totalMitkoBeers += drunkenNumStr[m] - '0';
                    totalVladkoBeers += drunkenNumStr[(drunkenNumStr.Length - 1) - m] - '0';
                }
            }
            else if (drunkenNumStr.Length % 2 != 0)
            {
                for (int m = 0; m <= drunkenNumStr.Length / 2; m++)
                {
                    totalMitkoBeers += drunkenNumStr[m] - '0';
                    totalVladkoBeers += drunkenNumStr[(drunkenNumStr.Length - 1) - m] - '0';
                }
            }
        }

        if (totalMitkoBeers > totalVladkoBeers)
        {
            Console.WriteLine("M {0}", totalMitkoBeers - totalVladkoBeers);
        }
        else if (totalVladkoBeers > totalMitkoBeers)
        {
            Console.WriteLine("V {0}", totalVladkoBeers - totalMitkoBeers);
        }
        else
        {
            Console.WriteLine("No {0}", totalMitkoBeers + totalVladkoBeers);
        }
    }
}


text:
/* jshint node: true */
'use strict';

module.exports = {
  name: 'ember-enchanter'
};


text:
package sunning.democollection.custom.learn;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;

/**
 * Created by sunning on 16/8/2.
 */
public class MeasureView extends View{
    public MeasureView(Context context) {
        super(context);
    }

    public MeasureView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MeasureView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public MeasureView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        setMeasuredDimension(300,300);
    }
}


text:
package ns

/**
* Configuration for capacity resource.
*/
type Nscapacity struct {
	/**
	* System bandwidth limit.
	*/
	Bandwidth int `json:"bandwidth,omitempty"`
	/**
	* appliance platform type.
	*/
	Platform string `json:"platform,omitempty"`
	/**
	* licensed using vcpu pool.
	*/
	Vcpu bool `json:"vcpu,omitempty"`
	/**
	* Product edition.
	*/
	Edition string `json:"edition,omitempty"`
	/**
	* Bandwidth unit.
	*/
	Unit string `json:"unit,omitempty"`
	/**
	* Unique number that identifies the cluster node.
	*/
	Nodeid int `json:"nodeid,omitempty"`

	//------- Read only Parameter ---------;

	Actualbandwidth string `json:"actualbandwidth,omitempty"`
	Vcpucount string `json:"vcpucount,omitempty"`
	Maxvcpucount string `json:"maxvcpucount,omitempty"`
	Maxbandwidth string `json:"maxbandwidth,omitempty"`
	Minbandwidth string `json:"minbandwidth,omitempty"`
	Instancecount string `json:"instancecount,omitempty"`

}


text:
import unittest
from biicode.common.edition.parsing.cpp.drl_parser import DRLCPPParser
from biicode.common.edition.parsing.code_reference import CPPItem
from biicode.common.test import testfileutils
from biicode.common.model.declare.cpp_declaration import CPPDeclaration
from biicode.common.model.declare.data_declaration import DataDeclaration
from biicode.common.edition.parsing.file_parser import FileParser

example = r'''// prueba.cpp:
//

#include "stdafx.h" //Another comment

#include <iostream> //One comment

#define MYVALUE 3 //example define

int a;
float b = 0.0f;

extern double c;
float suma(float a, float b) //comment
{
    //suma
    return a+b;
}
class PreDecl //My predc
    ;
float multiply(float a, float b);
class
Sphere : public Shape//MyClass comment
{
protected:
    float radius;
public:
    Sphere(float r):radius(r){ /*Inline coment*/};
    float volume(){
        return radius*radius*radius;
    }
    float methodDecl();
};

namespace Geom
{
    float intersect();
    float other(){
        return 0.0f;
    }
    class Line{

    };
}
float Geom::intersect(){
    return 0;
}
/* Multiline comment
asdasd

asd*/
using namespace std;
int main()
{
    Sphere s(2.0f);
    cout<<"Volume: "<<s.volume()<<endl;
    cout<<suma(2,3)<<endl;
    cout<<Geom::intersect()<<endl;
    return 1;
}'''

class DRLCPPParserTest(unittest.TestCase):

    def test_destructor(self):
        text = r"""
namespace Poco {
LexicalHandler::~LexicalHandler()
{
}
}"""
        parser = DRLCPPParser()
        parser.parse(text)
        self.assertEqual(CPPItem(CPPItem.METHOD, '~LexicalHandler', 'Poco::LexicalHandler'),
                         parser.definitions.pop())

    def test_includes(self):
        testIncludes = r'''
//comment
#include <iostream>
#include "file.h"
//#include "path/to/file2.h"
/*#include "file3.h" /**/*/
# include    "path/to/file4.h "
#include " file5.h " //Comment on include
#include <file6.h > /*Other comment*/
#define MYVAR 3
'''
        parser = DRLCPPParser()
        parser.parse(testIncludes)

        obtained = [ref.name for ref in parser.includes]
        expected = ['iostream', 'file.h', 'path/to/file4.h',
                      'file5.h', 'file6.h']
        self.assertEqual(expected, obtained)

    def test_declaration_defintions(self):
        text = r'''
int a;
float b = 0.0f;

extern double c;
float suma(float a, float b) //comment
{
    //suma
    return a+b;
}
class PreDecl //My predc
    ;
float multiply(float a, float b);
class
    Sphere : public Polygon//MyClass comment
{
protected:
    float radius;
public:
    Sphere(float r):radius(r){ /*Inline coment*/};
    float volume(){
        return radius*radius*radius;
    }
    float methodDecl();
};
'''
        parser = DRLCPPParser()
        parser.parse(text)

        expected = set([CPPItem(CPPItem.CLASS, 'Sphere'),
                        CPPItem(CPPItem.VAR, 'c'),
                        CPPItem(CPPItem.METHOD, 'multiply'),
                        ])

        #print parser.declarations
        self.assertEqual(expected, parser.declarations)

        expected = set([CPPItem(CPPItem.VAR, 'a'),
                        CPPItem(CPPItem.VAR, 'b'),
                        CPPItem(CPPItem.METHOD, 'suma'),
                        ])

        self.assertEqual(expected, parser.definitions)

    def test_namespace(self):
        text = r'''
namespace Geom
{
    float intersect();
    float other(){
        return 0.0f;
    }
    class Line{

    };
    namespace NS{
        float foo();
        class Bar{
        };
    }
}
float Geom::intersect(){
    return 0;
}
float Geom::NS::intersect2(){
    return 0;
}
'''
        parser = DRLCPPParser()
        parser.parse(text)

        expected = set([CPPItem(CPPItem.CLASS, 'Line', 'Geom'),
                        CPPItem(CPPItem.METHOD, 'intersect', 'Geom'),
                        CPPItem(CPPItem.CLASS, 'Bar', 'Geom::NS'),
                        CPPItem(CPPItem.METHOD, 'foo', 'Geom::NS'),
                        ])

        self.assertEqual(expected, parser.declarations)

        expected = set([CPPItem(CPPItem.METHOD, 'other',  'Geom'),
                        CPPItem(CPPItem.METHOD, 'intersect', 'Geom'),
                        CPPItem(CPPItem.METHOD, 'intersect2', 'Geom::NS'),
                        ])

        self.assertEqual(expected, parser.definitions)

    def test_explicit_dependencies(self):
        text = r'''
/*
 * Prueba de comentario en clase
 */
class Sphere
{
protected:
    float radius;
        protectedMethod();
        protectedMethod2(MYSTRUCT m);
public:
        ///Contructor
    Sphere(float r);
    ///bii://user/module/file
    float volume();

    ///bii://user2/module2/file2
    double hhh(){
                return 2*2;
    }
};'''
        parser = DRLCPPParser()
        parser.parse(text)
        explicitDependencies = parser.explicit_declarations
        expected = set(['user/module/file', 'user2/module2/file2'])
        self.assertSetEqual(expected,
                            set([str(expDep) for expDep in explicitDependencies]))

    def test_parse_escaped_strings(self):
        text = r'''
string a = "Hello \"world\""
string b = "Hello \"world\"\\"
int c = 8;
'''
        file_parser = FileParser()
        result, _ = file_parser._parse_strings_comments(text)
        self.assertEqual(r'"Hello \"world\""', result[0].content)
        self.assertEqual(r'"Hello \"world\"\\"', result[1].content)

    def test_parse_escaped_strings2(self):
        text = r'''cout << "   \"" << (char *)testSet[i].input << '\"';'''
        file_parser = FileParser()
        result, _ = file_parser._parse_strings_comments(text)
        self.assertEqual(r'"   \""', result[0].content)
        self.assertEqual(r"'\"'", result[1].content)

    def test_replace_includes(self):
        text = r'''# include   "file.h" //My comment
 # include   "file2.h"
# include   "path/to/file.h" //My comment
# include   "file3.h"
//bii://biicode.txt
'''
        parser = DRLCPPParser()
        parser.parse(text)
        d1 = CPPDeclaration('file.h')
        d2 = CPPDeclaration('user/block/file.h')
        text = parser.updateDeclaration(text, d1, d2)

        d1 = CPPDeclaration('file3.h')
        d2 = CPPDeclaration('user/block2/file3.h')
        text = parser.updateDeclaration(text, d1, d2)

        d1 = CPPDeclaration('file2.h')
        d2 = CPPDeclaration('user/block2/file2.h')
        text = parser.updateDeclaration(text, d1, d2)

        d1 = DataDeclaration('biicode.txt')
        d2 = DataDeclaration('user/block/biicode.txt')
        text = parser.updateDeclaration(text, d1, d2)
        expected = '''# include   "user/block/file.h" //My comment
 # include   "user/block2/file2.h"
# include   "path/to/file.h" //My comment
# include   "user/block2/file3.h"
//bii://user/block/biicode.txt
'''
        self.assertEqual(expected, text)

    def test_find_gtest_implementations(self):
        text = testfileutils.load('gtest/src/gtest-death-test.cc')
        parser = DRLCPPParser()
        parser.parse(text)
        self.assertIn(CPPDeclaration('../include/gtest/internal/gtest-port.h'),
                      parser.explicit_declarations)

    def test_using_no_definition(self):
        code = "using blobstore::onblocks::utils::ceilDivision;"
        parser = DRLCPPParser()
        parser.parse(code)
        expected = set()
        self.assertItemsEqual(expected, parser.definitions)

    def test_scope_in_const_definition(self):
        code = """
#include "cryptopp/cryptopp/pch.h"
#include "cryptopp/cryptopp/cast.h"

namespace CryptoPP{

// CAST S-boxes
int CAST::x = 1;
int CAST::y;
int z;

const word32 CAST::S[8][256] = {
{
    0x30FB40D4UL, 0x9FA0FF0BUL, 0x6BECCD2FUL, 0x3F258C7AUL,
    0x1E213F2FUL, 0x9C004DD3UL, 0x6003E540UL, 0xCF9FC949UL,
    0xBFD4AF27UL, 0x88BBBDB5UL, 0xE2034090UL, 0x98D09675UL,
    0x6E63A0E0UL, 0x15C361D2UL, 0xC2E7661DUL, 0x22D4FF8EUL
}}
"""
        parser = DRLCPPParser()
        parser.parse(code)
        expected = set([CPPItem(type_=CPPItem.VAR, name='S', scope='CryptoPP::CAST'),
                        CPPItem(type_=CPPItem.VAR, name='x', scope='CryptoPP::CAST'),
                        CPPItem(type_=CPPItem.VAR, name='y', scope='CryptoPP::CAST'),
                        CPPItem(type_=CPPItem.VAR, name='z', scope='CryptoPP')])
        self.assertItemsEqual(expected, parser.definitions)

    def test_arduino_imports(self):
        arduino_imports = """#import "hola.h"
#include "fran/duino/fancy.h"

void setup(){
    foo();
}

void loop(){
    bar();
}
"""
        parser = DRLCPPParser()
        parser.parse(arduino_imports)
        obtained_includes = [ref.name for ref in parser.includes]
        expected = ['hola.h', 'fran/duino/fancy.h']
        self.assertItemsEqual(expected, obtained_includes)


text:
Lista de Países

                        <a href="<?php echo base_url() ?>index.php/administracion/catalogos/paises/pais_agregar" class="btn btn-primary tboton"> País
                        <a href="<?php echo base_url() ?>index.php/administracion/catalogos/paises/paises_inactivos_lista" class="btn btn-info tboton"> Inactivos

                    No.
                    País
                    Editar
                    Inactivar

                            <a href="<?php echo base_url() ?>index.php/administracion/catalogos/paises/pais_editar">
                            <a href="<?php echo base_url() ?>index.php/administracion/catalogos/paises/pais_inactivar">

                            <a href="<?php echo base_url() ?>index.php/administracion/catalogos/paises/pais_editar">
                            <a href="<?php echo base_url() ?>index.php/administracion/catalogos/paises/pais_inactivar">

                            <a href="<?php echo base_url() ?>index.php/administracion/catalogos/paises/pais_editar">
                            <a href="<?php echo base_url() ?>index.php/administracion/catalogos/paises/pais_inactivar">

                            <a href="<?php echo base_url() ?>index.php/administracion/catalogos/paises/pais_editar">
                            <a href="<?php echo base_url() ?>index.php/administracion/catalogos/paises/pais_inactivar">

                    <?php
//                    echo '
';
//                    if ($cargos != FALSE) {
//                        $i = 1;
//                        foreach ($cargos as $fila) {
//                            $ids = $fila->idcargo;
//                            echo '
';
//                            echo '' . $i . '	';
//                            echo '' . $fila->cargo . '	';
//                            echo 'Editar	';
//                            echo 'Inactivar	';
//                            echo 'Cambio Clave	';//
//                            echo '
';
//                            $i++;
//                        }
//                    } else {
//                        echo '

NO HAY REGISTROS

';
//                    }
//                    echo '
';
                    ?>


text:
<?php

namespace CMS\BlogBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Article
 *
 * @ORM\Table(name="article")
 * @ORM\Entity(repositoryClass="CMS\BlogBundle\Repository\ArticleRepository")
 */
class Article
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="title", type="string", length=255)
     */
    private $title;

    /**
     * @var string
     *
     * @ORM\Column(name="metadescription", type="string", length=255, nullable=true)
     */
    private $metadescription;

     /**
     * @var string
     *
     * @ORM\Column(name="slug", type="string", length=255)
     */
    private $slug;
    /**
     * @var string
     *
     * @ORM\Column(name="description", type="text")
     */
    private $description;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="datepublication", type="datetime")
     */
    private $datepublication;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="datecreation", type="datetime")
     */
    private $datecreation;

    /**
     * @var string
     *
     *
     * @ORM\ManyToOne(targetEntity="CMS\BlogBundle\Entity\Image")
     * @ORM\JoinColumn(nullable=true)
     */
    private $thumb;

     /**
     * @ORM\ManyToOne(targetEntity="CMS\BlogBundle\Entity\Category")
     * @ORM\JoinColumn(nullable=false)
    */
    private $category;

    /**
     * @ORM\OneToMany(targetEntity="CMS\BlogBundle\Entity\Reply", mappedBy="article")
     *
    */
    private $replies;

    /**
     * @ORM\ManyToOne(targetEntity="CMS\BlogBundle\Entity\User")
     *
    */
    private $user;

    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set title
     *
     * @param string $title
     *
     * @return Article
     */
    public function setTitle($title)
    {
        $this->title = $title;

        return $this;
    }

    /**
     * Get title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Set metadescription
     *
     * @param string $metadescription
     *
     * @return Article
     */
    public function setMetadescription($metadescription)
    {
        $this->metadescription = $metadescription;

        return $this;
    }

    /**
     * Get metadescription
     *
     * @return string
     */
    public function getMetadescription()
    {
        return $this->metadescription;
    }

    /**
     * Set description
     *
     * @param string $description
     *
     * @return Article
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

    /**
     * Get description
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Set datepublication
     *
     * @param \DateTime $datepublication
     *
     * @return Article
     */
    public function setDatepublication($datepublication)
    {
        $this->datepublication = $datepublication;

        return $this;
    }

    /**
     * Get datepublication
     *
     * @return \DateTime
     */
    public function getDatepublication()
    {
        return $this->datepublication;
    }

    /**
     * Set datecreation
     *
     * @param \DateTime $datecreation
     *
     * @return Article
     */
    public function setDatecreation($datecreation)
    {
        $this->datecreation = $datecreation;

        return $this;
    }

    /**
     * Get datecreation
     *
     * @return \DateTime
     */
    public function getDatecreation()
    {
        return $this->datecreation;
    }

    /**
     * Set thumb
     *
     * @param string $thumb
     *
     * @return Article
     */
    public function setThumb($thumb)
    {
        $this->thumb = $thumb;

        return $this;
    }

    /**
     * Get thumb
     *
     * @return string
     */
    public function getThumb()
    {
        return $this->thumb;
    }

    /**
     * Set category
     *
     * @param \CMS\BlogBundle\Entity\Category $category
     *
     * @return Article
     */
    public function setCategory(\CMS\BlogBundle\Entity\Category $category)
    {
        $this->category = $category;

        return $this;
    }

    /**
     * Get category
     *
     * @return \CMS\BlogBundle\Entity\Category
     */
    public function getCategory()
    {
        return $this->category;
    }

    /**
     * Set slug
     *
     * @param string $slug
     *
     * @return Article
     */
    public function setSlug()
    {
        $this->slug = str_replace(' ', '_' , $this->title);

        return $this;
    }

    /**
     * Get slug
     *
     * @return string
     */
    public function getSlug()
    {
        return $this->slug;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->replies = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add reply
     *
     * @param \CMS\BlogBundle\Entity\Reply $reply
     *
     * @return Article
     */
    public function addReply(\CMS\BlogBundle\Entity\Reply $reply)
    {
        $this->replies[] = $reply;

        return $this;
    }

    /**
     * Remove reply
     *
     * @param \CMS\BlogBundle\Entity\Reply $reply
     */
    public function removeReply(\CMS\BlogBundle\Entity\Reply $reply)
    {
        $this->replies->removeElement($reply);
    }

    /**
     * Get replies
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getReplies()
    {
        return $this->replies;
    }

    /**
     * Set user
     *
     * @param \CMS\BlogBundle\Entity\User $user
     *
     * @return Article
     */
    public function setUser(\CMS\BlogBundle\Entity\User $user = null)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \CMS\BlogBundle\Entity\User
     */
    public function getUser()
    {
        return $this->user;
    }
}


text:
package com.android.ide.common.resources;

import com.android.SdkConstants;
import com.android.annotations.NonNull;
import com.android.ide.common.rendering.api.ResourceValue;
import com.android.ide.common.resources.ValueResourceParser.IValueResourceRepository;
import com.android.resources.ResourceType;
import com.google.common.io.Closeables;

import org.kxml2.io.KXmlParser;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * Parser for scanning an id-generating resource file such as a layout or a menu
 * file, which registers any ids it encounters with an
 * {@link IValueResourceRepository}, and which registers errors with a
 * {@link ScanningContext}.
 */
public class IdResourceParser {
    private final IValueResourceRepository mRepository;
    private final boolean mIsFramework;
    private ScanningContext mContext;

    /**
     * Creates a new {@link IdResourceParser}
     *
     * @param repository value repository for registering resource declaration
     * @param context a context object with state for the current update, such
     *            as a place to stash errors encountered
     * @param isFramework true if scanning a framework resource
     */
    public IdResourceParser(
            @NonNull IValueResourceRepository repository,
            @NonNull ScanningContext context,
            boolean isFramework) {
        mRepository = repository;
        mContext = context;
        mIsFramework = isFramework;
    }

    /**
     * Parse the given input and register ids with the given
     * {@link IValueResourceRepository}.
     *
     * @param type the type of resource being scanned
     * @param path the full OS path to the file being parsed
     * @param input the input stream of the XML to be parsed (will be closed by this method)
     * @return true if parsing succeeds and false if it fails
     * @throws IOException if reading the contents fails
     */
    public boolean parse(ResourceType type, final String path, InputStream input)
            throws IOException {
        KXmlParser parser = new KXmlParser();
        try {
            parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);

            if (input instanceof FileInputStream) {
                input = new BufferedInputStream(input);
            }
            parser.setInput(input, SdkConstants.UTF_8);

            return parse(type, path, parser);
        } catch (XmlPullParserException e) {
            String message = e.getMessage();

            // Strip off position description
            int index = message.indexOf("(position:"); //$NON-NLS-1$ (Hardcoded in KXml)
            if (index != -1) {
                message = message.substring(0, index);
            }

            String error = String.format("%1$s:%2$d: Error: %3$s", //$NON-NLS-1$
                    path, parser.getLineNumber(), message);
            mContext.addError(error);
            return false;
        } catch (RuntimeException e) {
            // Some exceptions are thrown by the KXmlParser that are not XmlPullParserExceptions,
            // such as this one:
            //    java.lang.RuntimeException: Undefined Prefix: w in org.kxml2.io.KXmlParser@...
            //        at org.kxml2.io.KXmlParser.adjustNsp(Unknown Source)
            //        at org.kxml2.io.KXmlParser.parseStartTag(Unknown Source)
            String message = e.getMessage();
            String error = String.format("%1$s:%2$d: Error: %3$s", //$NON-NLS-1$
                    path, parser.getLineNumber(), message);
            mContext.addError(error);
            return false;
        } finally {
            try {
                Closeables.close(input, true /* swallowIOException */);
            } catch (IOException e) {
                // cannot happen
            }
        }
    }

    private boolean parse(ResourceType type, String path, KXmlParser parser)
            throws XmlPullParserException, IOException {
        boolean valid = true;
        boolean checkForErrors = !mIsFramework && !mContext.needsFullAapt();

        while (true) {
            int event = parser.next();
            if (event == XmlPullParser.START_TAG) {
                for (int i = 0, n = parser.getAttributeCount(); i < n; i++) {
                    String attribute = parser.getAttributeName(i);
                    String value = parser.getAttributeValue(i);
                    assert value != null : attribute;

                    if (checkForErrors) {
                        String uri = parser.getAttributeNamespace(i);
                        if (!mContext.checkValue(uri, attribute, value)) {
                            mContext.requestFullAapt();
                            checkForErrors = false;
                            valid = false;
                        }
                    }

                    if (value.startsWith("@+")) {       //$NON-NLS-1$
                        // Strip out the @+id/ or @+android:id/ section
                        String id = value.substring(value.indexOf('/') + 1);
                        ResourceValue newId = new ResourceValue(ResourceType.ID, id,
                                mIsFramework);
                        mRepository.addResourceValue(newId);
                    }
                }
            } else if (event == XmlPullParser.END_DOCUMENT) {
                break;
            }
        }

        return valid;
    }
}


text:
<?php
/** @var \dosamigos\fileupload\FileUploadUI $this */
use yii\helpers\Html;

$context = $this->context;
?>
<div id="<?= str_replace('[]', '', $context->name);?>-files-container" >

		<tbody id="<?= strtolower($context->model->formName()) . '-' . str_replace('[]', '', $context->name);?>" class="files">


text:
java-crc16citt
==============

A class for calculating CRC16CITT checksum for byte arrays

usage:
------

```Java
byte[] array = new byte[] {1,2,3,4,5};
CRC16CCITT calc = new CRC16CCITT();
for (byte b : array)
  calc.update(b);
calc.value(); // current checksum
```


text:
#include "annotations/adapter/files.h"
#include "annotations/adapterinterface.h"
#include "annotations/adapter.h"
#include "annotations/exception.h"

#include <ext/standard/php_smart_str.h>
#include <ext/standard/php_var.h>

#include "kernel/main.h"
#include "kernel/memory.h"
#include "kernel/array.h"
#include "kernel/object.h"
#include "kernel/fcall.h"
#include "kernel/file.h"
#include "kernel/concat.h"
#include "kernel/require.h"
#include "kernel/operators.h"
#include "kernel/exception.h"

/**
 * Phalcon\Annotations\Adapter\Files
 *
 * Stores the parsed annotations in files. This adapter is suitable for production
 *
 *
 * $annotations = new \Phalcon\Annotations\Adapter\Files(array(
 *    'annotationsDir' => 'app/cache/annotations/'
 * ));
 *
 */
zend_class_entry *phalcon_annotations_adapter_files_ce;

PHP_METHOD(Phalcon_Annotations_Adapter_Files, __construct);
PHP_METHOD(Phalcon_Annotations_Adapter_Files, read);
PHP_METHOD(Phalcon_Annotations_Adapter_Files, write);

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_files___construct, 0, 0, 0)
	ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_files_read, 0, 0, 1)
	ZEND_ARG_INFO(0, key)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_files_write, 0, 0, 2)
	ZEND_ARG_INFO(0, key)
	ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

static const zend_function_entry phalcon_annotations_adapter_files_method_entry[] = {
	PHP_ME(Phalcon_Annotations_Adapter_Files, __construct, arginfo_phalcon_annotations_adapter_files___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
	PHP_ME(Phalcon_Annotations_Adapter_Files, read, arginfo_phalcon_annotations_adapter_files_read, ZEND_ACC_PUBLIC)
	PHP_ME(Phalcon_Annotations_Adapter_Files, write, arginfo_phalcon_annotations_adapter_files_write, ZEND_ACC_PUBLIC)
	PHP_FE_END
};

/**
 * Phalcon\Annotations\Adapter\Files initializer
 */
PHALCON_INIT_CLASS(Phalcon_Annotations_Adapter_Files){

	PHALCON_REGISTER_CLASS_EX(Phalcon\\Annotations\\Adapter, Files, annotations_adapter_files, phalcon_annotations_adapter_ce, phalcon_annotations_adapter_files_method_entry, 0);

	zend_declare_property_string(phalcon_annotations_adapter_files_ce, SL("_annotationsDir"), "./", ZEND_ACC_PROTECTED TSRMLS_CC);

	zend_class_implements(phalcon_annotations_adapter_files_ce TSRMLS_CC, 1, phalcon_annotations_adapterinterface_ce);

	return SUCCESS;
}

/**
 * Phalcon\Annotations\Adapter\Files constructor
 *
 * @param array $options
 */
PHP_METHOD(Phalcon_Annotations_Adapter_Files, __construct){

	zval *options = NULL, *annotations_dir;

	phalcon_fetch_params(0, 0, 1, &options);

	if (options && Z_TYPE_P(options) == IS_ARRAY) {
		if (phalcon_array_isset_string_fetch(&annotations_dir, options, SS("annotationsDir"))) {
			phalcon_update_property_this(this_ptr, SL("_annotationsDir"), annotations_dir TSRMLS_CC);
		}
	}
}

/**
 * Reads parsed annotations from files
 *
 * @param string $key
 * @return Phalcon\Annotations\Reflection
 */
PHP_METHOD(Phalcon_Annotations_Adapter_Files, read){

	zval **key, *annotations_dir, *virtual_key, *path;

	phalcon_fetch_params_ex(1, 0, &key);
	PHALCON_ENSURE_IS_STRING(key);

	PHALCON_MM_GROW();

	annotations_dir = phalcon_fetch_nproperty_this(this_ptr, SL("_annotationsDir"), PH_NOISY TSRMLS_CC);

	/**
	 * Paths must be normalized before be used as keys
	 */
	PHALCON_INIT_VAR(virtual_key);
	phalcon_prepare_virtual_path_ex(virtual_key, Z_STRVAL_PP(key), Z_STRLEN_PP(key), '_' TSRMLS_CC);

	PHALCON_INIT_VAR(path);
	PHALCON_CONCAT_VVS(path, annotations_dir, virtual_key, ".php");

	if (phalcon_file_exists(path TSRMLS_CC) == SUCCESS) {
		zval *tmp = NULL;
		RETURN_MM_ON_FAILURE(phalcon_require_ret(&tmp, Z_STRVAL_P(path) TSRMLS_CC));
		RETVAL_ZVAL(tmp, 1, 1);
	}

	PHALCON_MM_RESTORE();
}

/**
 * Writes parsed annotations to files
 *
 * @param string $key
 * @param Phalcon\Annotations\Reflection $data
 */
PHP_METHOD(Phalcon_Annotations_Adapter_Files, write){

	zval **key, **data, *annotations_dir;
	zval *virtual_key, *path, *php_export;
	zval *status;
	smart_str exp = { NULL, 0, 0 };

	phalcon_fetch_params_ex(2, 0, &key, &data);
	PHALCON_ENSURE_IS_STRING(key);

	PHALCON_MM_GROW();

	annotations_dir = phalcon_fetch_nproperty_this(this_ptr, SL("_annotationsDir"), PH_NOISY TSRMLS_CC);

	/**
	 * Paths must be normalized before be used as keys
	 */
	PHALCON_INIT_VAR(virtual_key);
	phalcon_prepare_virtual_path_ex(virtual_key, Z_STRVAL_PP(key), Z_STRLEN_PP(key), '_' TSRMLS_CC);

	PHALCON_INIT_VAR(path);
	PHALCON_CONCAT_VVS(path, annotations_dir, virtual_key, ".php");

	smart_str_appends(&exp, "<?php return ");
	php_var_export_ex(data, 0, &exp TSRMLS_CC);
	smart_str_appendc(&exp, ';');
	smart_str_0(&exp);

	PHALCON_INIT_VAR(php_export);
	ZVAL_STRINGL(php_export, exp.c, exp.len, 0);

	PHALCON_INIT_VAR(status);
	phalcon_file_put_contents(status, path, php_export TSRMLS_CC);
	if (PHALCON_IS_FALSE(status)) {
		PHALCON_THROW_EXCEPTION_STR(phalcon_annotations_exception_ce, "Annotations directory cannot be written");
		return;
	}

	PHALCON_MM_RESTORE();
}


text:
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1" level="3" version="1" layout:required="false">
  <model id="Model">
    <layout:listOfLayouts xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <layout:layout layout:id="layout">
        <layout:dimensions layout:width="600" layout:height="480" layout:depth="1"/>
        <layout:listOfCompartmentGlyphs>
          <layout:compartmentGlyph layout:id="cGlyph" layout:compartment="C1"/>
        </layout:listOfCompartmentGlyphs>
        <layout:listOfSpeciesGlyphs>
          <layout:speciesGlyph layout:id="s1Glyph" layout:species="s1">
            <layout:boundingBox>
              <layout:position layout:x="300" layout:y="100" layout:z="1"/>
              <layout:dimensions layout:width="50" layout:height="30" layout:depth="1"/>
            </layout:boundingBox>
          </layout:speciesGlyph>
          <layout:speciesGlyph layout:id="s2s2Glyph" layout:species="s2">
            <layout:boundingBox>
              <layout:position layout:x="300" layout:y="380" layout:z="1"/>
              <layout:dimensions layout:width="50" layout:height="30" layout:depth="1"/>
            </layout:boundingBox>
          </layout:speciesGlyph>
        </layout:listOfSpeciesGlyphs>
        <layout:listOfReactionGlyphs>
          <layout:reactionGlyph layout:id="rGlyph" layout:reaction="r1">
            <layout:listOfSpeciesReferenceGlyphs>
              <layout:speciesReferenceGlyph layout:id="s1ReferenceGlyph" layout:role="undefined" layout:speciesGlyph="s1Glyph"/>
              <layout:speciesReferenceGlyph layout:id="s2ReferenceGlyph" layout:role="product" layout:speciesGlyph="s2s2Glyph">
                <layout:curve>
                  <layout:listOfCurveSegments>
                    <layout:curveSegment xsi:type="CubicBezier">
                      <layout:start layout:x="3000" layout:y="100" layout:z="0"/>
                      <layout:end layout:x="300" layout:y="380" layout:z="0"/>
                      <layout:basePoint1 layout:x="230" layout:y="220" layout:z="0"/>
                      <layout:basePoint2 layout:x="230" layout:y="220" layout:z="0"/>
                    </layout:curveSegment>
                  </layout:listOfCurveSegments>
                </layout:curve>
              </layout:speciesReferenceGlyph>
            </layout:listOfSpeciesReferenceGlyphs>
          </layout:reactionGlyph>
        </layout:listOfReactionGlyphs>
      </layout:layout>
    </layout:listOfLayouts>
    <listOfCompartments>
      <compartment id="C1"/>
    </listOfCompartments>
    <listOfSpecies>
      <species id="s1" compartment="C1"/>
      <species id="s2" compartment="C1"/>
    </listOfSpecies>
    <listOfReactions>
      <reaction id="r1">
        <listOfReactants>
          <speciesReference species="s1"/>
        </listOfReactants>
        <listOfProducts>
          <speciesReference species="s2"/>
        </listOfProducts>
        <kineticLaw>
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <apply>
              <times/>
              <ci> k </ci>
              <ci> s1 </ci>
            </apply>
          </math>
                  <listOfLocalParameters>
            <localParameter id="k" value="1"/>
          </listOfLocalParameters>
        </kineticLaw>
      </reaction>
    </listOfReactions>
  </model>
</sbml>


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sawbonadev.cafe.web.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import sawbonadev.cafe.web.logic.UsersLogic;
import sawbonadev.solo.GenericResponse;
import sawbonadev.cafe.web.views.CreateAccountView;

/**
 *
 * @author sawbona
 */
@Controller
@RequestMapping(value = "/account")
public class AccountController {

    @Autowired
    private UsersLogic usuariosNegocio;

    @RequestMapping(value = "/create", method = RequestMethod.GET)
    public ModelAndView create() {
        ModelAndView mv = new ModelAndView("/account/create");
        return mv;
    }

    @RequestMapping(value = "/create", method = RequestMethod.POST)
    public ModelAndView create(CreateAccountView createView) {
        GenericResponse<CreateAccountView> basicResult = usuariosNegocio.save(createView);
        ModelAndView view = new ModelAndView("/account/create");
        if (basicResult.isValid()) {
            view = new ModelAndView("redirect:/account/create/success");
        } else {
            view.addObject("genericResponse", basicResult);
        }
        return view;
    }

    @RequestMapping(value = "/create/success", method = RequestMethod.GET)
    public ModelAndView success() {
        ModelAndView mv = new ModelAndView("/account/create/success");
        return mv;
    }

    @RequestMapping(value = "/login", method = RequestMethod.GET)
    public ModelAndView login() {
        ModelAndView mv = new ModelAndView("/account/login");
        return mv;
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="icon" href="../img/creative.ico">

    <title>Form3d</title>

    <link href="../css/bootstrap.min.css" rel="stylesheet">

    <link href="../css/ihover.css" rel="stylesheet">

    <link href="../css/bootstrap.min.css" rel="stylesheet">

    <link href="../css/form3d.css" rel="stylesheet">

    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" />

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#mainNavBar" aria-expanded="true" aria-controls="mainNavBar">
                Toggle navigation

            </button>

Contact

Order

Images

Welcome to

the next industrial revolution

Request

Request anything you want built, and we will give you a fair price.

Build

We will use the state of the art[insert 3d printer name here]

Recieve

Depending on the size of the project, we will get back to you ASAP.

                    Order Now

Copyright  2015 form3d


text:
Android animation samples
==========

Example application to demo how to use View-Property-animation and Object-animation.

The example based on platform API level 11 at least and [NineOldAndroid](https://github.com/JakeWharton/NineOldAndroids).

Also some special use-cases will be shown as well.

# Menu

|Menu|Sample|
|---|---|
|AnimSample|ObjectAnimator|
|AnimSample Pre 3.0|ObjectAnimator with [NineOldAndroid](https://github.com/JakeWharton/NineOldAndroids)|
|ViewPropertyAnimator|ViewPropertyAnimator|
|ViewPropertyAnimator Pre 3.1|ViewPropertyAnimator with [NineOldAndroid](https://github.com/JakeWharton/NineOldAndroids)|

# Snapshot
![Screen](/media/main-menu.png)

[![2 sides animation](/media/twoSidesAnim.png)](/media/twoSidesAnim.mp4)

License
======
```json

			Copyright   Chris Xinyue Zhao

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

    http://www.apache.org/licenses/LICENSE-2.0

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