text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Csla.Xaml;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
using Windows.UI.Popups;

namespace WinRtUI.ViewModel
{
  public class ProjectListViewModel : ViewModel<ProjectTracker.Library.ProjectList>
  {
    protected async override Task<ProjectTracker.Library.ProjectList> DoInitAsync()
    {
      return await ProjectTracker.Library.ProjectList.GetProjectListAsync();
    }

    protected override void OnRefreshed()
    {
      base.OnRefreshed();
      OnPropertyChanged("Items");
    }

    public ObservableCollection<ProjectInfoViewModel> Items
    {
      get
      {
        ObservableCollection<ProjectInfoViewModel> result = null;
        if (Model != null)
          result = new ObservableCollection<ProjectInfoViewModel>(
            Model.Select(r => new ProjectInfoViewModel(r)));

        return result;
      }
    }
  }

  public class ProjectInfoViewModel : ViewModel<ProjectTracker.Library.ProjectInfo>
  {
    private static Uri _baseUri = new Uri("ms-appx:///");
    private static List<string> _imageList = new List<string>
      {
        "Assets/LightGray.png",
        "Assets/MediumGray.png",
        "Assets/DarkGray.png"
      };
    private static int _imageIndex = 0;

    public ProjectInfoViewModel(ProjectTracker.Library.ProjectInfo info)
    {
      Model = info;
      _imagePath = _imageList[_imageIndex];
      _imageIndex++;
      if (_imageIndex >= _imageList.Count) _imageIndex = 0;
    }

    private ProjectEditViewModel _ProjectEdit = null;
    public ProjectEditViewModel ProjectEditViewModel
    {
      get
      {
        if (_ProjectEdit == null)
        {
          IsBusy = true;
          new ProjectEditViewModel(Model.Id, this).InitAsync().ContinueWith(t =>
          {
            ProjectEditViewModel = (ProjectEditViewModel)t.Result;
            IsBusy = false;
          },
              TaskContinuationOptions.ExecuteSynchronously);
        }
        return _ProjectEdit;
      }
      private set
      {
        _ProjectEdit = value;
        OnPropertyChanged("ProjectEditViewModel");
      }
    }

    private ImageSource _image = null;
    private String _imagePath = null;
    public ImageSource Image
    {
      get
      {
        if (this._image == null && this._imagePath != null)
          this._image = new BitmapImage(new Uri(_baseUri, this._imagePath));
        return this._image;
      }
      set
      {
        _imagePath = null;
        _image = value;
        OnPropertyChanged("Image");
      }
    }

    internal void UpdateInfo(ProjectTracker.Library.ProjectEdit projectEdit)
    {
      Model.SetName(projectEdit);
    }
  }

  public class ProjectEditViewModel : ViewModel<ProjectTracker.Library.ProjectEdit>
  {
    private int _ProjectId;
    private ProjectInfoViewModel _parent;

    public ProjectEditViewModel(int id, ProjectInfoViewModel parent)
    {
      _ProjectId = id;
      _parent = parent;
    }

    protected override async Task<ProjectTracker.Library.ProjectEdit> DoInitAsync()
    {
      var result = await ProjectTracker.Library.ProjectEdit.GetProjectAsync(_ProjectId);
      return result;
    }

    public new async Task<ProjectTracker.Library.ProjectEdit> SaveAsync()
    {
      var result = await base.SaveAsync();
      _parent.UpdateInfo(Model);
      return result;
    }
  }
}


text:
from copy import deepcopy
from hashlib import md5
from swift.common import swob
from swift.common.utils import split_path
from swift.common.request_helpers import is_sys_meta

class FakeSwift(object):
    """
    A good-enough fake Swift proxy server to use in testing middleware.
    """

    def __init__(self, s3_acl=False):
        self._calls = []
        self.req_method_paths = []
        self.swift_sources = []
        self.uploaded = {}
        # mapping of (method, path) --> (response class, headers, body)
        self._responses = {}
        self.s3_acl = s3_acl

    def _fake_auth_middleware(self, env):
        if 'swift.authorize_override' in env:
            return

        if 'HTTP_AUTHORIZATION' not in env:
            return

        _, authorization = env['HTTP_AUTHORIZATION'].split(' ')
        tenant_user, sign = authorization.rsplit(':', 1)
        tenant, user = tenant_user.rsplit(':', 1)

        path = env['PATH_INFO']
        env['PATH_INFO'] = path.replace(tenant_user, 'AUTH_' + tenant)

        env['REMOTE_USER'] = 'authorized'

        if env['REQUEST_METHOD'] == 'TEST':
            # AccessDenied by default at s3acl authenticate
            env['swift.authorize'] = \
                lambda req: swob.HTTPForbidden(request=req)
        else:
            env['swift.authorize'] = lambda req: None

    def __call__(self, env, start_response):
        if self.s3_acl:
            self._fake_auth_middleware(env)

        req = swob.Request(env)
        method = env['REQUEST_METHOD']
        path = env['PATH_INFO']
        _, acc, cont, obj = split_path(env['PATH_INFO'], 0, 4,
                                       rest_with_last=True)
        if env.get('QUERY_STRING'):
            path += '?' + env['QUERY_STRING']

        if 'swift.authorize' in env:
            resp = env['swift.authorize'](req)
            if resp:
                return resp(env, start_response)

        headers = req.headers
        self._calls.append((method, path, headers))
        self.swift_sources.append(env.get('swift.source'))

        try:
            resp_class, raw_headers, body = self._responses[(method, path)]
            headers = swob.HeaderKeyDict(raw_headers)
        except KeyError:
            # FIXME: suppress print state error for python3 compatibility.
            # pylint: disable-msg=E1601
            if (env.get('QUERY_STRING')
                    and (method, env['PATH_INFO']) in self._responses):
                resp_class, raw_headers, body = self._responses[
                    (method, env['PATH_INFO'])]
                headers = swob.HeaderKeyDict(raw_headers)
            elif method == 'HEAD' and ('GET', path) in self._responses:
                resp_class, raw_headers, _ = self._responses[('GET', path)]
                body = None
                headers = swob.HeaderKeyDict(raw_headers)
            elif method == 'GET' and obj and path in self.uploaded:
                resp_class = swob.HTTPOk
                headers, body = self.uploaded[path]
            else:
                print("Didn't find %r in allowed responses" %
                      ((method, path),))
                raise

        # simulate object PUT
        if method == 'PUT' and obj:
            input = env['wsgi.input'].read()
            etag = md5(input).hexdigest()
            headers.setdefault('Etag', etag)
            headers.setdefault('Content-Length', len(input))

            # keep it for subsequent GET requests later
            self.uploaded[path] = (deepcopy(headers), input)
            if "CONTENT_TYPE" in env:
                self.uploaded[path][0]['Content-Type'] = env["CONTENT_TYPE"]

        # range requests ought to work, but copies are special
        support_range_and_conditional = not (
            method == 'PUT' and
            'X-Copy-From' in req.headers and
            'Range' in req.headers)
        resp = resp_class(req=req, headers=headers, body=body,
                          conditional_response=support_range_and_conditional)
        return resp(env, start_response)

    @property
    def calls(self):
        return [(method, path) for method, path, headers in self._calls]

    @property
    def calls_with_headers(self):
        return self._calls

    @property
    def call_count(self):
        return len(self._calls)

    def register(self, method, path, response_class, headers, body):
        # assuming the path format like /v1/account/container/object
        resource_map = ['account', 'container', 'object']
        acos = filter(None, split_path(path, 0, 4, True)[1:])
        index = len(acos) - 1
        resource = resource_map[index]
        if (method, path) in self._responses:
            old_headers = self._responses[(method, path)][1]
            headers = headers.copy()
            for key, value in old_headers.iteritems():
                if is_sys_meta(resource, key) and key not in headers:
                    # keep old sysmeta for s3acl
                    headers.update({key: value})

        self._responses[(method, path)] = (response_class, headers, body)

    def register_unconditionally(self, method, path, response_class, headers,
                                 body):
        # register() keeps old sysmeta around, but
        # register_unconditionally() keeps nothing.
        self._responses[(method, path)] = (response_class, headers, body)

    def clear_calls(self):
        del self._calls[:]

class UnreadableInput(object):
    # Some clients will send neither a Content-Length nor a Transfer-Encoding
    # header, which will cause (some versions of?) eventlet to bomb out on
    # reads. This class helps us simulate that behavior.
    def __init__(self, test_case):
        self.calls = 0
        self.test_case = test_case

    def read(self, *a, **kw):
        self.calls += 1
        # Calling wsgi.input.read with neither a Content-Length nor
        # a Transfer-Encoding header will raise TypeError (See
        # https://bugs.launchpad.net/swift3/+bug/1593870 in detail)
        # This unreadable class emulates the behavior
        raise TypeError

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.test_case.assertEqual(0, self.calls)

redpajama_set_name: RedPajamaGithub


text:
#include "CCAutoreleasePool.h"
#include "ccMacros.h"

NS_CC_BEGIN

static PoolManager* s_pPoolManager = NULL;

AutoreleasePool::AutoreleasePool()
{
    _managedObjectArray = new Array();
    _managedObjectArray->initWithCapacity(150);
}

AutoreleasePool::~AutoreleasePool()
{
    CCLOGINFO("deallocing AutoreleasePool: %p", this);
    CC_SAFE_DELETE(_managedObjectArray);
}

void AutoreleasePool::addObject(Object* object)
{
    _managedObjectArray->addObject(object);

    CCASSERT(object->_reference > 1, "reference count should be greater than 1");
    ++(object->_autoReleaseCount);
    object->release(); // no ref count, in this case autorelease pool added.
}

void AutoreleasePool::removeObject(Object* object)
{
    for (unsigned int i = 0; i < object->_autoReleaseCount; ++i)
    {
        _managedObjectArray->removeObject(object, false);
    }
}

void AutoreleasePool::clear()
{
    if(_managedObjectArray->count() > 0)
    {
        //CCAutoreleasePool* pReleasePool;
#ifdef _DEBUG
        int nIndex = _managedObjectArray->count() - 1;
#endif

        Object* pObj = NULL;
        CCARRAY_FOREACH_REVERSE(_managedObjectArray, pObj)
        {
            if(!pObj)
                break;

            --(pObj->_autoReleaseCount);
            //(*it)->release();
            //delete (*it);
#ifdef _DEBUG
            nIndex--;
#endif
        }

        _managedObjectArray->removeAllObjects();
    }
}

//--------------------------------------------------------------------
//
// PoolManager
//
//--------------------------------------------------------------------

PoolManager* PoolManager::sharedPoolManager()
{
    if (s_pPoolManager == NULL)
    {
        s_pPoolManager = new PoolManager();
    }
    return s_pPoolManager;
}

void PoolManager::purgePoolManager()
{
    CC_SAFE_DELETE(s_pPoolManager);
}

PoolManager::PoolManager()
{
    _releasePoolStack = new Array();
    _releasePoolStack->initWithCapacity(150);
    _curReleasePool = 0;
}

