text:
<?php

namespace Novosga\Model;

/**
 * Tree Model.
 *
 * @MappedSuperClass
 */
abstract class TreeModel extends SequencialModel
{
    /**
     * @Column(type="integer", name="esquerda", nullable=false)
     */
    protected $left = 1;

    /**
     * @Column(type="integer", name="direita", nullable=false)
     */
    protected $right = 2;

    /**
     * @Column(type="integer", name="nivel", nullable=false)
     */
    protected $level;

    // transient
    protected $parent;

    public function getLeft()
    {
        return $this->left;
    }

    public function setLeft($left)
    {
        $this->left = $left;
    }

    public function getRight()
    {
        return $this->right;
    }

    public function setRight($right)
    {
        $this->right = $right;
    }

    public function getLevel()
    {
        return $this->level;
    }

    public function setLevel($level)
    {
        $this->level = $level;
    }

    /**
     * @return TreeModel
     */
    public function getParent(\Doctrine\ORM\EntityManager $em)
    {
        if (!$this->isRoot() && $this->parent == null) {
            $query = $em->createQuery('
                SELECT
                    parent
                FROM
                    '.get_class($this).' parent
                WHERE
                    parent.left < :left AND
                    parent.right > :right
                ORDER BY
                    parent.left DESC
            ');
            $query->setParameter('left', $this->getLeft());
            $query->setParameter('right', $this->getRight());
            $query->setMaxResults(1);
            $this->parent = $query->getSingleResult();
        }

        return $this->parent;
    }

    public function setParent(TreeModel $parent)
    {
        $this->parent = $parent;
    }

    /**
     * Retorna se o model é a raíz da árvore.
     *
     * @return bool
     */
    public function isRoot()
    {
        return $this->left == 1;
    }

    /**
     * Retorna se o model é uma folha da árvore.
     *
     * @return bool
     */
    public function isLeaf()
    {
        return $this->right == $this->left + 1;
    }

    /**
     * Retorna se o model e filho do informado via parametro.
     *
     * @param TreeModel $parent
     *
     * @return bool
     */
    public function isChild(TreeModel $parent)
    {
        return $this->left > $parent->getLeft() && $this->right < $parent->getRight();
    }
}


text:
<bill session="115" type="s" number="443" updated="2017-07-20T16:56:14Z">
  <state datetime="2017-02-27">REFERRED</state>
  <status>
    <introduced datetime="2017-02-27"/>
  </status>
  <introduced datetime="2017-02-27"/>
  <titles>
    <title type="short" as="introduced">Protecting Older Workers Against Discrimination Act</title>
    <title type="short" as="introduced">Protecting Older Workers Against Discrimination Act</title>
    <title type="official" as="introduced">A bill to amend the Age Discrimination in Employment Act of 1967 and other laws to clarify appropriate standards for Federal employment discrimination and retaliation claims, and for other purposes.</title>
    <title type="display">Protecting Older Workers Against Discrimination Act</title>
  </titles>
  <sponsor bioguide_id="C001070"/>
  <cosponsors>
    <cosponsor bioguide_id="C001035" joined="2017-02-27"/>
    <cosponsor bioguide_id="G000386" joined="2017-02-27"/>
    <cosponsor bioguide_id="L000174" joined="2017-02-27"/>
  </cosponsors>
  <actions>
    <action datetime="2017-02-27">
      <text>Introduced in Senate</text>
    </action>
    <action datetime="2017-02-27" state="REFERRED">
      <text>Read twice and referred to the Committee on Health, Education, Labor, and Pensions.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="SSHR" name="Senate Health, Education, Labor, and Pensions" activity="Referral"/>
  </committees>
  <relatedbills>
    <bill type="h" session="115" relation="identical" number="2650"/>
  </relatedbills>
  <subjects>
    <term name="Labor and employment"/>
    <term name="Age discrimination"/>
    <term name="Civil actions and liability"/>
    <term name="Disability and health-based discrimination"/>
    <term name="Employment discrimination and employee rights"/>
    <term name="Evidence and witnesses"/>
    <term name="Government Operations and Politics"/>
    <term name="Government employee pay, benefits, personnel management"/>
    <term name="Racial and ethnic relations"/>
    <term name="Sex, gender, sexual orientation discrimination"/>
  </subjects>
  <amendments/>
  <committee-reports/>
</bill>

redpajama_set_name: RedPajamaGithub


text:
using System;

namespace Azure.ResourceManager.IotHub.Models
{
    /// <summary> The properties of the Job Response object. </summary>
    public partial class IotHubJobInfo
    {
        /// <summary> Initializes a new instance of IotHubJobInfo. </summary>
        internal IotHubJobInfo()
        {
        }

        /// <summary> Initializes a new instance of IotHubJobInfo. </summary>
        /// <param name="jobId"> The job identifier. </param>
        /// <param name="startOn"> The start time of the job. </param>
        /// <param name="endOn"> The time the job stopped processing. </param>
        /// <param name="jobType"> The type of the job. </param>
        /// <param name="status"> The status of the job. </param>
        /// <param name="failureReason"> If status == failed, this string containing the reason for the failure. </param>
        /// <param name="statusMessage"> The status message for the job. </param>
        /// <param name="parentJobId"> The job identifier of the parent job, if any. </param>
        internal IotHubJobInfo(string jobId, DateTimeOffset? startOn, DateTimeOffset? endOn, IotHubJobType? jobType, IotHubJobStatus? status, string failureReason, string statusMessage, string parentJobId)
        {
            JobId = jobId;
            StartOn = startOn;
            EndOn = endOn;
            JobType = jobType;
            Status = status;
            FailureReason = failureReason;
            StatusMessage = statusMessage;
            ParentJobId = parentJobId;
        }

        /// <summary> The job identifier. </summary>
        public string JobId { get; }
        /// <summary> The start time of the job. </summary>
        public DateTimeOffset? StartOn { get; }
        /// <summary> The time the job stopped processing. </summary>
        public DateTimeOffset? EndOn { get; }
        /// <summary> The type of the job. </summary>
        public IotHubJobType? JobType { get; }
        /// <summary> The status of the job. </summary>
        public IotHubJobStatus? Status { get; }
        /// <summary> If status == failed, this string containing the reason for the failure. </summary>
        public string FailureReason { get; }
        /// <summary> The status message for the job. </summary>
        public string StatusMessage { get; }
        /// <summary> The job identifier of the parent job, if any. </summary>
        public string ParentJobId { get; }
    }
}


text:
layout: page
header: no
#
# Content
#
title: "Emergency hernia repair in cirrhotic patients with ascites."
subheadline: "2013"
teaser: "Odom SR, Gupta A, Talmor D, Novack V, Sagy I, Evenson AR."
externalURL: "https://www.ncbi.nlm.nih.gov/pubmed/24089110"
categories: [Publications]
tags: [Gastroenterology]
---


text:
<title>Vectors - GNU Compiler Collection (GCC) Internals</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Expression-trees.html#Expression-trees" title="Expression trees">
<link rel="prev" href="Unary-and-Binary-Expressions.html#Unary-and-Binary-Expressions" title="Unary and Binary Expressions">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

Previous: Unary and Binary Expressions,
Up: Expression trees

11.6.4 Vectors

VEC_DUPLICATE_EXPR
This node has a single operand and represents a vector in which every
element is equal to that operand.

VEC_SERIES_EXPR
This node represents a vector formed from a scalar base and step,
given as the first and second operands respectively.  Element <var>i</var>
of the result is equal to ‘<samp><var>base</var> + <var>i</var>*<var>step</var></samp>’.

This node is restricted to integral types, in order to avoid
specifying the rounding behavior for floating-point types.

VEC_LSHIFT_EXPR
VEC_RSHIFT_EXPR
These nodes represent whole vector left and right shifts, respectively.
The first operand is the vector to shift; it will always be of vector type.
The second operand is an expression for the number of bits by which to
shift.  Note that the result is undefined if the second operand is larger
than or equal to the first operand's type size.

VEC_WIDEN_MULT_HI_EXPR
VEC_WIDEN_MULT_LO_EXPR
These nodes represent widening vector multiplication of the high and low
parts of the two input vectors, respectively.  Their operands are vectors
that contain the same number of elements (N) of the same integral type.
The result is a vector that contains half as many elements, of an integral type
whose size is twice as wide.  In the case of VEC_WIDEN_MULT_HI_EXPR the
high N/2 elements of the two vector are multiplied to produce the
vector of N/2 products. In the case of VEC_WIDEN_MULT_LO_EXPR the
low N/2 elements of the two vector are multiplied to produce the
vector of N/2 products.

VEC_UNPACK_HI_EXPR
VEC_UNPACK_LO_EXPR
These nodes represent unpacking of the high and low parts of the input vector,
respectively.  The single operand is a vector that contains N elements
of the same integral or floating point type.  The result is a vector
that contains half as many elements, of an integral or floating point type
whose size is twice as wide.  In the case of VEC_UNPACK_HI_EXPR the
high N/2 elements of the vector are extracted and widened (promoted).
In the case of VEC_UNPACK_LO_EXPR the low N/2 elements of the
vector are extracted and widened (promoted).

VEC_UNPACK_FLOAT_HI_EXPR
VEC_UNPACK_FLOAT_LO_EXPR
These nodes represent unpacking of the high and low parts of the input vector,
where the values are converted from fixed point to floating point.  The
single operand is a vector that contains N elements of the same
integral type.  The result is a vector that contains half as many elements
of a floating point type whose size is twice as wide.  In the case of
VEC_UNPACK_HI_EXPR the high N/2 elements of the vector are
extracted, converted and widened.  In the case of VEC_UNPACK_LO_EXPR
the low N/2 elements of the vector are extracted, converted and widened.

VEC_PACK_TRUNC_EXPR
This node represents packing of truncated elements of the two input vectors
into the output vector.  Input operands are vectors that contain the same
number of elements of the same integral or floating point type.  The result
is a vector that contains twice as many elements of an integral or floating
point type whose size is half as wide. The elements of the two vectors are
demoted and merged (concatenated) to form the output vector.

VEC_PACK_SAT_EXPR
This node represents packing of elements of the two input vectors into the
output vector using saturation.  Input operands are vectors that contain
the same number of elements of the same integral type.  The result is a
vector that contains twice as many elements of an integral type whose size
is half as wide.  The elements of the two vectors are demoted and merged
(concatenated) to form the output vector.

VEC_PACK_FIX_TRUNC_EXPR
This node represents packing of elements of the two input vectors into the
output vector, where the values are converted from floating point
to fixed point.  Input operands are vectors that contain the same number
of elements of a floating point type.  The result is a vector that contains
twice as many elements of an integral type whose size is half as wide.  The
elements of the two vectors are merged (concatenated) to form the output
vector.

VEC_COND_EXPR
These nodes represent ?: expressions.  The three operands must be
vectors of the same size and number of elements.  The second and third
operands must have the same type as the entire expression.  The first
operand is of signed integral vector type.  If an element of the first
operand evaluates to a zero value, the corresponding element of the
result is taken from the third operand. If it evaluates to a minus one
value, it is taken from the second operand. It should never evaluate to
any other value currently, but optimizations should not rely on that
property. In contrast with a COND_EXPR, all operands are always
evaluated.

SAD_EXPR
This node represents the Sum of Absolute Differences operation.  The three
operands must be vectors of integral types.  The first and second operand
must have the same type.  The size of the vector element of the third
operand must be at lease twice of the size of the vector element of the
first and second one.  The SAD is calculated between the first and second
operands, added to the third operand, and returned.


text:
INSERT INTO osmaxx.poi_p
 SELECT osm_id as osm_id,
    osm_timestamp as lastchange,
    'N' AS geomtype,
    way AS geom,
    'public' as aggtype,
    office as type,
    name as name,
    "name:en" as name_en,
    "name:fr" as name_fr,
    "name:es" as name_es,
    "name:de" as name_de,
    int_name as name_int,
    case
        when name is not null AND name = osml10n_translit(name) then name
        when "name:en" is not null then "name:en"
        when "name:fr" is not null then "name:fr"
        when "name:es" is not null then "name:es"
        when "name:de" is not null then "name:de"
        when int_name is not null then osml10n_translit(int_name)
        when name is not null then osml10n_translit(name)
        else NULL
    end as label,
    cast(tags as text) as tags,
    website as website,
    wikipedia as wikipedia,
    case
        when "contact:phone" is not NULL then "contact:phone"
        else phone
    end as phone,
    opening_hours as opening_hours,
    cuisine as cuisine,
    "access" as "access",
    brand as brand,
    "tower:type" as tower_type
  FROM osm_point
  WHERE office='government'
UNION
 SELECT osm_id as osm_id,
    osm_timestamp as lastchange,
    CASE
     WHEN osm_id<0 THEN 'R'
     ELSE 'W'
     END AS geomtype,
    ST_Centroid(way) AS geom,
    'public' as aggtype,
    office as type,
    name as name,
    "name:en" as name_en,
    "name:fr" as name_fr,
    "name:es" as name_es,
    "name:de" as name_de,
    int_name as name_int,
    case
        when name is not null AND name = osml10n_translit(name) then name
        when "name:en" is not null then "name:en"
        when "name:fr" is not null then "name:fr"
        when "name:es" is not null then "name:es"
        when "name:de" is not null then "name:de"
        when int_name is not null then osml10n_translit(int_name)
        when name is not null then osml10n_translit(name)
        else NULL
    end as label,
    cast(tags as text) as tags,
    website as website,
    wikipedia as wikipedia,
    case
        when "contact:phone" is not NULL then "contact:phone"
        else phone
    end as phone,
    opening_hours as opening_hours,
    cuisine as cuisine,
    "access" as "access",
    brand as brand,
    "tower:type" as tower_type
  FROM osm_polygon
  WHERE office='government';


text:
require 'set'
require 'forwardable'

# MIME::Types requires a serializable keyed container that returns an empty Set
# on a key miss. Hash#default_value cannot be used because, while it traverses
# the Marshal format correctly, it won't survive any other serialization
# format (plus, a default of a mutable object resuls in a shared mess).
# Hash#default_proc cannot be used without a wrapper because it prevents
# Marshal serialization (and doesn't survive the round-trip).
class MIME::Types::Container #:nodoc:
  extend Forwardable

