text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class Transient
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class Transient
   ">
    <meta name="generator" content="docfx 2.44.0.0">

    <link rel="shortcut icon" href="../api/images/favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Class Transient

This class implements the transient analysis.

Inheritance

System.Object

Simulation

BaseSimulation

TimeSimulation

Transient

Inherited Members

      TimeSimulation.Method

      TimeSimulation.TimeSimulationStatistics

      TimeSimulation.Setup(EntityCollection)

      TimeSimulation.Unsetup()

      TimeSimulation.TimeIterate(Int32)

      TimeSimulation.InitializeStates()

      TimeSimulation.LoadInitialConditions(Object, LoadStateEventArgs)

      TimeSimulation.LoadBehaviors()

      TimeSimulation.Accept()

      TimeSimulation.Probe(Double)

      BaseSimulation.RealState

      BaseSimulation.ProblemVariable

      BaseSimulation.BeforeLoad

      BaseSimulation.AfterLoad

      BaseSimulation.BeforeTemperature

      BaseSimulation.AfterTemperature

      BaseSimulation.DcMaxIterations

      BaseSimulation.AbsTol

      BaseSimulation.RelTol

      BaseSimulation.BaseSimulationStatistics

      BaseSimulation.Temperature()

      BaseSimulation.Op(Int32)

      BaseSimulation.IterateGminStepping(Int32, Int32)

      BaseSimulation.IterateDiagonalGminStepping(Int32, Int32)

      BaseSimulation.IterateSourceStepping(Int32, Int32)

      BaseSimulation.Iterate(Int32)

      BaseSimulation.Load()

      BaseSimulation.LoadNodeSets(Object, LoadStateEventArgs)

      BaseSimulation.IsConvergent()

      BaseSimulation.OnBeforeLoad(LoadStateEventArgs)

      BaseSimulation.OnAfterLoad(LoadStateEventArgs)

      BaseSimulation.OnBeforeTemperature(LoadStateEventArgs)

      BaseSimulation.OnAfterTemperature(LoadStateEventArgs)

      Simulation.Status

      Simulation.Configurations

      Simulation.Statistics

      Simulation.Variables

      Simulation.ExportSimulationData

      Simulation.BeforeSetup

      Simulation.AfterSetup

      Simulation.BeforeExecute

      Simulation.AfterExecute

      Simulation.BeforeUnsetup

      Simulation.AfterUnsetup

      Simulation.Name

      Simulation.EntityBehaviors

      Simulation.EntityParameters

      Simulation.SimulationStatistics

      Simulation.BehaviorTypes

      Simulation.Run(EntityCollection)

      Simulation.OnExport(ExportDataEventArgs)

      Simulation.OnBeforeSetup(EventArgs)

      Simulation.OnBeforeExecute(BeforeExecuteEventArgs)

      Simulation.OnAfterSetup(EventArgs)

      Simulation.OnAfterExecute(AfterExecuteEventArgs)

      Simulation.OnBeforeUnsetup(EventArgs)

      Simulation.OnAfterUnsetup(EventArgs)

      System.Object.ToString()

      System.Object.Equals(System.Object)

      System.Object.Equals(System.Object, System.Object)

      System.Object.ReferenceEquals(System.Object, System.Object)

      System.Object.GetHashCode()

      System.Object.GetType()

      System.Object.MemberwiseClone()

Namespace: SpiceSharp.Simulations

Assembly: SpiceSharp.dll

Syntax

public class Transient : TimeSimulation

Constructors

Transient(String)

Initializes a new instance of the Transient class.

Declaration

public Transient(string name)

Parameters

        Type
        Name
        Description

        System.String
        name

The identifier of the simulation.

Transient(String, Double, Double)

Initializes a new instance of the Transient class.

Declaration

public Transient(string name, double step, double final)

Parameters

        Type
        Name
        Description

        System.String
        name

The identifier of the simulation.

        System.Double
        step

The step size.

        System.Double
        final

The final time.

Transient(String, Double, Double, Double)

Initializes a new instance of the Transient class.

Declaration

public Transient(string name, double step, double final, double maxStep)

Parameters

        Type
        Name
        Description

        System.String
        name

The identifier of the simulation.

        System.Double
        step

The step size.

        System.Double
        final

The final time.

        System.Double
        maxStep

The maximum step.

Methods

Execute()

Executes the simulation.

Declaration

protected override void Execute()

Overrides

TimeSimulation.Execute()

Extension Methods

      Utility.ThrowIfNull<T>(T, String)

      Utility.ThrowIfNotBound<T>(T, Behavior)

      ParameterHelper.TrySetPrincipalParameter<T>(Object, T)

      ParameterHelper.SetPrincipalParameter<T>(Object, T)

      ParameterHelper.TrySetParameter<T>(Object, String, T, IEqualityComparer<String>)

      ParameterHelper.SetParameter<T>(Object, String, T, IEqualityComparer<String>)

      ParameterHelper.TrySetParameter(Object, String, IEqualityComparer<String>)

      ParameterHelper.SetParameter(Object, String, IEqualityComparer<String>)

      ParameterHelper.TryGetParameter<T>(Object, String, out T, IEqualityComparer<String>)

      ParameterHelper.GetParameter<T>(Object, String, IEqualityComparer<String>)

      ParameterHelper.TryGetParameter<T>(Object, out T)

      ParameterHelper.GetParameter<T>(Object)

      ParameterHelper.CreateGetter<T>(Object)

      ParameterHelper.CreateGetter<T>(Object, String, IEqualityComparer<String>)

      ParameterHelper.CreateSetter<T>(Object)

      ParameterHelper.CreateSetter<T>(Object, String, IEqualityComparer<String>)

              Back to top

            Generated by DocFX


text:
<?php

namespace Geocoder\Tests\Provider;

use Geocoder\Tests\TestCase;
use Geocoder\Provider\GoogleMapsBusiness;

class GoogleMapsBusinessTest extends TestCase
{
    private $testClientId   = 'foo';

    private $testPrivateKey = 'bogus';

    public function testGetName()
    {
        $provider = new GoogleMapsBusiness($this->getMockAdapter($this->never()), $this->testClientId);
        $this->assertEquals('google_maps_business', $provider->getName());
    }

    public function testBuildQueryWithNoPrivateKey()
    {
        $method = new \ReflectionMethod(
          'Geocoder\Provider\GoogleMapsBusiness', 'buildQuery'
        );

        $method->setAccessible(true);

        $provider = new GoogleMapsBusiness($this->getMockAdapter($this->never()), $this->testClientId);
        $query    = 'http://maps.googleapis.com/maps/api/geocode/json?address=blah';

        $this->assertEquals($query.'&client=foo', $method->invoke($provider, $query));
    }

    public function testBuildQueryWithPrivateKey()
    {
        $method = new \ReflectionMethod(
          'Geocoder\Provider\GoogleMapsBusiness', 'buildQuery'
        );

        $method->setAccessible(true);

        $provider = new GoogleMapsBusiness(
            $this->getMockAdapter($this->never()),
            $this->testClientId,
            $this->testPrivateKey
        );

        $query = 'http://maps.googleapis.com/maps/api/geocode/json?address=blah';

        $this->assertEquals($query.'&client=foo&signature=9G2weMhhd4E2ciR681gp9YabvUg=', $method->invoke($provider, $query));
    }

    public function testSignQuery()
    {
        $method = new \ReflectionMethod(
          'Geocoder\Provider\GoogleMapsBusiness', 'signQuery'
        );

        $method->setAccessible(true);

        $provider = new GoogleMapsBusiness(
            $this->getMockAdapter($this->never()),
            $this->testClientId,
            $this->testPrivateKey
        );

        $query = 'http://maps.googleapis.com/maps/api/geocode/json?address=10%20avenue%20Gambetta%2C%20Paris%2C%20France';

        $this->assertEquals($query.'&signature=7oRS85BVVpPUsyrd4MWFGMJNWok=', $method->invoke($provider, $query));
    }

    /**
     * @expectedException \Geocoder\Exception\InvalidCredentials
     * @expectedExceptionMessage Invalid client ID / API Key https://maps.googleapis.com/maps/api/geocode/json?address=Columbia%20University&client=foo&signature=9dJq1hPF7_iwafUpnqXUqEkP0gY=
     */
    public function testGeocodeWithInvalidClientIdAndKey()
    {
        $provider = new GoogleMapsBusiness($this->getAdapter(), $this->testClientId, $this->testPrivateKey, null, null, true);

        $provider->geocode('Columbia University');
    }