PoolManager::~PoolManager()
{
    CCLOGINFO("deallocing PoolManager: %p", this);
    finalize();

     // we only release the last autorelease pool here
    _curReleasePool = 0;
    _releasePoolStack->removeObjectAtIndex(0);

    CC_SAFE_DELETE(_releasePoolStack);
}

void PoolManager::finalize()
{
    if(_releasePoolStack->count() > 0)
    {
        //CCAutoreleasePool* pReleasePool;
        Object* pObj = NULL;
        CCARRAY_FOREACH(_releasePoolStack, pObj)
        {
            if(!pObj)
                break;
            AutoreleasePool* pPool = static_cast<AutoreleasePool*>(pObj);
            pPool->clear();
        }
    }
}

void PoolManager::push()
{
    AutoreleasePool* pPool = new AutoreleasePool();       //ref = 1
    _curReleasePool = pPool;

    _releasePoolStack->addObject(pPool);                   //ref = 2

    pPool->release();                                       //ref = 1
}

void PoolManager::pop()
{
    if (! _curReleasePool)
    {
        return;
    }

    int nCount = _releasePoolStack->count();

    _curReleasePool->clear();

    if (nCount > 1)
    {
        _releasePoolStack->removeObjectAtIndex(nCount-1);

//         if(nCount > 1)
//         {
//             _curReleasePool = _releasePoolStack->getObjectAtIndex(nCount - 2);
//             return;
//         }
        _curReleasePool = (AutoreleasePool*)_releasePoolStack->getObjectAtIndex(nCount - 2);
    }

    /*_curReleasePool = NULL;*/
}

void PoolManager::removeObject(Object* object)
{
    CCASSERT(_curReleasePool, "current auto release pool should not be null");

    _curReleasePool->removeObject(object);
}

void PoolManager::addObject(Object* object)
{
    getCurReleasePool()->addObject(object);
}

AutoreleasePool* PoolManager::getCurReleasePool()
{
    if(!_curReleasePool)
    {
        push();
    }

    CCASSERT(_curReleasePool, "current auto release pool should not be null");

    return _curReleasePool;
}

NS_CC_END


text:
define(function () {
  var tooltip = (function () {
    var Tooltip = function ($node, options) {
      var self = this;

      this.init = function (options) {
        this.options = $.extend({}, {
          title: '',
          target: 'body',
          trigger: 'hover focus',
          placement: 'bottom'
        }, options);

        // create tooltip node
        this.$tooltip = $([
          '
',
          '
',
          '
',
          '
'
        ].join(''));

        // define event
        if (this.options.trigger !== 'manual') {
          this.options.trigger.split(' ').forEach(function (eventName) {
            if (eventName === 'hover') {
              $node.off('mouseenter mouseleave');

              $node.on('mouseenter', function () {
                self.show($node);
              }).on('mouseleave', function () {
                self.hide($node);
              });
            } else if (eventName === 'click')  {
              $node.on('click', function () {
                self.toggle($node);
              });
            } else if (eventName === 'focus') {
              $node.on('focus', function () {
                self.show($node);
              }).on('blur', function () {
                self.hide($node);
              });
            }
          });
        }
      };

      this.show = function () {
        var offset = $node.offset();

        var $tooltip = this.$tooltip;
        var title = this.options.title || $node.attr('title') || $node.data('title');
        var placement = this.options.placement || $node.data('placement');

        $tooltip.addClass(placement);
        $tooltip.addClass('in');
        $tooltip.find('.note-tooltip-content').text(title);
        $tooltip.appendTo(this.options.target);

        var nodeWidth = $node.outerWidth();
        var nodeHeight = $node.outerHeight();
        var tooltipWidth = $tooltip.outerWidth();
        var tooltipHeight = $tooltip.outerHeight();

        if (placement === 'bottom') {
          $tooltip.css({
            top: offset.top + nodeHeight,
            left: offset.left + (nodeWidth / 2 - tooltipWidth / 2)
          });
        } else if (placement === 'top') {
          $tooltip.css({
            top: offset.top - tooltipHeight,
            left: offset.left + (nodeWidth / 2 - tooltipWidth / 2)
          });
        } else if (placement === 'left') {
          $tooltip.css({
            top: offset.top + (nodeHeight / 2 - tooltipHeight / 2),
            left: offset.left - tooltipWidth
          });
        } else if (placement === 'right') {
          $tooltip.css({
            top: offset.top + (nodeHeight / 2 - tooltipHeight / 2),
            left: offset.left + nodeWidth
          });
        }
      };

      this.hide = function () {
        this.$tooltip.removeClass('in');
        this.$tooltip.remove();
      };

      this.toggle = function () {
        if (this.$tooltip.hasClass('in')) {
          this.hide();
        } else {
          this.show();
        }
      };

      this.init(options);
    };

    return {
      create: function ($node, options) {
        return new Tooltip($node, options);
      }
    };
  })();

  return tooltip;
});


text:
<?php

namespace DDSBase\Stdlib;

class Url {

	/**
	 *
	 * @return string
	 */
	public static function getBaseUrl() {
		$self = filter_input(INPUT_SERVER, "PHP_SELF");
		$self = substr($self, 0, strpos($self, "index.php"));
		$length = strlen($self);

		if ($length > 0 && $self[$length - 1] != "/")
			$self .= "/";

		return 'http://' . filter_input(INPUT_SERVER, "HTTP_HOST") . $self;
	}

}


text:
/*
Problem 1. Odd lines

Write a program that reads a text file and prints on the console its odd lines.
 */

using System;
using System.IO;
class PrintOddLines
{
    static void Main()
    {
        string filepath = @"..\..\file.txt";
        try
        {
            StreamReader fileReader = new StreamReader(filepath);
            using (fileReader)
            {
                int lineCnt = 0;
                string line = fileReader.ReadLine();
                while (line != null)
                {
                    lineCnt++;
                    if (lineCnt % 2 == 1)
                    {
                        Console.WriteLine("Line {0}: {1}", lineCnt, line);
                    }
                    line = fileReader.ReadLine();
                }
            }
        }
        catch (Exception)
        {
            Console.WriteLine("Error!");
        }
    }
}


text:
package hr.fer.zemris.java.tecaj_14.utility;

import hr.fer.zemris.java.tecaj_14.model.BlogComment;
import hr.fer.zemris.java.tecaj_14.model.BlogEntry;

/**
 * Provides some functions which generate HTML code.
 * @author karlo
 *
 */
public class JSPFunc {

	/**
	 * Formats data from the passed BlogEntry into HTML code that
	 * can be displayed for users to read.
	 * @param entry The entry to be formatted.
	 * @return String containing the HTML code.
	 */
	public static String formatEntryAsHTML(BlogEntry entry) {
		String entryContent = "
" + entry.getTitle() + "
"
  			+ "
" + HTTPSupport.escapeForHTMLBody(entry.getText()) + "
"
  			+ "
~Created on " + entry.getCreatedOn() + "
";
		if(entry.getLastModifiedOn() != null) {
			entryContent += "~Last modified on " + entry.getLastModifiedOn()
							+ "
";
		}
		return entryContent;
	}

	/**
	 * Formats the comments associated with the provided BlogEntry
	 * into HTML code that can be displayed for users to read.
	 * @param entry The entry which comments are to be displayed.
	 * @return String containing the HTML code.
	 */
	public static String formatEntryCommentsAsHTML(BlogEntry entry) {
		String comments = "
Comments (" +  entry.getComments().size() +"):
";
		for(BlogComment comment : entry.getComments()) {
			String commentContent = "
"
					+ HTTPSupport.escapeForHTMLBody(comment.getMessage())
					+ " -- posted on " + comment.getPostedOn()
					+ " by "
					+ HTTPSupport.escapeForHTMLBody(comment.getUsersEMail())
					+ "
";
			comments += commentContent;
		}
		if(entry.getComments().isEmpty()) {
			return "Nobody has commented on this entry yet!
";
		}
		return comments;
	}
}


text:
require File.expand_path("#{File.dirname(__FILE__)}/../../../test_helper")

class Piston::Svn::TestSvnRevisionCheckout < Piston::TestCase
  def setup
    super
    @wcdir = Pathname.new("tmp/wc")
    @repos = mock("repository")
    @repos.stubs(:url).returns("http://a.repos.com/trunk")
  end

  def test_head_checkout_to_path
    rev = new_revision("HEAD")
    rev.expects(:svn).with(:checkout, "--revision", "HEAD", @repos.url, @wcdir).returns("Checked out revision 1322.")
    rev.checkout_to(@wcdir)
    assert_equal 1322, rev.revision
  end

  def test_specific_revision_checkout_to_path
    rev = new_revision('1231')
    rev.expects(:svn).with(:checkout, "--revision", '1231', @repos.url, @wcdir).returns("Checked out revision 1231.")
    rev.checkout_to(@wcdir)
  end

  private
  def new_revision(revision)
    Piston::Svn::Revision.new(@repos, revision)
  end
end


text: alter table admiral default character set utf8mb4;


text:
/**
 * A basic animal generator used to test different cases in an environment
 */

function mergeRecursiveSet(master, slave) {
    for (var i in master) {
        if (slave.hasOwnProperty(i)) {
            if (slave[i].isInteger()) {
                master[i] += slave[i];
            } else {
                master[i] = slave[i];
            }
        }
    }
}

const Animal = {arms: 0, legs: 0, name: ''};

export function getAnimal(config) {
    return Object.assign({}, Animal, config);
}

export function getBiped(name) {
    return getAnimal({arms: 2, legs: 2, name: name});
}

export function getQuadroped(name) {
    return getAnimal({arms: 0, legs: 4, name: name});
}

/**
 * Function to test with recursivity
 *
 * @param {integer} uglifier number of iterations on function
 * @param {integer} config   starting configs
 *
 * @return {[type]}
 */
export function getMonster(uglifier, config) {
    if (!config) {
        config = getAnimal(mergeRecursiveSet(Object.assign(getBiped('Dave'), getQuadroped('Steve'))));
    }

    if (uglifier) {
        config = getMonster(uglifier - 1, config);
    }

    return config;
}


text:
<?php

/**
 * Dedicated text parser to handle parsing content submitted
 * to a discussion.
 *
 * This parser handles converting URL's in the text to links,
 * unless they are links to images (in which case they generate
 * an img tag) or youtube/vimeo (in which case they generate
 * an embed code).
 *
 * @author Mo <morven@ilateral.co.uk>
 * @package discussions
 */
class DiscussionContentParser extends TextParser
{

    /**
     * These classes are added to each image tag
     * on generation
     *
     * @config
     * @var array
     */
    private static $image_classes = array(
        "img-responsive",
        "leftAlone"
    );

    /**
     * The physical width to set on all elements (such as img
     * tags and video embeds). This will result in a width="xx"
     * attribute being added to the element.
     *
     * @config
     * @var integer
     */
    private static $embed_width = 640;

    /**
     * The physical height to set on all elements (such as img
     * tags and video embeds). This will result in a height="xx"
     * attribute being added to the element.
     *
     * @config
     * @var integer
     */
    private static $embed_height = 360;