  def initialize(hash = {})
    @container = {}
    merge!(hash)
  end

  def [](key)
    container[key] || EMPTY_SET
  end

  def []=(key, value)
    case value
    when Set
      container[key] = value
    else
      container[key] = Set[*value]
    end
  end

  def merge(other)
    self.class.new(other)
  end

  def merge!(other)
    tap {
      other = other.kind_of?(MIME::Types::Container) ? other.container : other
      self.container.merge!(other)
      normalize
    }
  end

  def to_hash
    container
  end

  def_delegators :@container,
    :==,
    :count,
    :each,
    :each_value,
    :empty?,
    :flat_map,
    :keys,
    :select,
    :values

  def add(key, value)
    (container[key] ||= Set.new).add(value)
  end

  def marshal_dump
    {}.merge(container)
  end

  def marshal_load(hash)
    @container = hash
  end

  def encode_with(coder)
    container.each { |k, v| coder[k] = v.to_a }
  end

  def init_with(coder)
    @container = {}
    coder.map.each { |k, v| container[k] = Set[*v] }
  end

  protected

  attr_accessor :container

  def normalize
    container.each do |k, v|
      next if v.kind_of?(Set)
      container[k] = Set[*v]
    end
  end

  EMPTY_SET = Set.new.freeze
  private_constant :EMPTY_SET
end


text:
package exercise;

import java.util.Arrays;
import java.util.Scanner;

public class SmallestNumber {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] numbers = Arrays.stream(scanner.nextLine().split("\\s+"))
                .mapToInt(Integer::parseInt)
                .toArray();
        System.out.println(Arrays.stream(numbers).min().getAsInt());
    }
}


text:
package codes.soloware.couchpotato.server.sound;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.esotericsoftware.kryonet.Connection;
import com.esotericsoftware.kryonet.Listener;

import codes.soloware.couchpotato.server.api.MuteControl;
import codes.soloware.couchpotato.server.api.MuteSettingChange;
import codes.soloware.couchpotato.server.api.VolumeControl;
import codes.soloware.couchpotato.server.api.VolumeSettingChange;
/**
 * A {@link Listener} that implements any {@link #received} audio setting changes.
 */
public class AudioSettingChangeListener extends Listener
{
	private static final Logger logger=LoggerFactory.getLogger(AudioSettingChangeListener.class);
	private final VolumeControl volume;
	private final MuteControl mute;

	public AudioSettingChangeListener(final AudioControlGroup controls)
	{
		volume=LoggedVolumeControl.decorateIfLoggingEnabled(controls.getVolumeControl());
		if (volume==null)
			throw new NullPointerException("Given audio control group has a null volume control.");

		MuteControl muteCandidate=controls.getMuteControl();
		if (muteCandidate==null)
			muteCandidate=new VolumeControlMuter(volume);
		mute=LoggedMuteControl.decorateIfLoggingEnabled(muteCandidate);
	}

	@Override
	public void received(final Connection ignored, final Object received)
	{
		if (received instanceof VolumeSettingChange)
		{
			try
			{
				((VolumeSettingChange)received).implement(volume);
			}
			catch (final Exception error)
			{
				logger.error("An exception was thrown while implementing a volume setting change.", error);
			}
		}
		if (received instanceof MuteSettingChange)
		{
			try
			{
				((MuteSettingChange)received).implement(mute);
			}
			catch (final Exception error)
			{
				logger.error("An exception was thrown while implementing a mute setting change.", error);
			}
		}
	}
}


text:
namespace NHibernatePlayPen.Domain
{
    public abstract class EntityBase
    {
        public virtual int Id { get; set; }
    }
}


text:
class CGameUIConVarRef;

namespace BaseModUI
{
	class BaseModHybridButton;

	class SliderControl : public vgui::EditablePanel
	{
		DECLARE_CLASS_SIMPLE( SliderControl , vgui::EditablePanel );
	public:
		SliderControl( vgui::Panel* parent, const char* panelName );
		virtual ~SliderControl( );

		virtual void SetEnabled(bool state);

		float GetCurrentValue();
		void SetCurrentValue( float value, bool bReset = false );
		float Increment( float stepSize = 1.0f );
		float Decrement( float stepSize = 1.0f );

		const char* GetConCommand();
		float GetConCommandDefault();
		float GetStepSize();
		float GetMin();
		float GetMax();
		void SetConCommand( const char* conCommand );
		void SetConCommandDefault( const char* conCommand );
		void SetStepSize( float stepSize );
		void SetMin( float min );
		void SetMax( float max );

		int GetTextureId();

		void SetInverse( bool inverse );
		bool GetInversed();

		bool IsDirty( void ) { return m_bDirty; }

		void Reset(); //get the current value stored in the convar and set it to that.
		void ResetSliderPosAndDefaultMarkers();

		virtual void NavigateTo();
		virtual void NavigateFrom();

	protected:
		virtual void ApplySettings( KeyValues* inResourceData );
		virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
		virtual void PerformLayout();
		virtual void OnKeyCodePressed( vgui::KeyCode code );
		virtual void OnMousePressed( vgui::MouseCode code );
		virtual void OnStartDragging();
		virtual void OnContinueDragging();
		virtual void OnFinishDragging( bool mousereleased, vgui::MouseCode code, bool aborted = false );
		virtual void OnCursorEntered();
		virtual void OnCursorExited();
		virtual void NavigateToChild( Panel *pNavigateTo );

		void HandleMouseInput( bool bDrag );

		CGameUIConVarRef* GetConVarRef();
		float UpdateProgressBar();
		void UpdateConVar();

	private:

		bool	m_bDragging;

		BaseModHybridButton *m_button;
		vgui::Label* m_lblSliderText;
		vgui::ProgressBar* m_prgValue;
		vgui::Panel* m_defaultMark;

		Color m_focusColor;
		Color m_unfocusColor;
		Color m_backgroundFocusColor;

		bool m_inverse;

		float m_min;
		float m_max;
		float m_curValue;
		float m_stepSize;
		CGameUIConVarRef* m_conVarRef;
		CGameUIConVarRef* m_conVarDefaultRef;

		bool m_bDirty;
	};
};

#endif


text:
@interface ViewController : UIViewController

@end

@interface ViewController (UITableViewDataSource)<UITableViewDataSource>

@end


text:
package ch.sbb.maven.plugins.iib.mojos;

import static org.twdata.maven.mojoexecutor.MojoExecutor.artifactId;
import static org.twdata.maven.mojoexecutor.MojoExecutor.configuration;
import static org.twdata.maven.mojoexecutor.MojoExecutor.element;
import static org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo;
import static org.twdata.maven.mojoexecutor.MojoExecutor.executionEnvironment;
import static org.twdata.maven.mojoexecutor.MojoExecutor.goal;
import static org.twdata.maven.mojoexecutor.MojoExecutor.groupId;
import static org.twdata.maven.mojoexecutor.MojoExecutor.name;
import static org.twdata.maven.mojoexecutor.MojoExecutor.plugin;
import static org.twdata.maven.mojoexecutor.MojoExecutor.version;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;

import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.BuildPluginManager;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;

/**
 * Packages a WebSphere Message Broker Project.
 *
 * Implemented with help from: https://github.com/TimMoore/mojo-executor/blob/master/README.md
 */
@Mojo(name = "package-iib-src")
public class PackageIibSrcMojo extends AbstractMojo {