    /**
     * @expectedException \Geocoder\Exception\InvalidCredentials
     * @expectedExceptionMessage Invalid client ID / API Key http://maps.googleapis.com/maps/api/geocode/json?address=Columbia%20University&client=foo&signature=9dJq1hPF7_iwafUpnqXUqEkP0gY=
     */
    public function testGeocodeWithInvalidClientIdAndKeyNoSsl()
    {
        $provider = new GoogleMapsBusiness($this->getAdapter(), $this->testClientId, $this->testPrivateKey, null, null, false);

        $provider->geocode('Columbia University', true);
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
                                                 xmlns:app="http://schemas.android.com/apk/res-auto"
                                                 android:layout_width="match_parent"
                                                 android:layout_height="match_parent"
                                                 android:orientation="vertical"
                                                 android:id="@+id/coordinator"
                                                 android:fitsSystemWindows="true"
    >

  <android.support.design.widget.AppBarLayout
      android:layout_width="match_parent"
      android:layout_height="?actionBarSize"
      android:background="?colorPrimary"
      >
    <android.support.v7.widget.Toolbar
        android:id="@id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:popupTheme="@style/Toolbar.Popup.AppCompat"
        app:theme="@style/Toolbar.AppCompat.Responsive"
        />
  </android.support.design.widget.AppBarLayout>

  <FrameLayout
      android:id="@+id/content"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      />

  <com.alorma.github.ui.view.HackBottomBar
      android:id="@+id/bottomBar"
      android:layout_width="match_parent"
      android:layout_height="60dp"
      android:layout_gravity="bottom"
      app:bb_tabXmlResource="@xml/tabs_pullrequest"
      app:bb_behavior="shy"
      app:bb_tabletMode="false"
      app:bb_activeTabColor="@color/white"
      app:bb_inActiveTabColor="@color/white"
      app:bb_activeTabAlpha="1"
      app:bb_inActiveTabAlpha="0.8"
      />
</android.support.design.widget.CoordinatorLayout>


text:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Leaderboard - Sports</title>
<meta name="CG" content="Sports">
<meta name="SCG" content="Ad Frame">
<meta name="PT" content="Multimedia">
<meta name="PST" content="Article">
<link rel="stylesheet" type="text/css" href="global.css">

Advertise on NYTimes.com

	<a href="http://www.nytimes.com/adx/bin/adx_click.html?type=cookie&pos=TopAd"><img src="http://www.nytimes.com/adx/bin/adx_remote.html?type=noscript&page=www.nytimes.com/yr/mo/day/nyregion/custom/&posall=TopAd,BigAd3,Inv1&pos=TopAd&query=qstring&keywords=?"></a>


text:
// Code generated by sbt-mavgen. Manual edits will be overwritten
package scavlink.message.ardupilotmega

import scavlink.message._
import scavlink.message.enums.MavCmd

import scavlink.message.common.CommandLong
import scavlink.coord.Coordinates
import scavlink.coord.Geo

/**
 * Mission command to perform motor test
 * @param motorSequenceNumber motor sequence number (a number from 1 to max number of motors on the vehicle)
 * @param throttleType throttle type (0=throttle percentage, 1=PWM, 2=pilot throttle channel pass-through. See MOTOR_TEST_THROTTLE_TYPE enum)
 * @param throttle throttle
 * @param timeout timeout (in seconds)
 */
case class DoMotorTest(targetSystem: SystemId = 0, targetComponent: ComponentId = 0, motorSequenceNumber: Float = 0, throttleType: Float = 0, throttle: Float = 0, timeout: Float = 0)
extends Command {
  val cmd = MavCmd(209)
  val message = CommandLong(targetSystem, targetComponent, cmd, param1 = motorSequenceNumber, param2 = throttleType, param3 = throttle, param4 = timeout)
  override def toString = cmd.toString + " motorSequenceNumber=" + motorSequenceNumber + " throttleType=" + throttleType + " throttle=" + throttle + " timeout=" + timeout
}

/**
 * Mission command to operate EPM gripper
 * @param gripperNumber gripper number (a number from 1 to max number of grippers on the vehicle)
 * @param gripperAction gripper action (0=release, 1=grab. See GRIPPER_ACTIONS enum)
 */
case class DoGripper(targetSystem: SystemId = 0, targetComponent: ComponentId = 0, gripperNumber: Float = 0, gripperAction: Float = 0)
extends Command {
  val cmd = MavCmd(211)
  val message = CommandLong(targetSystem, targetComponent, cmd, param1 = gripperNumber, param2 = gripperAction)
  override def toString = cmd.toString + " gripperNumber=" + gripperNumber + " gripperAction=" + gripperAction
}


text:
Media files are files associated with a specific attribute on a specific product. They can be uploaded and downloaded through Akeneo.NET

## Upload file

In order to upload a file, use the `FileUpload` class. In order for a successful upload, all properties must be set:

* Product Identifier: the identifier of the product
* Product Attribute: the attribute code for which the file should be associated with. The attribute should be a `FileAttribute` attribute
* File Path: The path to the image.

Below is an example of of a correctly created `FileUpload`

```csharp
var fileUpload = new MediaUpload
{
	Product =
	{
		Identifier = "nike_air",
		Attribute = "product_image_large"
	},
	FilePath = "C:\\images\\nike_air.png"
};
```

Upload the image by calling `UploadAsync`

```csharp
var response = await Client.UploadAsync(fileUpload);
```

The call returns an `AkeneoResponse` that hold information about the outcome of the operation.

## Download file

A file is downloaded through by supplying it's `mediaCode`. If the media file is recently uploaded, the media code can be retrieved from the links collection in the `AkeneoResponse`.

```csharp
var response = await Client.UploadAsync(fileUpload);
var mediaCode = response.Links[PaginationLinks.Location].Href;
```

Otherwise, it can be retrieved from the product values.

```csharp
var product = await Client.GetAsync<Product>("tyfon-tv-6m-0m-company");
var logoValue = product.Values["product_image_large"];
var mediaCode = logoValue.FirstOrDefault()?.Data as string;
```

Once the code is retrieved, it can be used as argument when calling `DownloadAsync`. The resource contains the original file name, as well as a `Stream` containing the image. There are extension methods for writing the file to disk.

```csharp
var file = await Client.DownloadAsync(mediaCode);
file.WriteToFile("C:\\downloads", file.FileName);
file.Dispose();
```

If a file name is not provided, the original file name will be used.


text:
module App.ViewModels
{
    export class ConditionFormViewModel extends FormBaseViewModel <Models.Condition>
    {
        //#region Private Static Properties
        //#endregion

        //#region Public Static Properties

        public static $inject = FormBaseViewModel.$inject.concat(["$scope"]);
        public static get controllerId(): string { return "ConditionFormViewModel"; }

        //#endregion

        //#region Private Properties
        //#endregion

        //#region Public Properties
        //#endregion

        //#region Constructors

        constructor($http, $q, $location, $route, $routeParams, zStorageWip, breezeFactory,
            private $scope: IFormBaseScope<ConditionFormViewModel>)
        {
            super($http,
                $q,
                $location,
                $route,
                $routeParams,
                zStorageWip,
                breezeFactory,
                breezeFactory.entityManager.metadataStore.getEntityType("Condition"),
                Models.Condition.newUrl,
                Models.Condition.listUrl,
                { ConditionId: breeze.core.getUuid() });

            $scope.vm = this;
        }

        //#endregion

        //#region Private Methods
        //#endregion

        //#region Protected Methods

        protected getQuery(): breeze.EntityQuery
        {
            let query = null;

            if (!this.isNew)
            {
                query = new breeze.EntityQuery()
                    .from("Conditions")
                    .where(new breeze.Predicate(Models.Condition.lookupProperty, "eq", this.$routeParams[Models.Condition.lookupProperty]));
            }

            return query;
        }

        protected getWipKey(): string
        {
            if (!this.isNew)
            {
                return Models.Condition.getWipKey(this.$routeParams[Models.Condition.lookupProperty]);
            }

            return Models.Condition.getWipKey();
        }

        //#endregion

        //#region Public Methods
        //#endregion
    }

    class ConditionFormRouteConfigurator
    {
        public static $inject = ['$routeProvider'];

        public constructor($routeProvider: ng.route.IRouteProvider)
        {
            // New Condition
            $routeProvider.when(Models.Condition.newUrl, {
                templateUrl: "/App/ConditionForm",
                controller: "ConditionFormViewModel"
            });

            // Edit Condition
            $routeProvider.when(Models.Condition.editUrl, {
                templateUrl: "/App/ConditionForm",
                controller: "ConditionFormViewModel"
            });
        }
    }

    // Init
    angular.module(Config.appName)
        .controller(ConditionFormViewModel.controllerId, ConditionFormViewModel)
        .config(ConditionFormRouteConfigurator);
}


text:
using namespace std;
// CListCtrlCl

typedef map<int,CButtonCtrl*> Button_map;

class CListCtrlCl : public CListCtrl
{
	DECLARE_DYNAMIC(CListCtrlCl)

public:
	CHeaderCtrlCl m_Header;
	CListCtrlCl();
	virtual ~CListCtrlCl();

protected:
	DECLARE_MESSAGE_MAP()
	virtual void PreSubclassWindow();
public:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
public:
	afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
public:
	// Ðиß
	int m_nRowHeight;
	int InsertColumn(int nCol, LPCTSTR lpszColumnHeading,
		int nFormat = LVCFMT_LEFT, int nWidth = -1, int nSubItem = -1);
public:
	// Gradient - ½¥±äϵÊý£¬Á¢Ìå±³¾°ÓÃ,²»Óý¥±äÉèΪ0
	void SetHeaderBKColor(int R, int G, int B, int Gradient);
public:
	// ÉèÖñíÍ·¸ß¶È
	void SetHeaderHeight(float Height);
	CPtrList m_ptrListCol;  //±£´æÁÐÑÕÉ«
	CPtrList m_ptrListItem; //±£´æItemÑÕÉ«±í
	CPtrList m_colTextColor; //±£´æÁÐ×ÖÌåÑÕÉ«
	CPtrList m_ItemTextColor; //±£´æµ¥Ôª¸ñ×ÖÌåÑÕÉ«
	bool FindColColor(int col ,COLORREF &color); //²éÕÒÁÐÑÕÉ«
	bool FindItemColor(int col,int row,COLORREF &color);
	bool FindColTextColor(int col,COLORREF &color); //²éÕÒÁÐ×ÖÌåÑÕÉ«
	bool FindItemTextColor(int col,int row,COLORREF &color);
	void SetColColor(int col,COLORREF color);  //ÉèÖÃÁÐÑÕÉ«
	void SetItemColor(int col,int row,COLORREF color); //ÉèÖÃItemÑÕÉ«
	void SetColTextColor(int col,COLORREF color);   //ÉèÖÃÁÐÎı¾ÑÕÉ«
	void SetItemTextColor(int col,int row,COLORREF color);
	void SetRowHeigt(int nHeight); //ÉèÖÃÐиß
	void SetHeaderFontHW(int nHeight,int nWith); //ÉèÖñíÍ·×ÖÌå´óС
	void SetHeaderTextColor(COLORREF color);
	COLORREF m_color;
	BOOL SetTextColor(COLORREF cr);
	void SetFontHW(int nHeight,int nWith);  //ÉèÖÃ×ÖÌåµÄ¸ßºÍ¿í
public:
	// ×ÖÌå¸ß¶È
	int m_fontHeight;
public:
	// ×ÖÌå¿í¶È
	int m_fontWith;
	afx_msg void OnPaint();
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
public:
	void createItemButton( int nItem, int nSubItem, HWND hMain,LPCTSTR lpszCaption ,void * pData,int nBitmapIn, COLORREF crTransColorIn, int nBitmapOut, COLORREF crTransColorOut);
	void createItemButton( int nItem, int nSubItem, HWND hMain,LPCTSTR lpszCaption ,void * pData,HBITMAP nBitmapIn, COLORREF crTransColorIn, HBITMAP nBitmapOut, COLORREF crTransColorOut);
	void updateListCtrlButtonPos();
	//ÊÍ·Å´´½¨µÄButton
	void release();
	void deleteItemEx( int nItem );
	CButtonCtrl*GetBtutton(int index);
	Button_map m_mButton;

public:
	UINT m_uID;
	CFont font ;    //°´Å¥ÉÏÃæµÄ×ÖÌå
	afx_msg void OnHdnBegintrack(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
};


text:
// -----------------------------------------------------------------------
// <copyright file="LabelEncoder.cs" company="Sharpkit.Learn">
// Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
//         Mathieu Blondel <mathieu@mblondel.org>
//         Olivier Grisel <olivier.grisel@ensta.org>
//         Andreas Mueller <amueller@ais.uni-bonn.de>
// License: BSD 3 clause
// </copyright>
// -----------------------------------------------------------------------

namespace Sharpkit.Learn.Preprocessing
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Encode labels with value between 0 and n_classes-1.
    /// </summary>
    /// <typeparam name="TLabel">Type of class label.</typeparam>
    /// <example>
    /// `LabelEncoder` can be used to normalize labels.
    /// <para>
    /// var le = new.LabelEncoder();
    /// le.Fit(new [] {1, 2, 2, 6});
    /// le.Classes
    ///     {1, 2, 6}
    /// le.Transform(new[] {1, 1, 2, 6})
    ///     {0, 0, 1, 2}
    /// le.InverseTransform(new[] {0, 0, 1, 2})
    ///     {1, 1, 2, 6}
    /// </para>
    /// <para>
    /// It can also be used to transform non-numerical labels to numerical labels.
    /// </para>
    /// <para>
    /// var le = new LabelEncoder();
    /// le.Fit(new[] {"paris", "paris", "tokyo", "amsterdam"});
    /// le.Classes
    ///     {"amsterdam', "paris", "tokyo"}
    /// le.Transform(new[] {"tokyo", "tokyo", "paris"})
    ///     {2, 2, 1}
    /// le.InverseTransform(new[] {2, 2, 1});
    ///     {"tokyo", "tokyo", "paris"}
    /// </para>
    /// </example>
    public class LabelEncoder<TLabel>
    {
        /// <summary>
        /// Gets or sets an array with labels for each class.
        /// </summary>
        public TLabel[] Classes { get; private set; }

        /// <summary>
        /// Fit label encoder.
        /// </summary>
        /// <param name="y">Target values. [n_samples]</param>
        /// <returns>Returns an instance of self.</returns>
        public LabelEncoder<TLabel> Fit(TLabel[] y)
        {
            this.Classes = y.Distinct().OrderBy(a => a).ToArray();
            return this;
        }

        /// <summary>
        /// Fit label encoder and return encoded labels.
        /// </summary>
        /// <param name="y">Target values. [n_samples]</param>
        /// <returns>Array [n_samples].</returns>
        public int[] FitTransform(TLabel[] y)
        {
            return Fit(y).Transform(y);
        }

        /// <summary>
        /// Transform labels to normalized encoding.
        /// </summary>
        /// <param name="y">Target values. [n_samples]</param>
        /// <returns>Array [n_samples].</returns>
        public int[] Transform(TLabel[] y)
        {
            CheckFitted();

            var classes = y.Distinct().ToList();
            var diff = new HashSet<TLabel>(classes);
            diff.ExceptWith(new HashSet<TLabel>(this.Classes));
            if (diff.Any())
            {
                throw new ArgumentException("y contains new labels: {0}", string.Concat(",", diff));
            }

            var dict = this.Classes.Select((label, index) => Tuple.Create(label, index))
                .ToDictionary(t => t.Item1, t => t.Item2);
            return y.Select(l => dict[l]).ToArray();
        }

        /// <summary>
        /// Transform labels back to original encoding.
        /// </summary>
        /// <param name="y">Target values. [n_samples]</param>
        /// <returns>Array. [n_samples]</returns>
        public TLabel[] InverseTransform(int[] y)
        {
            CheckFitted();

            return y.Select(a => this.Classes[a]).ToArray();
        }

        /// <summary>
        /// Ensures that <see cref="Fit"/> was called.
        /// </summary>
        private void CheckFitted()
        {
            if (this.Classes == null)
            {
                throw new InvalidOperationException("LabelNormalizer was not fitted yet.");
            }
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>

    <copyright>
      <year>1996</year><year>2013</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      The contents of this file are subject to the Erlang Public License,
      Version 1.1, (the "License"); you may not use this file except in
      compliance with the License. You should have received a copy of the
      Erlang Public License along with this software. If not, it can be
      retrieved online at http://www.erlang.org/.

      Software distributed under the License is distributed on an "AS IS"
      basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
      the License for the specific language governing rights and limitations
      under the License.

    </legalnotice>

    <title>gen_fsm</title>
    <prepared></prepared>
    <docno></docno>
    <date></date>
    <rev></rev>

  <module>gen_fsm</module>
  <modulesummary>Generic Finite State Machine Behaviour</modulesummary>
  <description>

A behaviour module for implementing a finite state machine.
      A generic finite state machine process (gen_fsm) implemented
      using this module will have a standard set of interface functions
      and include functionality for tracing and error reporting. It will
      also fit into an OTP supervision tree. Refer to
      <seealso marker="doc/design_principles:fsm">OTP Design Principles</seealso> for more information.

A gen_fsm assumes all specific parts to be located in a callback
      module exporting a pre-defined set of functions. The relationship
      between the behaviour functions and the callback functions can be
      illustrated as follows:

gen_fsm module                    Callback module
--------------                    ---------------
gen_fsm:start_link                -----> Module:init/1

gen_fsm:send_event                -----> Module:StateName/2

gen_fsm:send_all_state_event      -----> Module:handle_event/3

gen_fsm:sync_send_event           -----> Module:StateName/3

gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4

-                                 -----> Module:handle_info/3

-                                 -----> Module:terminate/3

-                                 -----> Module:code_change/4

If a callback function fails or returns a bad value, the gen_fsm
      will terminate.

A gen_fsm handles system messages as documented in
       <seealso marker="sys">sys(3)</seealso>. The <c>sys</c> module
       can be used for debugging a gen_fsm.

Note that a gen_fsm does not trap exit signals automatically,
      this must be explicitly initiated in the callback module.

Unless otherwise stated, all functions in this module fail if
      the specified gen_fsm does not exist or if bad arguments are
      given.

The gen_fsm process can go into hibernation
    (see <seealso marker="erts:erlang#erlang:hibernate/3">erlang(3)</seealso>) if a callback
    function specifies <c>'hibernate'</c> instead of a timeout value. This
    might be useful if the server is expected to be idle for a long
    time. However this feature should be used with care as hibernation
    implies at least two garbage collections (when hibernating and
    shortly after waking up) and is not something you'd want to do
    between each call to a busy state machine.

  </description>
  <funcs>
    <func>
      <name>start_link(Module, Args, Options) -> Result</name>
      <name>start_link(FsmName, Module, Args, Options) -> Result</name>
      <fsummary>Create a gen_fsm process in a supervision tree.</fsummary>
      <type>
        <v>FsmName = {local,Name} | {global,GlobalName}
	| {via,Module,ViaName}</v>
        <v> Name = atom()</v>
        <v> GlobalName = ViaName = term()</v>
        <v>Module = atom()</v>
        <v>Args = term()</v>
        <v>Options = [Option]</v>
        <v> Option = {debug,Dbgs} | {timeout,Time} | {spawn_opt,SOpts}</v>
        <v>  Dbgs = [Dbg]</v>
        <v>   Dbg = trace | log | statistics</v>
        <v>    | {log_to_file,FileName} | {install,{Func,FuncState}}</v>
        <v>  SOpts = [SOpt]</v>
        <v>   SOpt - see erlang:spawn_opt/2,3,4,5</v>
        <v>Result = {ok,Pid} | ignore | {error,Error}</v>
        <v> Pid = pid()</v>
        <v> Error = {already_started,Pid} | term()</v>
      </type>
      <desc>

Creates a gen_fsm process as part of a supervision tree.
          The function should be called, directly or indirectly, by
          the supervisor. It will, among other things, ensure that
          the gen_fsm is linked to the supervisor.

The gen_fsm process calls <c>Module:init/1</c> to
          initialize. To ensure a synchronized start-up procedure,
          <c>start_link/3,4</c> does not return until
          <c>Module:init/1</c> has returned.

If <c>FsmName={local,Name}</c>, the gen_fsm is registered
          locally as <c>Name</c> using <c>register/2</c>.
          If <c>FsmName={global,GlobalName}</c>, the gen_fsm is
          registered globally as <c>GlobalName</c> using
          <c>global:register_name/2</c>.
	  If <c>FsmName={via,Module,ViaName}</c>, the gen_fsm will
	  register with the registry represented by <c>Module</c>.
	  The <c>Module</c> callback should export the functions
	  <c>register_name/2</c>, <c>unregister_name/1</c>,
	  <c>whereis_name/1</c> and <c>send/2</c>, which should behave like the
	  corresponding functions in <c>global</c>. Thus,
	<c>{via,global,GlobalName}</c> is a valid reference.

If no name is provided,
	the gen_fsm is not registered.

<c>Module</c> is the name of the callback module.

<c>Args</c> is an arbitrary term which is passed as
          the argument to <c>Module:init/1</c>.

If the option <c>{timeout,Time}</c> is present, the gen_fsm
          is allowed to spend <c>Time</c> milliseconds initializing
          or it will be terminated and the start function will return
          <c>{error,timeout}</c>.

If the option <c>{debug,Dbgs}</c> is present,
          the corresponding <c>sys</c> function will be called for each
          item in <c>Dbgs</c>. See
          <seealso marker="sys">sys(3)</seealso>.

If the option <c>{spawn_opt,SOpts}</c> is present,
          <c>SOpts</c> will be passed as option list to
          the <c>spawn_opt</c> BIF which is used to spawn the gen_fsm
          process. See
          <seealso marker="erts:erlang#spawn_opt/2">erlang(3)</seealso>.

        <note>

Using the spawn option <c>monitor</c> is currently not
            allowed, but will cause the function to fail with reason
            <c>badarg</c>.

        </note>

If the gen_fsm is successfully created and initialized
          the function returns <c>{ok,Pid}</c>, where <c>Pid</c> is
          the pid of the gen_fsm. If there already exists a process with
          the specified <c>FsmName</c>, the function returns
          <c>{error,{already_started,Pid}}</c> where <c>Pid</c> is
          the pid of that process.

If <c>Module:init/1</c> fails with <c>Reason</c>,
          the function returns <c>{error,Reason}</c>. If
          <c>Module:init/1</c> returns <c>{stop,Reason}</c> or
          <c>ignore</c>, the process is terminated and the function
          returns <c>{error,Reason}</c> or <c>ignore</c>, respectively.

      </desc>
    </func>
    <func>
      <name>start(Module, Args, Options) -> Result</name>
      <name>start(FsmName, Module, Args, Options) -> Result</name>
      <fsummary>Create a stand-alone gen_fsm process.</fsummary>
      <type>
        <v>FsmName = {local,Name} | {global,GlobalName}
	| {via,Module,ViaName}</v>
        <v> Name = atom()</v>
        <v> GlobalName = ViaName = term()</v>
        <v>Module = atom()</v>
        <v>Args = term()</v>
        <v>Options = [Option]</v>
        <v> Option = {debug,Dbgs} | {timeout,Time} | {spawn_opt,SOpts}</v>
        <v>  Dbgs = [Dbg]</v>
        <v>   Dbg = trace | log | statistics</v>
        <v>    | {log_to_file,FileName} | {install,{Func,FuncState}}</v>
        <v>  SOpts = [term()]</v>
        <v>Result = {ok,Pid} | ignore | {error,Error}</v>
        <v> Pid = pid()</v>
        <v> Error = {already_started,Pid} | term()</v>
      </type>
      <desc>

Creates a stand-alone gen_fsm process, i.e. a gen_fsm which
          is not part of a supervision tree and thus has no supervisor.

See <seealso marker="#start_link/3">start_link/3,4</seealso>
          for a description of arguments and return values.

      </desc>
    </func>
    <func>
      <name>send_event(FsmRef, Event) -> ok</name>
      <fsummary>Send an event asynchronously to a generic FSM.</fsummary>
      <type>
        <v>FsmRef = Name | {Name,Node} | {global,GlobalName}
	| {via,Module,ViaName} | pid()</v>
        <v> Name = Node = atom()</v>
        <v> GlobalName = ViaName = term()</v>
        <v>Event = term()</v>
      </type>
      <desc>

Sends an event asynchronously to the gen_fsm <c>FsmRef</c>
          and returns <c>ok</c> immediately. The gen_fsm will call
          <c>Module:StateName/2</c> to handle the event, where
          <c>StateName</c> is the name of the current state of
          the gen_fsm.

<c>FsmRef</c> can be:

        <list type="bulleted">
          <item>the pid,</item>
          <item><c>Name</c>, if the gen_fsm is locally registered,</item>
          <item><c>{Name,Node}</c>, if the gen_fsm is locally
	  registered at another node, or</item>
	  <item><c>{global,GlobalName}</c>, if the gen_fsm is globally
	  registered.</item>
	  <item><c>{via,Module,ViaName}</c>, if the gen_fsm is registered
	  through an alternative process registry.</item>
        </list>

<c>Event</c> is an arbitrary term which is passed as one of
          the arguments to <c>Module:StateName/2</c>.

      </desc>
    </func>
    <func>
      <name>send_all_state_event(FsmRef, Event) -> ok</name>
      <fsummary>Send an event asynchronously to a generic FSM.</fsummary>
      <type>
        <v>FsmRef = Name | {Name,Node} | {global,GlobalName}
	| {via,Module,ViaName} | pid()</v>
        <v> Name = Node = atom()</v>
        <v> GlobalName = ViaName = term()</v>
        <v>Event = term()</v>
      </type>
      <desc>

Sends an event asynchronously to the gen_fsm <c>FsmRef</c>
          and returns <c>ok</c> immediately. The gen_fsm will call
          <c>Module:handle_event/3</c> to handle the event.

See <seealso marker="#send_event/2">send_event/2</seealso>
          for a description of the arguments.

The difference between <c>send_event</c> and
          <c>send_all_state_event</c> is which callback function is
          used to handle the event. This function is useful when
          sending events that are handled the same way in every state,
          as only one <c>handle_event</c> clause is needed to handle
          the event instead of one clause in each state name function.

      </desc>
    </func>
    <func>
      <name>sync_send_event(FsmRef, Event) -> Reply</name>
      <name>sync_send_event(FsmRef, Event, Timeout) -> Reply</name>
      <fsummary>Send an event synchronously to a generic FSM.</fsummary>
      <type>
        <v>FsmRef = Name | {Name,Node} | {global,GlobalName}
	| {via,Module,ViaName} | pid()</v>
        <v> Name = Node = atom()</v>
        <v> GlobalName = ViaName = term()</v>
        <v>Event = term()</v>
        <v>Timeout = int()>0 | infinity</v>
        <v>Reply = term()</v>
      </type>
      <desc>

Sends an event to the gen_fsm <c>FsmRef</c> and waits until a
          reply arrives or a timeout occurs. The gen_fsm will call
          <c>Module:StateName/3</c> to handle the event, where
          <c>StateName</c> is the name of the current state of
          the gen_fsm.

See <seealso marker="#send_event/2">send_event/2</seealso>
          for a description of <c>FsmRef</c> and <c>Event</c>.

<c>Timeout</c> is an integer greater than zero which
          specifies how many milliseconds to wait for a reply, or
          the atom <c>infinity</c> to wait indefinitely. Default value
          is 5000. If no reply is received within the specified time,
          the function call fails.

The return value <c>Reply</c> is defined in the return value
          of <c>Module:StateName/3</c>.

The ancient behaviour of sometimes consuming the server
          exit message if the server died during the call while
          linked to the client has been removed in OTP R12B/Erlang 5.6.

      </desc>
    </func>
    <func>
      <name>sync_send_all_state_event(FsmRef, Event) -> Reply</name>
      <name>sync_send_all_state_event(FsmRef, Event, Timeout) -> Reply</name>
      <fsummary>Send an event synchronously to a generic FSM.</fsummary>
      <type>
        <v>FsmRef = Name | {Name,Node} | {global,GlobalName}
	| {via,Module,ViaName} | pid()</v>
        <v> Name = Node = atom()</v>
        <v> GlobalName = ViaName = term()</v>
        <v>Event = term()</v>
        <v>Timeout = int()>0 | infinity</v>
        <v>Reply = term()</v>
      </type>
      <desc>

Sends an event to the gen_fsm <c>FsmRef</c> and waits until a
          reply arrives or a timeout occurs. The gen_fsm will call
          <c>Module:handle_sync_event/4</c> to handle the event.

See <seealso marker="#send_event/2">send_event/2</seealso>
          for a description of <c>FsmRef</c> and <c>Event</c>. See
          <seealso marker="#sync_send_event/3">sync_send_event/3</seealso>
          for a description of <c>Timeout</c> and <c>Reply</c>.

See
          <seealso marker="#send_all_state_event/2">send_all_state_event/2</seealso>
          for a discussion about the difference between
          <c>sync_send_event</c> and <c>sync_send_all_state_event</c>.

      </desc>
    </func>
    <func>
      <name>reply(Caller, Reply) -> true</name>
      <fsummary>Send a reply to a caller.</fsummary>
      <type>
        <v>Caller - see below</v>
        <v>Reply = term()</v>
      </type>
      <desc>

This function can be used by a gen_fsm to explicitly send a
          reply to a client process that called
          <seealso marker="#sync_send_event/2">sync_send_event/2,3</seealso>
          or
          <seealso marker="#sync_send_all_state_event/2">sync_send_all_state_event/2,3</seealso>,
          when the reply cannot be defined in the return value of
          <c>Module:State/3</c> or <c>Module:handle_sync_event/4</c>.

<c>Caller</c> must be the <c>From</c> argument provided to
          the callback function. <c>Reply</c> is an arbitrary term,
          which will be given back to the client as the return value of
          <c>sync_send_event/2,3</c> or
          <c>sync_send_all_state_event/2,3</c>.

      </desc>
    </func>
    <func>
      <name>send_event_after(Time, Event) -> Ref</name>
      <fsummary>Send a delayed event internally in a generic FSM.</fsummary>
      <type>
        <v>Time = integer()</v>
        <v>Event = term()</v>
        <v>Ref = reference()</v>
      </type>
      <desc>

Sends a delayed event internally in the gen_fsm that calls
          this function after <c>Time</c> ms. Returns immediately a
          reference that can be used to cancel the delayed send using
          <seealso marker="#cancel_timer/1">cancel_timer/1</seealso>.

The gen_fsm will call <c>Module:StateName/2</c> to handle
          the event, where <c>StateName</c> is the name of the current
          state of the gen_fsm at the time the delayed event is
          delivered.

<c>Event</c> is an arbitrary term which is passed as one of
          the arguments to <c>Module:StateName/2</c>.

      </desc>
    </func>
    <func>
      <name>start_timer(Time, Msg) -> Ref</name>
      <fsummary>Send a timeout event internally in a generic FSM.</fsummary>
      <type>
        <v>Time = integer()</v>
        <v>Msg = term()</v>
        <v>Ref = reference()</v>
      </type>
      <desc>

Sends a timeout event internally in the gen_fsm that calls
          this function after <c>Time</c> ms. Returns immediately a
          reference that can be used to cancel the timer using
          <seealso marker="#cancel_timer/1">cancel_timer/1</seealso>.

The gen_fsm will call <c>Module:StateName/2</c> to handle
          the event, where <c>StateName</c> is the name of the current
          state of the gen_fsm at the time the timeout message is
          delivered.

<c>Msg</c> is an arbitrary term which is passed in the
          timeout message, <c>{timeout, Ref, Msg}</c>, as one of
          the arguments to <c>Module:StateName/2</c>.

      </desc>
    </func>
    <func>
      <name>cancel_timer(Ref) -> RemainingTime | false</name>
      <fsummary>Cancel an internal timer in a generic FSM.</fsummary>
      <type>
        <v>Ref = reference()</v>
        <v>RemainingTime = integer()</v>
      </type>
      <desc>

Cancels an internal timer referred by <c>Ref</c> in the
          gen_fsm that calls this function.

<c>Ref</c> is a reference returned from
          <seealso marker="#send_event_after/2">send_event_after/2</seealso>
          or
          <seealso marker="#start_timer/2">start_timer/2</seealso>.

If the timer has already timed out, but the event not yet
          been delivered, it is cancelled as if it had not
          timed out, so there will be no false timer event after
          returning from this function.

Returns the remaining time in ms until the timer would
          have expired if <c>Ref</c> referred to an active timer,
          <c>false</c> otherwise.

      </desc>
    </func>
    <func>
      <name>enter_loop(Module, Options, StateName, StateData)</name>
      <name>enter_loop(Module, Options, StateName, StateData, FsmName)</name>
      <name>enter_loop(Module, Options, StateName, StateData, Timeout)</name>
      <name>enter_loop(Module, Options, StateName, StateData, FsmName, Timeout)</name>
      <fsummary>Enter the gen_fsm receive loop</fsummary>
      <type>
        <v>Module = atom()</v>
        <v>Options = [Option]</v>
        <v> Option = {debug,Dbgs}</v>
        <v>  Dbgs = [Dbg]</v>
        <v>   Dbg = trace | log | statistics</v>
        <v>    | {log_to_file,FileName} | {install,{Func,FuncState}}</v>
        <v>StateName = atom()</v>
        <v>StateData = term()</v>
        <v>FsmName = {local,Name} | {global,GlobalName}
	| {via,Module,ViaName}</v>
        <v> Name = atom()</v>
        <v> GlobalName = ViaName = term()</v>
        <v>Timeout = int() | infinity</v>
      </type>
      <desc>

Makes an existing process into a gen_fsm. Does not return,
          instead the calling process will enter the gen_fsm receive
          loop and become a gen_fsm process. The process must
          have been started using one of the start functions in
          <c>proc_lib</c>, see
          <seealso marker="proc_lib">proc_lib(3)</seealso>. The user is
          responsible for any initialization of the process, including
          registering a name for it.

This function is useful when a more complex initialization
          procedure is needed than the gen_fsm behaviour provides.

<c>Module</c>, <c>Options</c> and <c>FsmName</c> have
          the same meanings as when calling
          <seealso marker="#start_link/3">start[_link]/3,4</seealso>.
          However, if <c>FsmName</c> is specified, the process must have
          been registered accordingly before this function is
          called.

<c>StateName</c>, <c>StateData</c> and <c>Timeout</c> have
          the same meanings as in the return value of
          <seealso marker="#Moduleinit">Module:init/1</seealso>.
          Also, the callback module <c>Module</c> does not need to
          export an <c>init/1</c> function.

Failure: If the calling process was not started by a
          <c>proc_lib</c> start function, or if it is not registered
          according to <c>FsmName</c>.

      </desc>
    </func>
  </funcs>

    <title>CALLBACK FUNCTIONS</title>

The following functions should be exported from a <c>gen_fsm</c>
      callback module.

In the description, the expression state name is used to
      denote a state of the state machine. state data is used
      to denote the internal state of the Erlang process which
      implements the state machine.

  <funcs>
    <func>
      <name>Module:init(Args) -> Result</name>
      <fsummary>Initialize process and internal state name and state data.</fsummary>
      <type>
        <v>Args = term()</v>
        <v>Result = {ok,StateName,StateData} | {ok,StateName,StateData,Timeout}</v>
	<v>  | {ok,StateName,StateData,hibernate}</v>
        <v>  | {stop,Reason} | ignore</v>
        <v> StateName = atom()</v>
        <v> StateData = term()</v>
        <v> Timeout = int()>0 | infinity</v>
        <v> Reason = term()</v>
      </type>
      <desc>
        <marker id="Moduleinit"></marker>

Whenever a gen_fsm is started using
          <seealso marker="#start/3">gen_fsm:start/3,4</seealso> or
          <seealso marker="#start_link/3">gen_fsm:start_link/3,4</seealso>,
          this function is called by the new process to initialize.

<c>Args</c> is the <c>Args</c> argument provided to the start
          function.

If initialization is successful, the function should return
          <c>{ok,StateName,StateData}</c>,
          <c>{ok,StateName,StateData,Timeout}</c> or <c>{ok,StateName,StateData,hibernate}</c>,
	  where <c>StateName</c>
          is the initial state name and <c>StateData</c> the initial
          state data of the gen_fsm.

If an integer timeout value is provided, a timeout will occur
          unless an event or a message is received within <c>Timeout</c>
          milliseconds. A timeout is represented by the atom
          <c>timeout</c> and should be handled by
          the <c>Module:StateName/2</c> callback functions. The atom
          <c>infinity</c> can be used to wait indefinitely, this is
          the default value.

If <c>hibernate</c> is specified instead of a timeout value, the process will go
	   into hibernation when waiting for the next message to arrive (by calling
	   <seealso marker="proc_lib#hibernate/3">proc_lib:hibernate/3</seealso>).

If something goes wrong during the initialization
          the function should return <c>{stop,Reason}</c>, where
          <c>Reason</c> is any term, or <c>ignore</c>.

      </desc>
    </func>
    <func>
      <name>Module:StateName(Event, StateData) -> Result</name>
      <fsummary>Handle an asynchronous event.</fsummary>
      <type>
        <v>Event = timeout | term()</v>
        <v>StateData = term()</v>
        <v>Result = {next_state,NextStateName,NewStateData} </v>
	<v>  | {next_state,NextStateName,NewStateData,Timeout}</v>
	<v>  | {next_state,NextStateName,NewStateData,hibernate}</v>
        <v>  | {stop,Reason,NewStateData}</v>
        <v> NextStateName = atom()</v>
        <v> NewStateData = term()</v>
        <v> Timeout = int()>0 | infinity</v>
        <v> Reason = term()</v>
      </type>
      <desc>

There should be one instance of this function for each
          possible state name. Whenever a gen_fsm receives an event
          sent using
          <seealso marker="#send_event/2">gen_fsm:send_event/2</seealso>,
          the instance of this function with the same name as
          the current state name <c>StateName</c> is called to handle
          the event. It is also called if a timeout occurs.

<c>Event</c> is either the atom <c>timeout</c>, if a timeout
          has occurred, or the <c>Event</c> argument provided to
          <c>send_event/2</c>.

<c>StateData</c> is the state data of the gen_fsm.

If the function returns
          <c>{next_state,NextStateName,NewStateData}</c>,
          <c>{next_state,NextStateName,NewStateData,Timeout}</c> or
	  <c>{next_state,NextStateName,NewStateData,hibernate}</c>,
          the gen_fsm will continue executing with the current state
          name set to <c>NextStateName</c> and with the possibly
          updated state data <c>NewStateData</c>. See
          <c>Module:init/1</c> for a description of <c>Timeout</c> and <c>hibernate</c>.

If the function returns <c>{stop,Reason,NewStateData}</c>,
          the gen_fsm will call
          <c>Module:terminate(Reason,NewStateData)</c> and terminate.

      </desc>
    </func>
    <func>
      <name>Module:handle_event(Event, StateName, StateData) -> Result</name>
      <fsummary>Handle an asynchronous event.</fsummary>
      <type>
        <v>Event = term()</v>
        <v>StateName = atom()</v>
        <v>StateData = term()</v>
        <v>Result = {next_state,NextStateName,NewStateData} </v>
	<v>  | {next_state,NextStateName,NewStateData,Timeout}</v>
	<v>  | {next_state,NextStateName,NewStateData,hibernate}</v>
        <v>  | {stop,Reason,NewStateData}</v>
        <v> NextStateName = atom()</v>
        <v> NewStateData = term()</v>
        <v> Timeout = int()>0 | infinity</v>
        <v> Reason = term()</v>
      </type>
      <desc>

Whenever a gen_fsm receives an event sent using
          <seealso marker="#send_all_state_event/2">gen_fsm:send_all_state_event/2</seealso>,
          this function is called to handle the event.

<c>StateName</c> is the current state name of the gen_fsm.

See <c>Module:StateName/2</c> for a description of the other
          arguments and possible return values.

      </desc>
    </func>
    <func>
      <name>Module:StateName(Event, From, StateData) -> Result</name>
      <fsummary>Handle a synchronous event.</fsummary>
      <type>
        <v>Event = term()</v>
        <v>From = {pid(),Tag}</v>
        <v>StateData = term()</v>
        <v>Result = {reply,Reply,NextStateName,NewStateData}</v>
	<v>  | {reply,Reply,NextStateName,NewStateData,Timeout}</v>
	<v>  | {reply,Reply,NextStateName,NewStateData,hibernate}</v>
        <v>  | {next_state,NextStateName,NewStateData}</v>
	<v>  | {next_state,NextStateName,NewStateData,Timeout}</v>
	<v>  | {next_state,NextStateName,NewStateData,hibernate}</v>
        <v>  | {stop,Reason,Reply,NewStateData} | {stop,Reason,NewStateData}</v>
        <v> Reply = term()</v>
        <v> NextStateName = atom()</v>
        <v> NewStateData = term()</v>
        <v> Timeout = int()>0 | infinity</v>
        <v> Reason = normal | term()</v>
      </type>
      <desc>

There should be one instance of this function for each
          possible state name. Whenever a gen_fsm receives an event
          sent using
          <seealso marker="#sync_send_event/2">gen_fsm:sync_send_event/2,3</seealso>,
          the instance of this function with the same name as
          the current state name <c>StateName</c> is called to handle
          the event.

<c>Event</c> is the <c>Event</c> argument provided to
          <c>sync_send_event</c>.

<c>From</c> is a tuple <c>{Pid,Tag}</c> where <c>Pid</c> is
          the pid of the process which called <c>sync_send_event/2,3</c>
          and <c>Tag</c> is a unique tag.

<c>StateData</c> is the state data of the gen_fsm.

If the function returns
          <c>{reply,Reply,NextStateName,NewStateData}</c>,
          <c>{reply,Reply,NextStateName,NewStateData,Timeout}</c> or
	  <c>{reply,Reply,NextStateName,NewStateData,hibernate}</c>,
          <c>Reply</c> will be given back to <c>From</c> as the return
          value of <c>sync_send_event/2,3</c>. The gen_fsm then
          continues executing with the current state name set to
          <c>NextStateName</c> and with the possibly updated state data
          <c>NewStateData</c>. See <c>Module:init/1</c> for a
          description of <c>Timeout</c> and <c>hibernate</c>.

If the function returns
          <c>{next_state,NextStateName,NewStateData}</c>,
          <c>{next_state,NextStateName,NewStateData,Timeout}</c> or
          <c>{next_state,NextStateName,NewStateData,hibernate}</c>,
          the gen_fsm will continue executing in <c>NextStateName</c>
          with <c>NewStateData</c>. Any reply to <c>From</c> must be
          given explicitly using
          <seealso marker="#reply/2">gen_fsm:reply/2</seealso>.

If the function returns
          <c>{stop,Reason,Reply,NewStateData}</c>, <c>Reply</c> will be
          given back to <c>From</c>. If the function returns
          <c>{stop,Reason,NewStateData}</c>, any reply to <c>From</c>
          must be given explicitly using <c>gen_fsm:reply/2</c>.
          The gen_fsm will then call
          <c>Module:terminate(Reason,NewStateData)</c> and terminate.

      </desc>
    </func>
    <func>
      <name>Module:handle_sync_event(Event, From, StateName, StateData) -> Result</name>
      <fsummary>Handle a synchronous event.</fsummary>
      <type>
        <v>Event = term()</v>
        <v>From = {pid(),Tag}</v>
        <v>StateName = atom()</v>
        <v>StateData = term()</v>
        <v>Result = {reply,Reply,NextStateName,NewStateData}</v>
	<v>  | {reply,Reply,NextStateName,NewStateData,Timeout}</v>
	<v>  | {reply,Reply,NextStateName,NewStateData,hibernate}</v>
        <v>  | {next_state,NextStateName,NewStateData}</v>
	<v>  | {next_state,NextStateName,NewStateData,Timeout}</v>
	<v>  | {next_state,NextStateName,NewStateData,hibernate}</v>
        <v>  | {stop,Reason,Reply,NewStateData} | {stop,Reason,NewStateData}</v>
        <v> Reply = term()</v>
        <v> NextStateName = atom()</v>
        <v> NewStateData = term()</v>
        <v> Timeout = int()>0 | infinity</v>
        <v> Reason = term()</v>
      </type>
      <desc>

Whenever a gen_fsm receives an event sent using
          <seealso marker="#sync_send_all_state_event/2">gen_fsm:sync_send_all_state_event/2,3</seealso>,
          this function is called to handle the event.

<c>StateName</c> is the current state name of the gen_fsm.

See <c>Module:StateName/3</c> for a description of the other
          arguments and possible return values.

      </desc>
    </func>
    <func>
      <name>Module:handle_info(Info, StateName, StateData) -> Result</name>
      <fsummary>Handle an incoming message.</fsummary>
      <type>
        <v>Info = term()</v>
        <v>StateName = atom()</v>
        <v>StateData = term()</v>
        <v>Result = {next_state,NextStateName,NewStateData}</v>
	<v>  | {next_state,NextStateName,NewStateData,Timeout}</v>
	<v>  | {next_state,NextStateName,NewStateData,hibernate}</v>
        <v>  | {stop,Reason,NewStateData}</v>
        <v> NextStateName = atom()</v>
        <v> NewStateData = term()</v>
        <v> Timeout = int()>0 | infinity</v>
        <v> Reason = normal | term()</v>
      </type>
      <desc>

This function is called by a gen_fsm when it receives any
          other message than a synchronous or asynchronous event (or a
          system message).

<c>Info</c> is the received message.

See <c>Module:StateName/2</c> for a description of the other
          arguments and possible return values.

      </desc>
    </func>
    <func>
      <name>Module:terminate(Reason, StateName, StateData)</name>
      <fsummary>Clean up before termination.</fsummary>
      <type>
        <v>Reason = normal | shutdown | {shutdown,term()} | term()</v>
        <v>StateName = atom()</v>
        <v>StateData = term()</v>
      </type>
      <desc>

This function is called by a gen_fsm when it is about to
          terminate. It should be the opposite of <c>Module:init/1</c>
          and do any necessary cleaning up. When it returns, the gen_fsm
          terminates with <c>Reason</c>. The return value is ignored.

<c>Reason</c> is a term denoting the stop reason,
          <c>StateName</c> is the current state name, and
          <c>StateData</c> is the state data of the gen_fsm.

<c>Reason</c> depends on why the gen_fsm is terminating. If
          it is because another callback function has returned a stop
          tuple <c>{stop,..}</c>, <c>Reason</c> will have the value
          specified in that tuple. If it is due to a failure,
          <c>Reason</c> is the error reason.

If the gen_fsm is part of a supervision tree and is ordered
          by its supervisor to terminate, this function will be called
          with <c>Reason=shutdown</c> if the following conditions apply:

        <list type="bulleted">
          <item>the gen_fsm has been set to trap exit signals, and</item>
          <item>the shutdown strategy as defined in the supervisor's
           child specification is an integer timeout value, not
          <c>brutal_kill</c>.</item>
        </list>

Even if the gen_fsm is not part of a supervision tree,
	   this function will be called if it receives an <c>'EXIT'</c>
	   message from its parent. <c>Reason</c> will be the same as in
	   the <c>'EXIT'</c> message.

Otherwise, the gen_fsm will be immediately terminated.

Note that for any other reason than <c>normal</c>,
          <c>shutdown</c>, or <c>{shutdown,Term}</c> the gen_fsm is
	  assumed to terminate due to an error and
	  an error report is issued using
          <seealso marker="kernel:error_logger#format/2">error_logger:format/2</seealso>.

      </desc>
    </func>
    <func>
      <name>Module:code_change(OldVsn, StateName, StateData, Extra) -> {ok, NextStateName, NewStateData}</name>
      <fsummary>Update the internal state data during upgrade/downgrade.</fsummary>
      <type>
        <v>OldVsn = Vsn | {down,  Vsn}</v>
        <v>  Vsn = term()</v>
        <v>StateName = NextStateName = atom()</v>
        <v>StateData = NewStateData = term()</v>
        <v>Extra = term()</v>
      </type>
      <desc>

This function is called by a gen_fsm when it should update
          its internal state data during a release upgrade/downgrade,
          i.e. when the instruction <c>{update,Module,Change,...}</c>
          where <c>Change={advanced,Extra}</c> is given in
          the <c>appup</c> file. See
          <seealso marker="doc/design_principles:release_handling#instr">OTP Design Principles</seealso>.

In the case of an upgrade, <c>OldVsn</c> is <c>Vsn</c>, and
          in the case of a downgrade, <c>OldVsn</c> is
          <c>{down,Vsn}</c>. <c>Vsn</c> is defined by the <c>vsn</c>
          attribute(s) of the old version of the callback module
          <c>Module</c>. If no such attribute is defined, the version is
          the checksum of the BEAM file.

<c>StateName</c> is the current state name and
          <c>StateData</c> the internal state data of the gen_fsm.

<c>Extra</c> is passed as-is from the <c>{advanced,Extra}</c>
          part of the update instruction.

The function should return the new current state name and
          updated internal data.

      </desc>
    </func>
    <func>
      <name>Module:format_status(Opt, [PDict, StateData]) -> Status</name>
      <fsummary>Optional function for providing a term describing the
        current gen_fsm status.</fsummary>
      <type>
        <v>Opt = normal | terminate</v>
        <v>PDict = [{Key, Value}]</v>
        <v>StateData = term()</v>
        <v>Status = term()</v>
      </type>
      <desc>
        <note>

This callback is optional, so callback modules need not
            export it. The gen_fsm module provides a default
            implementation of this function that returns the callback
            module state data.

        </note>

This function is called by a gen_fsm process when:

        <list typed="bulleted">
          <item>One
            of <seealso marker="sys#get_status/1">sys:get_status/1,2</seealso>
            is invoked to get the gen_fsm status. <c>Opt</c> is set to
            the atom <c>normal</c> for this case.</item>
          <item>The gen_fsm terminates abnormally and logs an
            error. <c>Opt</c> is set to the atom <c>terminate</c> for
            this case.</item>
        </list>

This function is useful for customising the form and
          appearance of the gen_fsm status for these cases. A callback
          module wishing to customise the <c>sys:get_status/1,2</c>
          return value as well as how its status appears in
          termination error logs exports an instance
          of <c>format_status/2</c> that returns a term describing the
          current status of the gen_fsm.

<c>PDict</c> is the current value of the gen_fsm's
          process dictionary.

<c>StateData</c> is the internal state data of the
          gen_fsm.

The function should return <c>Status</c>, a term that
          customises the details of the current state and status of
          the gen_fsm. There are no restrictions on the
          form <c>Status</c> can take, but for
          the <c>sys:get_status/1,2</c> case (when <c>Opt</c>
          is <c>normal</c>), the recommended form for
          the <c>Status</c> value is <c>[{data, [{"StateData",
          Term}]}]</c> where <c>Term</c> provides relevant details of
          the gen_fsm state data. Following this recommendation isn't
          required, but doing so will make the callback module status
          consistent with the rest of the <c>sys:get_status/1,2</c>
          return value.

One use for this function is to return compact alternative
          state data representations to avoid having large state terms
          printed in logfiles.

      </desc>
    </func>
  </funcs>

    <title>SEE ALSO</title>

<seealso marker="gen_event">gen_event(3)</seealso>,
      <seealso marker="gen_server">gen_server(3)</seealso>,
      <seealso marker="supervisor">supervisor(3)</seealso>,
      <seealso marker="proc_lib">proc_lib(3)</seealso>,
      <seealso marker="sys">sys(3)</seealso>

</erlref>


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

// --------------------------------------------------------------------

/**
 * ExpressionEngine Radio Fieldtype Class
 *
 * @package		ExpressionEngine
 * @subpackage	Fieldtypes
 * @category	Fieldtypes
 * @author		EllisLab Dev Team
 * @link		http://ellislab.com
 */
class Radio_ft extends EE_Fieldtype {

	var $info = array(
		'name'		=> 'Radio Buttons',
		'version'	=> '1.0'
	);

	var $has_array_data = FALSE;

	// used in display_field() below to set
	// some defaults for third party usage
	var $settings_vars = array(
		'field_text_direction'	=> 'rtl',
		'field_pre_populate'	=> 'n',
		'field_list_items'		=> array(),
		'field_pre_field_id'	=> '',
		'field_pre_channel_id'	=> ''
	);

	function validate($data)
	{
		$valid			= FALSE;
		$field_options	= $this->_get_field_options($data);

		if ($data === FALSE OR $data == '')
		{
			return TRUE;
		}

		$data = form_prep($data);

		foreach($field_options as $key => $val)
		{
			if (is_array($val))
			{
				if (array_key_exists($data, $val))
				{
					$valid = TRUE;
					break;
				}
			}
			elseif ((string) $key === $data)
			{
				$valid = TRUE;
				break;
			}
		}

		if ( ! $valid)
		{
			return $this->EE->lang->line('invalid_selection');
		}
	}

	// --------------------------------------------------------------------

	function display_field($data)
	{
		array_merge($this->settings, $this->settings_vars);

		$text_direction = ($this->settings['field_text_direction'] == 'rtl') ? 'rtl' : 'ltr';

		$field_options = $this->_get_field_options($data);

		// If they've selected something we'll make sure that it's a valid choice
		$selected = $data;
//$this->EE->input->post($this->field_name);

		$r = form_fieldset('');

		foreach($field_options as $option)
		{
			$selected = ($option == $data);
			$r .= '<label>'.form_radio($this->field_name, $option, $selected).NBS.$option.'</label>';
		}

		return $r.form_fieldset_close();
	}

	// --------------------------------------------------------------------

	function replace_tag($data, $params = '', $tagdata = '')
	{
		// Experimental parameter, do not use
		if (isset($params['raw_output']) && $params['raw_output'] == 'yes')
		{
			return $this->EE->functions->encode_ee_tags($data);
		}

		return $this->EE->typography->parse_type(
			$this->EE->functions->encode_ee_tags($data),
			array(
				'text_format'	=> $this->row['field_ft_'.$this->field_id],
				'html_format'	=> $this->row['channel_html_formatting'],
				'auto_links'	=> $this->row['channel_auto_link_urls'],
				'allow_img_url' => $this->row['channel_allow_img_urls']
			)
		);
	}

	// --------------------------------------------------------------------

	function display_settings($data)
	{
		$this->field_formatting_row($data, 'radio');
		$this->multi_item_row($data, 'radio');
	}

	function _get_field_options($data)
	{
		$field_options = array();

		if ($this->settings['field_pre_populate'] == 'n')
		{
			if ( ! is_array($this->settings['field_list_items']))
			{
				foreach (explode("\n", trim($this->settings['field_list_items'])) as $v)
				{
					$v = trim($v);
					$field_options[form_prep($v)] = form_prep($v);
				}
			}
			else
			{
				$field_options = $this->settings['field_list_items'];
			}
		}
		else
		{
			// We need to pre-populate this menu from an another channel custom field

			$this->EE->db->select('field_id_'.$this->settings['field_pre_field_id']);
			$this->EE->db->where('channel_id', $this->settings['field_pre_channel_id']);
			$pop_query = $this->EE->db->get('channel_data');

			$field_options[''] = '--';

			if ($pop_query->num_rows() > 0)
			{
				foreach ($pop_query->result_array() as $prow)
				{
					$selected = ($prow['field_id_'.$this->settings['field_pre_field_id']] == $data) ? 1 : '';
					$pretitle = substr($prow['field_id_'.$this->settings['field_pre_field_id']], 0, 110);
					$pretitle = str_replace(array("\r\n", "\r", "\n", "\t"), " ", $pretitle);
					$pretitle = form_prep($pretitle);

					$field_options[form_prep($prow['field_id_'.$this->settings['field_pre_field_id']])] = $pretitle;
				}
			}
		}

		return $field_options;
	}
}

// END Radio_ft class

/* End of file ft.radio.php */
/* Location: ./system/expressionengine/fieldtypes/ft.radio.php */


text:
package com.salmon.scommerce.core.services.handlers;

import java.util.HashSet;
import java.util.Set;

import com.salmon.scommerce.core.domain.User;
import com.salmon.scommerce.core.services.UserService;
import com.salmon.scommerce.security.shiro.PasswordHelper;

public class MockedUserServiceHandler implements UserService{

	private PasswordHelper passwordHelper;

	public MockedUserServiceHandler(PasswordHelper passwordHelper) {
		this.passwordHelper = passwordHelper;
	}

	public Set<String> findRoles(String userName) {
		Set<String> roles = new HashSet<String>();
		roles.add("test");
		return roles;
	}

	public Set<String> findPermissions(String userName) {
		Set<String> permissions = new HashSet<String>();
		permissions.add("permission");
		return permissions;
	}

	public User findByUsername(String userName) {
		User user = new User();
		user.setUsername("test");
		user.setPassword("test");
		user.setLocked(false);
		user.setSalt("test");
		return user;
	}

	public User createUser(User user) {
		passwordHelper.encryptPassword(user);
		return user;
	}

	public void changePassword(Long userId, String newPassword) {
		// TODO Auto-generated method stub

	}

	public void correlationRoles(Long userId, Long... roleIds) {
		// TODO Auto-generated method stub

	}

	public void uncorrelationRoles(Long userId, Long... roleIds) {
		// TODO Auto-generated method stub

	}

}


text:
class RunLengthEncoding
  def self.encode(str)
    str.chars.chunk { |char| char }.each_with_object('') do |chunk, out|
      out << encoded(chunk)
    end
  end

  def self.decode(str)
    str.scan(/(\d+)?(\D)/).each_with_object('') do |captures, out|
      out << decoded(captures)
    end
  end

  # private

  def self.encoded(chunk)
    char = chunk.first
    times = chunk.last.count
    return char if times == 1
    "#{times}#{char}"
  end
  private_class_method :encoded

  def self.decoded(captures)
    times = (captures.first || 1).to_i
    char = captures.last
    char * times
  end
  private_class_method :decoded
end


text:
import abc
import numpy as np

class KNN(metaclass=abc.ABCMeta):
    """
    Abstract base class for nearest neighbours algorithms. This class is not
    meant to be instanciated, ont its subclasses can be used.
    """

    def __init__(self, samples_per_class=None, k=1):
        self.samples_per_class = samples_per_class
        self.k = k
        self.last_confidence = None

    def get_distances(self, feat):
        """
        Calculates the distances between the given feature and all the instances
        saved during training. The calculation method is the L2 Euclidean
        distance.
        :param  feat:   An array-like object of shape (nb_features)
        :return:        A numpy array of shape (nb_training_examples)
        """
        p_squared = np.square(feat).sum()
        q_squared = np.square(self.features).sum(axis=1)
        product   = -2 * feat.dot(self.features.T)
        distances = np.sqrt(product + q_squared + np.matrix(p_squared).T)
        return distances

    def get_last_confidence(self):
        """
        Returns the confidence calculated on the last prediction made.
        For classification, confidence is the number of instances of the
        predicted class in the neighbours divided by the number of neighbours.
        For regression, confidence is one minus (variance in the neighbours
        divided by the mean value of neighbours)
        """
        return self.last_confidence

class KNNClassifier(KNN):
    """
    K-nearest neighbours algorithm used for classification.

    :param  samples_per_class:  Number of training examples that will be saved
                                by the model. If None, all examples will be kept
    :param  k:                  Number of neighbours to use for prediction
    """

    def fit(self, features, targets):
        """
        Trains the algorithm on the given dataset. For each class, the algorithm
        calculates a center that is the mean of all examples of the class. It
        only saves self.samples_per_class values for each class.
        :param  features:   An array-like object of shape (nb_samples, nb_features)
        :param  targets:    An array-like object of shape (nb_samples) of output
                            values
        """
        groups = list(set(targets))
        zipped = list(zip(targets, features))
        data = {a : np.array([b[1] for b in zipped if b[0] == a]) for a in groups}
        features, targets = [], []
        self.group_means = {}
        for group in data:
            mean = np.mean(data[group], axis=0)
            features.append(mean)
            targets.append(group)
            self.group_means[group] = mean
            nb_samples = len(data[group]) if not self.samples_per_class else self.samples_per_class
            idxs = np.random.choice(range(len(data[group])), nb_samples, replace=False)
            for i in idxs:
                features.append(data[group][i])
                targets.append(group)
        self.features = np.array(features)
        self.targets = np.array(targets)

    def predict(self, feat):
        """
        Predicts an output for the given feature.
        :param  feat:   Array-like object of shape (nb_samples)
        :return:        The most represented class in the neighbours
        """
        distances = self.get_distances(feat)
        labels = self.targets[np.argsort(distances[0])].flatten()
        k_closest = list(labels[:self.k])
        pred = max(k_closest, key=k_closest.count)
        self.last_confidence = k_closest.count(pred) / self.k
        return pred

class KNNRegressor(KNN):
    """
    K-nearest neighbours algorithm used for regression.

    :param  samples_per_class:  Not used in this class
    :param  k:                  Number of neighbours to use for prediction
    """

    def fit(self, features, targets):
        """
        Trains the algorithm on the given dataset.
        :param  features:   An array-like object of shape (nb_samples, nb_features)
        :param  targets:    An array-like object of shape (nb_samples) of output
                            values
        """
        self.features = features
        self.targets = targets

    def predict(self, feat):
        """
        Predicts an output for the given feature.
        :param  feat:   Array-like object of shape (nb_samples)
        :return:        The mean value of the k neighbours
        """
        distances = self.get_distances(feat)
        values = self.targets[np.argsort(distances[0])].flatten()
        k_closest = list(values[:self.k])
        predictions = np.mean(k_closest)
        self.last_confidence = 1 - np.var(k_closest) / np.mean(k_closest)
        return predictions


text:
body {
  font: 18px/34px 'Raleway',Helvetica,Arial,sans-serif;
  background: #f2f2f2;
}
.units-container {
  max-width: 1200px;
  margin: 0 auto;
}
figure {
  max-width: 100%;
  background-position: center center;
  background-size: cover;
}

/*
 ===============================
 ========== HEADER =============
 ===============================
*/
/* Top Bar */
.top-bar {
  background: #222;
}
.top-bar .navbar.navbar-left li {
  margin-right: 2.2em;
}
.top-bar .navbar.navbar-right li {
  margin-left: 1.45em;
}
.top-bar .navbar li {
  padding: 14px 0;
}
.top-bar .navbar li.nav-current a {
  color: #ad6c60;
}
.top-bar li a {
  font-family: 'Oswald',Arial,Helvetica,sans-serif;
  font-size: 16px;
  transition: all .6s ease 0s;
  -webkit-transition: all .6s ease 0s;
  text-transform: uppercase;
  color: #fff;
}
.top-bar .socials a {
  font-size: 18px;
  line-height: 28px;
}
/* Logo */
.logo {
  margin-bottom: 70px;
  padding: 70px 0;
  text-align: center;
  background: #fafafa;
}
.logo a {
  font-family: 'Oswald', Arial, Helvetica, sans-serif;
  font-size: 46px;
  text-transform: uppercase;
  color: #000;
}
/* Blog Description */
.blog-description {
  font-size: 34px;
  font-weight: normal;
  line-height: 36px;
  margin-top: 10px;
  text-transform: uppercase;
  color: #949494;
}
/* Description lines on sides */
/* First-top line */
/*.blog-description span {
  position: relative;
  display: inline-block;
}
.blog-description span:before,
.blog-description span:after {
  position: absolute;
  top: 15px;
  width: 130px;
  height: 15px;
  content: '';
  border-top: 2px solid #949494;
}
.blog-description span:before {
  right: 100%;
  margin-right: 15px;
}
.blog-description span:after {
  left: 100%;
  margin-left: 15px;
}
/* Second bottom line */
/*
.blog-description span span:before,
.blog-description span span:after {
  position: absolute;
  top: 25px;
  width: 100px;
  height: 15px;
  content: '';
  border-top: 2px solid #949494;
}
.blog-description span span:before {
  right: 100%;
  margin-right: 15px;
}
.blog-description span span:after {
  left: 100%;
  margin-left: 15px;
}
*/
/* Featured */
.home-template .featured header {
  position: relative;
  padding: 22px 0;
  border: 4px solid #fff;
  background: #fff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .15);
}
.home-template .featured.box header {
  padding: 0;
}
/* The bottom arrow */
.home-template .featured header:after,
.home-template .featured header:before {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 0;
  height: 0;
  content: ' ';
  pointer-events: none;
  border: solid transparent;
}
.home-template .featured header:after {
  margin-left: -10px;
  border-width: 10px;
  border-color: rgba(255, 255, 255, 0);
  border-top-color: #fff;
}
.home-template .featured header:before {
  margin-left: -16px;
  border-width: 16px;
  border-color: rgba(255, 255, 255, 0);
  border-top-color: #fff;
}
/* Featured header hover */
.home-template .featured header:hover {
  color: #fff;
  border: 4px solid #000;
  background: #000;
}
.home-template .featured header:hover::after,
.home-template .featured header:hover::before {
  border-color: rgba(0,0,0,0);
  border-top-color: #000;
}
.home-template .featured header p {
  font-size: 14px;
  line-height: 18px;
  margin: 28px 0 0 0;
  text-transform: uppercase;
  color: #999;
}
.home-template .featured header:hover .post-title a {
  transition: all .6s ease 0s;
  -webkit-transition: all .6s ease 0s;
  color: #fff;
}
.home-template .featured header p:before {
  position: absolute;
  left: 50%;
  float: left;
  width: 100px;
  height: 1px;
  margin-top: -15px;
  margin-left: -50px;
  content: '';
  background: #ddd none repeat scroll 0 0;
}
.home-template .featured figure {
  min-height: 260px;
}
/*
 ===============================
 =========== MAIN ==============
 ===============================
*/
main {
  overflow: hidden;
}
main .socials li a {
  line-height: 36px;
  display: inline-block;
  width: 36px;
  height: 36px;
  margin: 0 0 0 5px;
  transition: all .6s ease 0s;
  -webkit-transition: all .6s ease 0s;
  text-align: center;
  color: #fff;
  border-radius: 50%;
  background: #ccc none repeat scroll 0 0;
}
main .socials li a:hover {
  color: #fff;
  background: #ad6c60;
}
.inner-padding {
  clear: both;
  padding: 50px 30px 20px;
}
.box {
  margin-bottom: 50px;
  background: #fff;
  box-shadow: 0 3px 3px 0 rgba(0, 0, 0, .05);
}
.box header {
  text-align: center;
}
.box header figure {
  min-height: 410px;
  transition: all .25s ease-in-out 0s;
 -webkit-transition: all .25s ease-in-out 0s;
}
.box header figure:hover {
  opacity: .9;
}
.post-title,
.post-title a {
  text-transform: uppercase;
  color: #333;
}
.post-tags,
.post-tags a {
  text-transform: uppercase;
  color: #bbb;
}
/* Tags lines on sides */
/* First-top line */
.post-tags span {
  position: relative;
  display: inline-block;
}
.post-tags span:before,
.post-tags span:after {
  position: absolute;
  top: 12px;
  width: 70px;
  height: 15px;
  content: '';
  border-top: 1px solid #bbb;
}
.post-tags span:before {
  right: 100%;
  margin-right: 10px;
}
.post-tags span:after {
  left: 100%;
  margin-left: 10px;
}
/* Second-bottom Line */
.post-tags span span:before,
.post-tags span span:after {
  position: absolute;
  top: 20px;
  width: 55px;
  height: 15px;
  content: '';
  border-top: 1px solid #bbb;
}
.post-tags span span:before {
  right: 100%;
  margin-right: 10px;
}
.post-tags span span:after {
  left: 100%;
  margin-left: 10px;
}
.read-more {
  display: block;
  text-align: center;
  text-transform: uppercase;
  color: #333;
}
/* Date and author */
.ribbon {
  position: relative;
  width: auto;
  margin: 0 auto;
  background-color: #333;
}
.ribbon:before {
  position: absolute;
  left: 100%;
  content: '';
  border-width: 22px;
  border-style: solid;
  border-color: #333 transparent #333 #333;
}
.date {
  font-family: 'Oswald', Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 400;
  display: block;
  padding: 5px 0 5px 30px;
  text-transform: uppercase;
  color: #fff;
}
.date a {
  color: #fff;
  border-bottom: 2px solid #333;
}
.date a:hover {
  border-bottom: 2px solid #fff;
}
/*
 ===============================
 ====== SINGLE BLOG POST =======
 ===============================
*/
article footer {
  padding: 0;
  box-shadow: none;
}
article footer .group {
  padding: 40px 30px 40px 0;
  background: url('../images/divider.jpg') repeat-x center top;
}
.post-template article footer .group {
  background-image: url(../images/divider.jpg), url(../images/divider.jpg);
  background-repeat: repeat-x;
  background-position: center top, center bottom;
}
.author-info {
  display: inline-block;
}
.author-info figure img {
  width: 100px;
  height: 100px;
  margin: 0 26px 0 0;
  transition: all .6s ease 0s;
  -webkit-transition: all .6s ease 0s;
  vertical-align: middle;
  border-radius: 50%;
}
.author-info h5 {
  font-family: 'Raleway',Helvetica,Arial,sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}
/* Related Posts */
.related-posts h2 {
  text-align: center;
}
.related-posts h5 {
  line-height: 12px;
  margin-bottom: 0;
}
.related-posts a {
  font-size: 16px;
  text-transform: uppercase;
  color: #343434;
}
.related-posts li img{
  min-height: 160px;
  margin-bottom: 15px;
}
.related-posts time {
  font-size: 14px;
  font-style: italic;
  color: #bbb;
}
/* Post Navigation */
.post-navigation {
  padding: 30px 25px;
  text-transform: uppercase;
}
.post-navigation span {
  font-size: 14px;
  color: #343434;
  border-bottom: 1px solid;
}
.next-post {
  float: right;
  text-align: right;
}
.page-number {
  font-size: 14px;
  text-align: center;
}
/*
 ===============================
 ========== SIDEBAR ============
 ===============================
*/
aside h2 {
  text-transform: uppercase;
}
aside .box {
  font-size: 16px;
  margin-bottom: 40px;
  padding: 30px;
  color: #999;
}
aside .box p {
  margin: 0;
}

/* Widgets */
/* Twitter widget */
#twitter-widget ul {
  margin: 0;
}
#twitter-widget ul li {
  padding-bottom: 10px;
  list-style: none;
}
#twitter-widget ul li p {
  margin-bottom: 5px;
}
#twitter-widget .interact {
  display: none;
}
#twitter-widget section {
  display: inline-block;
  margin-top: -33px;
  padding-left: 30px;
}
#twitter-widget i {
  font-size: 20px;
}
.timePosted {
  padding-left: 30px;
}
/* Search Widget */
.search form {
  margin: 0;
}
.search input {
  font-size: 15px;
  line-height: 37px;
  padding-left: 10px;
  border: 0;
  background: #eee;
}
.search .btn-big,
.search input.btn-big[type='submit'] {
  font-size: 13px;
  padding: 12px 19px;
  text-transform: uppercase;
}
/* Search Results */
#result {
  position: relative;
  display: none;
}
#result i {
  position: absolute;
  top: 0;
  right: 0;
  display: none;
  padding: 55px 30px 0 0;
  cursor: pointer;
}
/* Tags Widget */
.tag-cloud a {
  font-size: 12px;
  display: inline-block;
  margin: 0 0 4px 4px;
  padding: 0 12px;
  text-transform: uppercase;
  color: #fff;
  border-radius: 2px;
  background: #ad6c60;
}
/*
 ===============================
 =========== PAGES =============
 ===============================
*/
/* Author Page & Tags Page */
.ribbon-title {
  line-height: 0;
  margin-bottom: 0;
  padding: 20px 0 20px 30px;
  text-transform: uppercase;
  color: #fff;
}
.ribbon-title i {
  font-size: 24px;
  padding-right: 10px;
}
.author-tag .ribbon {
  margin: 30px 0;
}
.author-tag .ribbon::before {
  border-width: 32px;
}
.author-tag .inner-padding {
  background: url('../images/divider.jpg') repeat-x center top;
}
.author-tag .post-title {
  margin-bottom: 45px;
}
/* Error - 404 page */
.error-page {
  margin-top: -70px;
  padding: 55px 0;
  text-align: center;
  color: #fff;
  background: #222;
}
.error-page .units-row.logo {
  margin-bottom: 0;
}
.error-page h1,
.error-page a {
  color: #fff;
}
.error-page i {
  font-size: 42px;
}