    /**
     * These classes are added to a div that wraps
     * each youtube iframe
     *
     * @config
     * @var array
     */
    private static $youtube_classes = array(
        "video-embed",
        "embed-responsive",
        "embed-responsive-16by9"
    );

    /**
     * These classes are added to a div that wraps
     * each youtube iframe
     *
     * @config
     * @var array
     */
    private static $vimeo_classes = array(
        "video-embed",
        "embed-responsive",
        "embed-responsive-16by9"
    );

    /**
     * Run this content through various checks to render common HTML tags.
     * Many thanks for the following stack overflow posts for these:
     *
     * https://stackoverflow.com/questions/1960461/convert-plain-text-urls-into-html-hyperlinks-in-php
     * https://stackoverflow.com/questions/910912/extract-urls-from-text-in-php
     * https://stackoverflow.com/questions/3392993/php-regex-to-get-youtube-video-id
     * https://stackoverflow.com/questions/10488943/easy-way-to-get-vimeo-id-from-a-vimeo-url
     *
     * @return string
     */
    public function parse()
    {
        $regex = '~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?<![\.,:])~i';
        $file_categories = Config::inst()->get("File", "app_categories");

        preg_match_all($regex, $this->content, $matches);
        $urls = $matches[0];

        // Loop found URLs and manipulate
        foreach($urls as $url)
        {
            $ext = pathinfo($url, PATHINFO_EXTENSION);

            if ($ext && in_array($ext, $file_categories["image"])) {
                if (is_array($this->config()->image_classes)) {
                    $classes = implode(" ", $this->config()->image_classes);
                } else {
                    $classes = "";
                }

                $this->content = str_replace(
                    $url,
                    '',
                    $this->content
                );
            } elseif (strpos($url, "youtube") !== false || strpos($url, "youtu.be") !== false) {
                $this->content = str_replace(
                    $url,
                    $this->embedYoutube(
                        $url,
                        $this->config()->embed_width,
                        $this->config()->embed_height
                    ),
                    $this->content
                );
            } elseif (strpos($url, "vimeo") !== false) {
                $this->content = str_replace(
                    $url,
                    $this->embedVimeo(
                        $url,
                        $this->config()->embed_width,
                        $this->config()->embed_height
                    ),
                    $this->content
                );
            } else {
                $this->content = str_replace(
                    $url,
                    '' . $url . '',
                    $this->content
                );
            }
        }

        return nl2br($this->content);
    }

    /**
     * Get youtube video ID from content
     *
     * @param $url The share link to extract the ID from
     * @return string
     */
    protected function getYouTubeID($url) {
        preg_match(
            "/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/",
            $url,
            $matches
        );

        if(isset($matches[1])) {
            return $matches[1];
        } else {
            return "";
        }
    }

    /**
     * Get vimeo video ID from content
     *
     * @param $url The share link to extract the ID from
     * @return string
     */
    protected function getVimeoID($url) {
        preg_match(
            "/(https?:\/\/)?(www\.)?(player\.)?vimeo\.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/",
            $url,
            $matches
        );

        if(isset($matches[5])) {
            return $matches[5];
        } else {
            return "";
        }
    }

    protected function embedYoutube($url, $width, $height)
    {
        if (is_array($this->config()->youtube_classes)) {
            $classes = implode(" ", $this->config()->youtube_classes);
        } else {
            $classes = "";
        }

        $embed = '';
        $embed .= 'getYouTubeID($url) .'"';
        $embed .= 'width="' . $width . '" height="' . $height . '" ';
        $embed .= 'allowfullscreen>';
        return $embed;
    }

    protected function embedVimeo($url, $width, $height)
    {
        if (is_array($this->config()->vimeo_classes)) {
            $classes = implode(" ", $this->config()->vimeo_classes);
        } else {
            $classes = "";
        }

        $embed = '';
        $embed .= 'getVimeoID($url) . '" ';
        $embed .= 'width="' . $width . '" height="' . $height . '" ';
        $embed .= 'allowfullscreen>';
        return $embed;
    }

}


text:
import React, { Component } from 'react';
import './styles/index.css';
import './styles/font-awesome.min.css';
import classic from './resources/images/classic.jpg';
import cinnamon from './resources/images/cinnamon.jpg';
import cupcakish from './resources/images/cupcakish.jpg';

class Home extends Component {
    render() {
        return (

Our signature classic cinnamon rolls are the favorites of every Pittsburgher out there! We use top quality ingredients, importing the cinnamons from Indonesia. The classic recipe has been refined for decades and we trust that no one can resist the taste of our rolls. As if.

We have got a wide selection of different flavours for you to choose from. Can't find one you like or got ideas for a new flavour? Tell us! We'll be happy to custom bake one for you... at a premium of course.

We ship fresh cinnamon rolls across the whole of the United States. However, we cannot guarantee that the cinnamon rolls will still be edible upon arrival. Additionally, please refer to the delivery page for more details about time frame as well as costs.

        );
    }
}

export default Home;


text:
var Services = (function() {
  return Backbone.Collection.extend({
    model: Service,
    url: 'http://sensorweb.demo.52north.org/sensorwebclient-webapp-stable/api/v0/services.json',
  });
})();


text:
var COLOR = 'color',
    POSITIONS = 'positions',
    DIMENSIONS = 'dimensions',
    SHADOW = 'shadow',
    ANGLE = 'angle',
    ALPHA = 'alpha',
    PX = 'px';