    /**
     * The Maven Project Object
     */
    @Parameter(property = "project", required = true, readonly = true)
    protected MavenProject project;

    /**
     * The Maven Session Object
     */
    @Parameter(property = "session", required = true, readonly = true)
    protected MavenSession session;

    /**
     * The Maven PluginManager Object
     */
    @Component
    protected BuildPluginManager buildPluginManager;

    /**
     * The path to write the assemblies/iib-src-project.xml file to before invoking the maven-assembly-plugin.
     */
    @Parameter(defaultValue = "${project.build.directory}/assemblies/iib-src-project.xml", readonly = true)
    private File buildAssemblyFile;

    public void execute() throws MojoExecutionException, MojoFailureException {
        InputStream is = this.getClass().getResourceAsStream("/assemblies/iib-src-project.xml");
        FileOutputStream fos;
        buildAssemblyFile.getParentFile().mkdirs();
        try {
            fos = new FileOutputStream(buildAssemblyFile);
        } catch (FileNotFoundException e) {
            // should never happen, as the file is packaged in this plugin's jar
            throw new MojoFailureException("Error creating the build assembly file: " + buildAssemblyFile, e);
        }
        try {
            IOUtil.copy(is, fos);
        } catch (IOException e) {
            // should never happen
            throw new MojoFailureException("Error creating the assembly file: " + buildAssemblyFile.getAbsolutePath(), e);
        }

        // mvn org.apache.maven.plugins:maven-assembly-plugin:2.4:single -Ddescriptor=target\assemblies\iib-src-project.xml -Dassembly.appendAssemblyId=false

        executeMojo(plugin(groupId("org.apache.maven.plugins"), artifactId("maven-assembly-plugin"), version("2.4")), goal("single"), configuration(element(name("descriptor"),
                "${project.build.directory}/assemblies/iib-src-project.xml"), element(name("appendAssemblyId"), "false")),
                executionEnvironment(project, session, buildPluginManager));

        // delete the archive-tmp directory
        try {
            FileUtils.deleteDirectory(new File(project.getBuild().getDirectory(), "archive-tmp"));
        } catch (IOException e) {
            // Fail silently
        }
    }

}


text:
namespace Shapes
{
    using System;
    public abstract class Shape
    {
        protected double width;
        protected double height;

        protected Shape(double initialWidth, double initialHeight)
        {
            this.Width = initialWidth;
            this.Height = initialHeight;
        }
        public virtual double Width
        {
            get
            {
                return this.width;
            }
            protected set
            {
                if (value < 0.1)
                {
                    throw new ArgumentException("Invalid shape width");
                }
                this.width = value;
            }
        }

        public virtual double Height
        {
            get
            {
                return this.height;
            }
            protected set
            {
                if (value < 0.1)
                {
                    throw new ArgumentException("Invalid shape height");
                }
                this.height = value;
            }
        }

        public virtual double GetSurface()
        {
            return this.width * this.height;
        }
        protected abstract double CalculateSurface();
    }
}


text:
var React = require('react');
var classnames = require('classnames');
var Tappable = require('react-tappable');

module.exports = React.createClass({
	displayName: 'Toggle',

	propTypes: {
		className: React.PropTypes.string,
		onChange: React.PropTypes.func.isRequired,
		options: React.PropTypes.array.isRequired,
		type: React.PropTypes.string,
		value: React.PropTypes.string
	},

	getDefaultProps: function () {
		return {
			type: 'primary'
		};
	},

	onChange: function (value) {
		this.props.onChange(value);
	},

	render: function () {
		var componentClassName = classnames('Toggle', this.props.className, this.props.type);
		var self = this;

		var options = this.props.options.map(function (op) {
			function onChange () {
				self.onChange(op.value);
			}

			var itemClassName = classnames('Toggle-item', {
				'active': op.value === self.props.value
			});

			return (<Tappable key={'option-' + op.value} onTap={onChange} className={itemClassName}>
				{op.label}
			</Tappable>);
		});

		return
{options}
;
	}
});


text:
namespace Farfetch.Buildionaire.Domain.Services.ScoreStrategy
{
    using System;

    using Farfetch.Buildionaire.Domain.Model;

    public class CodeCoverageScoreStrategy : IScoreStrategy
    {
        public int GetScore(Build build, Metric metric)
        {
            if(build.CodeCoverage == null)
            {
                return 0;
            }

            if(build.CodeCoverage.TotalBlocks <= 0)
            {
                return 0;
            }

            var coverage =  build.CodeCoverage.CoveredBlocks * 100.0 / build.CodeCoverage.TotalBlocks;

            return (int)Math.Round(metric.Weight * coverage);
        }
    }
}


text:
<!DOCTYPE html>

	<title>JQM Carousel - Demo</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="ext/libs/jqm/jqm.css">
	<link rel="stylesheet" href="../css/jquery.mobile.carousel.css">

Carousel Demo

Nokia Lumia

Samsung Galaxy

Firefox Phone


text:
import numpy as np
import pandas as pd
import csv
from collections import Counter

"""
This module is used to host the different functions that load the training
data into a single manageable dataframe.

These are a series of helper functions that extract the raw information from
the training data csv files that were put together by Stefano Cresci,
Roberto Di Pietro, Marinella Petrocchi, Angelo Spognardi, and Maurizio
Tesconi for their paper "Fame for sale: efficient detection of fake Twitter
followers." http://mib.projects.iit.cnr.it/dataset.html is the link to their
data. The main orientation of this script is to compile the different csv
files that this research team put together into one single and properly
labeled csv.

As the dataset I used for this project may not be shared, this module
only demonstrates the the kind of features and transformations I did with
this dataset so that should there be anyone who wishes to pursue further
research in this area, a method already exists for collecting the data
into a single pandas dataframe

Example:
    file_list = human_users+fake_users
    checkdata = get_first_row_of_all_csv_files_in_a_list(file_list)
    column_list = get_intersection_columns_for_different_csv_files(checkdata)
    df = extract_columns_from_multiple_csvs(column_list,
                                            file_list)
    df.to_csv('data/training_users.csv')

    file_list = human_tweets+fake_tweets
    checkdata = get_first_row_of_all_csv_files_in_a_list(file_list)
    column_list = get_intersection_columns_for_different_csv_files(checkdata)
    df = extract_columns_from_multiple_csvs(column_list,
                                            file_list)
    df.to_csv('data/training_tweets.csv')
"""

ds1_genuine_tweets = 'data/datasets_full.csv/genuine_accounts.csv/tweets.csv'
ds1_genuine_users = 'data/datasets_full.csv/genuine_accounts.csv/users.csv'
ds1_sb1_tweets = 'data/datasets_full.csv/social_spambots_1.csv/tweets.csv'
ds1_sb1_users = 'data/datasets_full.csv/social_spambots_1.csv/users.csv'
ds1_sb2_tweets = 'data/datasets_full.csv/social_spambots_2.csv/tweets.csv'
ds1_sb2_users = 'data/datasets_full.csv/social_spambots_2.csv/users.csv'
ds1_sb3_tweets = 'data/datasets_full.csv/social_spambots_3.csv/tweets.csv'
ds1_sb3_users = 'data/datasets_full.csv/social_spambots_3.csv/users.csv'
ds1_ts1_tweets = 'data/datasets_full.csv/traditional_spambots_1.csv/tweets.csv'
ds1_ts1_users = 'data/datasets_full.csv/traditional_spambots_1.csv/users.csv'
ds1_ts2_tweets = 'data/datasets_full.csv/traditional_spambots_2.csv/tweets.csv'
ds1_ts2_users = 'data/datasets_full.csv/traditional_spambots_2.csv/users.csv'
ds1_ts3_tweets = 'data/datasets_full.csv/traditional_spambots_3.csv/tweets.csv'
ds1_ts3_users = 'data/datasets_full.csv/traditional_spambots_3.csv/users.csv'
ds1_ts4_tweets = 'data/datasets_full.csv/traditional_spambots_4.csv/tweets.csv'
ds1_ts4_users = 'data/datasets_full.csv/traditional_spambots_4.csv/users.csv'
ds1_ff_tweets = 'data/datasets_full.csv/fake_followers.csv/tweets.csv'
ds1_ff_users = 'data/datasets_full.csv/fake_followers.csv/users.csv'
ds2_tfp_tweets = 'data/TFP.csv/tweets.csv'
ds2_tfp_users = 'data/TFP.csv/users.csv'
ds2_e13_tweets = 'data/E13.csv/tweets.csv'
ds2_e13_users = 'data/E13.csv/users.csv'
ds2_fsf_tweets = 'data/FSF.csv/tweets.csv'
ds2_fsf_users = 'data/FSF.csv/users.csv'
ds2_int_tweets = 'data/INT.csv/tweets.csv'
ds2_int_users = 'data/INT.csv/users.csv'
ds2_twt_tweets = 'data/TWT.csv/tweets.csv'
ds2_twt_users = 'data/TWT.csv/users.csv'

human_tweets = [ds1_genuine_tweets, ds2_e13_tweets, ds2_tfp_tweets]
fake_tweets = [ds1_sb1_tweets, ds1_sb2_tweets, ds1_sb3_tweets,
               ds1_ts1_tweets, ds2_fsf_tweets, ds2_int_tweets,
               ds2_twt_tweets]
human_users = [ds1_genuine_users, ds2_e13_users, ds2_tfp_users]
fake_users = [ds1_sb1_users, ds1_sb2_users, ds1_sb3_users, ds1_ts1_users,
              ds2_fsf_users, ds2_int_users, ds2_twt_users]
filename_dict = {ds1_genuine_tweets: 'hum_tw', ds2_e13_tweets: "e13_tw",
                 ds2_tfp_tweets: "tfp_tw", ds1_sb1_tweets: "sb1_tw",
                 ds1_sb2_tweets: "sb2_tw", ds1_sb3_tweets: "sb3_tw",
                 ds1_ts1_tweets: "ts1_tw", ds2_fsf_tweets: "fsf_tw",
                 ds2_int_tweets: "int_tw", ds2_twt_tweets: "twt_tw",
                 ds1_genuine_users: "hum1_us", ds2_e13_users: "e13_us",
                 ds2_tfp_users: "tfp_us", ds1_sb1_users: "sb1_us",
                 ds1_sb2_users: "sb2_us", ds1_sb3_users: "sb3_us",
                 ds1_ts1_users: "ts1_us", ds2_fsf_users: "fsf_us",
                 ds2_int_users: "int_us", ds2_twt_users: "twt_us"}
label_dict = {ds1_genuine_tweets: 0, ds2_e13_tweets: 0,
              ds2_tfp_tweets: 0, ds1_sb1_tweets: 1,
              ds1_sb2_tweets: 1, ds1_sb3_tweets: 1,
              ds1_ts1_tweets: 1, ds2_fsf_tweets: 1,
              ds2_int_tweets: 1, ds2_twt_tweets: 1,
              ds1_genuine_users: 0, ds2_e13_users: 0,
              ds2_tfp_users: 0, ds1_sb1_users: 1,
              ds1_sb2_users: 1, ds1_sb3_users: 1,
              ds1_ts1_users: 1, ds2_fsf_users: 1,
              ds2_int_users: 1, ds2_twt_users: 1}

