text:
__version__=''' $Id$ '''

#tests and documents Page Layout API
__doc__="""Tests low level programming of doc templates
"""
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import sys
import unittest
class PlatypusProgrammingTestCase(unittest.TestCase):
    "test platypus programming"

    def test0(self):
        from reportlab.lib.styles import ParagraphStyle
        from reportlab.platypus.flowables import DocPara, DocAssert
        from reportlab.platypus.doctemplate import SimpleDocTemplate
        def func(val):
            story = [
                    DocAssert(val,'this should fail'),
                    DocPara('repr(doc._nameSpace)',escape=True),
                    ]
            doc = SimpleDocTemplate(outputfile('test_doc_programming_asserts.pdf'))
            doc.build(story)
        self.assertRaises(AssertionError,func,False)
        func(True)

    def test1(self):
        from reportlab.lib.styles import ParagraphStyle
        from reportlab.platypus import SimpleDocTemplate, Paragraph
        from reportlab.platypus.flowables import DocAssign, DocExec, DocPara, DocIf, DocWhile
        normal = ParagraphStyle(name='Normal', fontName='Helvetica', fontSize=8.5, leading=11)
        header = ParagraphStyle(name='Heading1', parent=normal, fontSize=14, leading=19,
                    spaceAfter=6, keepWithNext=1)
        story = [
                DocAssign('currentFrame','doc.frame.id'),
                DocAssign('currentPageTemplate','doc.pageTemplate.id'),
                DocAssign('aW','availableWidth'),
                DocAssign('aH','availableHeight'),
                DocAssign('aWH','availableWidth,availableHeight'),
                DocAssign('i',3),
                DocIf('i>3',Paragraph('The value of i is larger than 3',normal),Paragraph('The value of i is not larger than 3',normal)),
                DocIf('i==3',Paragraph('The value of i is equal to 3',normal),Paragraph('The value of i is not equal to 3',normal)),
                DocIf('i<3',Paragraph('The value of i is less than 3',normal),Paragraph('The value of i is not less than 3',normal)),
                DocWhile('i',[DocPara('i',format='The value of i is %(__expr__)d',style=normal),DocExec('i-=1')]),
                DocPara('repr(doc._nameSpace)',escape=True),
                ]
        doc = SimpleDocTemplate(outputfile('test_doc_programming.pdf'))
        doc.build(story)

    def test2(self):
        "This makes one long multi-page paragraph in multi-pass for testing docWhile etc etc"
        from reportlab.platypus.flowables import DocAssign, DocExec, DocPara, DocIf, DocWhile
        from test_platypus_xref import MyDocTemplate
        from reportlab.platypus.tableofcontents import TableOfContents, SimpleIndex
        from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
        from reportlab.platypus import Paragraph
        from reportlab.lib import colors
        from reportlab.lib.randomtext import randomText, PYTHON

        # Build story.
        story = []

        styleSheet = getSampleStyleSheet()
        h1 = styleSheet['Heading1']
        h1.pageBreakBefore = 1
        h1.keepWithNext = 1
        h1.outlineLevel = 0

        h2 = styleSheet['Heading2']
        h2.backColor = colors.cyan
        h2.keepWithNext = 1
        h2.outlineLevel = 1

        bt = styleSheet['BodyText']

        story.append(Paragraph("""Cross-Referencing Test""", styleSheet["Title"]))
        story.append(Paragraph("""
            Subsequent pages test cross-references: indexes, tables and individual
            cross references.  The number in brackets at the end of each paragraph
            is its position in the story. (%d)""" % len(story), bt))

        story.append(Paragraph("""Table of Contents:""", styleSheet["Title"]))
        toc = TableOfContents()
        story.append(toc)

        chapterNum = 1
        for i in range(10):
            story.append(Paragraph('Chapter %d: Chapters always starts a new page' % chapterNum, h1))
            chapterNum += chapterNum
            story.append(DocAssign('chapterNum',chapterNum))
            for j in range(3):
                story.append(Paragraph('Heading1 paragraphs should always'
                                'have a page break before.  Heading 2 on the other hand'
                                'should always have a FRAME break before (%d)' % len(story), bt))
                story.append(Paragraph('Heading 2 should always be kept with the next thing (%d)' % len(story), h2))
                for j in range(3):
                    story.append(Paragraph(randomText(theme=PYTHON, sentences=2)+' (%d)' % len(story), bt))
                    story.append(Paragraph('I should never be at the bottom of a frame (%d)' % len(story), h2))
                    story.append(Paragraph(randomText(theme=PYTHON, sentences=1)+' (%d)' % len(story), bt))

            story.extend([
                    DocAssign('currentFrame','doc.frame.id'),
                    DocAssign('currentPageTemplate','doc.pageTemplate.id'),
                    DocAssign('aW','availableWidth'),
                    DocAssign('aH','availableHeight'),
                    DocAssign('aWH','availableWidth,availableHeight'),
                    DocAssign('i',3,life='forever'),
                    DocIf('i>3',Paragraph('The value of i is larger than 3',bt),Paragraph('The value of i is not larger than 3',bt)),
                    DocIf('i==3',Paragraph('The value of i is equal to 3',bt),Paragraph('The value of i is not equal to 3',bt)),
                    DocIf('i<3',Paragraph('The value of i is less than 3',bt),Paragraph('The value of i is not less than 3',bt)),
                    DocWhile('i',[DocPara('i',format='The value of i is %(__expr__)d',style=bt),DocExec('i-=1')]),
                    DocPara('repr(doc._nameSpace)',escape=True),
                    ])
        story.append(Paragraph('The Index which goes at the back', h1))
        story.append(SimpleIndex())

        doc = MyDocTemplate(outputfile('test_platypus_programming_multipass.pdf'))
        doc.multiBuild(story)

def makeSuite():
    return makeSuiteForClasses(PlatypusProgrammingTestCase)

#noruntests
if __name__ == "__main__":
    unittest.TextTestRunner().run(makeSuite())
    printLocation()


text:
app.controller('DeputyController', ['$scope', '$http', '$location', '$state', '$stateParams',//'items',
   function($scope, $http, $location, $state, $stateParams  ) {$scope.id = $stateParams.id;   }
    ])
/******************************************список депутатов*************************************************/
.directive('deputiesList', ['$http', function($http) {
    var map, infoWindow;
    var link = function($scope, element, attrs) {
        $http({
            method: 'GET',
            url: '/backend/deputy/index',
        }).then(function(response) {
            //console.log(response.data);
            $scope.deputies = response.data.deputies;
            var i;
            for (i = 0; i < $scope.deputies.length; i++) {
                if ($scope.deputies[i].tvoid==0){
                    $scope.deputies[i].ifLeader='лідер списку';
                    $scope.deputies[i].tvoid=null;
                    //console.log($scope.deputies[i]);
                }
                $scope.deputies[i].fullname = $scope.deputies[i].surname + ' ' + $scope.deputies[i].name + ' ' + $scope.deputies[i].patronymic;
            }
        });
    };
    return {
        restrict: 'A',
        template: '

',
        replace: true,
        link: link
    };
}])
/*************************************один депутат****************************************************/
.directive('deputyPage', ['$http', function($http) {
    var link = function($scope, element) {
       $http({
            method: 'GET',
             url: '/backend/deputy/id/' + $scope.id
        }).then(function(response) {
            //console.log(response.data);
            $scope.deputy = response.data.deputy;
            if ($scope.deputy.sex=="f"){$scope.deputy.sexfix="а";}
            if ($scope.deputy.sex=="m"){$scope.deputy.sexfix="ий";}
            $scope.deputy.tvourl="#!/tvo/"+$scope.deputy.tvoid;
            if ($scope.deputy.tvoid!="0"){
                $scope.deputy.listfix2="за списком ";
                $scope.deputy.listfix1="територіального виборчого округу № ";
            }
            if ($scope.deputy.tvoid=="0"){
                $scope.deputy.tvoid="";
                $scope.deputy.listfix3=" як лідер списку";
            }
            if ($scope.deputy.user_id!=null){$scope.deputy.confirmed="цей депутат офіційно зареєстрований у системі та може особисто відповідати на ваші звернення тут";}
        });
        $http({
            method: 'GET',
            url: '/backend/dep_request/deprequests/' + $scope.id
        }).then(function(response) {if (response.data.error == 0) {
            $scope.requests = response.data.Requests;
            var i; $scope.answered=0; $scope.new=0; $scope.review=0;
            for (i = 0; i < $scope.requests.length; i++) {
                if ($scope.requests[i].public_appeal == 1) {
                    if ($scope.requests[i].status=='new') {$scope.new++;}
                    if ($scope.requests[i].status=='answered'){$scope.answered++;}
                    if ($scope.requests[i].status=='review'){$scope.review++;}
                }
            }
            if ($scope.answered==0){$scope.answered='жодного';}
            if ($scope.review==0){$scope.review='жодне не ';}
            if ($scope.new==0){$scope.new='жодного нового';}
            else if ($scope.new % 10 ==1){$scope.new+=' нове';}
            else {$scope.new+=' нових';}
            $http({
                method: 'GET',
                url: '/backend/deputy/index',
            }).then(function(response) {
                //console.log(response.data);
                $scope.deputies = response.data.deputies;
            });
            //console.log($scope.requests);
            //console.log($scope);
        }
        });

    };
    return {
        restrict: 'A',
        replace: true,
        link: link
    };

}])
;

redpajama_set_name: RedPajamaGithub


text:
class AddInstitutionToAdminUser < ActiveRecord::Migration[5.0]
  def change
    add_reference :admin_users, :institution, foreign_key: true
  end
end


text:
SET Id=WriteableBitmapEx
SET VERSION=1.6.1
..\3rdParty\nuget\nuget setApiKey [APIKEY] -source https://www.nuget.org/api/v2/package
..\3rdParty\nuget\nuget delete %ID% %VERSION%
..\3rdParty\nuget\nuget push ..\Build\nuget\%ID%.%VERSION%.nupkg -source https://www.nuget.org/api/v2/package


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

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->

    <link href="<?php echo Yii::app()->request->baseUrl; ?>/static/default/simpleboot/css/simplebootadmin.css" rel="stylesheet">
    <link href="<?php echo Yii::app()->request->baseUrl; ?>/static/default/js/artDialog/skins/default.css" rel="stylesheet" />
    <link href="<?php echo Yii::app()->request->baseUrl; ?>/static/default/simpleboot/font-awesome/4.2.0/css/font-awesome.min.css"  rel="stylesheet" type="text/css">
    <link href="<?php echo Yii::app()->request->baseUrl; ?>/static/default/simpleboot/themes/flat/theme.min.css" rel="stylesheet">
    <link href="<?php echo Yii::app()->request->baseUrl; ?>/static/default/simpleboot/themes/flat/simplebootadminindex.min.css?" rel="stylesheet">

    <style>
		.length_3{width: 180px;}
	</style>
    <script type="text/javascript">
//全局变量
var GV = {
    //DIMAUB: "__ROOT__/",
    DIMAUB: "/",
    JS_ROOT: "static/default/js/",
    TOKEN: ""
};
</script>
	<script src="<?php echo Yii::app()->request->baseUrl; ?>/static/default/js/jquery.js"></script>
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/static/default/js/wind.js"></script>
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/static/default/simpleboot/bootstrap/js/bootstrap.min.js"></script>