module.exports = {
    // Color properties
    color: COLOR,
    backgroundColor: COLOR,
    outlineColor: COLOR,
    fill: COLOR,
    stroke: COLOR,
    // Border
    borderColor: COLOR,
    borderTopColor: COLOR,
    borderRightColor: COLOR,
    borderBottomColor: COLOR,
    borderLeftColor: COLOR,
    borderRadius: PX,
    // Dimensions
    margin: DIMENSIONS,
    padding: DIMENSIONS,
    width: PX,
    height: PX,
    // Positions
    backgroundPosition: POSITIONS,
    perspectiveOrigin: POSITIONS,
    transformOrigin: POSITIONS,
    // Shadows
    textShadow: SHADOW,
    boxShadow: SHADOW,
    // Transform properties
    rotate: ANGLE,
    rotateX: ANGLE,
    rotateY: ANGLE,
    rotateZ: ANGLE,
    skewX: ANGLE,
    skewY: ANGLE,
    translateX: PX,
    translateY: PX,
    translateZ: PX,
    perspective: PX,
    opacity: ALPHA
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.smartdata</groupId>
        <artifactId>smartdata-project</artifactId>
        <version>1.5.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>smart-common</artifactId>
    <version>1.5.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.smartdata</groupId>
            <artifactId>smart-metrics</artifactId>
            <version>1.5.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.kerby</groupId>
            <artifactId>kerb-simplekdc</artifactId>
            <version>${kerby.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/lib</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.os72</groupId>
                <artifactId>protoc-jar-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <protocVersion>${protobuf.version}</protocVersion>
                            <inputDirectories>
                                <include>${basedir}/src/main/proto</include>
                            </inputDirectories>
                            <outputTargets>
                                <outputTarget>
                                    <type>java</type>
                                    <addSources>none</addSources>
                                    <outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory>
                                </outputTarget>
                            </outputTargets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.1.1</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>org.smartdata.versioninfo.VersionInfoWrite</mainClass>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>6.19</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <configLocation>../supports/tools/checkstyle.xml</configLocation>
                    <suppressionsLocation>../supports/tools/suppressions.xml</suppressionsLocation>
                    <consoleOutput>true</consoleOutput>
                    <failOnViolation>true</failOnViolation>
                    <includeResources>false</includeResources>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                </configuration>
                <executions>
                    <!--
                      Execute checkstyle after compilation but before tests.

                      This ensures that any parsing or type checking errors are from
                      javac, so they look as expected. Beyond that, we want to
                      fail as early as possible.
                    -->
                    <execution>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
==============
dhcp_agent.ini
==============

The ``dhcp_agent.ini`` file contains configuration for the DHCP agent.

.. literalinclude:: ../../samples/neutron/dhcp_agent.ini.sample
   :language: ini


text:
"""Domain-randomization for simulations."""

from typing import Iterable, Optional, Sequence, Tuple, Union

import numpy as np

from robel.robot_env import RobotEnv

# Define types.
Bound = Union[float, Sequence[float]]
Range = Tuple[Bound, Bound]

class SimRandomizer:
    """Randomizes simulation properties."""

    def __init__(self, env: RobotEnv):
        """Initializes a new randomizer.

        Args:
            env: The environment to randomize.
        """
        self.env = env
        self.sim_scene = env.sim_scene
        self.model = self.sim_scene.model
        self.orig_model = self.sim_scene.copy_model()

    @property
    def rand(self) -> np.random.RandomState:
        """Returns the random state."""
        return self.env.np_random

    def randomize_global(self,
                         total_mass_range: Optional[Range] = None,
                         height_field_range: Optional[Range] = None):
        """Randomizes global options in the scene.

        Args:
            total_mass_range: A range of mass values to which all bodies and
                inertias should be scaled to achieve.
            height_field_range: A range of values to generate a noise map
                for the height field.
        """
        if total_mass_range is not None:
            self.sim_scene.get_mjlib().mj_setTotalmass(
                self.sim_scene.get_handle(self.model),
                self.rand.uniform(*total_mass_range))

        if height_field_range is not None:
            self.model.hfield_data[:] = self.rand.uniform(
                *height_field_range, size=np.shape(self.model.hfield_data))

    def randomize_bodies(self,
                         names: Optional[Iterable[str]] = None,
                         all_same: bool = False,
                         position_perturb_range: Optional[Range] = None):
        """Randomizes the bodies in the scene.

        Args:
            names: The body names to randomize. If this is not provided, all
                bodies are randomized.
            all_same: If True, the bodies are assigned the same random value.
            position_perturb_range: A range to perturb the position of the body
                relative to its original position.
        """
        if names is None:
            body_ids = list(range(self.model.nbody))
        else:
            body_ids = [self.model.body_name2id(name) for name in names]
            body_ids = sorted(set(body_ids))
        num_bodies = len(body_ids)

        # Randomize the position relative to the original position.
        if position_perturb_range is not None:
            original_pos = self.orig_model.body_pos[body_ids]
            self.model.body_pos[body_ids] = original_pos + self.rand.uniform(
                *position_perturb_range,
                size=(3,) if all_same else (num_bodies, 3))

    def randomize_geoms(self,
                        names: Optional[Iterable[str]] = None,
                        parent_body_names: Optional[Iterable[str]] = None,
                        all_same: bool = False,
                        size_perturb_range: Optional[Range] = None,
                        color_range: Optional[Range] = None,
                        friction_slide_range: Optional[Range] = None,
                        friction_spin_range: Optional[Range] = None,
                        friction_roll_range: Optional[Range] = None):
        """Randomizes the geoms in the scene.

        Args:
            names: The geom names to randomize. If this nor `parent_body_names`
                is provided, all geoms are randomized.
            parent_body_names: A list of body names whose child geoms should be
                randomized.
            all_same: If True, the geoms are assigned the same random value.
            size_perturb_range: A range to perturb the size of the geom relative
                to its original size.
            color_range: A color range to assign an RGB color to the geom.
            friction_slide_range: The sliding friction that acts along both axes
                of the tangent plane.
            friction_spin_range: The torsional friction acting around the
                contact normal.
            friction_roll_range: The rolling friction acting around both axes of
                the tangent plane.
        """
        if names is None and parent_body_names is None:
            # Address all geoms if no names are given.
            geom_ids = list(range(self.model.ngeom))
        else:
            geom_ids = []
            if names is not None:
                geom_ids.extend(self.model.geom_name2id(name) for name in names)

            # Add child geoms of parent bodies.
            if parent_body_names is not None:
                for name in parent_body_names:
                    body_id = self.model.body_name2id(name)
                    geom_id_start = self.model.body_geomadr[body_id]
                    for i in range(self.model.body_geomnum[body_id]):
                        geom_ids.append(geom_id_start + i)

            geom_ids = sorted(set(geom_ids))
        num_geoms = len(geom_ids)

        # Randomize the size of the geoms relative to the original size.
        if size_perturb_range is not None:
            original_size = self.orig_model.geom_size[geom_ids]
            self.model.geom_size[geom_ids] = original_size + self.rand.uniform(
                *size_perturb_range, size=(3,) if all_same else (num_geoms, 3))

        # Randomize the color of the geoms.
        if color_range is not None:
            self.model.geom_rgba[geom_ids, :3] = self.rand.uniform(
                *color_range, size=(3,) if all_same else (num_geoms, 3))

        # Randomize the friction parameters.
        if friction_slide_range is not None:
            self.model.geom_friction[geom_ids, 0] = self.rand.uniform(
                *friction_slide_range, size=1 if all_same else num_geoms)

        if friction_spin_range is not None:
            self.model.geom_friction[geom_ids, 1] = self.rand.uniform(
                *friction_spin_range, size=1 if all_same else num_geoms)

        if friction_roll_range is not None:
            self.model.geom_friction[geom_ids, 2] = self.rand.uniform(
                *friction_roll_range, size=1 if all_same else num_geoms)

    def randomize_dofs(self,
                       indices: Optional[Iterable[int]] = None,
                       all_same: bool = False,
                       damping_range: Optional[Range] = None,
                       friction_loss_range: Optional[Range] = None):
        """Randomizes the DoFs in the scene.

        Args:
            indices: The DoF indices to randomize. If not provided, randomizes
                all DoFs.
            all_same: If True, the DoFs are assigned the same random value.
            damping_range: The range to assign a damping for the DoF.
            friction_loss_range: The range to assign a friction loss for the
                DoF.
        """
        if indices is None:
            dof_ids = list(range(self.model.nv))
        else:
            nv = self.model.nv
            assert all(-nv <= i < nv for i in indices), \
                'All DoF indices must be in [-{}, {}]'.format(nv, nv-1)
            dof_ids = sorted(set(indices))
        num_dofs = len(dof_ids)

        # Randomize the damping for each DoF.
        if damping_range is not None:
            self.model.dof_damping[dof_ids] = self.rand.uniform(
                *damping_range, size=1 if all_same else num_dofs)

        # Randomize the friction loss for each DoF.
        if friction_loss_range is not None:
            self.model.dof_frictionloss[dof_ids] = self.rand.uniform(
                *friction_loss_range, size=1 if all_same else num_dofs)

    def randomize_actuators(self,
                            indices: Optional[Iterable[int]] = None,
                            all_same: bool = False,
                            kp_range: Optional[Range] = None,
                            kv_range: Optional[Range] = None):
        """Randomizes the actuators in the scene.

        Args:
            indices: The actuator indices to randomize. If not provided,
                randomizes all actuators.
            all_same: If True, the actuators are assigned the same random value.
            kp_range: The position feedback gain range for the actuators.
                This assumes position control actuators.
            kv_range: The velocity feedback gain range for the actuators.
                This assumes velocity control actuators.
        """
        if indices is None:
            act_ids = list(range(self.model.nu))
        else:
            nu = self.model.nu
            assert all(-nu <= i < nu for i in indices), \
                'All actuator indices must be in [-{}, {}]'.format(nu, nu-1)
            act_ids = sorted(set(indices))
        num_acts = len(act_ids)

        # NOTE: For the values below, refer to:
        # http://mujoco.org/book/XMLreference.html#actuator

        # Randomize the Kp for each actuator.
        if kp_range is not None:
            kp = self.rand.uniform(*kp_range, size=1 if all_same else num_acts)
            self.model.actuator_gainprm[:, 0] = kp
            self.model.actuator_biasprm[:, 1] = -kp

        # Randomize the Kv for each actuator.
        if kv_range is not None:
            kv = self.rand.uniform(*kv_range, size=1 if all_same else num_acts)
            self.model.actuator_gainprm[:, 0] = kv
            self.model.actuator_biasprm[:, 2] = -kv


text:
using CefSharp.JavascriptBinding;

namespace CefSharp.Internals
{
    public sealed class MethodInvocationResult
    {
        public int BrowserId { get; set; }

        public long? CallbackId { get; set; }

        public long FrameId { get; set; }

        public string Message { get; set; }

        public bool Success { get; set; }

        public object Result { get; set; }

        public IJavascriptNameConverter NameConverter { get; set; }
    }
}


text:
<?php

defined('_JEXEC') or die;

/**
 * Joomla! P3P Header Plugin.
 *
 * @since  1.6
 * @deprecate  4.0  Obsolete
 */
class PlgSystemP3p extends JPlugin
{
	/**
	 * After initialise.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 * @deprecate  4.0  Obsolete
	 */
	public function onAfterInitialise()
	{
		// Get the header.
		$header = $this->params->get('header', 'NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM');
		$header = trim($header);

		// Bail out on empty header (why would anyone do that?!).
		if ( empty($header) )
		{
			return;
		}

		// Replace any existing P3P headers in the response.
		JFactory::getApplication()->setHeader('P3P', 'CP="' . $header . '"', true);
	}
}


text:
from swgpy.object import *

def create(kernel):
	result = Tangible()

	result.template = "object/tangible/ship/components/armor/shared_arm_kse_heavy_durasteel.iff"
	result.attribute_template_id = 8
	result.stfName("space/space_item","arm_kse_heavy_durasteel_n")

	#### BEGIN MODIFICATIONS ####
	####  END MODIFICATIONS  ####

	return result


text:
            <?php _trans('email'); ?>

                            <?php _trans('email_pdf_attachment'); ?>

                        <select name="settings[email_pdf_attachment]" id="settings[email_pdf_attachment]"
                                class="form-control simple-select">
                            <option value="0"><?php _trans('no'); ?></option>
                            <option value="1" <?php check_select(get_setting('email_pdf_attachment'), '1'); ?>>
                                <?php _trans('yes'); ?>
                            </option>
                        </select>

                            <?php _trans('email_send_method'); ?>

                        <select name="settings[email_send_method]" id="email_send_method"
                                class="form-control simple-select">
                            <option value=""><?php _trans('none'); ?></option>
                            <option value="phpmail" <?php check_select(get_setting('email_send_method'), 'phpmail'); ?>>
                                <?php _trans('email_send_method_phpmail'); ?>
                            </option>
                            <option value="sendmail" <?php check_select(get_setting('email_send_method'), 'sendmail'); ?>>
                                <?php _trans('email_send_method_sendmail'); ?>
                            </option>
                            <option value="smtp" <?php check_select(get_setting('email_send_method'), 'smtp'); ?>>
                                <?php _trans('email_send_method_smtp'); ?>
                            </option>
                        </select>

                                <?php _trans('smtp_server_address'); ?>

                            <input type="text" name="settings[smtp_server_address]" id="settings[smtp_server_address]"
                                   class="form-control"
                                   value="<?php echo get_setting('smtp_server_address', '', true); ?>">

                                <?php _trans('smtp_requires_authentication'); ?>

                            <select name="settings[smtp_authentication]" id="settings[smtp_authentication]"
                                    class="form-control simple-select">
                                <option value="0">
                                    <?php _trans('no'); ?>
                                </option>
                                <option value="1" <?php check_select(get_setting('smtp_authentication'), '1'); ?>>
                                    <?php _trans('yes'); ?>
                                </option>
                            </select>

                                <?php _trans('smtp_username'); ?>

                            <input type="text" name="settings[smtp_username]" id="settings[smtp_username]"
                                   class="form-control"
                                   value="<?php echo get_setting('smtp_username', '', true); ?>">

                                <?php _trans('smtp_password'); ?>

                            <input type="password" id="smtp_password" class="form-control"
                                   name="settings[smtp_password]"
                                   value="<?php echo $this->crypt->decode(get_setting('settings[smtp_password]')); ?>">
                            <input type="hidden" name="settings[smtp_password_field_is_password]" value="1">

                                    <?php _trans('smtp_port'); ?>

                                <input type="number" name="settings[smtp_port]" id="settings[smtp_port]"
                                       class="form-control"
                                       value="<?php echo get_setting('smtp_port'); ?>">

                                <?php _trans('smtp_security'); ?>

                            <select name="settings[smtp_security]" id="settings[smtp_security]"
                                    class="form-control simple-select">
                                <option value=""><?php _trans('none'); ?></option>
                                <option value="ssl" <?php check_select(get_setting('smtp_security'), 'ssl'); ?>>
                                    <?php _trans('smtp_ssl'); ?>
                                </option>
                                <option value="tls" <?php check_select(get_setting('smtp_security'), 'tls'); ?>>
                                    <?php _trans('smtp_tls'); ?>
                                </option>
                            </select>

                                <?php _trans('smtp_verify_certs'); ?>

                            <select name="settings[smtp_verify_certs]" id="settings[smtp_verify_certs]"
                                    class="form-control simple-select">
                                <option value="1"><?php _trans('yes'); ?></option>
                                <option value="0" <?php check_select(get_setting('smtp_verify_certs'), '0'); ?>>
                                    <?php _trans('no'); ?>
                                </option>
                            </select>


text:
require 'serverspec'

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

describe command('/bin/true') do
  it { should return_exit_status 0 }
end


text:
layout: default
title: "Puppet Server: Puppet Server vs. Apache/Passenger Puppet Master"
canonical: "/puppetserver/latest/puppetserver_vs_passenger.html"
---

Puppet Server is intended to function as a drop-in replacement for the existing
Apache/Passenger Puppet master stack. However, there are a handful of differences with Puppet Server due to changes in the underlying architecture.

This page details things that are intentionally different between the two
applications. You may also be interested in the [Known Issues](./known_issues.markdown)
page, where we've listed a handful of issues that we expect to fix in future releases.

## Service Name

Since the Apache/Passenger master runs under, well, Apache, the name of the service
that you use to start and stop the master is `httpd` (or `apache2`, depending
on your platform). With Puppet Server, the service name is `puppetserver`. So
to start and stop the service, you'll use `puppetserver` commands, such as `service puppetserver restart`.

## Config Files

Puppet Server honors almost all settings in `puppet.conf` and should pick them
up automatically. However, for some tasks, such as configuring the webserver or an external Certificate Authority, we have introduced new Puppet Server-specific configuration files and settings. These new files and settings are detailed on the [Puppet Server Configuration](./configuration.markdown) page.

## Gems

If you have server-side Ruby code in your modules, Puppet Server will run it via
JRuby. Generally speaking, this only affects custom parser functions and report
processors. For the vast majority of cases, this shouldn't pose any problems, as JRuby is highly compatible with vanilla Ruby.

## Ruby Compatibility For Extensions

Ruby extension code in your modules needs to run under both Ruby 1.9 and Ruby 2.1. This is because Puppet Server runs Puppet functions and custom resource types under JRuby 1.7 (which is a Ruby 1.9-compatible interpreter), and the official `puppet-agent` releases run custom facts and types/providers under MRI Ruby 2.1.

## Installing And Removing Gems

We isolate the Ruby load paths that are accessible to Puppet Server's
JRuby interpreter, so that it doesn't load any gems or other code that
you have installed on your system Ruby. If you want Puppet Server to load additional gems, use the Puppet Server-specific `gem` command to install them. For more details on how Puppet Server interacts with gems, see the [Puppet Server and Gems](./gems.markdown)
page.

## Startup Time

Because Puppet Server runs on the JVM, it takes a bit longer than the Apache/Passenger stack to start and get ready to accept HTTP connections.

Overall, Puppet Server performance is significantly better than a Puppet master running on the Apache/Passenger stack, but the initial startup is definitely slower.

## External CA Configuration

You can configure Puppet Server for use with an external CA instead of the
internal Puppet CA. You'll do this a little differently for Puppet Server than you would for an Apache/Passenger configuration. See the
[External CA Configuration](./external_ca_configuration.markdown) page for
more details.

## External SSL Termination

See [External SSL termination](external_ssl_termination.markdown) for details on
how to get this working in Puppet Server.

## Log Levels

The Passenger Puppet master used Puppet's logging, which has 8 levels and
defaults to the 'notice' log level. Puppet Server uses logback, which has 5
levels and defaults to 'info'. Puppet Server also combines the 'notice' and
'info' levels from Puppet and logs them at the 'info' level to logback.
Because of this mismatch in levels, log events that would not be logged by
default in Passenger will be logged in Puppet Server. In particular, anything
logged using `Puppet.info` will be logged in Puppet Server and would not have
been under Passenger. See
[Puppet Server Configuration Files: logback.xml](./config_file_logbackxml.md)
for more information, as well as instructions on how to set log levels in Puppet Server.


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Helminthosporium mystrosporioides Preuss

### Remarks
null


text:
using Esri.ArcGISRuntime.Controls;
using System;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;

namespace ArcGISRuntime.Samples.Desktop.Samples
{
	/// <summary>
	/// This page contains instructions for accessing the Security samples
	/// </summary>
	/// <title>Security samples</title>
	/// <category>Security</category>
	public partial class SecuritySamples : UserControl
	{
		public SecuritySamples()
		{
			InitializeComponent();
		}

		private void GitHubSiteLink_Click(object sender, RoutedEventArgs e)
		{
			Process.Start(new ProcessStartInfo("https://github.com/Esri/arcgis-runtime-samples-dotnet/tree/master/src/Desktop/ArcGISRuntimeSamplesDesktop/Samples/Security"));
		}
	}
}


text:
.class public Lcom/baidu/android/vad/JNI;
.super Ljava/lang/Object;
.source "JNI.java"

# static fields
.field public static final MFE_ERROR_UNKNOWN:I = -0x64

.field public static final MFE_FORMAT_ADPCM_8K:I = 0x2

.field public static final MFE_FORMAT_AMR_16K:I = 0x7

.field public static final MFE_FORMAT_BV32_16K:I = 0x4

.field public static final MFE_FORMAT_BV32_8K:I = 0x0

.field public static final MFE_FORMAT_PCM_16K:I = 0x5

.field public static final MFE_FORMAT_PCM_8K:I = 0x1

.field public static final MFE_MEMALLOC_ERR:I = -0x6b

.field public static final MFE_PARAMRANGE_ERR:I = -0x6d

.field public static final MFE_POINTER_ERR:I = -0x67

.field public static final MFE_SEND_TOOMORE_DATA_ONCE:I = -0x76

.field public static final MFE_STATE_ERR:I = -0x66

.field public static final MFE_SUCCESS:I = 0x0

.field public static final MFE_VAD_INIT_ERROR:I = -0x78

.field public static final PARAM_ENERGY_THRESHOLD_EP:I = 0x7

.field public static final PARAM_ENERGY_THRESHOLD_SP:I = 0x6

.field public static final PARAM_MAX_SP_DURATION:I = 0x2

.field public static final PARAM_MAX_SP_PAUSE:I = 0x3

.field public static final PARAM_MAX_WAIT_DURATION:I = 0x1

.field public static final PARAM_MIN_SP_DURATION:I = 0x4

.field public static final PARAM_OFFSET:I = 0x8

.field public static final PARAM_SLEEP_TIMEOUT:I = 0x5

.field public static final PARAM_SPEECHIN_THRESHOLD_BIAS:I = 0xb

.field public static final PARAM_SPEECHOUT_THRESHOLD_BIAS:I = 0xc

.field public static final PARAM_SPEECH_END:I = 0x9

.field public static final PARAM_SPEECH_MODE:I = 0xa

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 197
    const-string v0, "voiceSpeechVad"

    invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V

    .line 198
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 6
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public native mfeClose()I
.end method

.method public native mfeDetect()I
.end method

.method public native mfeEnableNoiseDetection(Z)I
.end method

.method public native mfeExit()I
.end method

.method public native mfeGetCallbackData([BI)I
.end method

.method public native mfeGetParam(I)I
.end method

.method public native mfeInit(II)I
.end method

.method public native mfeOpen()I
.end method

.method public native mfeSendData([SI)I
.end method

.method public native mfeSetLogLevel(I)V
.end method

.method public native mfeSetParam(II)I
.end method

.method public native mfeStart()I
.end method

.method public native mfeStop()I
.end method


text:
Started at https://github.com/TheAlgorithms/Python/issues/1831

* D-Wave: https://www.dwavesys.com and https://github.com/dwavesystems
* Google: https://research.google/teams/applied-science/quantum
* IBM: https://qiskit.org and https://github.com/Qiskit
* Rigetti: https://rigetti.com and https://github.com/rigetti

## IBM Qiskit
- Start using by installing `pip install qiskit`, refer the [docs](https://qiskit.org/documentation/install.html) for more info.
- Tutorials & References
  - https://github.com/Qiskit/qiskit-tutorials
  - https://quantum-computing.ibm.com/docs/iql/first-circuit
  - https://medium.com/qiskit/how-to-program-a-quantum-computer-982a9329ed02


text:
@interface BMHorizontalCTransition : NSObject <BMExtendableContinuousPageTransition>

@end


text:
<?php

namespace Rimed\BlogBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class CategoryFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('enabled', 'checkbox', array('label' => 'Habilitado:', 'required' => false));
        $builder->add('name', 'text', array('label' => 'Nombre:'));
        $builder->add('description', 'text', array('label' => 'Descripción:'));
    }

    public function getDefaultOptions(array $options)
    {
        return array(
            'data_class' => 'Rimed\\BlogBundle\\Entity\\BaseCategory',
        );
    }

    public function getName()
    {
        return "CategoryFormType";
    }
}


text:
<?php

/* ROAppBundle:Accueil:rightMenu.html.twig */
class __TwigTemplate_0764413764e73d13e18081993155aeeaa172e7999f44165f750f8c2aab3dc0cd extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 2
        echo "
Liens

";
        // line 3
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["pages"]) ? $context["pages"] : $this->getContext($context, "pages")));
        foreach ($context['_seq'] as $context["_key"] => $context["page"]) {
            // line 4
            echo "    env->getExtension('routing')->getPath($this->getAttribute((isset($context["page"]) ? $context["page"] : $this->getContext($context, "page")), "path"));
            echo "\" class=\"menubutton\">";
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context["page"]) ? $context["page"] : $this->getContext($context, "page")), "title"), "html", null, true);
            echo "