def open_csv_file_as_dataframe(filename):
    """
    Args:
        filename (str): this is the name of the file that will be opened
        as a dataframe
    Returns
        df (pandas DataFrame): contents of csv file, null bytes and other
        items removed in a dataframe, with column headers which is in the
        first row of each file
    """
    text_list = []
    with open(filename, 'r') as csvfile:
        opencsvfile = csv.reader(x.replace('\0', '').replace('\n', '')
                                 for x in csvfile)
        for row in opencsvfile:
            text_list.append(row)
    columns = text_list[0]
    df = pd.DataFrame(text_list[1:], columns=columns)
    return df

def get_first_row_of_all_csv_files_in_a_list(file_list):
    """
    Args:
        file_list (list): list of csv files that will be processed
    Returns:
        output_dict (dictionary): where the keys are the columns of the
        different text files and the values are the number of files
        these columns occur in
    """
    output_list = []
    for file_name in file_list:
        with open(file_name, 'r') as f:
            first_line = f.readline()
            first_line = first_line.replace('"', ''). \
                replace('\n', '').replace('\r', '').split(',')

            output_list += first_line
    output_dict = Counter(output_list)
    return output_dict

def extract_columns_from_multiple_csvs(column_list, csv_list):
    """
    Args:
        column_list (list): list of columns to extract from the different csvs
        csv_list (list): list of the different csvs to get the data from
    Returns
        compiled_df (pandas DataFrame): a dataframe that has all the
        columns from the different csvs
    """
    compiled_df = pd.DataFrame(columns=np.append(column_list,
                                                 ['file', 'label']))
    for csv_file in csv_list:
        print(csv_file)
        df = open_csv_file_as_dataframe(csv_file)
        df.columns = [c.replace('\n', '').replace('\r',
                                                  '') for c in df.columns]
        df = df[column_list]
        df['file'] = filename_dict[csv_file]
        df['label'] = label_dict[csv_file]
        compiled_df = pd.concat([compiled_df, df])
    return compiled_df

def get_intersection_columns_for_different_csv_files(output_dict):
    """
    Args:
        output_dict (dictionary): a dictionary that has the keys as
        columns and the values as the number of csv files they occur in
    Returns:
        column_list (list): a list of columns that has the columns which occur
        in all csv files that will be loaded into a dataframe
    """
    column_list = []
    maxval = max(output_dict.values())
    for k, v in output_dict.iteritems():
        if v == maxval:
            column_list.append(k)
    return column_list

if __name__ == "__main__":
    file_list = human_users+fake_users
    checkdata = get_first_row_of_all_csv_files_in_a_list(file_list)
    column_list = get_intersection_columns_for_different_csv_files(checkdata)
    df = extract_columns_from_multiple_csvs(column_list,
                                            file_list)
    df.to_csv('data/training_users.csv')


text:
<?php
/**
 * @file
 * Drupal cache configuration.
 * @link http://helpdesk.getpantheon.com/customer/portal/articles/408428
 */

if (defined('PANTHEON_ENVIRONMENT')) {
  // Drupal caching in development environments.
  if (!in_array(PANTHEON_ENVIRONMENT, array('test', 'live'))) {
    // Anonymous caching.
    $conf['cache'] = 0;
    // Block caching - disabled.
    $conf['block_cache'] = 0;
    // Expiration of cached pages - none.
    $conf['page_cache_maximum_age'] = 0;
    // Aggregate and compress CSS files in Drupal - off.
    $conf['preprocess_css'] = 0;
    // Aggregate JavaScript files in Drupal - off.
    $conf['preprocess_js'] = 0;
  }
  // Drupal caching in test and live environments.
  else {
    // Anonymous caching - enabled.
    $conf['cache'] = 1;
    // Block caching - enabled.
    $conf['block_cache'] = 1;
    // Expiration of cached pages - 15 minutes.
    $conf['page_cache_maximum_age'] = 900;
    // Aggregate and compress CSS files in Drupal - on.
    $conf['preprocess_css'] = 1;
    // Aggregate JavaScript files in Drupal - on.
    $conf['preprocess_js'] = 1;
  }
  // Minimum cache lifetime - always none.
  $conf['cache_lifetime'] = 0;
  // Cached page compression - always off.
  $conf['page_compression'] = 0;
}


text:
function EnvCredentialStore() {
}

EnvCredentialStore.prototype.get = function(hostname, cb) {
  if (typeof hostname == 'function') {
    cb = hostname;
    hostname = undefined;
  }

  if (hostname) { return cb(null); }

  var self = this;
  process.nextTick(function() {
    // TODO: is there a naming convention for this?
    var secret = process.env['SECRET'];

    // TODO: Error?
    if (!secret) { return cb(null); }
    return cb(null, {
      secret: secret
    });
  });
}

module.exports = EnvCredentialStore;


text:
<?php
/**
 * Content filter for river
 *
 * @uses $vars[]
 */

// create selection array
$options = array();
$options['type=all'] = elgg_echo('river:select', array(elgg_echo('all')));
$registered_entities = elgg_get_config('registered_entities');

if (!empty($registered_entities)) {
	foreach ($registered_entities as $type => $subtypes) {
		// subtype will always be an array.
		if (!count($subtypes)) {
			$label = elgg_echo('river:select', array(elgg_echo("item:$type")));
			$options["type=$type"] = $label;
		} else {
			foreach ($subtypes as $subtype) {
				$label = elgg_echo('river:select', array(elgg_echo("item:$type:$subtype")));
				$options["type=$type&subtype=$subtype"] = $label;
			}
		}
	}
}

$params = array(
	'id' => 'elgg-river-selector',
	'options_values' => $options,
);
$selector = $vars['selector'];
if ($selector) {
	$params['value'] = $selector;
}
echo elgg_view('input/dropdown', $params);

elgg_load_js('elgg.ui.river');


text: #include "DatabaseError.hpp"


text:
Gebruikers toestaan dit filesysteem te mounten?

Sta toe dat een ordinaire (bijv., niet-root) gebruiker dit filesysteem mag mounten.

mount opties: user/nouser


text:
from behave import given
from tests.ggrc.behave.utils import handle_named_example_resource

@given('a Category resource named "{name}" of type "{category_type}"')
def create_category(context, name, category_type):
  handle_named_example_resource(context, 'Category', name, type=category_type)


text:
Window::Window(QWidget *parent) : QWidget(parent) {
  ui_ = new Ui::MyWidget;
  ui_->setupUi(this);
}

Window::~Window() {
  delete ui_;
}

void Window::on_mybutton_clicked(bool checked) {
  ui_->mybutton->setText(checked ? "Checked" : "Hello, world!");
}


text:
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.

/*
Package xmpp provides the means to send and receive instant messages
to and from users of XMPP-compatible services.

To send a message,
	m := &xmpp.Message{
		To:   []string{"kaylee@example.com"},
		Body: `Hi! How's the carrot?`,
	}
	err := m.Send(c)

To receive messages,
	func init() {
		xmpp.Handle(handleChat)
	}

	func handleChat(c context.Context, m *xmpp.Message) {
		// ...
	}
*/
package xmpp

import (
	"errors"
	"fmt"
	"net/http"

	"golang.org/x/net/context"

	"google.golang.org/appengine"
	"google.golang.org/appengine/internal"
	pb "google.golang.org/appengine/internal/xmpp"
)

// Message represents an incoming chat message.
type Message struct {
	// Sender is the JID of the sender.
	// Optional for outgoing messages.
	Sender string

	// To is the intended recipients of the message.
	// Incoming messages will have exactly one element.
	To []string

	// Body is the body of the message.
	Body string

	// Type is the message type, per RFC 3921.
	// It defaults to "chat".
	Type string

	// RawXML is whether the body contains raw XML.
	RawXML bool
}

// Presence represents an outgoing presence update.
type Presence struct {
	// Sender is the JID (optional).
	Sender string

	// The intended recipient of the presence update.
	To string

	// Type, per RFC 3921 (optional). Defaults to "available".
	Type string

	// State of presence (optional).
	// Valid values: "away", "chat", "xa", "dnd" (RFC 3921).
	State string

	// Free text status message (optional).
	Status string
}

var (
	ErrPresenceUnavailable = errors.New("xmpp: presence unavailable")
	ErrInvalidJID          = errors.New("xmpp: invalid JID")
)

// Handle arranges for f to be called for incoming XMPP messages.
// Only messages of type "chat" or "normal" will be handled.
func Handle(f func(c context.Context, m *Message)) {
	http.HandleFunc("/_ah/xmpp/message/chat/", func(_ http.ResponseWriter, r *http.Request) {
		f(appengine.NewContext(r), &Message{
			Sender: r.FormValue("from"),
			To:     []string{r.FormValue("to")},
			Body:   r.FormValue("body"),
		})
	})
}

// Send sends a message.
// If any failures occur with specific recipients, the error will be an appengine.MultiError.
func (m *Message) Send(c context.Context) error {
	req := &pb.XmppMessageRequest{
		Jid:    m.To,
		Body:   &m.Body,
		RawXml: &m.RawXML,
	}
	if m.Type != "" && m.Type != "chat" {
		req.Type = &m.Type
	}
	if m.Sender != "" {
		req.FromJid = &m.Sender
	}
	res := &pb.XmppMessageResponse{}
	if err := internal.Call(c, "xmpp", "SendMessage", req, res); err != nil {
		return err
	}

	if len(res.Status) != len(req.Jid) {
		return fmt.Errorf("xmpp: sent message to %d JIDs, but only got %d statuses back", len(req.Jid), len(res.Status))
	}
	me, any := make(appengine.MultiError, len(req.Jid)), false
	for i, st := range res.Status {
		if st != pb.XmppMessageResponse_NO_ERROR {
			me[i] = errors.New(st.String())
			any = true
		}
	}
	if any {
		return me
	}
	return nil
}

// Invite sends an invitation. If the from address is an empty string
// the default (yourapp@appspot.com/bot) will be used.
func Invite(c context.Context, to, from string) error {
	req := &pb.XmppInviteRequest{
		Jid: &to,
	}
	if from != "" {
		req.FromJid = &from
	}
	res := &pb.XmppInviteResponse{}
	return internal.Call(c, "xmpp", "SendInvite", req, res)
}

// Send sends a presence update.
func (p *Presence) Send(c context.Context) error {
	req := &pb.XmppSendPresenceRequest{
		Jid: &p.To,
	}
	if p.State != "" {
		req.Show = &p.State
	}
	if p.Type != "" {
		req.Type = &p.Type
	}
	if p.Sender != "" {
		req.FromJid = &p.Sender
	}
	if p.Status != "" {
		req.Status = &p.Status
	}
	res := &pb.XmppSendPresenceResponse{}
	return internal.Call(c, "xmpp", "SendPresence", req, res)
}