</head>


text:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="history" name="save" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>DeviceException Members</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />

            A MIDI Library for .NET

DeviceException Members

        DeviceException overview

Public Instance Constructors

              DeviceException Constructor

             Constructs exception with a specific error message.

Public Instance Properties

Data (inherited from Exception)

HelpLink (inherited from Exception)

InnerException (inherited from Exception)

Message (inherited from Exception)

Source (inherited from Exception)

StackTrace (inherited from Exception)

TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)

GetBaseException (inherited from Exception)

GetHashCode (inherited from Object)

GetObjectData (inherited from Exception)

GetType (inherited from Exception)

ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)

MemberwiseClone (inherited from Object)

See Also

        DeviceException Class | Midi Namespace

          Copyright © 2009 Tom Lokovic

Generated from assembly Midi [1.1.0.0] by NDoc3


text:
import unittest

import mock

from ...authentication.authorize_client import AuthorizeClient

class TestAuthorizeClient(unittest.TestCase):
    @mock.patch("auth0.v3.authentication.authorize_client.AuthorizeClient.get")
    def test_login(self, mock_get):

        a = AuthorizeClient("my.domain.com")

        a.authorize(
            client_id="cid",
            audience="https://test.com/api",
            state="st",
            redirect_uri="http://localhost",
            response_type="token",
            scope="openid profile",
            organization="org_123",
            invitation="invitation_abc",
        )

        args, kwargs = mock_get.call_args

        self.assertEqual(args[0], "https://my.domain.com/authorize")
        self.assertEqual(
            kwargs["params"],
            {
                "client_id": "cid",
                "audience": "https://test.com/api",
                "state": "st",
                "redirect_uri": "http://localhost",
                "response_type": "token",
                "scope": "openid profile",
                "organization": "org_123",
                "invitation": "invitation_abc",
            },
        )

    @mock.patch("auth0.v3.authentication.authorize_client.AuthorizeClient.get")
    def test_login_default_param_values(self, mock_get):

        a = AuthorizeClient("my.domain.com")

        a.authorize(client_id="cid")

        args, kwargs = mock_get.call_args

        self.assertEqual(args[0], "https://my.domain.com/authorize")
        self.assertEqual(
            kwargs["params"],
            {
                "audience": None,
                "invitation": None,
                "organization": None,
                "redirect_uri": None,
                "state": None,
                "client_id": "cid",
                "response_type": "code",
                "scope": "openid",
            },
        )


text:
// Copyright (c) André N. Klingsheim. See License.txt in the project root for license information.

using NWebsec.Core.Common.HttpHeaders.Configuration;

namespace NWebsec.Core.Common.Middleware.Options
{
    public class XRobotsTagOptions : IFluentXRobotsTagOptions
    {
        public XRobotsTagOptions()
        {
            Config = new XRobotsTagConfiguration();
        }

        public XRobotsTagConfiguration Config { get; }

        public IFluentXRobotsTagOptions NoIndex()
        {
            Config.NoIndex = Config.Enabled = true;
            return this;
        }

        public IFluentXRobotsTagOptions NoFollow()
        {
            Config.NoFollow = Config.Enabled = true;
            return this;
        }

        public IFluentXRobotsTagOptions NoSnippet()
        {
            Config.NoSnippet = Config.Enabled = true;
            return this;
        }

        public IFluentXRobotsTagOptions NoArchive()
        {
            Config.NoArchive = Config.Enabled = true;
            return this;
        }

        public IFluentXRobotsTagOptions NoOdp()
        {
            Config.NoOdp = Config.Enabled = true;
            return this;
        }

        public IFluentXRobotsTagOptions NoTranslate()
        {
            Config.NoTranslate = Config.Enabled = true;
            return this;
        }

        public IFluentXRobotsTagOptions NoImageIndex()
        {
            Config.NoImageIndex = Config.Enabled = true;
            return this;
        }
    }
}


text:
using System;
using Classifier.Interfaces;
using myoddweb.classifier.core;
using Moq;
using NUnit.Framework;
namespace myoddweb.classifierUnitTest
{
  [TestFixture]
  public class TestEngine
  {
    [Test]
    public void ctor_NullIsAllowed()
    {
      Assert.DoesNotThrow( () => new Engine( null ));
    }

    [Test]
    public void GetEngineVersionNumber_NullEngineReturnsZero()
    {
      var eng = new Engine(null);
      Assert.That( 0 == eng.GetEngineVersionNumber() );
    }

    [Test]
    [TestCase(-1)]
    [TestCase(1006003)]
    [TestCase(2005001)]
    public void GetEngineVersionNumber_GetProperVersionNumber( int version )
    {
      var classify = new Mock<IClassify1>();
      classify.Setup(e => e.GetEngineVersion()).Returns(version);
      var eng = new Engine(classify.Object);

      Assert.That(version == eng.GetEngineVersionNumber());
    }

    [Test]
    [TestCase(1, 0, 0, 1)]
    [TestCase(1006003, 1, 6, 3)]
    [TestCase(2005004, 2, 5, 4)]
    public void GetEngineVersion_GetProperVersionNumber(int versionnumber, int major, int minor, int build)
    {
      var classify = new Mock<IClassify1>();
      classify.Setup(e => e.GetEngineVersion()).Returns(versionnumber);
      var eng = new Engine(classify.Object);

      var version = eng.GetEngineVersion();
      var expected = new Version(major, minor, build, 0);

      Assert.That(version == expected );
    }

    [Test]
    [TestCase(-1)]
    [TestCase(-10)]
    [TestCase(-123)]
    public void GetEngineVersion_NegativeVersionNumberReturnsZero(int versionnumber)
    {
      var classify = new Mock<IClassify1>();
      classify.Setup(e => e.GetEngineVersion()).Returns(versionnumber);
      var eng = new Engine(classify.Object);

      var version = eng.GetEngineVersion();

      Assert.That(version == new Version(0, 0, 0, 0));
    }
  }
}


text:
angular.module('myApp.filters').filter('filterRdv', [function () {
	'use strict';
	return function (items,plateformId,tags) {

		var aFilterdItems = [];

		var aTags = [];
		if(typeof tags === "string" && tags !== ""){
			aTags = tags.split(' ');
		}

		var d = new Date();
		var now = d.getTime()/1000;

		for(var key in items){
			if(plateformId !== ""){
				if(items[key].plateform === null || items[key].plateform.id !== plateformId){
					continue;
				}
			}

			if(items[key].end < now){
				continue;
			}

			if(aTags.length === 0){
				aFilterdItems.push(items[key]);
				continue;
			}

			var aTagItem = [];
			for(var keyTagItem in items[key].tags){
				aTagItem.push(items[key].tags[keyTagItem].nom.toLowerCase());
			}

			var asTag = true;
			for(var keyTag in aTags){
				if(aTagItem.indexOf(aTags[keyTag].toLowerCase()) < 0){
					asTag = false;
				}
			}

			if(asTag === false){
				continue;
			}

			aFilterdItems.push(items[key]);
		}

		return aFilterdItems;
	};
}]);


text:
namespace VRTK.UnityEventHelper
{
    using UnityEngine.Events;
    using System;

    public sealed class VRTK_ObjectControl_UnityEvents : VRTK_UnityEvents<VRTK_ObjectControl>
    {
        [Serializable]
        public sealed class ObjectControlEvent : UnityEvent<object, ObjectControlEventArgs> { }

        public ObjectControlEvent OnXAxisChanged = new ObjectControlEvent();
        public ObjectControlEvent OnYAxisChanged = new ObjectControlEvent();

        protected override void AddListeners(VRTK_ObjectControl component)
        {
            component.XAxisChanged += XAxisChanged;
            component.YAxisChanged += YAxisChanged;
        }

        protected override void RemoveListeners(VRTK_ObjectControl component)
        {
            component.XAxisChanged -= XAxisChanged;
            component.YAxisChanged -= YAxisChanged;
        }

        private void XAxisChanged(object o, ObjectControlEventArgs e)
        {
            OnXAxisChanged.Invoke(o, e);
        }

        private void YAxisChanged(object o, ObjectControlEventArgs e)
        {
            OnYAxisChanged.Invoke(o, e);
        }
    }
}


text:
using System;
using System.Diagnostics;
using Microsoft.Xna.Framework;

namespace $safeprojectname$
{

    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            using (Game1 game = new Game1())
            {
                game.Run();
            }
        }
    }

}


text:
#sidepanel #navigation {
    height:100%;
    -moz-box-sizing: border-box;
    -webkit-box-sizing:
    border-box; box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
}
#sidepanel #user-info{
    height:46px;
    padding:15px 15px 15px 10px;
    font-family: 'OpenSans-Regular';
    background-color: #374141;
}
.offline #sidepanel #user-info{
    display:none;
}

#sidepanel #user-image {
    float: left;
    height: 50px;
    width: 50px;
    margin-right: 10px;
    cursor: pointer;
}

#sidepanel div#user-image{
    background-position: -186px -56px;
    border: 1px solid #374141;
}

#sidepanel #user-image.userImage {
    background-position: inherit;
    background-size: 50px 50px;
    border: 1px solid #505050;
    border-radius: 50%;
    -webkit-background-clip: padding-box;
    -moz-background-clip: padding;
    background-clip: padding-box;
}

#sidepanel #user-image.nopicture{
    background-color: rgba(0, 0, 0, 0);
    border: 0 none;
}

#sidepanel #user-name{
    font-family:'OpenSans-SemiBold';
    font-size:13px;
    color:white;
    position:absolute;
    white-space:nowrap;
}

#sidepanel #user-email{
    font-size:11px;
    color:#abb3b3;
    position:absolute;
    top:35px;
}

#sidepanel #user-config{
    left: 50px;
    position: absolute;
    top: 50px;
}

#sidepanel #user-config {
   cursor:pointer;
}

#sidepanel .button, #dialog .button, .replier .button, .editormode .button{
  cursor: pointer;
  display: inline-block;
  padding: 1px 20px;
  color: #707070;
  line-height: normal;
  font-family: 'OpenSans-Regular';
  font-size:11px;
}

#toppanel .button {
  cursor: pointer;
  display: inline-block;
  padding: 5px 17px;
  color: #707070;
  line-height: normal;
  font-family: 'OpenSans-Regular';
  font-size:11px;
}

#commentscontrol, #scenarioName {
  -webkit-transition: color 0.5s ease, opacity 0.5s ease;
  -moz-transition: color 0.5s ease, opacity 0.5s ease;
  -o-transition: color 0.5s ease, opacity 0.5s ease;
  -ms-transition: color 0.5s ease, opacity 0.5s ease;
  transition: color 0.5s ease, opacity 0.5s ease;
}

.highlight, .gesturecontrol span, #rotateDevice {
  -webkit-transition: opacity 0.5s ease;
  -moz-transition: opacity 0.5s ease;
  -o-transition: opacity 0.5s ease;
  -ms-transition: opacity 0.5s ease;
  transition: opacity 0.5s ease;
}

#topSeparationLine {
  -webkit-transition: background-color 0.5s ease;
  -moz-transition: background-color 0.5s ease;
  -o-transition: background-color 0.5s ease;
  -ms-transition: background-color 0.5s ease;
  transition: background-color 0.5s ease;
}

#toppanel.add-comment .panel-separator {
  background-color: #D0D0D0;
}