";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['page'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
    }

    public function getTemplateName()
    {
        return "ROAppBundle:Accueil:rightMenu.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  26 => 4,  22 => 3,  19 => 2,);
    }
}


text:
import 'angular2-meteor-polyfills';

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { Meteor } from "meteor/meteor";
import { AppModule } from './imports/app/app.module';

enableProdMode();

Meteor.startup(() => {
  platformBrowserDynamic().bootstrapModule(AppModule);
});


text:
module Azure end
module Azure::AzureStackHCI end
module Azure::AzureStackHCI::Profiles end
module Azure::AzureStackHCI::Profiles::Latest end


text:
import * as React from 'react'
import * as Kb from '../../common-adapters'
import * as Types from '../../constants/types/fs'
import * as Constants from '../../constants/fs'
import openUrl from '../../util/open-url'
import * as FsGen from '../../actions/fs-gen'
import * as Container from '../../util/container'

type Props = {
  path: Types.Path
}

const getTlfName = (parsedPath: Types.ParsedPath): string => {
  if (parsedPath.kind === Types.PathKind.Root || parsedPath.kind === Types.PathKind.TlfList) {
    return ''
  }
  return parsedPath.tlfName
}

const PublicBanner = ({path}: Props) => {
  const isWritable = Container.useSelector(state => Constants.getPathItem(state.fs.pathItems, path).writable)
  const lastPublicBannerClosedTlf = Container.useSelector(state => state.fs.lastPublicBannerClosedTlf)
  const you = Container.useSelector(state => state.config.username)

  const dispatch = Container.useDispatch()
  const setLastClosed = () => dispatch(FsGen.createSetLastPublicBannerClosedTlf({tlf: tlfName}))

  const parsedPath = Constants.parsePath(path)
  const tlfName = getTlfName(parsedPath)

  // If we're showing the banner for a new TLF, clear the closed state
  React.useEffect(() => {
    if (lastPublicBannerClosedTlf !== '' && lastPublicBannerClosedTlf !== tlfName) {
      dispatch(FsGen.createSetLastPublicBannerClosedTlf({tlf: ''}))
    }
  }, [dispatch, tlfName, lastPublicBannerClosedTlf])

  if (parsedPath.kind !== Types.PathKind.GroupTlf && parsedPath.kind !== Types.PathKind.InGroupTlf) {
    return null
  }

  const isPublic = parsedPath.tlfType === Types.TlfType.Public
  const closedThisBannerLast = lastPublicBannerClosedTlf === tlfName

  if (!isWritable || !isPublic || closedThisBannerLast) {
    return null
  }
  const url = `https://keybase.pub/${parsedPath.tlfName}`
  return (
    <Kb.Banner color="yellow" onClose={setLastClosed}>
      <Kb.BannerParagraph
        bannerColor="yellow"
        content={
          // keybase.pub only supports simple TLFs
          tlfName === you
            ? [
                'Everything you upload in here can be viewed by everyone at ',
                {onClick: () => openUrl(url), text: url},
                '.',
              ]
            : ['Everything you upload here is public.']
        }
      />
    </Kb.Banner>
  )
}