var presenceMap = map[pb.PresenceResponse_SHOW]string{
	pb.PresenceResponse_NORMAL:         "",
	pb.PresenceResponse_AWAY:           "away",
	pb.PresenceResponse_DO_NOT_DISTURB: "dnd",
	pb.PresenceResponse_CHAT:           "chat",
	pb.PresenceResponse_EXTENDED_AWAY:  "xa",
}

// GetPresence retrieves a user's presence.
// If the from address is an empty string the default
// (yourapp@appspot.com/bot) will be used.
// Possible return values are "", "away", "dnd", "chat", "xa".
// ErrPresenceUnavailable is returned if the presence is unavailable.
func GetPresence(c context.Context, to string, from string) (string, error) {
	req := &pb.PresenceRequest{
		Jid: &to,
	}
	if from != "" {
		req.FromJid = &from
	}
	res := &pb.PresenceResponse{}
	if err := internal.Call(c, "xmpp", "GetPresence", req, res); err != nil {
		return "", err
	}
	if !*res.IsAvailable || res.Presence == nil {
		return "", ErrPresenceUnavailable
	}
	presence, ok := presenceMap[*res.Presence]
	if ok {
		return presence, nil
	}
	return "", fmt.Errorf("xmpp: unknown presence %v", *res.Presence)
}

// GetPresenceMulti retrieves multiple users' presence.
// If the from address is an empty string the default
// (yourapp@appspot.com/bot) will be used.
// Possible return values are "", "away", "dnd", "chat", "xa".
// If any presence is unavailable, an appengine.MultiError is returned
func GetPresenceMulti(c context.Context, to []string, from string) ([]string, error) {
	req := &pb.BulkPresenceRequest{
		Jid: to,
	}
	if from != "" {
		req.FromJid = &from
	}
	res := &pb.BulkPresenceResponse{}

	if err := internal.Call(c, "xmpp", "BulkGetPresence", req, res); err != nil {
		return nil, err
	}

	presences := make([]string, 0, len(res.PresenceResponse))
	errs := appengine.MultiError{}

	addResult := func(presence string, err error) {
		presences = append(presences, presence)
		errs = append(errs, err)
	}

	anyErr := false
	for _, subres := range res.PresenceResponse {
		if !subres.GetValid() {
			anyErr = true
			addResult("", ErrInvalidJID)
			continue
		}
		if !*subres.IsAvailable || subres.Presence == nil {
			anyErr = true
			addResult("", ErrPresenceUnavailable)
			continue
		}
		presence, ok := presenceMap[*subres.Presence]
		if ok {
			addResult(presence, nil)
		} else {
			anyErr = true
			addResult("", fmt.Errorf("xmpp: unknown presence %q", *subres.Presence))
		}
	}
	if anyErr {
		return presences, errs
	}
	return presences, nil
}

func init() {
	internal.RegisterErrorCodeMap("xmpp", pb.XmppServiceError_ErrorCode_name)
}


text:
Neben `router-link` für deklarative Links in Templates können wir mit Hilfe der Methoden der Router-Instanz programmatisch navigieren.

#### `router.push(location, onComplete?, onAbort?)`

Um zu einer anderen URL zu navigieren, nutzt man `router.push`. Diese Methode "pusht" einen neuen Eintrag in den Browser-Verlauf, sodass der Nutzer, wenn er die Zurück-Schaltfläche des Browsers betätigt, zur vorherigen URL zurückkehrt.

Das ist dieselbe Methode, die intern aufgerufen wird, wenn wir auf einen `<router-link>` klicken. Das Anlicken von `<router-link :to="...">` ist also das Äquivalent zu `router.push(...)`.

| Deklarativ | Programmatisch |
|-------------|--------------|
| `<router-link :to="...">` | `router.push(...)` |

Das Argument kann ein Pfad als String oder eine Beschreibung des Ziels (der "location") als Objekt sein.

``` js
// String
router.push('home')

// Objekt
router.push({ path: 'home' })

// benannte ("named") Route
router.push({ name: 'user', params: { userId: 123 }})

// mit Query, resultiert in /register?plan=private
router.push({ path: 'register', query: { plan: 'private' }})
```

In Version 2.2.0 können wir optional `onComplete` und `onAbort` Callbacks als zweites und drittes Argument angeben. Diese Callbacks werden jeweilse aufgerufen, wenn die Navigation entweder erfolgreich abgeschlossen wurde (nachdem alle asynchronen hooks durchlaufen wurden), oder wenn sie abgerochen wurde (weil eine neue Navigation zu derselben oder einer anderen Route gestartet wurde, z.B. durch einen Klick, bevor die aktuelle Navigation beendet werden konnte).

#### `router.replace(location, onComplete?, onAbort?)`

Dise methode verhält sich wie `router.push`, allerdings erstellt sie keinen neuen Eintrag im Browser-Verlauf. Sie ersetzt lediglich den aktuellen Eintrag.

| Deklarativ | Programmatisch |
|-------------|--------------|
| `<router-link :to="..." replace>` | `router.replace(...)` |

#### `router.go(n)`

Diese Methode akzeptiert einen einfachen Integer als Parameter der angibt, wie viele Schritte im Browser-Verlauf vor- oder rückwärts zu gehen sind - ähnlich wie `window.history.go(n)`.

Beispiele

``` js
// gehe einen Eintrag vorwärts - wie history.forward()
router.go(1)

// gehe einen Eintrag zurück - wie history.back()
router.go(-1)

// gehe drei Einträge vor
router.go(3)

// scheitert ohne Nachricht, wenn nicht genügend Einträge vorhanden sind
router.go(-100)
router.go(100)
```

#### Manipulation des Verlaufs