#toppanel.add-comment #rotateDevice, #toppanel.add-comment .customSelect {
  opacity: 0.4;
  cursor: default;
}

#toppanel.add-comment #gestureTool {
  cursor: default;
}

#simulation-btns .button.selected, #dialog .button.selected, #toppanel .button.selected, .replier .button.selected, .editormode .button.selected{
  background-color: #494D50;
}
#simulation-btns .button.selected:hover, #dialog .button.selected:hover, #toppanel .button.selected, .replier .button.selected:hover, .editormode .button.selected:hover{
  color: #FFFFFF;
}

#sidepanel .button:active, #dialog .button:active, #toppanel .button:active { opacity:0.75; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=75)"; filter: alpha(opacity=75); }
#sidepanel .tabs:active { opacity:0.75; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=75)"; filter: alpha(opacity=75); }

/* start root */
.groupComments .root { position: relative; background-color: #FFFFFF; color: #4F4F4F; border-bottom: 1px solid #DDDDDD;}
.groupComments .root .comment { border-top: 1px dotted #e6e6e6; position:relative;}
.groupComments .root .replier { border-top: 1px dotted #e6e6e6; padding:15px 15px 10px; }
.groupComments .root .comment .comment-content { padding:15px 15px 10px; }
.groupComments .root:last-child { border-bottom: 0 none;}
.groupComments .root.closed { background-color: #FFFFFF;}
.groupComments .root.closed .attachment:hover { color: #666666; }
.groupComments .root.closed .text { text-overflow: ellipsis; -o-text-overflow: ellipsis; -webkit-text-overflow: ellipsis; overflow: hidden;}
/*.groupComments .root.closed.unread .text { font-weight: bold; }*/
.groupComments .root.scoped, .groupComments .root.searched { display: none; }

.groupComments .root > .comment .viewmode .actions {display:none;}
.groupComments .root > .replies .comment .viewmode .actions {display:none;}
.groupComments .root.closed > .comment .actions {display:inline;}
.groupComments .root > .replies .comment:last-child .actions{display:inline;}
.groupComments .root.replying .comment .viewmode .actions{display:none;}
.groupComments .root.replying > .replies .comment .viewmode .actions{display:none;}
.groupComments .comment.editing { background-color: #e9ebee; }
.groupComments .comment.editing .delete, .groupComments .comment.editing .edit{display:none;}

/* start visibility settings */
.groupComments .root.closed > .comment .total { display: none; }
.groupComments .root.closed.hasReplies > .comment .total { display: inline; }
.groupComments .root > .date, .groupComments .root > .replies, .groupComments .root > .replier, .groupComments .comment .viewmode, .groupComments .comment.editor .editormode { display: block; }
.groupComments .root > .comment .total, .groupComments .root.closed > .replies, .groupComments .root > .replier, .groupComments .comment.editor > .date, .groupComments .comment.editor .viewmode, .groupComments .comment .editormode { display: none; }
.groupComments .total-wrap {display:none;}
.groupComments .hasReplies .total-wrap{display:inline-block;}

.replies .comment {background-color:#f6f7f8;}

/* start comment fields */
.groupComments { overflow-y: auto; font-family:'OpenSans-Regular';}
.groupComments .author { font-size:14px; font-family:'OpenSans-SemiBold'; color:#21C0C0; display:inline-block; max-width:158px; overflow:hidden; vertical-align:bottom; white-space:nowrap;}
.groupComments .delete, .groupComments .edit { font-size:8px; color:#535353; display:inline-block; margin-left:6px; vertical-align:middle; cursor:pointer;}
.groupComments .actions, .groupComments .editormode .actions { color: #7B7979; float: left; width:180px; font-size:11px; margin-left:-48px; position:relative;}
.groupComments .editormode .actions{width:236px;}
.groupComments .actions .reply a{ vertical-align:top;}
.groupComments .action { cursor: pointer;}
.groupComments .action:hover { color: #000000; }
.groupComments .date {font-size:11px; color:#999999; display:block;}
.groupComments .text { margin-bottom: 10px; font-size:12px; word-wrap: break-word;}
.groupComments .annotation {padding: 3px; width: 181px; max-width:181px; min-width:181px; min-height:40px; height:65px; color: #707070; font-family: 'OpenSans-Regular'; font-size: 11px; border:0 none; margin-top:5px;}
.groupComments .replier .annotation {margin-left:10px; margin-top:0px;}
.groupComments .viewmode .filename { vertical-align:middle; display:inline-block; text-decoration: none; text-overflow:ellipsis; white-space: nowrap; overflow:hidden; color:#21C0C0; font-size:11px; font-family:'OpenSans-Regular'; cursor:pointer !important;}
.groupComments .actions .filename { text-decoration: none; text-overflow:ellipsis; white-space: nowrap; overflow:hidden; width: 85px; color:#21C0C0; font-size:11px; font-family:'OpenSans-Regular'; }
.groupComments .viewmode .attachment-wrap{ display: block; margin-bottom: 10px; margin-left: 2px; overflow: hidden; white-space: nowrap;}
.groupComments .attachment:hover { color: #c6c6c6; }
.groupComments .root .attachment {cursor:pointer;}
.groupComments .root img.attachment {display:block;}
.groupComments img.attachment {max-width:170px; height:80px; margin-bottom:10px;}
.groupComments .comment, .groupComments .replier { border-top: 1px dotted #a7a7a7; }
.groupComments .root > .comment { border-top: none !important; margin-top: 0px; } /* overwrite */
.groupComments .comment .viewmode { margin-top:4px; text-overflow:ellipsis; }
.groupComments .comment .viewmode .a { font-size:12px; margin-bottom: 6px; }
.groupComments .replier .actions form.attachment, .groupComments .editormode .actions form.attachment{ margin-top: 10px; }
.groupComments .replier .actions { color: #7B7979; float: left; width:100%; font-size:11px; margin-left:0px; position:relative;}
.groupComments .replier .filename, .groupComments .editormode .filename{color:#494D50;display: inline-block; vertical-align: middle;}
.expand-btn{cursor: pointer; color:#738F8F; font-size:11px; float:right; display:none; font-family:'OpenSans-SemiBold';}
.groupComments .hasReplies .expand-btn {display:inline;}
.groupComments .root .replier{ background-color:#f6f7f8; position:relative;}
.groupComments .actions .reply-img{ margin-right:5px; margin-top:1px; display:inline-block;}
.groupComments .actions .reply {display: inline-block; vertical-align: middle;}
.groupComments .actions .total-img{ margin-right:5px; margin-top:-1px; display:inline-block; vertical-align:middle;}
.groupComments .actions .total{margin-right:8px;}
.groupComments .expand-btn-img{margin-right:5px; display:inline-block; vertical-align:middle;}
.groupComments .expand-btn-text{display:inline-block; vertical-align:middle;}
.groupComments .warning{ margin-right:5px; display:inline-block; vertical-align:middle; margin-top:-3px;}

.groupComments .replier .user-comment-img {
    border: 1px solid #21C0C0;
}

.groupComments .user-comment-img {
    background-position: -191px -109px;
    width: 40px;
    height: 40px;
    float: left;
    margin-top: 3px;
}

.groupComments .user-comment-img.userImage {
    background-position: 0px 0px;
    background-size: 40px 40px;
    border-radius:50%;
    -webkit-background-clip: padding-box;
    -moz-background-clip: padding;
    background-clip: padding-box;
    border: 1px solid #DDDDDD;
    background-color:#FFFFFF;
}

.groupComments .user-comment-img.firer{
    cursor:pointer !important;
}

.groupComments .user-comment-img-add{
    background-color: #FF0000;
    left: 13px;
    position: absolute;
    top: 48px;
    cursor:pointer !important;
}

.groupComments .user-comment-content{
    margin-left:50px;
}

.offline .groupComments .user-comment-content{
    margin-left:0px;
}

.offline .groupComments .user-comment-img{
    display:none;
}

/* start attachment form */
#sidepanel form.attachment { position: relative; margin-top:-1px; height:20px; overflow:hidden; text-overflow: ellipsis; width: 110px; float:left; text-align:left; }
#dialog form.attachment { position: relative; margin-left: 10px; margin-top:8px; float:left; overflow:hidden; text-overflow: ellipsis; width: 130px; }
.replier form.attachment, .editormode form.attachment { position: relative; margin-top:10px; float:left; overflow:hidden; text-overflow: ellipsis; width: 110px; }
form.attachment .file { position: absolute; top: 0; left: 0; height: 13px; opacity: 0; filter: alpha(opacity = "0"); -ms-filter: alpha(opacity = "0"); cursor: pointer; width:100px;}
.groupComments form.attachment { display: inline; }
.replier form.attachment, .editormode form.attachment { top: -1px; }
.groupComments form.attachment .file { left: -10px\9; /* IE only */ }
#dialog form.attachment .file { left: -20px\9; /* IE only */ }
form.attachment .delete_attach{
    display: none;
    vertical-align: middle;
    cursor:pointer;
}

form.attachment.attachment-set .delete_attach{
    display:inline-block;
}

/* start helper classes */
#blockui { position: absolute; top: 0; left: 0; right: 0; bottom: 0; height: 100%; width: 100%; z-index: 100000; }
.commentpanel { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: lightGrey; opacity: .4; filter: alpha(opacity = "40"); -ms-filter: alpha(opacity = "40"); z-index: 3; }
.search-highlight { background-color: #ffff00; }
.groupComments .root .search-highlight { color: #2e2e2e; }
.add-comment .ui-page { cursor: default !important; }
.add-comment .ui-page .firer, .add-comment .ui-page.ui-scenario { cursor: crosshair !important; }
.offline .add-comment .ui-page { cursor: default !important; }
.offline .add-comment .ui-page .firer { cursor: default !important; }
.current-element { outline: 3px solid #21C0C0; }
.over-current-element { outline: 3px solid #21CACA; }

/* start dialog */
#dialog { position: absolute; top: 40%; left: 34%; background-color: #ffffff; box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.05); width: 280px; min-width:280px; color: #606060; font-family: 'OpenSans-SemiBold'; font-size:12px; }
#dialog #dialog-close { cursor: pointer; float: right; width: 16px; height: 16px; background: transparent url("../images/comments/sprite.png") -7px -22px no-repeat scroll; }
#dialog #content { padding: 0px 10px 10px 0px; background-color:#f6f7f8; overflow:hidden;}
#dialog .annotation { border: 0 none; color: #707070; font-size: 11px; padding: 10px; width: 100%; height:88px; font-size:11px; font-family: 'OpenSans-Regular'; resize:none; min-width:270px; }
#dialog .filename { font-family: 'OpenSans-SemiBold'; font-size:11px; color:#606060; width: 100px; display:inline-block; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; white-space:nowrap;}
#dialog form.attachment .file, .replier form.attachment .file .editormode form.attachment { left: 19px; width:93px; }
#dialog .button , .replier .button, .editormode .button{ margin: 8px 0 0 5px; float: right; color: #FFFFFF; }
#dialog-cancel, #dialog #dialog-cancel, .message button { background-color: transparent; border: 0 none; font-family: 'OpenSans-SemiBold'; text-decoration:underline; padding-left:2px; padding-right:2px; color:#494d50; }
#dialog-cancel {width:50px;}
#dialog-save { border: 0 none; font-family: 'OpenSans-SemiBold';}
.attachment-img { display:inline-block; vertical-align:middle; margin-right:5px;}

/* start messages */
.message { font-family: 'OpenSans-Regular'; clear: both; color: #ffffff; padding: 3px 10px; }
.message .container { clear: both; position: relative; font-size:11px; }
.message .close { position: absolute; top: 0px; right: 0px; cursor:pointer; }
.message strong { margin-right: 5px; }
.error { background-color: #EF4747; font-family: 'OpenSans-Regular';}
.error .notice { width: 90%; display:inline-block; white-space:nowrap; }
.feedback { background-color: #EF4747;}
.feedback .notice { display:inline; margin-right:10px; }
.feedback button { font-size: 11px; cursor:pointer; color:white; }
.feedback .ok { display:inline;}
.feedback .cancel { display:inline;}

/* hide comment elements for annotated */
.review.offline #simulation-btns, .review.offline .reply, .review.offline .reply-separator, .review.offline .edit, .review.offline .delete, .review.offline .replier { display: none; }
.simulation.offline #simulation-btns, .simulation.offline .reply, .simulation.offline .reply-separator, .simulation.offline .edit, .simulation.offline .delete, .simulation.offline .replier { display: none; }

/*balloons*/
.comment-balloon {
	background-color: #21c0c0;
	border-color: white;
	border-width: 3px;
	border-style: solid;
	box-shadow: 0.695px 3.939px 8px 0px rgba(0, 0, 0, 0.44);
    position:absolute !important;
    top:10px;
    left:10px;
    background-color:black;
    z-index:105;
    text-align:center;
    vertical-align:middle;
    cursor:pointer;
    line-height: 13px;
}
.comment-balloon input {
    display:none;
}
.comment-balloon span {
    top:5px;
    font-size:14px;
    font-family:'OpenSans-SemiBold';
    font-weight:bold;
    color:#FFFFFF;
    position:relative;
}

.comments-layer{
    display:none;
}

.comments-dialog-layer{
    display:none;
}

.group .comment-balloon{
    pointer-events: auto;
}

/*Callouts*/
.groupComments{
    top:10px;
    left:10px;
    width:270px;
    background-color:white;
    padding:0px;
    font-family:'OpenSans-Regular';
    box-shadow: 0 0 19px 1px #999999;
}
.groupComments input.hidden{
    display:none;
}
.callout-right .notch{
    position: absolute;
    top: 20px;
    right:-10px;
    margin: 0;
    border-top: 10px solid transparent;
    border-left: 10px solid #FFFFFF;
    border-right: 0;
    border-bottom: 10px solid transparent;
    padding: 0;
    width: 5;
    height: 5;
}
.callout-left .notch{
    position: absolute;
    top: 20px;
    left: -10px;
    margin: 0;
    border-top: 10px solid transparent;
    border-left: 0;
    border-right: 10px solid #FFFFFF;
    border-bottom: 10px solid transparent;
    padding: 0;
    width: 5;
    height: 5;
}
.callout-wrap{
    position:absolute;
    top:10px;
    left:10px;
    background-color:white;
    z-index:110;
    display:none;
}

/*SPRITES*/
#sidepanel #user-config,
.groupComments .delete,
.groupComments .edit,
.groupComments .actions .reply-img,
.groupComments .actions .total-img,
.groupComments .expand-btn-img,
.groupComments .warning,
.groupComments .user-comment-img-add,
form.attachment .delete_attach,
.attachment-img,
.groupComments .root.closed .icon
{
    background: url("./images/jimsprite.png");
}

@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (   min--moz-device-pixel-ratio: 2),
only screen and (     -o-min-device-pixel-ratio: 2/1),
only screen and (        min-device-pixel-ratio: 2),
only screen and (                min-resolution: 192dpi),
only screen and (                min-resolution: 2dppx)
{
	#sidepanel #user-config,
	.groupComments .delete,
	.groupComments .edit,
	.groupComments .actions .reply-img,
	.groupComments .actions .total-img,
	.groupComments .expand-btn-img,
	.groupComments .warning,
	.groupComments .user-comment-img-add,
	form.attachment .delete_attach,
	.attachment-img,
	.groupComments .root.closed .icon
	{
	    background: url("./images/jimsprite@2x.png");
	    background-size:256px 188px;
    }
}

#sidepanel #user-config.menu_edituser{background-position:-69px -34px;width:12px;height:12px;}
.comment-balloon.bullet_one{ border-radius: 50%; width:23px; height:23px; }
.comment-balloon.bullet_two{ border-radius: 45%; width:29px;height:23px; }
.comment-balloon.bullet_three{ border-radius: 40%; width:35px; height:23px; }
.groupComments .actions .reply-img{background-position:-96px -70px;width:16px;height:13px;}
.groupComments .actions .comments{background-position:-176px 0px;width:11px;height:12px;}
.groupComments .collapse{background-position:-164px 0px;width:12px;height:8px;}
.groupComments .expand{background-position:-215px 0px;width:12px;height:8px;}
.groupComments .root.closed .icon { background-position: -34px -23px; }
.attachment-img{background-position:-7px 0px !important;width:8px;height:18px;}
.delete_attach{background-position:-187px 0px !important;width:8px;height:7px;}
.delete_topic{background-position:-195px 0px !important;width:9px;height:8px;}
.edit_topic{background-position:-204px 0px !important;width:11px;height:10px;}
.warning{background-position:-126px -70px !important;width:16px;height:15px;}
.user_picture_more{background-position:-171px -70px !important;width:12px;height:12px;}
.viewmode .attachment-img{background-position: -176px -168px !important;width: 14px;height: 18px;}
/*END SPRITES*/

/*LAYOUT CHANGES */

.commentsMode .highlight, .commentsMode #top-bar-hide, .commentsMode #comments-separator1 {opacity:0;}
.commentsMode #canvasname {color: #000000;}
.commentsMode #highlight-select, .commentsMode #top-bar-hide {cursor: default;}
.commentsMode #commentsBackground {top: 0px;}
.commentsMode #topCommentsLine {height: 8px;}
.commentsMode #commentscontrol {color: #000000;}

.commentsMode .ui-scenario.ui-page-active .Page {pointer-events: none;}

/*END LAYOUT CHANGES */


text:
A drop-in view controller for allowing the user to select a location. Contains place-autocompletion.

Not yet ready for use with Cocoapods as Google's framework as an issue being added as a dependency.


text:
#ifndef _htl_app_rtmp_play_hpp
#define _htl_app_rtmp_play_hpp

/*
#include <htl_app_rtmp_play.hpp>
*/
#include <string>

#include <htl_core_uri.hpp>
#include <htl_os_st.hpp>

#include <htl_app_rtmp_protocol.hpp>

class StRtmpPlayClient
{
protected:
    srs_rtmp_t srs;
    int stream_id;
public:
    StRtmpPlayClient();
    virtual ~StRtmpPlayClient();
public:
    virtual int Dump(RtmpUrl* url);
protected:
    virtual int Connect(RtmpUrl* url);
    virtual int Handshake();
    virtual int ConnectApp();
    virtual int PlayStram();
    virtual int DumpAV();
};

class StRtmpPlayClientFast : public StRtmpPlayClient
{
public:
    StRtmpPlayClientFast();
    virtual ~StRtmpPlayClientFast();
protected:
    virtual int DumpAV();
};

#endif


text:
/*
 * Created on Jan 2, 2004
 */
package samples.graph;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import javax.swing.JApplet;

import edu.uci.ics.jung.algorithms.transformation.DirectionTransformer;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.decorators.StringLabeller;
import edu.uci.ics.jung.graph.decorators.StringLabeller.UniqueLabelException;
import edu.uci.ics.jung.graph.impl.SparseGraph;
import edu.uci.ics.jung.io.PajekNetReader;
import edu.uci.ics.jung.utils.GraphUtils;

/**
 * @author danyelf
 */
public  class RankingDemoDriver extends JApplet {

	public void start() {
		System.out.println("Starting in applet mode.");
		InputStream is =
			this.getClass().getClassLoader().getResourceAsStream(
				"samples/datasets/smyth.net");
		BufferedReader br = new BufferedReader(new InputStreamReader(is));

		PajekNetReader pnr = new PajekNetReader(true);
        try
        {
            Graph ug = pnr.load(br, new SparseGraph());
            Graph g = DirectionTransformer.toDirected(ug);
            GraphUtils.copyLabels(StringLabeller.getLabeller(ug, PajekNetReader.LABEL),
                StringLabeller.getLabeller(g, PajekNetReader.LABEL));
//            Graph g = pnr.load(br, new UndirectedSparseGraph());
            RankingDemo vizApp = new RankingDemo(g);
            getContentPane().add(vizApp);
        }
        catch (IOException e)
        {
            System.out.println("Error in loading graph");
            e.printStackTrace();
        }
        catch (UniqueLabelException ule)
        {
            System.out.println("Unexpected duplicate label");
            ule.printStackTrace();
        }
	}

}


text:
using System;
using System.Security.Cryptography;
using Neat.Encryption.Parameters;
using Neat.Encryption.Parameters.Abstract;
using Neat.Encryption.ProviderFactory.Interface;
using Neat.Encryption.Strategy.Interface;
using Neat.Wrapper.Stream.Factory.Interface;

namespace Neat.Encryption.Strategy
{
    public class AesEncryptionStrategy : IEncryptionStrategy
    {
        private readonly IAesCryptoServiceProviderFactory _aesCryptoServiceProviderFactory;
        private readonly IMemoryStreamFactory _memoryStreamFactory;
        private readonly ICryptoStreamFactory _cryptoStreamFactory;

        public AesEncryptionStrategy(IAesCryptoServiceProviderFactory aesCryptoServiceProviderFactory, IMemoryStreamFactory memoryStreamFactory, ICryptoStreamFactory cryptoStreamFactory)
        {
            _aesCryptoServiceProviderFactory = aesCryptoServiceProviderFactory;
            _memoryStreamFactory = memoryStreamFactory;
            _cryptoStreamFactory = cryptoStreamFactory;
        }

        public EncryptionMethod EncryptionMethod
        {
            get { return EncryptionMethod.Aes; }
        }

        public byte[] Encrypt(EncryptionParameters encryptionParameters)
        {
            if (encryptionParameters == null)
            {
                throw new ArgumentNullException();
            }
            var aesEncryptionParameters = encryptionParameters as AesEncryptionParameters;
            if (aesEncryptionParameters == null)
            {
                throw new ArgumentException("EncryptionParameters must be of type AesEncryptionParameters!");
            }

            byte[] returnValue;
            var aes = _aesCryptoServiceProviderFactory.Create();
            var cryptoTransform = aes.CreateEncryptor(aesEncryptionParameters.Key, aesEncryptionParameters.Vector);

            using (var memoryStream = _memoryStreamFactory.Create())
            {
                using (var cryptoStream = _cryptoStreamFactory.Create(memoryStream, cryptoTransform, CryptoStreamMode.Write))
                {
                    cryptoStream.Write(aesEncryptionParameters.Data, 0, aesEncryptionParameters.Data.Length);
                }

                returnValue = memoryStream.ToArray();
            }

            aes.Clear();

            return returnValue;
        }

        public byte[] Decrypt(EncryptionParameters encryptionParameters)
        {
            if (encryptionParameters == null)
            {
                throw new ArgumentNullException();
            }
            var aesEncryptionParameters = encryptionParameters as AesEncryptionParameters;
            if (aesEncryptionParameters == null)
            {
                throw new ArgumentException("EncryptionParameters must be of type AesEncryptionParameters!");
            }

            byte[] returnValue;
            var aes = _aesCryptoServiceProviderFactory.Create();
            var cryptoTransform = aes.CreateDecryptor(aesEncryptionParameters.Key, aesEncryptionParameters.Vector);

            using (var memoryStream = _memoryStreamFactory.Create())
            {
                using (var cryptoStream = _cryptoStreamFactory.Create(memoryStream, cryptoTransform, CryptoStreamMode.Write))
                {
                    cryptoStream.Write(aesEncryptionParameters.Data, 0, aesEncryptionParameters.Data.Length);
                }

                returnValue = memoryStream.ToArray();
            }

            return returnValue;
        }
    }
}


text:
#ifndef IVW_VECTORMAGNITUDEPROCESSOR_H
#define IVW_VECTORMAGNITUDEPROCESSOR_H

#include <modules/basegl/baseglmoduledefine.h>
#include <inviwo/core/common/inviwo.h>
#include <inviwo/core/properties/transferfunctionproperty.h>
#include <inviwo/core/properties/ordinalproperty.h>
#include <inviwo/core/properties/cameraproperty.h>
#include <modules/basegl/processors/volumeprocessing/volumeglprocessor.h>

namespace inviwo {

/**
 * \class VectorMagnitudeProcessor
 *
 * \brief Takes and ImageInport and renders it into a OpenGL window i.e. a canvas.
 */
/** \docpage{org.inviwo.VectorMagnitude, Vector Magnitude}
 * ![](org.inviwo.VectorMagnitude.png?classIdentifier=org.inviwo.VectorMagnitude)
 *
 * ...
 *
 *
 *
 *
 */
class IVW_MODULE_BASEGL_API VectorMagnitudeProcessor : public VolumeGLProcessor  {
public:
    VectorMagnitudeProcessor();
    virtual ~VectorMagnitudeProcessor();
    virtual const ProcessorInfo getProcessorInfo() const override;
    static const ProcessorInfo processorInfo_;

protected:
    virtual void postProcess() override;
};

} // namespace

#endif // IVW_VECTORMAGNITUDEPROCESSOR_H


text: Docker base image of CentOS with EPEL installed


text:
import * as CopyPaste from 'copy-paste';

class TestClass {}

let strRet: string  = CopyPaste.copy("content");
strRet = CopyPaste.copy("content", (err: Error) => { return; });

let objRet: TestClass  = CopyPaste.copy(new TestClass());
objRet = CopyPaste.copy(new TestClass(), (err: Error) => { return; });

strRet = CopyPaste.paste();
CopyPaste.paste((err: Error, content: string) => { return; });


text:
module CiVariablesHelper
  def ci_variable_protected_by_default?
    Gitlab::CurrentSettings.current_application_settings.protected_ci_variables
  end

  def ci_variable_protected?(variable, only_key_value)
    if variable && !only_key_value
      variable.protected
    else
      ci_variable_protected_by_default?
    end
  end

  def ci_variable_masked?(variable, only_key_value)
    if variable && !only_key_value
      variable.masked
    else
      true
    end
  end

  def ci_variable_type_options
    [
      %w(Variable env_var),
      %w(File file)
    ]
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using CodeComb.Marked;

namespace ForumR.Models
{
    public class Post
    {
        public Guid Id { get; set; }

        [ForeignKey("Thread")]
        public long ThreadId { get; set; }

        public virtual Thread Thread { get; set; }

        public string Content { get; set; }

        [NotMapped]
        public string FiltedContent
        {
            get
            {
                var ret = Helpers.RemoveHtml.Remove(Marked.Parse(Content));
                if (ret.Length > 100)
                    ret = ret.Substring(0, 100);
                return ret;
            }
        }

        public DateTime Time { get; set; }

        [ForeignKey("Parent")]
        public Guid? ParentId { get; set; }

        public virtual Post Parent { get; set; }

        public virtual ICollection<Post> SubPosts { get; set; } = new List<Post>();

        [ForeignKey("User")]
        public long? UserId { get; set; }

        public virtual User User { get; set; }
    }
}


text:
@implementation ETROuterUnionCollectionModel

- (NSInteger)numberOfSections
{
    NSInteger sum = 0;
    for (ETRCollectionModel *col in self.collections) {
        sum += [col numberOfSections];
    }
    return sum;
}

- (BOOL)supportsSectionUpdates
{
    return YES;
}

- (NSInteger)globalSectionForLocalSection:(NSInteger)section
                          collectionIndex:(NSInteger)collectionIndex
{
    NSInteger currentCollection = 0;
    for (ETRCollectionModel *col in self.collections) {
        if (currentCollection == collectionIndex)
            break;
        section += [col numberOfSections];
        currentCollection++;
    }
    return section;
}

- (NSInteger)localSectionForGlobalSection:(NSInteger)section
                          collectionIndex:(NSInteger*)collectioIndexPtr
{
    NSInteger collectionIndex = 0;
    for (ETRCollectionModel *col in self.collections) {
        NSInteger num = [col numberOfSections];
        if (section < num) {
            break;
        } else {
            section -= num;
        }
        collectionIndex++;
    }
    if (collectioIndexPtr)
        *collectioIndexPtr = collectionIndex;
    return section;
}

@end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>com.googlecode.mobilityrpc.common.util (Mobility-RPC 0.5.2 API)</title>
<meta name="date" content="2012-03-13">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

com.googlecode.mobilityrpc.common.util

Classes

IOUtil


text:
if (typeof(jQuery) === 'undefined') {
  var jQuery;
  // Check if require is a defined function.
  if (typeof(require) === 'function') {
    jQuery = $ = require('jquery');
  // Else use the dollar sign alias.
  } else {
    jQuery = $;
  }
}


text:
$(function()
{
    $('.result-item').click(function()
    {
        var $this = $(this);
        $this.toggleClass('show-detail');
        var show = $this.hasClass('show-detail');
        $this.next('.result-detail').toggleClass('hide', !show);
        $this.find('.collapse-handle').toggleClass('icon-chevron-down', !show).toggleClass('icon-chevron-up', show);;
    });

    $('#casesResults table caption .result-tip').html($('#resultTip').html());
});


text:
A gem to search with Sunspot using filters in the query string.

## Installation

Add this line to your application's Gemfile:

    gem 'sunspot_search'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install sunspot_search

## Usage

You must configure in your models the filters the user is allowed to use in the query string using **sunspot\_search\_with**.

```ruby
   class Article
     include SunspotSearch

     searchable do
       text :title, :body
       time :published_at
       integer author_id
     end

     sunspot_search_with :title, :body, :published_at, :author_id
   end
```

Your parameters keys should be prefixed with 'filter_'. You can use filters in the next way:
* ?filter_text=Foo
* ?filter_title=My+Awesome+Title
* ?filter_author_id=5

Or if you are searching using dates you can use keys like 'filter_published_at_start' and/or 'filter_published_at_end' to set a date range.

In your controllers you can simply use **sunspot\_search** to retrieve the results:
```ruby
   class ArticlesController < ActionController::Base
     def index
       @articles = Article.sunspot_search(params).results
     end
   end
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
<?php

namespace Estey\EvernoteOCR;

use Exception;
use Estey\EvernoteOCR\ResourceFactory;
use Estey\EvernoteOCR\Exceptions\ImageRecognitionException;
use Evernote\Client as Evernote;
use Evernote\Model\Note;
use Evernote\Model\Resource;
use Evernote\File\FileInterface;
use Evernote\File\File;

/**
 * Client
 *
 * The client class is the entry point into the Evernote OCR package that
 * manages all of the calls to the interactions with the Evernote PHP SDK,
 * parses the XML response and returns an array of TextBlock objects.
 */
class Client
{
    /**
     * Evernote SDK.
     * @var Evernote\Client
     */
    private $client;

    /**
     * File.
     * @var Evernote\File\FileInterface
     */
    private $file;

    /**
     * Resource Factory.
     * @var Estey\EvernoteOCR\ResourceFactory
     */
    private $resource_factory;

    /**
     * New Client.
     *
     * @param string $token
     * @param Evernote\File\FileInterface $file
     * @param Estey\EvernoteOCR\ResourceFactory $resource_factory
     * @param Evernote\Client $client
     * @return void
     */
    public function __construct(
        $token,
        FileInterface $file = null,
        ResourceFactory $resource_factory = null,
        Evernote $client = null
    ) {
        $this->file = $file;
        $this->resource_factory = $resource_factory ?: new ResourceFactory;
        $this->client = $client ?: new Evernote($token, false);
    }

    /**
     * Pass the location of the file to run text recognition on.
     * Returns an array of Estey\EvernoteOCR\TextBlock objects.
     *
     * @param string $path
     * @param Evernote\Model\Note $note
     * @return Estey\EvernoteOCR\TextBlock[]
     */
    public function recognize($path = null, Note $note = null)
    {
        if (!$this->file instanceof FileInterface) {
            $this->file = new File($path);
        }

        // Create a note resource.
        $resource = $this->resource_factory->make($this->file);

        // Add the resource to a new Note.
        $note = $this->makeNote($resource, $note);

        // Upload note to Evernote API return the note data.
        $note = $this->saveNote($note);

        // Get text recognition.
        return $this->getRecognition($note);
    }

    /**
     * Make a new note or append to a note that has already been created.
     *
     * @param Evernote\Model\Resource $resource
     * @param Evernote\Model\Note $note
     * @return Evernote\Model\Note
     */
    private function makeNote(Resource $resource, Note $note = null)
    {
        $note = $note ?: new Note;

        // Title and content are both required.
        // Only content can be an empty string.
        $note->setTitle('Evernote OCR');
        $note->setContent('');

        $note->addResource($resource);
        return $note;
    }

    /**
     * Upload Note to Evernote API.
     *
     * @param Evernote\Model\Note $note
     * @return Evernote\Model\Note
     */
    private function saveNote(Note $note)
    {
        // Upload note to Evernote, get response.
        $note = $this->client->uploadNote($note);

        // Delete note from Evernote.
        $this->client->deleteNote($note);

        return $note;
    }

    /**
     * Take note and read the text recognition data.
     * Returns an array of Estey\EvernoteOCR\TextBlock objects.
     *
     * @param Evernote\Model\Note $note
     * @return Estey\EvernoteOCR\TextBlock[]
     * @throws Estey\EvernoteOCR\Exceptions\ImageRecognitionException
     */
    private function getRecognition(Note $note)
    {
        // Get collection of resources from note.
        $resources = $note->getResources();
        $data = (array) $resources[0]->recognition;

        if (!isset($data['body'])) {
            throw new ImageRecognitionException(
                'No text found in image file.'
            );
        }

        return $this->parseTextBlocks($data['body']);
    }

    /**
     * Parse XML and returns an array of Estey\EvernoteOCR\TextBlock objects.
     *
     * @param string $xml
     * @return Estey\EvernoteOCR\TextBlock[]
     */
    private function parseTextBlocks($xml)
    {
        $data = [];
        $current_item = 0;

        $parser = xml_parser_create();
        xml_parse_into_struct($parser, $xml, $elements, $index);
        xml_parser_free($parser);

        foreach ($elements as $element) {
            if ($element['tag'] === 'ITEM' and $element['type'] === 'open') {
                $data[$current_item] = new TextBlock(
                    (integer) $element['attributes']['X'],
                    (integer) $element['attributes']['Y'],
                    (integer) $element['attributes']['W'],
                    (integer) $element['attributes']['H']
                );
                continue;
            }

            if ($element['tag'] === 'ITEM' and $element['type'] === 'close') {
                $current_item++;
                continue;
            }

            if ($element['tag'] === 'T') {
                $data[$current_item]->addText(
                    (string) $element['value'],
                    (integer) $element['attributes']['W']
                );
            }
        }

        return $data;
    }
}


text:
from jsonrpc import ServiceProxy
import sys
import string

# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======

if rpcpass == "":
	access = ServiceProxy("http://127.0.0.1:7462")
else:
	access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:7462")
cmd = sys.argv[1].lower()

if cmd == "backupwallet":
	try:
		path = raw_input("Enter destination path/filename: ")
		print access.backupwallet(path)
	except:
		print "\n---An error occurred---\n"

elif cmd == "getaccount":
	try:
		addr = raw_input("Enter a scrypt address: ")
		print access.getaccount(addr)
	except:
		print "\n---An error occurred---\n"

elif cmd == "getaccountaddress":
	try:
		acct = raw_input("Enter an account name: ")
		print access.getaccountaddress(acct)
	except:
		print "\n---An error occurred---\n"

elif cmd == "getaddressesbyaccount":
	try:
		acct = raw_input("Enter an account name: ")
		print access.getaddressesbyaccount(acct)
	except:
		print "\n---An error occurred---\n"

elif cmd == "getbalance":
	try:
		acct = raw_input("Enter an account (optional): ")
		mc = raw_input("Minimum confirmations (optional): ")
		try:
			print access.getbalance(acct, mc)
		except:
			print access.getbalance()
	except:
		print "\n---An error occurred---\n"

elif cmd == "getblockbycount":
	try:
		height = raw_input("Height: ")
		print access.getblockbycount(height)
	except:
		print "\n---An error occurred---\n"

elif cmd == "getblockcount":
	try:
		print access.getblockcount()
	except:
		print "\n---An error occurred---\n"

elif cmd == "getblocknumber":
	try:
		print access.getblocknumber()
	except:
		print "\n---An error occurred---\n"

elif cmd == "getconnectioncount":
	try:
		print access.getconnectioncount()
	except:
		print "\n---An error occurred---\n"

elif cmd == "getdifficulty":
	try:
		print access.getdifficulty()
	except:
		print "\n---An error occurred---\n"

elif cmd == "getgenerate":
	try:
		print access.getgenerate()
	except:
		print "\n---An error occurred---\n"

elif cmd == "gethashespersec":
	try:
		print access.gethashespersec()
	except:
		print "\n---An error occurred---\n"

elif cmd == "getinfo":
	try:
		print access.getinfo()
	except:
		print "\n---An error occurred---\n"

elif cmd == "getnewaddress":
	try:
		acct = raw_input("Enter an account name: ")
		try:
			print access.getnewaddress(acct)
		except:
			print access.getnewaddress()
	except:
		print "\n---An error occurred---\n"

elif cmd == "getreceivedbyaccount":
	try:
		acct = raw_input("Enter an account (optional): ")
		mc = raw_input("Minimum confirmations (optional): ")
		try:
			print access.getreceivedbyaccount(acct, mc)
		except:
			print access.getreceivedbyaccount()
	except:
		print "\n---An error occurred---\n"

elif cmd == "getreceivedbyaddress":
	try:
		addr = raw_input("Enter a scrypt address (optional): ")
		mc = raw_input("Minimum confirmations (optional): ")
		try:
			print access.getreceivedbyaddress(addr, mc)
		except:
			print access.getreceivedbyaddress()
	except:
		print "\n---An error occurred---\n"

elif cmd == "gettransaction":
	try:
		txid = raw_input("Enter a transaction ID: ")
		print access.gettransaction(txid)
	except:
		print "\n---An error occurred---\n"

elif cmd == "getwork":
	try:
		data = raw_input("Data (optional): ")
		try:
			print access.gettransaction(data)
		except:
			print access.gettransaction()
	except:
		print "\n---An error occurred---\n"

elif cmd == "help":
	try:
		cmd = raw_input("Command (optional): ")
		try:
			print access.help(cmd)
		except:
			print access.help()
	except:
		print "\n---An error occurred---\n"

elif cmd == "listaccounts":
	try:
		mc = raw_input("Minimum confirmations (optional): ")
		try:
			print access.listaccounts(mc)
		except:
			print access.listaccounts()
	except:
		print "\n---An error occurred---\n"

elif cmd == "listreceivedbyaccount":
	try:
		mc = raw_input("Minimum confirmations (optional): ")
		incemp = raw_input("Include empty? (true/false, optional): ")
		try:
			print access.listreceivedbyaccount(mc, incemp)
		except:
			print access.listreceivedbyaccount()
	except:
		print "\n---An error occurred---\n"

elif cmd == "listreceivedbyaddress":
	try:
		mc = raw_input("Minimum confirmations (optional): ")
		incemp = raw_input("Include empty? (true/false, optional): ")
		try:
			print access.listreceivedbyaddress(mc, incemp)
		except:
			print access.listreceivedbyaddress()
	except:
		print "\n---An error occurred---\n"

elif cmd == "listtransactions":
	try:
		acct = raw_input("Account (optional): ")
		count = raw_input("Number of transactions (optional): ")
		frm = raw_input("Skip (optional):")
		try:
			print access.listtransactions(acct, count, frm)
		except:
			print access.listtransactions()
	except:
		print "\n---An error occurred---\n"

elif cmd == "move":
	try:
		frm = raw_input("From: ")
		to = raw_input("To: ")
		amt = raw_input("Amount:")
		mc = raw_input("Minimum confirmations (optional): ")
		comment = raw_input("Comment (optional): ")
		try:
			print access.move(frm, to, amt, mc, comment)
		except:
			print access.move(frm, to, amt)
	except:
		print "\n---An error occurred---\n"

elif cmd == "sendfrom":
	try:
		frm = raw_input("From: ")
		to = raw_input("To: ")
		amt = raw_input("Amount:")
		mc = raw_input("Minimum confirmations (optional): ")
		comment = raw_input("Comment (optional): ")
		commentto = raw_input("Comment-to (optional): ")
		try:
			print access.sendfrom(frm, to, amt, mc, comment, commentto)
		except:
			print access.sendfrom(frm, to, amt)
	except:
		print "\n---An error occurred---\n"

elif cmd == "sendmany":
	try:
		frm = raw_input("From: ")
		to = raw_input("To (in format address1:amount1,address2:amount2,...): ")
		mc = raw_input("Minimum confirmations (optional): ")
		comment = raw_input("Comment (optional): ")
		try:
			print access.sendmany(frm,to,mc,comment)
		except:
			print access.sendmany(frm,to)
	except:
		print "\n---An error occurred---\n"

elif cmd == "sendtoaddress":
	try:
		to = raw_input("To (in format address1:amount1,address2:amount2,...): ")
		amt = raw_input("Amount:")
		comment = raw_input("Comment (optional): ")
		commentto = raw_input("Comment-to (optional): ")
		try:
			print access.sendtoaddress(to,amt,comment,commentto)
		except:
			print access.sendtoaddress(to,amt)
	except:
		print "\n---An error occurred---\n"

elif cmd == "setaccount":
	try:
		addr = raw_input("Address: ")
		acct = raw_input("Account:")
		print access.setaccount(addr,acct)
	except:
		print "\n---An error occurred---\n"

elif cmd == "setgenerate":
	try:
		gen= raw_input("Generate? (true/false): ")
		cpus = raw_input("Max processors/cores (-1 for unlimited, optional):")
		try:
			print access.setgenerate(gen, cpus)
		except:
			print access.setgenerate(gen)
	except:
		print "\n---An error occurred---\n"

elif cmd == "settxfee":
	try:
		amt = raw_input("Amount:")
		print access.settxfee(amt)
	except:
		print "\n---An error occurred---\n"

elif cmd == "stop":
	try:
		print access.stop()
	except:
		print "\n---An error occurred---\n"

elif cmd == "validateaddress":
	try:
		addr = raw_input("Address: ")
		print access.validateaddress(addr)
	except:
		print "\n---An error occurred---\n"

elif cmd == "walletpassphrase":
	try:
		pwd = raw_input("Enter wallet passphrase: ")
		access.walletpassphrase(pwd, 60)
		print "\n---Wallet unlocked---\n"
	except:
		print "\n---An error occurred---\n"

elif cmd == "walletpassphrasechange":
	try:
		pwd = raw_input("Enter old wallet passphrase: ")
		pwd2 = raw_input("Enter new wallet passphrase: ")
		access.walletpassphrasechange(pwd, pwd2)
		print
		print "\n---Passphrase changed---\n"
	except:
		print
		print "\n---An error occurred---\n"
		print

else:
	print "Command not found or not supported"


text:
from typing import Any, Dict
from pandas import DataFrame
from lib.pipeline import DataSource
from lib.utils import table_rename

_column_adapter = {
    "Time": "date",
    "Variant": "indicator",
    "Location": "country_name",
    "PopTotal": "population",
    "PopMale": "population_male",
    "PopFemale": "population_female",
    "PopDensity": "population_density",
    "AgeGrpStart": "age",
}

_dummy_record = {
    "population_age_00_09": 0,
    "population_age_10_19": 0,
    "population_age_20_29": 0,
    "population_age_30_39": 0,
    "population_age_40_49": 0,
    "population_age_50_59": 0,
    "population_age_60_69": 0,
    "population_age_70_79": 0,
    "population_age_80_and_older": 0,
}

def _preprocess_population_data(data: DataFrame, aux: Dict[str, DataFrame]) -> DataFrame:
    data = table_rename(data, _column_adapter, drop=True)

    # Filter data for 2020 and remove all other years
    data = data[data["date"] == 2020].drop(columns=["date"])

    # We only care about the population count indicators
    data = data[data["indicator"] == "Medium"]

    # Population counts are in thousands, convert back to single units
    for col in data.columns:
        if col.startswith("population") and col != "population_density":
            data[col] = data[col] * 1_000

    # Derive key from our country names mapping
    names = aux["un_country_names"]
    return data.merge(names, how="left")

class UnWppByAgeDataSource(DataSource):
    def parse_dataframes(
        self, dataframes: Dict[Any, DataFrame], aux: Dict[str, DataFrame], **parse_opts
    ) -> DataFrame:
        data = _preprocess_population_data(dataframes[0], aux)

        # Combine the age groups into one record per location
        records: Dict[str, Any] = {}
        for key, row in data.set_index("key").iterrows():
            records[key] = records.get(key, dict(_dummy_record, key=key))
            if row["age"] >= 80:
                records[key]["population_age_80_and_older"] += row["population"]
            else:
                for i in range(0, 8):
                    if row["age"] < 10 * (i + 1):
                        records[key][f"population_age_{i}0_{i}9"] += row["population"]
                        break

        return DataFrame.from_records(list(records.values()))

class UnWppBySexDataSource(DataSource):
    def parse_dataframes(
        self, dataframes: Dict[Any, DataFrame], aux: Dict[str, DataFrame], **parse_opts
    ) -> DataFrame:
        data = _preprocess_population_data(dataframes[0], aux)

        # Data is already stratified how we need it for the male/female populations
        return data


text:
<?php

namespace tests\src\moduleapp;

use Yii;

class RunTest extends \tests\BaseModuleAppTest
{
    public function testApp()
    {
        // index controller with default route 'index' in module
        $this->assertEquals('foo', Yii::$app->runAction('', []));
        $this->assertEquals('foo', Yii::$app->runAction('moduletest', []));
        $this->assertEquals('foo', Yii::$app->runAction('moduletest/', []));
        $this->assertEquals('foo', Yii::$app->runAction('moduletest/test', []));
        $this->assertEquals('foo', Yii::$app->runAction('moduletest/test/', []));
        $this->assertEquals('foo', Yii::$app->runAction('moduletest/test/index', []));
        $this->assertEquals('foo', Yii::$app->runAction('moduletest/test/index/', []));
        $this->assertEquals('bar', Yii::$app->runAction('moduletest/test/bar', []));
        $this->assertEquals('bar', Yii::$app->runAction('moduletest/test/bar/', []));
        // other controller
        $this->assertEquals('index', Yii::$app->runAction('moduletest/other', []));
        $this->assertEquals('index', Yii::$app->runAction('moduletest/other/', []));
        $this->assertEquals('index', Yii::$app->runAction('moduletest/other/index', []));
        $this->assertEquals('index', Yii::$app->runAction('moduletest/other/index/', []));
        $this->assertEquals('baz', Yii::$app->runAction('moduletest/other/baz', []));
        $this->assertEquals('baz', Yii::$app->runAction('moduletest/other/baz/', []));
    }
}


text:
So you want to contribute to the project. **THIS IS GREAT NEWS!**  Seriously. We're all pretty happy about this. Here's how to get started:

* [Getting Set Up To Contribute](#getting-set-up-to-contribute)
* [Adding a Cask](#adding-a-cask)
* [Testing Your New Cask](#testing-your-new-cask)
* [Finding a Home For Your Cask](#finding-a-home-for-your-cask)
* [Submitting Your Changes](#submitting-your-changes)
* [Cleaning up](#cleaning-up)
* [Reporting Bugs](README.md#reporting-bugs)

## Getting Set Up To Contribute

1. Fork the repository in GitHub with the `Fork` button.

2. Add your GitHub fork as a remote for your homebrew-cask Tap:

```bash
$ github_user='<my-github-username>'
$ cd "$(brew --repository)"/Library/Taps/caskroom/homebrew-cask
$ git remote add "$github_user" "https://github.com/$github_user/homebrew-cask"
```

## Adding a Cask

Making a Cask is easy: a Cask is a small Ruby file.

### Examples

Here's a Cask for `shuttle` as an example. Note that the `url` stanza uses `#{version}` ([string interpolation](https://en.wikipedia.org/wiki/String_interpolation#Ruby)) to create a Cask that only needs `version` and `sha256` changes when updated.

```ruby
cask 'shuttle' do
  version '1.2.5'
  sha256 '7df182f506b80011222c0cdd470be76e0376f38e331f3fafbb6af9add3578023'

  url "https://github.com/fitztrev/shuttle/releases/download/v#{version}/Shuttle.zip"
  appcast 'https://github.com/fitztrev/shuttle/releases.atom'
  name 'Shuttle'
  homepage 'https://fitztrev.github.io/shuttle/'
  license :mit

  app 'Shuttle.app'

  zap :delete => '~/.shuttle.json'
end
```

Here is another Cask for `genymotion`. Note that you may repeat the `app` stanza as many times as you need, to define multiple apps:

```ruby
cask 'genymotion' do
  version '2.6.0'
  sha256 '9d12ae904761d76b15a556262d7eb32d1f5031fe60690224d7b0a70303cf8d39'

  depends_on :cask => 'virtualbox'

  url "http://files2.genymotion.com/genymotion/genymotion-#{version}/genymotion-#{version}.dmg"
  name 'Genymotion'
  homepage 'https://www.genymotion.com/'
  license :commercial

  app 'Genymotion.app'
  app 'Genymotion Shell.app'
  binary 'Genymotion Shell.app/Contents/MacOS/genyshell'

  caveats do
    files_in_usr_local
  end
end
```

And here is one for `gateblu`. Note that it has an unversioned download (the download `url` does not contain the version number, unlike the example above). It also suppresses the checksum with `sha256 :no_check` (necessary since the checksum will change when a new distribution is made available). This combination of `version :latest` and `sha256 :no_check` is currently the preferred mechanism when a versioned download URL is not available. Also note the comment above `url`, which is needed when [the url and homepage hostnames differ](doc/CASK_LANGUAGE_REFERENCE.md#when-url-and-homepage-hostnames-differ-add-a-comment):

```ruby
cask 'gateblu' do
  version :latest
  sha256 :no_check

  # amazonaws.com is the official download host per the vendor homepage
  url 'https://s3-us-west-2.amazonaws.com/gateblu/gateblu-ui/latest/Gateblu.dmg'
  name 'Gateblu'
  homepage 'https://gateblu.octoblu.com'
  license :mit

  pkg 'Gateblu Installer.pkg'

  uninstall :pkgutil => 'com.octoblu.*',
            :delete => '/Applications/Gateblu.app'
end
```

### Generating a Token for the Cask

The Cask **token** is the mnemonic string people will use to interact with the Cask via `brew cask install`, `brew cask search`, etc. The name of the Cask **file** is simply the token with the extension `.rb` appended.

The easiest way to generate a token for a Cask is to run this command:

```bash
$ "$(brew --repository)/Library/Taps/caskroom/homebrew-cask/developer/bin/generate_cask_token" '/full/path/to/new/software.app'
```

If the software you wish to Cask is not installed, or does not have an associated App bundle, just give the full proper name of the software instead of a pathname:

```bash
$ "$(brew --repository)/Library/Taps/caskroom/homebrew-cask/developer/bin/generate_cask_token" 'Google Chrome'
```

If the `generate_cask_token` script does not work for you, see [Cask Token Details](#cask-token-details).

### The `brew cask create` Command

Once you know the token, create your Cask with the handy-dandy `brew cask create` command.

```bash
$ brew cask create my-new-cask
```

This will open `$EDITOR` with a template for your new Cask, to be stored in the file `my-new-cask.rb`. Running the `create` command above will get you a template that looks like this:

```ruby
cask 'my-new-cask' do
  version ''
  sha256 ''

  url ''
  name ''
  homepage ''
  license :unknown

  app ''
end
```

### Cask Stanzas

Fill in the following stanzas for your Cask:

| name               | value       |
| ------------------ | ----------- |
| `version`          | application version; give the value `:latest` if an unversioned download is available
| `sha256`           | SHA-256 checksum of the file downloaded from `url`, calculated by the command `shasum -a 256 <file>`. Can be suppressed by using the special value `:no_check`. (see also [Checksum Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#checksum-stanza-details))
| `url`              | URL to the `.dmg`/`.zip`/`.tgz` file that contains the application. A [comment](doc/CASK_LANGUAGE_REFERENCE.md#when-url-and-homepage-hostnames-differ-add-a-comment) should be added if the hostnames in the `url` and `homepage` stanzas differ (see also [URL Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#url-stanza-details))
| `name`             | the full and proper name defined by the vendor, and any useful alternate names (see also [Name Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#name-stanza-details))
| `homepage`         | application homepage; used for the `brew cask home` command
| `license`          | a symbol identifying the license for the application. Valid category licenses include `:oss`, `:closed`, and `:unknown`. It is OK to leave as `:unknown`. (see also [License Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#license-stanza-details))
| `app`              | relative path to an `.app` bundle that should be linked into the `~/Applications` folder on installation (see also [App Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#app-stanza-details))

Other commonly-used stanzas are:

| name               | value       |
| ------------------ | ----------- |
| `pkg`              | relative path to a `.pkg` file containing the distribution (see also [Pkg Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#pkg-stanza-details))
| `uninstall`        | procedures to uninstall a Cask. Optional unless the `pkg` stanza is used. (see also [Uninstall Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#uninstall-stanza-details))

Additional stanzas you might need for special use-cases:

| name                   | value       |
| ---------------------- | ----------- |
| `prefpane`             | relative path to a preference pane that should be linked into the `~/Library/PreferencePanes` folder on installation
| `colorpicker`          | relative path to a ColorPicker plugin that should be linked into the `~/Library/ColorPickers` folder on installation
| `qlplugin`             | relative path to a QuickLook plugin that should be linked into the `~/Library/QuickLook` folder on installation
| `font`                 | relative path to a font that should be linked into the `~/Library/Fonts` folder on installation
| `service`              | relative path to a service that should be linked into the `~/Library/Services` folder on installation
| `binary`               | relative path to a binary that should be linked into the `/usr/local/bin` folder on installation
| `input_method`         | relative path to a input method that should be linked into the `~/Library/Input Methods` folder on installation
| `screen_saver`         | relative path to a Screen Saver that should be linked into the `~/Library/Screen Savers` folder on installation
| `suite`                | relative path to a containing directory that should be linked into the `~/Applications` folder on installation
| `container :nested =>` | relative path to an inner container that must be extracted before moving on with the installation; this allows us to support dmg inside tar, zip inside dmg, etc.
| `caveats`              | a string or Ruby block providing the user with Cask-specific information at install time (see also [Caveats Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#caveats-stanza-details))

Even more special-use stanzas are listed at [Optional Stanzas](doc/CASK_LANGUAGE_REFERENCE.md#optional-stanzas) and [Legacy Stanzas](doc/CASK_LANGUAGE_REFERENCE.md#legacy-stanzas).

### SourceForge URLs

SourceForge projects are a common way to distribute binaries, but they provide many different styles of URLs to get to the goods.

We prefer URLs of this format:

```
http://downloads.sourceforge.net/sourceforge/$PROJECTNAME/$FILENAME.$EXT
```

Or, if it's from [SourceForge.JP](http://sourceforge.jp/):

```
http://$STRING.sourceforge.jp/$PROJECTNAME/$RELEASEID/$FILENAME.$EXT
```

`$STRING` is typically of the form `dl` or `$USER.dl`.

If these formats are not available, and the application is Mac-exclusive (otherwise a command-line download defaults to the Windows version) we prefer the use of this format:

```
http://sourceforge.net/projects/$PROJECTNAME/files/latest/download
```

### Personal Hosting Such as Dropbox

URLs from dropbox.com or cl.ly/cloudapp.com are not readily distinguishable as being controlled by the original software vendor. These URLs should be used only when given as such on the official project website.

Also make sure to give the URL for the binary download itself, rather than a preview page. (See <https://www.dropbox.com/help/201/en>.)

### Some Providers Block Command-line Downloads

Some hosting providers actively block command-line HTTP clients (example: FossHub). Such URLs cannot be used in Casks.

### Vendor URLs Are Preferred

When possible, it is best to use a download URL from the original developer or vendor, rather than an aggregator such as `macupdate.com`.

### Cask Token Details

If a token conflicts with an already-existing Cask, authors should manually make the new token unique by prepending the vendor name. Example: [unison.rb](../master/Casks/unison.rb) and [panic-unison.rb](../master/Casks/panic-unison.rb).

If possible, avoid creating tokens which differ only by the placement of hyphens.

To generate a token manually, or to learn about exceptions for unusual cases, see [cask_token_reference.md](doc/cask_token_reference.md).

### Archives With Subfolders

When a downloaded archive expands to a subfolder, the subfolder name must be included in the `app` value.

Example:

1. Texmaker is downloaded to the file `TexmakerMacosxLion.zip`.
2. `TexmakerMacosxLion.zip` unzips to a folder called `TexmakerMacosxLion`.
3. The folder `TexmakerMacosxLion` contains the application `texmaker.app`.
4. So, the `app` stanza should include the subfolder as a relative path:

  ```ruby
  app 'TexmakerMacosxLion/texmaker.app'
  ```

### Style guide

All Casks and code in the homebrew-cask project should be indented using two spaces (never tabs).

If relevant, you may also use string manipulations to improve the maintainability of your Cask. Here's an example from `Lynkeos.app`:

```ruby
cask 'lynkeos' do
  version '2.10'
  sha256 'bd27055c51575555a1c8fe546cf057c57c0e45ea5d252510847277734dc550a4'

  url "http://downloads.sourceforge.net/project/lynkeos/lynkeos/#{version}/Lynkeos-App-#{version.gsub('.', '-')}.zip"
  name 'Lynkeos'
  homepage 'http://lynkeos.sourceforge.net/'
  license :gpl

  app "Lynkeos-App-#{version.gsub('.', '-')}/Lynkeos.app"
end
```

## Testing Your New Cask

Give it a shot with `brew cask install my-new-cask`

Did it install? If something went wrong, `brew cask uninstall my-new-cask` and edit your Cask to fix it.

If everything looks good, you'll also want to make sure your Cask passes audit with:

```bash
brew cask audit my-new-cask --download
```

You should also check stylistic details with the [`rubocop`](https://github.com/bbatsov/rubocop) gem:

```bash
cd "$(brew --repository)/Library/Taps/caskroom/homebrew-cask"
bundle install
bundle exec rubocop Casks/my-new-cask.rb
```

Keep in mind all of these checks will be made when you submit your PR, so by doing them in advance you're saving everyone a lot of time and trouble.

If your application and homebrew-cask do not work well together, feel free to [file an issue](https://github.com/caskroom/homebrew-cask#reporting-bugs) after checking out open issues.

## Finding a Home For Your Cask

We maintain separate Taps for different types of binaries. Our nomenclature is:

+ **Stable**: The latest version provided by the developer defined by them as such.
+ **Beta, Development, Unstable**: Subsequent versions to **stable**, yet incomplete and under development, aiming to eventually become the new **stable**.
+ **Nightly**: Constantly up-to-date versions of the current development state.
+ **Legacy**: Any **stable** version that is not the most recent.
+ **Trial**: Date-limited version that stops working entirely after it expires, requiring payment to lift the limitation.
+ **Freemium**: Gratis version that works indefinitely but with limitations that can be removed by paying.
+ **Fork**: An alternate version of an existing project, with a based-on but modified source and binary.
+ **Unofficial**: An *allegedly* unmodified compiled binary, by a third-party, of a binary that has no existing build by the owner of the source code.
+ **Vendorless**: A binary distributed without an official website, like a forum posting.
+ **Walled**: When the download URL is both behind a login/registration form and from a host that differs from the homepage.

### Stable Versions

Stable versions live in the main repository at [caskroom/homebrew-cask](https://github.com/caskroom/homebrew-cask). They should run on the latest release of OS X or the previous point release (in 2015, for example, that meant El Capitan and Yosemite).

### But There Is No Stable Version!

When an App is only available as beta, development, or unstable versions, or in cases where such a version is the general standard, then said version can go into the main repo.

### Beta, Unstable, Development, Nightly, or Legacy Versions

When an App's stable version already exists in the main repo, alternate versions can be submitted to [caskroom/homebrew-versions](https://github.com/caskroom/homebrew-versions).

### Trial and Freemium Versions

Before submitting a trial, make sure it can be made into a full working version without the need to be redownloaded. If an App provides a trial but the only way to buy the full version is via the Mac App Store, it does not belong in any of the official repos. Freemium versions are fine.

### Forks and Apps with conflicting names

Forks should have the vendor's name as a prefix on the cask's file name and token. For unrelated apps that share a name, the most popular one (usually the one already present) stays unprefixed. Since this can be subjective, if you disagree with a decision open an issue and make your case to the maintainers.

### Unofficial, Vendorless, and Walled Builds

Please submit these to [caskroom/homebrew-unofficial](http://github.com/caskroom/homebrew-unofficial). If you've made an unofficial build and need a place to host it, contact our sister project [alehouse](https://github.com/alehouse).

### Fonts

Font casks live in the [caskroom/homebrew-fonts](https://github.com/caskroom/homebrew-fonts) repository. See the font repo [CONTRIBUTING.md](https://github.com/caskroom/homebrew-fonts/blob/master/CONTRIBUTING.md)
for details.

## Submitting Your Changes

Hop into your Tap and check to make sure your new Cask is there:

```bash
$ cd "$(brew --repository)"/Library/Taps/caskroom/homebrew-cask
$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       Casks/my-new-cask.rb
```

So far, so good. Now make a feature branch that you'll use in your pull request:

```bash
$ git checkout -b my-new-cask
Switched to a new branch 'my-new-cask'
```

Stage your Cask with `git add Casks/my-new-cask.rb`. You can view the changes that are to be committed with `git diff --cached`.

Commit your changes with `git commit -v`.

### Commit Messages

For any git project, some good rules for commit messages are:

* The first line is commit summary, 50 characters or less,
* Followed by an empty line
* Followed by an explanation of the commit, wrapped to 72 characters.

See [a note about git commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) for more.

The first line of a commit message becomes the **title** of a pull request on GitHub, like the subject line of an email. Including the key info in the first line will help us respond faster to your pull.

For Cask commits in the homebrew-cask project, we like to include the Application name, version number (or `:latest`), and purpose of the commit in the first line.

Examples of good, clear commit summaries:

* `Add Transmission.app v1.0`
* `Upgrade Transmission.app to v2.82`
* `Fix checksum in Transmission.app Cask`
* `Add CodeBox Latest`

Examples of difficult, unclear commit summaries:

* `Upgrade to v2.82`
* `Checksum was bad`

### Pushing

Push your changes to your GitHub account:

```bash
$ github_user='<my-github-username>'
$ git push "$github_user" my-new-cask
```

If you are using [GitHub two-factor authentication](https://help.github.com/articles/about-two-factor-authentication/) and set your remote repository as HTTPS you will need to set up a personal access token and use that instead of your password. Further information [here](https://help.github.com/articles/https-cloning-errors/#provide-access-token-if-2fa-enabled).

### Squashing

If your pull request has multiple commits which revise the same lines of code, or if you make some changes after comments from one of the maintainers, it is better to [squash](http://davidwalsh.name/squash-commits-git) those commits together into one logical unit.

But you don't always have to squash — it is fine for a pull request to contain multiple commits when there is a logical reason for the separation.

### Filing a Pull Request on GitHub

Now go to *your* GitHub repository at https://github.com/my-github-username/homebrew-cask, switch branch to your topic branch and click the `New Pull Request` button. If it isn't automatically selected, choose to `compare across forks`. The base fork should be `caskroom/homebrew-cask @ master`, and the head fork should be `my-github-username/homebrew-cask @ my-new-cask`. You can also add any further comments to your pull request at this stage.

Congratulations! You are done now, and your Cask should be pulled in or otherwise noticed in a while. If a maintainer suggests some changes, just make them on the `my-new-cask` branch locally, [squash](CONTRIBUTING.md#squashing), and [push](CONTRIBUTING.md#pushing).

## Cleaning up

After your Pull Request is submitted, you might want to get yourself back onto `master`, so that `brew update` will pull down new Casks properly.

```bash
cd "$(brew --repository)"/Library/Taps/caskroom/homebrew-cask
git checkout master
```

Neat and tidy!

# <3 THANK YOU! <3


text:
namespace BootstrapMvc.Paging
{
    using System;
    using BootstrapMvc.Core;
    using System.Collections.Generic;

    public class PaginatorGenerator : Element
    {
        public PaginatorGenerator()
        {
            TotalPages = 1;
            CurrentPage = 1;
            PageButtonsCountBack = -1;
            PageButtonsCountForward = -1;
            HidePreviousNextButtons = false;
            ButtonPreviousText = "«";
            ButtonNextText = "»";
            ButtonPageTextTemplate = "{0}";
            HrefTemplate = "page={0}";
        }

        public Paginator Paginator { get; set; }

        public int TotalPages { get; set; }

        public int CurrentPage { get; set; }

        public int PageButtonsCountBack { get; set; }

        public int PageButtonsCountForward { get; set; }

        public bool HidePreviousNextButtons { get; set; }

        /// <summary>
        /// Pattern string for generating page button text. Default <value>{0}</value>
        /// </summary>
        public string ButtonPageTextTemplate { get; set; }

        public string ButtonPreviousText { get; set; }

        public string ButtonNextText { get; set; }

        public string HrefTemplate { get; set; }

        protected override void WriteSelf(System.IO.TextWriter writer)
        {
            if (CurrentPage < 1)
            {
                throw new ArgumentOutOfRangeException("CurrentPage must be 1 or greater");
            }
            if (TotalPages < 1)
            {
                throw new ArgumentOutOfRangeException("TotalPages must be 1 or greater");
            }
            if (CurrentPage > TotalPages)
            {
                throw new ArgumentOutOfRangeException(string.Format("CurrentPage ({0}) must be less or equal to TotalPages ({1})", CurrentPage, TotalPages));
            }

            var pageStart = (PageButtonsCountBack == -1) ? 1 : Math.Max(1, CurrentPage - PageButtonsCountBack);
            var pageEnd = (PageButtonsCountForward == -1) ? TotalPages : Math.Min(TotalPages, CurrentPage + PageButtonsCountForward);

            using (Paginator.BeginContent(writer, null))
            {
                if (!HidePreviousNextButtons)
                {
                    var p = Math.Max(1, CurrentPage - 1);
                    var pi = Helper.CreateWriter<PaginatorItem, AnyContent>(this)
                        .Disabled(p == CurrentPage)
                        .Href(string.Format(HrefTemplate, p))
                        .Content(ButtonPreviousText);
                    pi.Item.WriteTo(writer);
                }
                for (var i = pageStart; i <= pageEnd; i++)
                {
                    var pi = Helper.CreateWriter<PaginatorItem, AnyContent>(this)
                        .Active(i == CurrentPage)
                        .Href(string.Format(HrefTemplate, i))
                        .Content(string.Format(ButtonPageTextTemplate, i));
                    pi.Item.WriteTo(writer);
                }
                if (!HidePreviousNextButtons)
                {
                    var p = Math.Min(TotalPages, CurrentPage + 1);
                    var pi = Helper.CreateWriter<PaginatorItem, AnyContent>(this)
                        .Disabled(p == CurrentPage)
                        .Href(string.Format(HrefTemplate, p))
                        .Content(ButtonNextText);
                    pi.Item.WriteTo(writer);
                }
            }
        }
    }
}