export default PublicBanner


text:
#import "DMSinglePicZoomShow.h"
#import "UIImageView+WebCache.h"

#if DEBUG
#define DMSinglePicDebug(...)   NSLog(__VA_ARGS__)
#else
#define DMSinglePicDebug(...)
#endif

@interface DMSinglePicZoomShow () <UIScrollViewDelegate>

@property (nonatomic, strong) UIScrollView *m_scrollView;
@property (nonatomic, strong) UIImageView *m_imageView;
@property (nonatomic, weak) UITapGestureRecognizer *m_tap;
@property (nonatomic, weak) UITapGestureRecognizer *m_doubleTap;
@property (nonatomic, weak) UILongPressGestureRecognizer *m_longPress;

@end

@implementation DMSinglePicZoomShow

#pragma mark - Life Cycle

- (void)dealloc
{
    DMSinglePicDebug(@"%@ dealloc", [[self class] description]);

    [self.m_imageView sd_cancelCurrentImageLoad];
}

+ (instancetype)singlePicZoomShowWithFrame:(CGRect)frame andImage:(UIImage *)image
{
    return [[self alloc] initWithFrame:frame andImage:image];
}

+ (instancetype)singlePicZoomShowWithFrame:(CGRect)frame andUrlString:(NSString *)urlString
{
    return [[self alloc] initWithFrame:frame andUrlString:urlString];
}

- (instancetype)initWithFrame:(CGRect)frame andImage:(UIImage *)image
{
    self = [self initWithFrame:frame];
    if (self)
    {
        self.image = image;
    }

    return self;
}

- (instancetype)initWithFrame:(CGRect)frame andUrlString:(NSString *)urlString
{
    self = [self initWithFrame:frame];
    if (self)
    {
        self.imageUrlString = urlString;
    }

    return self;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self defaultSetting];
    }

    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self)
    {
        [self defaultSetting];
    }

    return self;
}

- (void)defaultSetting
{
    [self createScrollView];
}

- (void)layoutSubviews
{
    [super layoutSubviews];

    if (![self.subviews containsObject:self.m_scrollView])
    {
        [self addSubview:self.m_scrollView];
    }

    self.m_scrollView.frame = self.bounds;
    self.m_scrollView.contentSize = self.bounds.size;
    self.m_imageView.frame = self.bounds;
}

#pragma mark - Sub Views
#pragma mark ScrollView
- (void)createScrollView
{
    if (nil == self.m_scrollView)
    {
        UIScrollView *scrollView = [[UIScrollView alloc] init];
        self.m_scrollView = scrollView;

        scrollView.delegate = self;
        scrollView.showsVerticalScrollIndicator = NO;
        scrollView.showsHorizontalScrollIndicator = NO;

        [self createImageView];
    }
}

#pragma mark ImageView
- (void)createImageView
{
    if (nil == self.m_imageView)
    {
        UIImageView *imageView = [[UIImageView alloc] init];
        [self.m_scrollView addSubview:imageView];
        self.m_imageView = imageView;
        imageView.contentMode = UIViewContentModeScaleAspectFit;
        imageView.image = self.image;
    }
}

#pragma mark - UIScrollViewDelegate
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
    return self.m_imageView;
}

- (void)scrollZoomHandle:(UIScrollView *)scrollView
{
    CGFloat x = 0;
    CGFloat y = 0;
    if (self.m_imageView.frame.size.width < scrollView.frame.size.width
        || self.m_imageView.frame.size.height < scrollView.frame.size.height)
    {
        x = (scrollView.frame.size.width - scrollView.contentSize.width) / 2;
        y = (scrollView.frame.size.height - scrollView.contentSize.height) / 2;
    }

    self.m_imageView.frame = (CGRect){x, y, self.m_imageView.frame.size};
}

- (void)scrollViewDidZoom:(UIScrollView *)scrollView
{
    [self scrollZoomHandle:scrollView];
}

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
{
    [self scrollZoomHandle:scrollView];
}

#pragma mark - setter / getter
- (void)setFrame:(CGRect)frame
{
    [super setFrame:frame];

    [self setNeedsLayout];
}

- (void)setImage:(UIImage *)image
{
    _image = image;

    self.m_imageView.image = image;
    [self setNeedsLayout];
}

- (void)setImageUrlString:(NSString *)imageUrlString
{
    _imageUrlString = [imageUrlString copy];

    NSURL *imageUrl = [NSURL URLWithString:_imageUrlString];
    [self.m_imageView sd_setImageWithURL:imageUrl placeholderImage:self.placeholderImage];
}

- (CGFloat)maxScale
{
    return self.m_scrollView.maximumZoomScale;
}

- (void)setMaxScale:(CGFloat)maxScale
{
    NSLog(@"self.m_scrollView.maximumZoomScale = %f", self.m_scrollView.maximumZoomScale);

    self.m_scrollView.maximumZoomScale = maxScale;
}

- (CGFloat)minScale
{
    return self.m_scrollView.minimumZoomScale;
}

- (void)setMinScale:(CGFloat)minScale
{
    self.m_scrollView.minimumZoomScale = minScale;
}

- (void)setCurScale:(CGFloat)curScale
{
    [self setCurScale:curScale animated:NO];
}

- (void)setCurScale:(CGFloat)curScale animated:(BOOL)animated
{
    [self.m_scrollView setZoomScale:curScale animated:animated];
}

- (void)setLongPressEnable:(BOOL)longPressEnable
{
    _longPressEnable = longPressEnable;

    if (longPressEnable)
    {
        if (nil == self.m_longPress)
        {
            UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressHandle:)];
            [self.m_scrollView addGestureRecognizer:longPress];
            self.m_longPress = longPress;
        }
    }
    else
    {
        [self removeGestureRecognizer:self.m_longPress];
        self.m_longPress = nil;
    }
}

- (void)setClickEnable:(BOOL)clickEnable
{
    _clickEnable = clickEnable;

    if (clickEnable)
    {
        if (nil == self.m_tap)
        {
            UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapHandle:)];
            tap.numberOfTapsRequired = 1;
            tap.numberOfTouchesRequired = 1;
            [self.m_scrollView addGestureRecognizer:tap];
            self.m_tap = tap;
        }
    }
    else
    {
        [self removeGestureRecognizer:self.m_tap];
        self.m_tap = nil;
    }
}

- (void)setDoubleClickEnable:(BOOL)doubleClickEnable
{
    _doubleClickEnable = doubleClickEnable;

    if (doubleClickEnable)
    {
        if (nil == self.m_doubleTap)
        {
            UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTapHandle:)];
            doubleTap.numberOfTapsRequired = 2;
            doubleTap.numberOfTouchesRequired = 1;
            [self.m_scrollView addGestureRecognizer:doubleTap];
            self.m_doubleTap = doubleTap;

            //这句非常 重要,
            [self.m_tap requireGestureRecognizerToFail:doubleTap];
        }
    }
    else
    {
        [self removeGestureRecognizer:self.m_doubleTap];
        self.m_doubleTap = nil;
    }
}

#pragma mark - GestureRecognizer
- (void)longPressHandle:(UILongPressGestureRecognizer *)longPress
{
    if (self.longPressEnable)
    {
        if ([self.delegate respondsToSelector:@selector(singlePicZoomShowLongPress:status:)])
        {
            [self.delegate singlePicZoomShowLongPress:self status:longPress.state];
        }
    }
}

- (void)tapHandle:(UITapGestureRecognizer *)tap
{
    if (self.clickEnable)
    {
        if ([self.delegate respondsToSelector:@selector(singlePicZoomShowTap:status:)])
        {
            [self.delegate singlePicZoomShowTap:self status:tap.state];
        }
    }
}

- (void)doubleTapHandle:(UITapGestureRecognizer *)tap
{
    if (self.doubleClickEnable)
    {
        if ([self.delegate respondsToSelector:@selector(singlePicZoomShowDoubleTap:status:zoomScale:)])
        {
            [self.delegate singlePicZoomShowDoubleTap:self status:tap.state zoomScale:self.m_scrollView.zoomScale];
        }
    }
}

@end


text:
Swifter
=======

A collection of Swift files to extend core functionality and implement common use cases and patterns.

Currently, it doesn't look like it is easy to create an external Framework or library with Swift files.  For now, use this code library
by adding the src/Swifter file (or any individual files) directly to your Xcode project.


text:
package rds

import (
	. "aliyun-openapi-go-sdk/core"
	"strconv"
)

type CheckAccountNameAvailableRequest struct {
	RpcRequest
	OwnerId              int
	ResourceOwnerAccount string
	ResourceOwnerId      int
	ClientToken          string
	DBInstanceId         string
	AccountName          string
	OwnerAccount         string
}

func (r *CheckAccountNameAvailableRequest) SetOwnerId(value int) {
	r.OwnerId = value
	r.QueryParams.Set("OwnerId", strconv.Itoa(value))
}
func (r *CheckAccountNameAvailableRequest) GetOwnerId() int {
	return r.OwnerId
}
func (r *CheckAccountNameAvailableRequest) SetResourceOwnerAccount(value string) {
	r.ResourceOwnerAccount = value
	r.QueryParams.Set("ResourceOwnerAccount", value)
}
func (r *CheckAccountNameAvailableRequest) GetResourceOwnerAccount() string {
	return r.ResourceOwnerAccount
}
func (r *CheckAccountNameAvailableRequest) SetResourceOwnerId(value int) {
	r.ResourceOwnerId = value
	r.QueryParams.Set("ResourceOwnerId", strconv.Itoa(value))
}
func (r *CheckAccountNameAvailableRequest) GetResourceOwnerId() int {
	return r.ResourceOwnerId
}
func (r *CheckAccountNameAvailableRequest) SetClientToken(value string) {
	r.ClientToken = value
	r.QueryParams.Set("ClientToken", value)
}
func (r *CheckAccountNameAvailableRequest) GetClientToken() string {
	return r.ClientToken
}
func (r *CheckAccountNameAvailableRequest) SetDBInstanceId(value string) {
	r.DBInstanceId = value
	r.QueryParams.Set("DBInstanceId", value)
}
func (r *CheckAccountNameAvailableRequest) GetDBInstanceId() string {
	return r.DBInstanceId
}
func (r *CheckAccountNameAvailableRequest) SetAccountName(value string) {
	r.AccountName = value
	r.QueryParams.Set("AccountName", value)
}
func (r *CheckAccountNameAvailableRequest) GetAccountName() string {
	return r.AccountName
}
func (r *CheckAccountNameAvailableRequest) SetOwnerAccount(value string) {
	r.OwnerAccount = value
	r.QueryParams.Set("OwnerAccount", value)
}
func (r *CheckAccountNameAvailableRequest) GetOwnerAccount() string {
	return r.OwnerAccount
}