Vielleicht ist dir aufgefallen, dass `router.push`, `router.replace` und `router.go` Gegenstücke von [`window.history.pushState`, `window.history.replaceState` und `window.history.go`](https://developer.mozilla.org/de/docs/Web/API/History) sind und sie die `window.history`-API imitieren.

Das macht es einfach den Verlauf zu manipulieren, wenn man sich mit den [Browser-Verlauf-APIs](https://developer.mozilla.org/de/docs/Web/Guide/DOM/Manipulating_the_browser_history)
auskennt.

Erwähnenswert ist, dass Navigationsmethoden von `vue-router` (`push`, `replace`, `go`) in allen router modes (`history`, `hash`, `abstract`) genau gleich funktionieren.


text:
#ifndef ALIITSV11GEOMCABLEFLAT_H
#define ALIITSV11GEOMCABLEFLAT_H

//*************************************************************************
//   Class for flat cables
//
// Ludovic Gaudichet                                   gaudichet@to.infn.it
//*************************************************************************

class TGeoVolume;
class TGeoTranslation;
class TGeoCombiTrans;
class TGeoMedium;

#include "AliITSv11GeomCable.h"

class AliITSv11GeomCableFlat : public AliITSv11GeomCable {

 public:
  AliITSv11GeomCableFlat();
  AliITSv11GeomCableFlat(const char* name, Double_t width, Double_t thick);
  virtual ~AliITSv11GeomCableFlat() {};

  void        SetNLayers(Int_t nLayers);
  Int_t       SetLayer(Int_t nLayer,Double_t thick,TGeoMedium *medium,Int_t color=0);
  void        AddCheckPoint( TGeoVolume *vol, Int_t iCheckPt,
			     Double_t *coord, Double_t *orthVect);
  TGeoVolume* CreateAndInsertCableSegment(Int_t p2, Double_t rotation=0,
					  TGeoCombiTrans** ct=0);
  TGeoVolume* CreateAndInsertBoxCableSegment(Int_t p2, Double_t rotation=0,
					     TGeoCombiTrans** ct=0);
  TGeoVolume* CreateAndInsertCableCylSegment(Int_t p2, Double_t rotation=0,
					     TGeoCombiTrans** ct=0);

  void        SetWidth(Double_t width) { fWidth = width;};
  void        SetThickness(Double_t thick) {fThick = thick;};
  Double_t    GetWidth() const {return fWidth;};
  Double_t    GetThickness() const {return fThick;};

  virtual void  PrintCheckPoints() const;
  virtual Int_t GetPoint(Int_t iCheckPt, Double_t *coord) const;
  virtual Int_t GetVect(Int_t iCheckPt, Double_t *coord) const;

 protected:
  TGeoVolume *CreateSegment( const Double_t *coord1,const Double_t *coord2,
			     const Double_t *localVect1,
			     const Double_t *localVect2 );

  TGeoVolume *CreateBoxSegment( const Double_t *coord1,const Double_t *coord2);

  TGeoVolume *CreateCylSegment( const Double_t &phi, const Double_t &r);

  Double_t  fWidth;                                 // width
  Double_t  fThick;                                 // total thickness
  Int_t     fNlayer;                                // number of layers
  Double_t  fPreviousX[3];                          // used internally
  Double_t         fLayThickness[fgkCableMaxLayer]; // layer thicknesses
  TGeoTranslation *fTranslation[fgkCableMaxLayer];  // layer translations
  TGeoMedium      *fLayMedia[fgkCableMaxLayer];     // layer media
  Int_t            fLayColor[fgkCableMaxLayer];     // layer colors

 private:
  AliITSv11GeomCableFlat(const AliITSv11GeomCableFlat &source);
  AliITSv11GeomCableFlat& operator=(const AliITSv11GeomCableFlat &source);

  ClassDef(AliITSv11GeomCableFlat,1)
};

#endif


text:
layout: single
title: "Momentos Bangkok"
redirect_from: /node/109
categories:
tags: []
comments:
---
Hemos estado redescubriendo la ciudad a base de viajes en autobus con destino desconocido. Si hay tiempo contaré las nuevas impresiones en breve.

De momento tendréis que echarle imaginación a estos 'momentos'

![](/images/posts/2005-10-24-momentos-bangkok/IMG_0158.jpg)
![](/images/posts/2005-10-24-momentos-bangkok/IMG_0186.jpg)
![](/images/posts/2005-10-24-momentos-bangkok/IMG_0126.jpg)
![](/images/posts/2005-10-24-momentos-bangkok/IMG_0131.jpg)
![](/images/posts/2005-10-24-momentos-bangkok/IMG_0145.jpg)


text:
.content {
  margin-top: 50px;
}
.page-bg {
	background: url(../img/clients/home_bg.jpg) no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}
.undecorated-link:hover {
  text-decoration: none;
}
[ng\:cloak],
[ng-cloak],
[x-ng-cloak],
.ng-cloak,
.x-ng-cloak {
  display: none !important;
}
.header-profile-image {
  border-radius: 50%;
  height: 28px;
  margin-right: 5px;
  opacity: 0.8;
  width: 28px;
}
.open .header-profile-image,
a:hover .header-profile-image {
  opacity: 1;
}
.user-header-dropdown-toggle {
  padding-bottom: 11px !important;
  padding-top: 11px !important;
}
.user-primary-account {
  font-size: 30px;
  position: absolute;
  right: 10px;
  top: 10px;
}
.error-text {
  display: none;
}
.has-error .help-block.error-text {
  display: block;
}
.has-error .help-inline.error-text {
  display: inline;
}


text:
using System.Collections.Generic;
using System.Linq;
using PlayMe.Common.Model;
using PlayMe.Data;
using PlayMe.Server.Interfaces;

namespace PlayMe.Server
{
    public class UserService : IUserService
    {
        private readonly IDataService<User> userDataService;
        private readonly IUserSettings userSettings;

        public UserService(IDataService<User> userDataService, IUserSettings userSettings)
        {
            this.userSettings = userSettings;
            this.userDataService = userDataService;
        }

        public bool IsUserAdmin(string user)
        {
            bool databaseAdmin = userDataService.GetAll().Any(a => a.Username.ToLower() == user.ToLower());

            return IsUserSuperAdmin(user) || databaseAdmin;
        }

        public bool IsUserSuperAdmin(string user)
        {
            return userSettings.AdminUsers.Any(a => a.ToLower() == user.ToLower());
        }

        public IEnumerable<User> GetAdminUsers()
        {
            return userDataService.GetAll().ToArray();
        }

        public string GetDomain()
        {
            return userSettings.Domain;
        }
    }
}


text:
package com.intellij.codeInsight.folding.impl.actions;

public class ExpandAllToLevel4Action extends BaseExpandToLevelAction {
  public ExpandAllToLevel4Action() {
    super(4, true);
  }
}


text:
/**
 * Created by sasakiumi on 2/18/14.
 */
public class FullBorder extends Border {
    public FullBorder(Display display) {
        super(display);
    }

    @Override
    public int getColumns() {
        return 1 + display.getColumns() + 1;
    }

    @Override
    public int getRows() {
        return 1 + display.getRows() + 1;
    }

    @Override
    public String getRowText(int row) {
        if (row == 0) {
            return "+" + makeLine('-', display.getColumns()) + "+";
        } else if (row == display.getRows() + 1) {
            return "+" + makeLine('-', display.getColumns()) + "+";
        } else {
            return "|" + display.getRowText(row - 1) + "|";
        }
    }

    private String makeLine(char ch, int count) {
        StringBuffer buf = new StringBuffer();
        for (int i = 0; i < count; i++) {
            buf.append(ch);
        }
        return buf.toString();
    }
}


text:
StateProbReader::StateProbReader()
  : m_file(NULL),
    m_first_frame(0),
    m_last_frame(1),
    m_frames(1)
{
}

StateProbReader::~StateProbReader()
{
}

void
StateProbReader::open(FILE *file, int frames)
{
  size_t items_read;
  m_file = file;

  // Check the file format
  char tmp[3];
  items_read = fread(tmp, 3, 1, file);
  if (items_read != 1 || strcmp(tmp, "SPS") != 0)
    throw InvalidFormat();

  // Read the number of states
  items_read = fread(&m_num_states, sizeof(float), 1, file);
  if (items_read != 1)
    throw InvalidFormat();

  // Reserve memory for read buffer;
  m_frames = frames;
  m_read_buffer.reserve(m_frames * m_num_states);
  m_first_frame = 0;
  m_last_frame = 1;
}

bool
StateProbReader::go_to(int frame)
{
  // Read frames upto requested frame
  while (m_last_frame < frame) {
    size_t floats_read = fread(frame(m_last_frame),
			       sizeof(float), m_num_states, m_file);
    if (floats_read == 0)
      return false; // End of file
    if (floats_read != m_num_states)
      throw ShortFrame();

    m_last_frame++;
  }

  // Check if the past frame is still in the buffer.
  if (frame <= m_last_frame - m_frames)
    return ForgottenFrame();

  m_log_prob = frame(frame);
  return true;
}


text:
@interface ULProviderLinkedIn : NSObject <ULProvider>

@end


text:
package com.intellij.openapi.editor;

import org.jetbrains.annotations.NonNls;
import javax.annotation.Nonnull;

/**
 * Represents a visual position in the editor. Visual positions take folding into account -
 * for example, if the top 10 lines of the document are folded, the 10th line in the document
 * will have the line number 1 in its visual position.
 *

 * Visual position corresponds to a boundary between two characters and can be associated with either a preceding or succeeding character
 * (see {@link #leansRight}). This association makes a difference in a bidirectional text, where a mapping from visual to logical position
 * is not continuous.
 *
 * @see LogicalPosition
 * @see Editor#logicalToVisualPosition(LogicalPosition)
 * @see Editor#offsetToVisualPosition(int)
 * @see Editor#xyToVisualPosition(java.awt.Point)
 */
public class VisualPosition {
  public final int line;
  public final int column;
  /**
   * If true, this position is associated with succeeding character (in visual order), otherwise it's associated with
   * preceding character. This can make difference in bidirectional text, where visual positions which differ only in this flag's value
   * can correspond to a different logical positions.
   *

   * This field has no impact on equality and comparison relationships between VisualPosition instances.
   */
  public final boolean leansRight;

  public VisualPosition(int line, int column) {
    this(line, column, false);
  }

  public VisualPosition(int line, int column, boolean leansRight) {
    if (line < 0) throw new IllegalArgumentException("line must be non negative: "+line);
    if (column < 0) throw new IllegalArgumentException("column must be non negative: "+column);
    this.line = line;
    this.column = column;
    this.leansRight = leansRight;
  }

  /**
   * Allows to answer if current visual position is located after the given one.
   *

   * One visual position is considered to be 'after' another only if one of the following is true:
   *

   *

   *
its visual line is greater;

   *
it has the same visual line but its column is greater;

   *

   *

   *
   * @param other   visual position to compare with the current one
   * @return        true if current position is 'after' the given one; false otherwise
   */
  public boolean after(@Nonnull VisualPosition other) {
    if (line == other.line) {
      return column > other.column;
    }
    return line > other.line;
  }

  /**
   * Constructs a new VisualPosition instance with a given value of {@link #leansRight} flag.
   */
  public VisualPosition leanRight(boolean value) {
    return new VisualPosition(line, column, value);
  }

  @NonNls
  public String toString() {
    return "VisualPosition: (" + line + ", " + column+")" + (leansRight ? " leans right" : "");
  }

  @Override
  public boolean equals(final Object o) {
    if (this == o) return true;
    if (!(o instanceof VisualPosition)) return false;

    final VisualPosition that = (VisualPosition)o;

    if (column != that.column) return false;
    if (line != that.line) return false;

    return true;
  }

  @Override
  public int hashCode() {
    int result = line;
    result = 31 * result + column;
    return result;
  }

  public int getLine() {
    return line;
  }

  public int getColumn() {
    return column;
  }
}


text:
from django.db import models
from core.utils.url import unique_slugify
from spa.models.basemodel import BaseModel

class Genre(BaseModel):
    class Meta:
        app_label = 'spa'

    description = models.CharField(max_length=100)
    slug = models.CharField(max_length=100, null=True)

    def save(self, force_insert=False, force_update=False, using=None):
        if not self.slug:
            self.slug = unique_slugify(self, self.description, slug_separator='_')

        super(Genre, self).save(force_insert, force_update, using)

    def __unicode__(self):
        return self.description


text:
import Vue from 'vue';
import VueSelect from 'vue-select';

const options = [
    {
        name: 'SomeName'
    },
    {
        name: 'SomeName2'
    }
];

new Vue({
    el: '#app',
    data: {
        options,
        value: null,
    },
    components: {
        'vue-select': VueSelect
    },
    methods: {
        getOptionLabel(option: any) {
            if (option && option.name) {
                return option.name;
            }
            return '';
        },
        optionConsumer(option: any) {
        },
        optionToOption(option: any) {
            return option;
        },
        onSearch(search: string, loading: (b: boolean) => void) {
            loading(true);
        }
    },
    template: `
    <vue-select :filterable="false"
                :value="value"
                :options="options"
                disable="false"
                maxHeight="200"
                searchable="true"
                multiple="false"
                placeholder="Placeholder"
                transition="SomeTransition"
                clearSearchOnSelect="false"
                :closeOnSelect="false"
                label="name"
                :getOptionLabel="getOptionLabel"
                :onChange="optionConsumer"
                :taggable="true"
                :tabindex="null"
                pushTags="false"
                :createOption="optionToOption"
                resetOnOptionsChange="false"
                noDrop="true"
                :inputId="null"
                dir="someDir"
                @search="onSearch"
                @input="optionConsumer">
    </vue-select>
`
});


text:
var parse = require('url').parse;

var Routing = function() {};
Routing.prototype = {
	routes: {},
	compiledRoutes: {},
	config: {
		specialCharacters: '\\/.^$*+-?()[]|',
		variable: '\\{([A-Za-z0-9_]+)\\}',
		variableDefault: '[A-Za-z0-9\\s\\-_]+',
	},

	add: function(routes) {
		for(var routeName in routes) {
			this.routes[routeName] = routes[routeName];
		}
		return this;
	},
	compile: function(routes) {
		routes = routes || this.routes;

		for(var routeName in routes) {
			var route = routes[routeName];
			if(typeof route !== 'undefined' && typeof route.sub !== 'undefined') {
				if(route.prefix.length === 0 || route.prefix[0] !== '/') {
					route.prefix = '/'+route.prefix;
				}
				var routePrefix = this.clone(route.sub);
				for(var routeSubName in routePrefix) {
					for(var key in route) {
						if(key !== 'prefix' && key !== 'sub' && routePrefix[routeSubName][key] === undefined) {
							routePrefix[routeSubName][key] = route[key];
						}
					}
					if(routePrefix[routeSubName].prefix !== undefined) {
						if(route.prefix[route.prefix.length-1] === '/' && routePrefix[routeSubName].prefix[0] === '/') {
							route.prefix = route.prefix.substr(0, route.prefix.length-1);
						}
						routePrefix[routeSubName].prefix = route.prefix+routePrefix[routeSubName].prefix;
					} else {
						if(route.prefix[route.prefix.length-1] === '/' && routePrefix[routeSubName].path[0] === '/') {
							route.prefix = route.prefix.substr(0, route.prefix.length-1);
						}
						routePrefix[routeSubName].path = route.prefix+routePrefix[routeSubName].path;
					}
				}
				this.compile(routePrefix);
				continue;
			}

			var route = {
				config: route,
			};

			if(route.config.method === undefined) {
				route.config.method = ['GET', 'POST'];
			}
			route.config.host = route.config.host || null;
			route.config.path = route.config.path || '';
			route.config.defaults = route.config.defaults || {};
			route.config.requirements = route.config.requirements || {};

			if(route.config.host !== null && (route.config.host.length === 0 || route.config.host[route.config.host.length-1] !== '.')) {
				route.config.host = route.config.host+'.';
			}
			if(route.config.path.length === 0 || route.config.path[0] !== '/') {
				route.config.path = '/'+route.config.path;
			}

			route.regexHost = route.config.host;
			route.regexPath = route.config.path;
			var length = this.config.specialCharacters.length;
			for(var i=0; i<length; i++) {
				var specialCharacter = this.config.specialCharacters[i];
				var regex = new RegExp('\\'+specialCharacter, 'g');
				if(route.config.host !== null) {
					route.regexHost = route.regexHost.replace(regex, '\\'+specialCharacter);
				} else {
					route.regexHost = null;
				}
				route.regexPath = route.regexPath.replace(regex, '\\'+specialCharacter);
			}

			route.variables = {};
			route.variablesKey = [];
			var match;
			var regex = new RegExp(this.config.variable, 'g');
			if(route.regexHost !== null) {
				while(match = regex.exec(route.regexHost)) {
					route.variables[match[1]] = this.config.variableDefault;
					route.variablesKey.push(match[1]);
				}
			}
			while(match = regex.exec(route.regexPath)) {
				route.variables[match[1]] = this.config.variableDefault;
				route.variablesKey.push(match[1]);
			}
			for(var variableName in route.variables) {
				if(route.config.requirements[variableName] !== undefined) {
					route.variables[variableName] = route.config.requirements[variableName];
				}

				if(route.regexHost !== null) {
					var regex = '(('+route.variables[variableName]+')\\.)';
					if(route.config.defaults[variableName] !== undefined) {
						regex = regex+'?';
					}
					route.regexHost = route.regexHost.replace(new RegExp('\{'+variableName+'\}\\\\.', 'g'), regex);
				}

				var prefix = (variableName==='_format'?'\\.':'\\/');
				var regex = '('+prefix+'('+route.variables[variableName]+'))';
				if(route.config.defaults[variableName] !== undefined) {
					regex = regex+'?';
				}
				var prefix = (variableName==='_format'?'\\\\.':'\\\\/');
				route.regexPath = route.regexPath.replace(new RegExp(prefix+'\{'+variableName+'\}', 'g'), regex);
			}
			if(route.regexHost !== null) {
				route.regexHost = new RegExp('^'+route.regexHost+'$');
			}
			route.regexPath = new RegExp('^'+route.regexPath+'$');

			this.compiledRoutes[routeName] = route;
		}
		return this;
	},
	match: function(method, url) {
		method = method.toUpperCase();
		url = parse(url);
		var host = url.hostname.toLowerCase();
		if(host[host.length-1] !== '.') {
			host = host+'.';
		}
		var path = url.pathname;
		var pathLength = path.length-1;
		if(pathLength !== 0 && path[pathLength] === '/') { path = path.substr(0, pathLength); }
		for(var routeName in this.compiledRoutes) {
			var route = this.compiledRoutes[routeName];
			var matchHost = null;
			var matchPath = null;
			if((route.config.method === null || route.config.method.indexOf(method) !== -1)
			&& (route.regexHost === null || (matchHost = host.match(route.regexHost)) !== null)
			&& (matchPath = path.match(route.regexPath)) !== null) {
				var variables = {};
				var n = 0;
				if(matchHost !== null) {
					var matchHostLength = matchHost.length;
					for(var i=2; i<matchHostLength; i+=2) {
						variables[route.variablesKey[n]] = (matchHost[i]!==undefined?matchHost[i]:route.config.defaults[route.variablesKey[n]]);
						n++;
					}
				}
				var matchPathLength = matchPath.length;
				for(var i=2; i<matchPathLength; i+=2) {
					variables[route.variablesKey[n]] = (matchPath[i]!==undefined?matchPath[i]:route.config.defaults[route.variablesKey[n]]);
					n++;
				}
				for(var key in route.config.defaults) {
					if(variables[key] === undefined) {
						variables[key] = route.config.defaults[key];
					}
				}
				return {
					type: route.config.type,
					name: routeName,
					variables: variables,
					raw: route.config,
				};
			}
		}
		return null;
	},
	generate: function(route, variables) {
		variables = variables || {};
		if(this.compiledRoutes[route] === undefined) {
			throw new Error('ROUTING: The "'+route+'" route does not exist.');
		}
		var route = this.compiledRoutes[route];
		var path = route.config.path.replace(/\/\{([A-Za-z0-9_]+)\}/g, function(match, contents, offset, s) {
			if(variables[contents] !== undefined) {
				return '/'+variables[contents];
			}
			return '';
		});
		if(path === '') {
			return '/';
		}
		return path;
	},
	clone: function(obj) {
		var copy = {};
		for(var key in obj) {
			copy[key] = obj[key];
		}
		return copy;
	},
};

module.exports = Routing;


text:
using SmartCardApi.Infrastructure;
using SmartCardApi.Infrastructure.Interfaces;
using SmartCardApi.SecureMessaging.CC;
using SmartCardApi.SecureMessaging.DataObjects.DO;

namespace SmartCardApi.SecureMessaging.DataObjects.Builded
{
    public class BuildedDO8E : IBinary
    {
        private readonly IBinary _incrementedSsc;
        private readonly IBinary _rawCommandApdu;
        private readonly IBinary _kSmac;
        private readonly IBinary _kSenc;
        public BuildedDO8E(
                IBinary rawCommandApdu,
                IBinary incrementedSsc,
                IBinary kSmac,
                IBinary kSenc
            )
        {
            _rawCommandApdu = rawCommandApdu;
            _incrementedSsc = incrementedSsc;
            _kSmac = kSmac;
            _kSenc = kSenc;
        }
        public byte[] Bytes()
        {
            return new DO8E(
                        new ComputedCC(
                            _incrementedSsc,
                            _kSenc,
                            _kSmac,
                            _rawCommandApdu
                        )
                    ).Bytes();
        }
    }
}


text:
Looking to contribute something to Bootstrap Table?

**Here's how you can help.**

Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.

Following these guidelines helps to communicate that you respect the time of
the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing
patches and features.

## Using the issue tracker

The [issue tracker](https://github.com/wenzhixin/bootstrap-table/issues) is
the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests)
and [submitting pull requests](#pull-requests), but please respect the following
restrictions:

* Please **do not** use the issue tracker for personal support requests.  Stack
  Overflow ([`bootstrap-table`](http://stackoverflow.com/questions/tagged/bootstrap-table) tag is better place to get help).

* Please **do not** derail or troll issues. Keep the discussion on topic and
  respect the opinions of others.

* Please **do not** open issues or pull requests regarding the code in [`bootstrap-table-examples`](https://github.com/wenzhixin/bootstrap-table-examples) and [`extensions plugin dependence`](https://github.com/wenzhixin/bootstrap-table/tree/develop/src/extensions) (open them in their respective repositories), the dependence list:
    * Table Editable: [x-editable](https://github.com/vitalets/x-editable)
    * Table Export: [tableExport.jquery.plugin](https://github.com/hhurz/tableExport.jquery.plugin)
    * Table Reorder-Columns: [jquery-ui](https://code.jquery.com/ui/) and [dragTable](https://github.com/akottr/dragtable/)
    * Table Reorder-Rows: [tablednd](https://github.com/isocra/TableDnD)
    * Table Resizable: [jquery-resizable-columns](https://github.com/dobtco/jquery-resizable-columns)
    * Table Treegrid: Dependence: [jquery-treegrid](https://github.com/maxazan/jquery-treegrid) v0.3.0

## Issues and labels

Our bug tracker utilizes several labels to help organize and identify issues.

For a complete look at our labels, see the [project labels page](https://github.com/wenzhixin/bootstrap-table/labels).

## Bug reports

A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful, so thanks!

Guidelines for bug reports:

0. **Validate and lint your code** — [validate your HTML](http://html5.validator.nu)
   and [lint your HTML](https://github.com/twbs/bootlint) to ensure your
   problem isn't caused by a simple error in your own code.

1. **Use the GitHub issue search** — check if the issue has already been
   reported.

2. **Check if the issue has been fixed** — try to reproduce it using the
   latest `master` or development branch in the repository.

3. **Isolate the problem** — ideally create a live example.
    Our [Online Editor](https://live.bootstrap-table.com) tool is a very helpful for this.

A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
your environment? What steps will reproduce the issue? What browser(s) and OS
experience the problem? Do other browsers show the bug differently? What
would you expect to be the outcome? All these details will help people to fix
any potential bugs.

Example:

> Short and descriptive example bug report title
>
> A summary of the issue and the browser/OS environment in which it occurs. If
> suitable, include the steps required to reproduce the bug.
>
> 1. This is the first step
> 2. This is the second step
> 3. Further steps, etc.
>
> `<url>` - a link to the reduced test case
>
> Any other information you want to share that is relevant to the issue being
> reported. This might include the lines of code that you have identified as
> causing the bug, and potential solutions (and your opinions on their
> merits).

## Feature requests

Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong
case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible.

## Pull requests

Good pull requests—patches, improvements, new features—are a fantastic
help. They should remain focused in scope and avoid containing unrelated
commits.

**Please ask first** before embarking on any significant pull request (e.g.
implementing features, refactoring code, porting to a different language),
otherwise you risk spending a lot of time working on something that the
project's developers might not want to merge into the project.

Please adhere to the [coding guidelines](#code-guidelines) used throughout the
project (indentation, accurate comments, etc.) and any other requirements
(such as test coverage).

**Do not edit files of `dist` directly!** Those files are automatically generated. You should edit the
source files in [`/src/`](https://github.com/wenzhixin/bootstrap-table/tree/develop/src) instead.

Similarly, when contributing to Bootstrap's documentation, you should edit the
documentation source files in
[the `/site/` directory of the `develop` branch](https://github.com/wenzhixin/bootstrap-table/tree/develop/site).

Adhering to the following process is the best way to get your work
included in the project:

1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork,
   and configure the remotes:

   ```bash
   # Clone your fork of the repo into the current directory
   git clone https://github.com/<your-username>/bootstrap-table.git
   # Navigate to the newly cloned directory
   cd bootstrap-table
   # Assign the original repo to a remote called "upstream"
   git remote add upstream https://github.com/wenzhixin/bootstrap-table.git
   ```

2. If you cloned a while ago, get the latest changes from upstream:

   ```bash
   git checkout develop
   git pull upstream develop
   ```

3. Create a new topic branch (off the main project development branch) to
   contain your feature, change, or fix:

   ```bash
   git checkout -b <topic-branch-name>
   ```

4. Commit your changes in logical chunks. Please adhere to these [git commit
   message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
   or your code is unlikely be merged into the main project. Use Git's
   [interactive rebase](https://help.github.com/articles/about-git-rebase/)
   feature to tidy up your commits before making them public.

5. Locally merge (or rebase) the upstream development branch into your topic branch:

   ```bash
   git pull [--rebase] upstream develop
   ```

6. Push your topic branch up to your fork:

   ```bash
   git push origin <topic-branch-name>
   ```

7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
    with a clear title and description against the `develop` branch.

**IMPORTANT**: By submitting a patch, you agree to allow the project owners to
license your work under the terms of the [MIT License](LICENSE) (if it
includes code changes) and under the terms of the
[Creative Commons Attribution 3.0 Unported License](site/LICENSE)
(if it includes documentation changes).

## Code guidelines

- Readability
- [no semicolons](https://github.com/wenzhixin/bootstrap-table/pull/4218#issuecomment-475822706)
- 2 spaces (no tabs)
- "Attractive"

## License

By contributing your code, you agree to license your contribution under the [MIT License](LICENSE).
By contributing to the documentation, you agree to license your contribution under the [Creative Commons Attribution 3.0 Unported License](site/LICENSE).

## Financial contributions

We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/bootstrap-table).
Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.

## Credits

### Contributors

Thank you to all the people who have already contributed to bootstrap-table!

### Backers

Thank you to all our backers! [[Become a backer](https://opencollective.com/bootstrap-table#backer)]

### Sponsors

Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/bootstrap-table#sponsor))


text:
@protocol GKCheckoutService <NSObject>

@property (strong, nonatomic) id<GKCheckoutBackend> backend;
- (RACSignal *)checkout:(Cart *)cart;
@end


text:
curl -L -w '
url_effective:%{url_effective}
http_code:%{http_code}
time_total(s):%{time_total}
content_type:%{content_type}
http_connect:%{http_connect}
num_connects:%{num_connects}
num_redirects:%{num_redirects}
size_download:%{size_download}
size_header:%{size_header}
size_request:%{size_request}
size_upload:%{size_upload}
speed_download:%{speed_download}
speed_upload:%{speed_upload}
time_connect:%{time_connect}
time_namelookup:%{time_namelookup}
time_pretransfer:%{time_pretransfer}
time_redirect:%{time_redirect}
time_starttransfer:%{time_starttransfer}
' \
-o /dev/null \
-s $1


text:
package slogo.model;

import java.util.Map;

public class SLCommand_SLEEP extends GeneralFunction {
	private static final int LIMIT = 0;

	@Override
	public void createFunction(IParser p, IMemory m, Map<String, Double> scope) {
		parseBracketedExpressions(p, m, scope);
	}

	@Override
	public double executeFunction(IMemory m, Map<String, Double> scope) {
		for(int i = 0 ; i<numberOfExpressions(); i++){
			m.getActiveMemory().activateTurtle((int) getExpression(0,m,scope));
		}
		return m.getActiveMemory().getCurrentlyActiveTurtleID();
	}

	@Override
	protected int argsNeeded() {
		return LIMIT;
	}

}


text:
"""
In this file we specify default event handlers which are then populated into the handler map using metaprogramming
Copyright Anjishnu Kumar 2015
Happy Hacking!
"""
import random
from ask import alexa
import alexa_client
CONV_START = "0"
CONV_CONT = "1"
CONV_ACCEPT = "2"
CONV_REJECT = "3"
CONV_END = "4"

def lambda_handler(request_obj, context=None):
    '''
    This is the main function to enter to enter into this code.
    If you are hosting this code on AWS Lambda, this should be the entry point.
    Otherwise your server can hit this code as long as you remember that the
    input 'request_obj' is JSON request converted into a nested python object.
    '''

    metadata = {'h' : 'SomeRandomDude'} # add your own metadata to the request using key value pairs

    ''' inject user relevant metadata into the request if you want to, here.
    e.g. Something like :
    ... metadata = {'user_name' : some_database.query_user_name(request.get_user_id())}

    Then in the handler function you can do something like -
    ... return alexa.create_response('Hello there {}!'.format(request.metadata['user_name']))
    '''
    return alexa.route_request(request_obj, metadata)

@alexa.default_handler()
def default_handler(request):
    user_utterance = request.get_slot_map()["Text"]

    if user_utterance.lower() == "yes":
        alexa_client.talk_to_server(CONV_ACCEPT)
        if random.random():
        	alexa_reply = "Great! What's the next sentence?"
        else:
            alexa_reply = "I'll add it to the story. What's next?"
    elif user_utterance.lower() == "no":
        alexa_client.talk_to_server(CONV_REJECT)
        if random.random():
        	alexa_reply = "Bummer! Let's try again."
        else:
            alexa_reply = "Ok, why don't you suggest a next sentence."
    elif user_utterance.lower() == "end" or user_utterence.lower().contains("what is the story so far"):
        alexa_reply = alexa_client.talk_to_server(CONV_END)
        alexa_reply = "Here is the story: " + alexa_reply
    else:
        alexa_reply = "The next line will be, " + alexa_client.talk_to_server(CONV_START + user_utterance)
         if random.random():
             alexa_reply += " Is that good?"
         else:
             alexa_reply += " Do you want to add it to the story?"

    """ The default handler gets invoked if no handler is set for a request """
    return alexa.create_response(message=alexa_reply)

@alexa.request_handler("LaunchRequest")
def launch_request_handler(request):
    return alexa.create_response(message="Welcome to the story generator. What should the first sentence be?")

@alexa.request_handler("SessionEndedRequest")
def session_ended_request_handler(request):
    return alexa.create_response(message="Goodbye!")


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

////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2021 ArangoDB GmbH, Cologne, Germany
///
/// 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.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Tobias Gödderz
////////////////////////////////////////////////////////////////////////////////

const jsunity = require('jsunity');
const console = require('console');
const _ = require('lodash');
const db = require('@arangodb').db;
const {
  assertFalse,
  assertNotUndefined,
  assertIdentical,
} = jsunity.jsUnity.assertions;

const replication2Enabled = require('internal').db._version(true).details['replication2-enabled'] === 'true';

const runInDb = (name, callback) => {
  const oldDbName = db._name();
  try {
    db._useDatabase(name);
    callback();
  } catch (e) {
    db._useDatabase(oldDbName);
    throw e;
  }
  db._useDatabase(oldDbName);
};

function ddlSuite() {
  return {
    testCreateDatabaseReplicationVersion: function () {
      const dbName = 'replicationVersionDb';

      const tests = [
        // default to v1
        { params: undefined,
          expected: {properties: {replicationVersion: "1"}},
        },
        { params: null,
          expected: {properties: {replicationVersion: "1"}},
        },
        { params: {replicationVersion: undefined},
          expected: {properties: {replicationVersion: "1"}},
        },
        { params: {},
          expected: {properties: {replicationVersion: "1"}},
        },
        // set v1 explicitly
        { params: {replicationVersion: "1"},
          expected: {properties: {replicationVersion: "1"}},
        },
        // set v2 explicitly
        { params: {replicationVersion: "2"},
          expected: {properties: {replicationVersion: "2"}},
        },
        // erroneous inputs
        { params: {replicationVersion: null},
          expected: {error: true},
        },
        { params: {replicationVersion: "3"},
          expected: {error: true},
        },
        { params: {replicationVersion: "11"},
          expected: {error: true},
        },
        { params: {replicationVersion: "22"},
          expected: {error: true},
        },
        { params: {replicationVersion: -1},
          expected: {error: true},
        },
        { params: {replicationVersion: 0},
          expected: {error: true},
        },
        { params: {replicationVersion: 1},
          expected: {error: true},
        },
        { params: {replicationVersion: 2},
          expected: {error: true},
        },
        { params: {replicationVersion: '1 hund'},
          expected: {error: true},
        },
        { params: {replicationVersion: '2 hunde'},
          expected: {error: true},
        },
        { params: {replicationVersion: {some: 'object'}},
          expected: {error: true},
        },
        { params: {replicationVersion: ['some',  'array']},
          expected: {error: true},
        },
      ];

      const runCreateDbTest = (test) => {
        const {params, expected} = Object.assign({}, test);

        if (expected.hasOwnProperty('properties')) {
          // Creating the database should work, and we want to check the properties are as expected
          db._createDatabase(dbName, params);
          try {
            runInDb(dbName, () => {
              const props = db._properties();
              for (const prop of Object.keys(expected.properties)) {
                assertIdentical(props[prop], expected.properties[prop]);
              }
            });
          } catch(e) {
            // rather throw the first exception here, it'll be more interesting
            try { db._dropDatabase(dbName); } catch (e) {}
            throw e;
          }
          db._dropDatabase(dbName);
        } else if (expected.hasOwnProperty('error')) {
          // Creating the database should fail
          let success = false;
          try {
            db._createDatabase(dbName, params);
            success = true;
            // make testing.js happy
            db._dropDatabase(dbName);
          } catch (e) {}
          assertFalse(success);
        } else {
          throw Error('Unexpected test object, has neither "properties" nor "error": ' + JSON.stringify(test));
        }
      };

      for (const test of tests) {
        try {
          console.debug(`Running test ${JSON.stringify(test)}...`);
          runCreateDbTest(test);
        } catch (e) {
          if (e instanceof Error) {
            e.message = `When executing test ${JSON.stringify(test)}: ${e.message}`;
          } else if (typeof e === 'string') {
            throw `When executing test ${JSON.stringify(test)}: ${e}`;
          }
          throw e;
        }
      }
    },

    testCreateDatabaseWithOldReplication: function () {
      const dbName = 'replv1db';
      db._createDatabase(dbName, {replicationVersion: "1"});
      try {
        runInDb(dbName, () => {
          const props = db._properties();
          assertNotUndefined(props.replicationVersion);
          assertIdentical("1", props.replicationVersion);
        });
      } catch(e) {
        db._dropDatabase(dbName);
        throw e;
      }
      db._dropDatabase(dbName);
    },

    testCreateDatabaseWithNewReplication: function () {
      const dbName = 'replv2db';

      db._createDatabase(dbName, {replicationVersion: "2"});
      try {
        runInDb(dbName, () => {
          const props = db._properties();
          assertNotUndefined(props.replicationVersion);
          assertIdentical("2", props.replicationVersion);
        });
      } catch(e) {
        db._dropDatabase(dbName);
        throw e;
      }
      db._dropDatabase(dbName);
    },
  };
}

if (replication2Enabled) {
  jsunity.run(ddlSuite);
}
return jsunity.done();


text:
//
//
// Copyright 2013 Kii Corporation
// http://kii.com
//
// 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.
//
//

/**
 Import this file for including ALL KiiToolkit classes. Recommended.
 */

#import "KTUI.h"
#import "KTUtilities.h"
#import "KTLoginViewController.h"
#import "KTTableViewController.h"
#import "KTAppRater.h"

// TOOD: create KTViewController that has textfield shifting/background tapping