/*
 ===============================
 ========== FOOTER =============
 ===============================
*/
footer {
  padding-bottom: 100px;
  background: #fff;
  box-shadow: 1px 0 0 1px rgba(0, 0, 0, .05);
}
footer h2 {
  padding: 30px 0 10px 0;
  text-align: center;
  text-transform: uppercase;
}
#instafeed {
  padding-bottom: 50px;
}
#instafeed a {
  margin-bottom: 0;
}
.quote {
  font-family: 'Playfair Display', Arial,Helvetica,Verdana,sans-serif;
  font-size: 26px;
  font-style: italic;
  padding-bottom: 40px;
  color: #ccc;
}
/* Copyright */
.copyright {
  font-size: 14px;
  padding: 15px 0;
  color: #bbb;
  background: #f4f4f4;
}

/* Extra addons - theme related*/
.btn-coral,
input[type='submit'].btn-coral {
  color: rgba(255, 255, 255, .9);
  background: #ad6c60;
}
.btn-coral:hover,
input[type='submit'].btn-coral:hover {
  color: rgba(255, 255, 255, .6);
  background: #ad6c60;
}
.btn-coral.btn-active,
input[type='submit'].btn-coral.btn-active {
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5) inset;
}
.btn-coral.btn-active,
input[type='submit'].btn-coral.btn-active,
.btn-coral.btn-disabled,
input[type='submit'].btn-coral.btn-disabled,
.btn-coral.btn[disabled],
input[type='submit'].btn-coral.btn[disabled] {
  color: rgba(255, 255, 255, .5);
  background: #ad6c60;
}
.btn-coral.btn-active:hover,
input[type='submit'].btn-coral.btn-active:hover,
.btn-coral.btn-disabled:hover,
input[type='submit'].btn-coral.btn-disabled:hover,
.btn-coral.btn[disabled]:hover,
input[type='submit'].btn-coral.btn[disabled]:hover {
  color: rgba(255, 255, 255, .5);
}

/*
 ===============================
 ======= RESPONSIVNESS =========
 ===============================
*/
@media only screen and (max-width: 767px) {
  .top-bar .navbar.navbar-right li,
  .navbar li {
    display: inline-block;
  }
  .navbar.navbar-right,
  .navbar li,
  .author-info,
  .copyright,
  .post-navigation,
  .next-post {
    float: none;
    text-align: center;
  }
  .author-info figure {
    margin-bottom: 20px;
  }
  .units-row article.unit-33,
  article figure {
    margin-bottom: 0;
  }
  .ribbon,
  main .socials {
    display: block;
    float: left;
    clear: both;
    text-align: center;
  }
  .ribbon {
    float: none;
    margin-bottom: 20px;
  }
  article footer .group {
    padding-right: 0;
  }
  article footer .group .navbar.navbar-right li {
    margin-left: 0;
  }
  .box header figure {
    min-height: 210px;
    margin-bottom: 20px;
  }
}
/* EOF */