func (r *CheckAccountNameAvailableRequest) Init() {
	r.RpcRequest.Init()
	r.SetVersion(Version)
	r.SetAction("CheckAccountNameAvailable")
	r.SetProduct(Product)
}

type CheckAccountNameAvailableResponse struct {
}

func CheckAccountNameAvailable(req *CheckAccountNameAvailableRequest, accessId, accessSecret string) (*CheckAccountNameAvailableResponse, error) {
	var pResponse CheckAccountNameAvailableResponse
	body, err := ApiHttpRequest(accessId, accessSecret, req)
	if err != nil {
		return nil, err
	}
	ApiUnmarshalResponse(req.GetFormat(), body, &pResponse)
	return &pResponse, err
}


text:
Typography
##########

The Typography library contains methods that help you format text
in semantically relevant ways.

.. contents::
    :local:
    :depth: 2

*******************
Loading the Library
*******************

Like all services in CodeIgniter, it can be loaded via ``Config\Services``, though you usually will not need
to load it manually:

.. literalinclude:: typography/001.php

**************************
Available static functions
**************************

The following functions are available:

.. php:function:: autoTypography($str[, $reduce_linebreaks = false])

    :param    string    $str: Input string
    :param    bool    $reduce_linebreaks: Whether to reduce multiple instances of double newlines to two
    :returns:    HTML-formatted typography-safe string
    :rtype: string

    Formats text so that it is semantically and typographically correct
    HTML.

    Usage example:

    .. literalinclude:: typography/002.php

    .. note:: Typographic formatting can be processor intensive, particularly if
        you have a lot of content being formatted. If you choose to use this
        function you may want to consider :doc:`caching <../general/caching>` your
        pages.

.. php:function:: formatCharacters($str)

    :param    string    $str: Input string
    :returns:    String with formatted characters.
    :rtype:    string

    This function mainly converts double and single quotes
    to curly entities, but it also converts em-dashes,
    double spaces, and ampersands.

    Usage example:

    .. literalinclude:: typography/003.php

.. php:function:: nl2brExceptPre($str)

    :param    string    $str: Input string
    :returns:    String with HTML-formatted line breaks
    :rtype:    string

    Converts newlines to ``<br />`` tags unless they appear within ``<pre>`` tags.
    This function is identical to the native PHP ``nl2br()`` function,
    except that it ignores ``<pre>`` tags.

    Usage example:

    .. literalinclude:: typography/004.php


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace WebAPITest.CustRelations
{
    [TestClass]
    public class CustRelationsUnitTest
    {
        [TestMethod]
        public void TestMethod1()
        {
        }
    }
}


text:
module HealthSeven::V2_7_1
class Ft1 < ::HealthSeven::Segment
  # Set ID - FT1
  attribute :set_id_ft1, Si, position: "FT1.1"
  # Transaction ID
  attribute :transaction_id, St, position: "FT1.2"
  # Transaction Batch ID
  attribute :transaction_batch_id, St, position: "FT1.3"
  # Transaction Date
  attribute :transaction_date, Dr, position: "FT1.4", require: true
  # Transaction Posting Date
  attribute :transaction_posting_date, Dtm, position: "FT1.5"
  # Transaction Type
  attribute :transaction_type, Cwe, position: "FT1.6", require: true
  # Transaction Code
  attribute :transaction_code, Cwe, position: "FT1.7", require: true
  # Transaction Quantity
  attribute :transaction_quantity, Nm, position: "FT1.10"
  # Transaction Amount - Extended
  attribute :transaction_amount_extended, Cp, position: "FT1.11"
  # Transaction amount - unit
  attribute :transaction_amount_unit, Cp, position: "FT1.12"
  # Department Code
  attribute :department_code, Cwe, position: "FT1.13"
  # Health Plan ID
  attribute :health_plan_id, Cwe, position: "FT1.14"
  # Insurance Amount
  attribute :insurance_amount, Cp, position: "FT1.15"
  # Assigned Patient Location
  attribute :assigned_patient_location, Pl, position: "FT1.16"
  # Fee Schedule
  attribute :fee_schedule, Cwe, position: "FT1.17"
  # Patient Type
  attribute :patient_type, Cwe, position: "FT1.18"
  # Diagnosis Code - FT1
  attribute :diagnosis_code_ft1s, Array[Cwe], position: "FT1.19", multiple: true
  # Performed By Code
  attribute :performed_by_codes, Array[Xcn], position: "FT1.20", multiple: true
  # Ordered By Code
  attribute :ordered_by_codes, Array[Xcn], position: "FT1.21", multiple: true
  # Unit Cost
  attribute :unit_cost, Cp, position: "FT1.22"
  # Filler Order Number
  attribute :filler_order_number, Ei, position: "FT1.23"
  # Entered By Code
  attribute :entered_by_codes, Array[Xcn], position: "FT1.24", multiple: true
  # Procedure Code
  attribute :procedure_code, Cne, position: "FT1.25"
  # Procedure Code Modifier
  attribute :procedure_code_modifiers, Array[Cne], position: "FT1.26", multiple: true
  # Advanced Beneficiary Notice Code
  attribute :advanced_beneficiary_notice_code, Cwe, position: "FT1.27"
  # Medically Necessary Duplicate Procedure Reason
  attribute :medically_necessary_duplicate_procedure_reason, Cwe, position: "FT1.28"
  # NDC Code
  attribute :ndc_code, Cwe, position: "FT1.29"
  # Payment Reference ID
  attribute :payment_reference_id, Cx, position: "FT1.30"
  # Transaction Reference Key
  attribute :transaction_reference_keys, Array[Si], position: "FT1.31", multiple: true
  # Performing Facility
  attribute :performing_facilities, Array[Xon], position: "FT1.32", multiple: true
  # Ordering Facility
  attribute :ordering_facility, Xon, position: "FT1.33"
  # Item Number
  attribute :item_number, Cwe, position: "FT1.34"
  # Model Number
  attribute :model_number, St, position: "FT1.35"
  # Special Processing Code
  attribute :special_processing_codes, Array[Cwe], position: "FT1.36", multiple: true
  # Clinic Code
  attribute :clinic_code, Cwe, position: "FT1.37"
  # Referral Number
  attribute :referral_number, Cx, position: "FT1.38"
  # Authorization Number
  attribute :authorization_number, Cx, position: "FT1.39"
  # Service Provider Taxonomy Code
  attribute :service_provider_taxonomy_code, Cwe, position: "FT1.40"
  # Revenue Code
  attribute :revenue_code, Cwe, position: "FT1.41"
  # Prescription Number
  attribute :prescription_number, St, position: "FT1.42"
  # NDC Qty and UOM
  attribute :ndc_qty_and_uom, Cq, position: "FT1.43"
end
end


text:
package com.eims.ris.core;

import java.sql.ResultSet;
import java.sql.SQLException;

import java.util.Date;
import java.util.List;
import java.util.ListIterator;

import com.eims.ris.core.DBUtils;
import com.eims.ris.core.Enumeradores.DateTimeFormat;
import com.trolltech.qt.core.QDate;
import com.trolltech.qt.core.QDateTime;
import com.trolltech.qt.core.QFile;
import com.trolltech.qt.core.QIODevice;
import com.trolltech.qt.core.QObject;
import com.trolltech.qt.core.QTime;
import com.trolltech.qt.core.QUrl;
import com.trolltech.qt.core.Qt;
import com.trolltech.qt.gui.QColor;
import com.trolltech.qt.gui.QDesktopServices;
import com.trolltech.qt.gui.QFont;
import com.trolltech.qt.gui.QMessageBox;
import com.trolltech.qt.gui.QPainter;
import com.trolltech.qt.gui.QPen;
import com.trolltech.qt.gui.QPixmap;
import com.trolltech.qt.gui.QPrinter;
import com.trolltech.qt.gui.QTableWidget;
import com.trolltech.qt.gui.QWidget;
import com.trolltech.qt.gui.QPushButton;
import com.trolltech.qt.xml.QXmlStreamWriter;

public class Utils {

	public static boolean HabilitaOpciones(QWidget parent, String userAccount){
	    if(parent.equals(0) || userAccount.equals(""))return false;
	    try{
		    String sql = String.format("SELECT usu_id FROM miniris.usuarios WHERE usu_acco='%1$s';", userAccount);
		    ResultSet query = DBUtils.getResultSet(sql);
		    query.next();
		    int userID = query.getInt(1);
		    sql = String.format("SELECT cls_id FROM miniris.user_access WHERE usu_id=%1$s", userID);
		    //sql = String.format("SELECT cls_id FROM miniris.user_access WHERE cls_id='Ciudades'");
		    query = DBUtils.getResultSet(sql);
		    query.next();
		    List<QObject> allObjects = parent.findChildren();
		    ListIterator<QObject> iteratObjs = allObjects.listIterator();
		    QObject objeto = new QObject();
		    QPushButton boton = new QPushButton();
		    while (iteratObjs.hasNext()){
		    	objeto = iteratObjs.next();
		        if(objeto.objectName().length()>4){
			        if(objeto.objectName().substring(0, 4).equals("btnM")){
			        	boton = (QPushButton)objeto;
			        	boton.setEnabled(false);
			        	System.out.println(boton.whatsThis());
			            query.first();
			            do{
			                if(boton.whatsThis().equals(query.getString(1).trim())){
			                    boton.setEnabled(true);
			                    break;
			                }
			            }while(query.next());
			        }
		        }
		    }
		    return true;
	    }catch (SQLException e) {
	    	DBUtils.showSQLException(e);
			return false;
		}
	}

	public static boolean HabilitaAcciones(QWidget parent, String userAccount, String clase, char accion){
		try{
			String sql = String.format("SELECT usu_id FROM miniris.usuarios WHERE usu_acco='%1$s';", userAccount);
			ResultSet query = DBUtils.getResultSet(sql);
		    query.next();
		    int userID = query.getInt(1);
		    boolean lUseRecord = false;
		    sql = String.format("SELECT acc_lect,acc_ins,acc_edit,acc_elim,acc_print FROM miniris.user_access WHERE usu_id=%1$s AND TRIM(cls_id)='%2$s'", userID, clase);
		    //System.out.println(sql);
		    query = DBUtils.getResultSet(sql);
		    if(query.next()) lUseRecord = true;
		    List<QObject> allObjects = parent.findChildren();
		    ListIterator<QObject> iteratObjs = allObjects.listIterator();
		    QObject objeto = new QObject();
		    QPushButton boton = new QPushButton();
		    while (iteratObjs.hasNext()){
		        objeto = iteratObjs.next();
		        if(objeto.objectName().length()>3){
			        if(objeto.objectName().substring(0, 3).equals("btn")){
			        	boton = (QPushButton)objeto;
			        	//System.out.println(boton.objectName());
				        if(boton.objectName().equals("btnNuevo")){
				            if(lUseRecord)
				            	boton.setEnabled(query.getBoolean(2) && (accion=='\0' || accion=='G' || accion=='B'));
				            else
				            	boton.setEnabled(false);
				        }else if(boton.objectName().equals("btnEditar")){
				            if(lUseRecord)
				            	boton.setEnabled(query.getBoolean(3) && (accion=='B'));
				            else
				            	boton.setEnabled(false);
				        }else if(boton.objectName().equals("btnGuardar")){
				        	boton.setEnabled(accion=='A' || accion=='E');
				        }else if(boton.objectName().equals("btnEliminar")){
				            if(lUseRecord)
				            	boton.setEnabled(query.getBoolean(4) && (accion=='G' || accion=='B'));
				            else
				            	boton.setEnabled(false);
				        }else if(boton.objectName().equals("btnImprimir")){
				            if(lUseRecord)
				            	boton.setEnabled(query.getBoolean(5));// && (accion=='G' || accion=='B'));
				            else
				            	boton.setEnabled(false);
				        }
			        }
		        }
		    }
		    return lUseRecord;
		}catch (SQLException e) {
			DBUtils.showSQLException(e);
			return false;
		}
	}
	/**
	 * Método estático para Transformar un objeto Date a QDate
	 * @return Objeto QDate
	 */
	public static QDate DateToQDate(Date fecha){
		String[] f = fecha.toString().substring(0, 10).split("-");
    	return new QDate(Integer.parseInt(f[0]), Integer.parseInt(f[1]), Integer.parseInt(f[2]));
	}
	/**
	 * Método estático para obtener la Fecha y Hora actual
	 * @return FechaHora de tipo String
	 */
	public static String ObtenerFechaHora(){
		String result = QDateTime.currentDateTime().toString("yyyy-MM-dd HH:mm:ss");
        try{
	        ResultSet query = DBUtils.getResultSet("SELECT NOW();");
	        query.next();
	        //System.out.println(query.getTimestamp(1).toString());
	        result = query.getTimestamp(1).toString().substring(0, 19); // == null ? "" : query.getTimestamp(1).toString();
	    }catch (SQLException e) {
	    	DBUtils.showSQLException(e);
		}
	    return result;
	}
	public static String getDateTimeFormat(DateTimeFormat dtf){
		String dateTimeFormat = "dd-MM-yyyy HH:mm:ss";
		try{
	        ResultSet query = DBUtils.getResultSet("SELECT par_info FROM miniris.parametros WHERE par_grupo='DF' AND par_id=1;");
	        query.next();
	        if(dtf.equals(Enumeradores.DateTimeFormat.Date))
	        	dateTimeFormat = query.getString(1).substring(0, 10);
	        else if(dtf.equals(Enumeradores.DateTimeFormat.Time))
	        	dateTimeFormat = query.getString(1).substring(10,8);
        	else
        		dateTimeFormat = query.getString(1);
	    }catch (SQLException e) {
	    	DBUtils.showSQLException(e);
		}
	    return dateTimeFormat;
	}
	public static String getAETitle(){
		return "EIMSRIS";
	}
	public static boolean ValidarRUN(String RUN)
	{
		RUN.replace(".", "");
	    String list[] = RUN.split("-");
	    String run, dv;
	    run = list[0];
	    dv = list[1];
	    int T = Integer.parseInt(run);
	    int M = 0, S = 1;
	    for( ; T!=0; T/=10)
	        S = (S + T % 10 * (9 - M++ % 6)) % 11;
	    //System.out.print((char)(S!=0?S+47:75));
	    return String.format("%1$s",(char)(S!=0?S+47:75)).toUpperCase().equals(dv.toUpperCase());
	}
	public static void ShowPDF(String fileName)
	{
	    QDesktopServices.openUrl(QUrl.fromLocalFile(fileName));
	}
	public static int MessageBox(Enumeradores.Message tipo, String msg){
		String image = (tipo==Enumeradores.Message.Information ? "info" : (tipo==Enumeradores.Message.Error ? "error" : "question"));
		QPixmap icon = new QPixmap(String.format("classpath:com/ehealthcare/ris/images/%1$s64.png", image));
		QMessageBox mbox = new QMessageBox(QMessageBox.Icon.NoIcon, "RIS - Mensaje", msg);
		mbox.setIconPixmap(icon);
		//mbox.setDetailedText("Algún texto de detalle en caso de error");
		//mbox.setInformativeText("Información adicional");
		mbox.setText(msg);
		if(tipo == Enumeradores.Message.Question){
			mbox.setStandardButtons(QMessageBox.StandardButton.No, QMessageBox.StandardButton.Yes);
			mbox.setDefaultButton(QMessageBox.StandardButton.No);
		}
		mbox.setText(msg);
		return mbox.exec();
	}
	/**
	  GenerateXML
	  Descripción: Genera un archivo XML con información del TableWidget enviado como parámetro.
	  Parámetros :
	    index    : entero que indica el ID del TableWidget
	    fileName : nombre de archivo excluye la extensión
	    tw       : QTableWidget con información
	  */
	public static void GenerateXML(int index, String fileName, QTableWidget tw)
	{
		//String lPath = QCoreApplication.applicationDirPath();
		String lPath = "/home/pablo/temp";
		String lFullFile = lPath+"/"+fileName+".xml";
		System.out.print("FullFile: "+lFullFile);
	    QFile file = new QFile(lFullFile);
	    if(!file.open(QIODevice.OpenModeFlag.WriteOnly)){
	        //QMessageBox::warning(0, "Error de archivo", "Imposible abrir el archivo en modo escritura.");
	        return;
	    }else{
	        QXmlStreamWriter xmlWriter = new QXmlStreamWriter();
	        xmlWriter.setDevice(file);
	        xmlWriter.writeStartDocument();
	        xmlWriter.writeStartElement("Registros");
	        String columnName;
	        for(int row=0;row<tw.rowCount();row++){
	            xmlWriter.writeStartElement(tw.horizontalHeaderItem(index).text().toUpperCase());
	            for(int i=0;i<tw.columnCount();i++){
	                if(i!=index){
	                    columnName = tw.horizontalHeaderItem(i).text().toUpperCase().replace("/", "_");
	                    columnName = columnName.replace(" ", "_");
	                    xmlWriter.writeAttribute(columnName, tw.item(row,i).text());
	                }
	            }
	            xmlWriter.writeCharacters(tw.item(row,index).text());
	            xmlWriter.writeEndElement();
	        }
	        xmlWriter.writeEndElement();
	        xmlWriter.writeEndDocument();
	        file.close();
	        QDesktopServices.openUrl(QUrl.fromLocalFile(lFullFile));
	    }
	}
	/**
	  PrintHeader
	  Descripción: Imprime en el painter la cabezera de un informe.
	  Parámetros :
	    painter  : Objeto QPainter en donde se dibujará (argumento utilizado por referencia)
	    title    : String con el título del informe
	  */
	public static void PrintHeader(QPainter painter, String title, String header[][], int nroPage, int totalPage){
		//QRect rect = new QRect(10,10,350,150);
		QPen pen = new QPen();
        pen.setWidth(1);
        pen.setColor(QColor.black);
        painter.setPen(pen);
        int width  = painter.paintEngine().paintDevice().width();  // ancho de la página
        int height = painter.paintEngine().paintDevice().height(); // alto de la página
        QFont fnt = new QFont("Arial",8);
        //fnt.setLetterSpacing(QFont::PercentageSpacing,104);
        int lX = 20; // Para el margen izquierdo
        //painter.drawImage(rect,QImage(String(":/images/resources/logo.png")));
        //painter.drawRect(lX, 10, width - (lX * 2), 60);
        painter.setFont(fnt);
        painter.drawText(lX+4 , 30, "EIMS");
        painter.drawText(width - lX - 60 , 30, QDate.currentDate().toString("dd-MM-yyyy"));
        painter.drawText(lX+4, 50, "RIS");
        painter.drawText(width - lX - 60 , 50, QTime.currentTime().toString("HH:mm:ss"));

        fnt.setPointSize(14);
        fnt.setBold(true);
        painter.setFont(fnt);
        painter.drawText(0, 20, width, 40, 5, title);
        pen.setWidth(2);
        painter.setPen(pen);
        painter.drawLine(lX, 65, width - lX, 65);
        pen.setWidth(1);
        painter.setPen(pen);

        fnt.setPointSize(12);
        fnt.setBold(false);
        painter.setFont(fnt);
        int lX1 = lX;
        int lW;
        for(int i=0; i<header.length; i++){
        	lW = Integer.parseInt(header[i][0]);
        	painter.fillRect(lX1  , 70, lW  , 20, QColor.lightGray);
        	painter.drawRect(lX1  , 70, lW  , 20);
        	painter.drawText(lX1+2, 70, lW-4, 20, 0, header[i][1]);
        	lX1 += lW;
        }
        // Para el footer de la página
        fnt.setPointSize(8);
        painter.setFont(fnt);
        pen.setWidth(2);
        painter.setPen(pen);
        painter.drawLine(lX, height - 14, width - lX, height - 14);
        pen.setWidth(1);
        painter.setPen(pen);
        painter.drawText(lX, height - 10, width - lX, 20, 5, "EIMS - Sistema de Información Radiológica");
        painter.drawText(width - lX - 60 , height - 10, 100, 20, 0, "Pág.: " + nroPage+"/"+totalPage);
	}
	public static void PrintTableWidget(QPrinter printer, QPainter painter, String title, QTableWidget tw, String widthFields[][]){
		int lW;
		int lH = 20;
    	int lX1 = 20;
    	int lY = 90;
    	int nroPage = 1;
    	int height = painter.paintEngine().paintDevice().height(); // alto de la página
    	int nroPerPage = (height == 992 ? 44 : 32); //922
        int totalPage = (int)(tw.rowCount() / nroPerPage) + 1;
    	QPen pen = new QPen();
        pen.setWidth(1);
        pen.setColor(QColor.black);
        painter.setPen(pen);
        QFont fnt = new QFont("Arial",10);
        painter.setFont(fnt);
        //992 salto de página letter portrait
        for(int i=0; i<tw.rowCount(); i++){
        	if(lY>=(height - 22)){
        		printer.newPage();
        		PrintHeader(painter, title, widthFields, ++nroPage, totalPage);
        		fnt.setPointSize(10);
                painter.setFont(fnt);
                lX1 = 20;
        		lY = 90;
        	}
        	for(int j=0; j<widthFields.length; j++){
	        	lW = Integer.parseInt(widthFields[j][0]);
	        	painter.drawRect(lX1  , lY, lW  , lH);
	        	painter.drawText(lX1+2, lY, lW-4, lH, Qt.AlignmentFlag.AlignVCenter.value() | Integer.parseInt(widthFields[j][2]), tw.item(i, j).text());
	        	lX1 += lW;
        	}
        	//painter.drawText(40, lY-5, "Y:" + lY); // para chequear en que coordenada hacer el salto de página
        	lX1 = 20;
        	lY += lH;
        }
	}
}


text:
require_relative '../../puppet_x/puppetlabs/swagger/fuzzy_compare'

Puppet::Type.newtype(:kubernetes_unique_volume_name) do

  ensurable

  newparam(:name, namevar: true) do
    desc 'Name of the unique_volume_name.'
  end

end