text:
//Problem 1. Make person
//Write a functio for creating persons.
//Each person must have firstname, lastname, age and gender (true is female, false is male)
//Generate an array with ten person with different names, ages and genders

function createPerson(fname, lname, age, gender) {
    return {
        fname: fname,
        lname: lname,
        age: age,
        gender: gender === 'female' ? true : false

    };
}

var people = [
    createPerson('Pesho', 'Ivanov', 25, 'male'),
    createPerson('Tosho', 'Nikolov', 26, 'male'),
    createPerson('Gosho', 'Petrov', 55, 'male'),
    createPerson('Mara', 'Ivanova', 5, 'female'),
    createPerson('Miro', 'Iliev', 34, 'male'),
    createPerson('Pencho', 'Todorov', 42, 'male'),
    createPerson('Pena', 'Popinska', 23, 'female'),
    createPerson('Krasi', 'Stoichkov', 18, 'male'),
    createPerson('Daniela', 'Spasova', 29, 'female'),
    createPerson('Borislava', 'Petrova', 55, 'female')
];

console.log(people);
console.log('---------------------');

//Problem 2. People of age
//Write a function that checks if an array of person contains only people of age (with age 18 or greater)
//    Use only array methods and no regular loops (for, while)

function minAge(min) {
    return function (item) {
        return item.age >= min;
    }
}

console.log(people.every(minAge(18)));
console.log('---------------------');

//Problem 3. Underage people
//Write a function that prints all underaged persons of an array of person
//Use Array#filter and Array#forEach
//Use only array methods and no regular loops (for, while)

console.log(people.filter(minAge(18)));
console.log('---------------------');

//Problem 4. Average age of females
//Write a function that calculates the average age of all females, extracted from an array of persons
//Use Array#filter
//Use only array methods and no regular loops (for, while)

function isFemale(gender) {
    return function (item) {
        return !!item.gender;
    }
}

var counter = 0,
    sumAgeOfFemales = people.filter(isFemale(true))
                                .reduce(function (sum, number) {
                                    counter += 1;
                                    return sum + number.age;
                                }, 0),
    avgFemales = Math.floor((sumAgeOfFemales / counter + 0.5));

console.log(avgFemales);
console.log('---------------------');

//Problem 5. Youngest person
//Write a function that finds the youngest male person in a given array of people and prints his full name
//Use only array methods and no regular loops (for, while)
//    Use Array#find

if (!Array.prototype.find) {
    Array.prototype.find = function (callback) {
        var i, len = this.length;
        for (i = 0; i < len; i += 1) {
            if (callback(this[i], i, this)) {
                return this[i];
            }
        }
    }
}

function isMale(gender) {
    return function (item) {
        return !item.gender;
    }
}

var sortPeopleByAge = people.sort(function (item1, item2) {
    return item1.age > item2.age;
}),
    youngestMale = sortPeopleByAge.find(isMale(false)),
    fullNameyoungestMale = youngestMale.fname + ' ' + youngestMale.lname;

console.log(sortPeopleByAge);
console.log(youngestMale);
console.log(fullNameyoungestMale);
console.log('---------------------');

//Problem 6. Group people
//Write a function that groups an array of persons by first letter of first name and returns the groups as a JavaScript Object
//Use Array#reduce
//Use only array methods and no regular loops (for, while)

var sortPeopleByFirstLetterInFirstname = people.sort(function (item1, item2) {
    return item1.fname[0] > item2.fname[0]
}),
    groupPeopleByFirstLetterInFirstname = sortPeopleByFirstLetterInFirstname.reduce(function (obj, item) {
        if (obj[item.fname[0]]) {
            obj[item.fname[0]].push(item);
        } else {
            obj[item.fname[0]] = [item];
        }
        return obj;
    }, {});

console.log(groupPeopleByFirstLetterInFirstname);


text:
import click
from textkit.tokenize.words import text2words
from textkit.tokenize.sentences import text2sentences
from textkit.tokenize.bigrams import words2bigrams
from textkit.tokenize.ngrams import words2ngrams, text2ngrams
from textkit.tokenize.punc import text2punc
from textkit.filter.filter_punc import filterpunc
from textkit.filter.filter_words import filterwords
from textkit.filter.filter_lengths import filterlengths
from textkit.filter.filter_words import showstops
from textkit.transform.tokens_to_lower import tokens2lower
from textkit.transform.tokens_to_upper import tokens2upper
from textkit.transform.newlines import nonewlines
from textkit.transform.tokens_to_stem import tokens2stem
from textkit.transform.tokens_to_counts import tokens2counts
from textkit.transform.tokens_to_top_bigrams import tokens2topbigrams
from textkit.transform.tokens_to_pos import tokens2pos
from textkit.transform.transliterate import transliterate
from textkit.package.tokens_to_json import tokens2json
from textkit.package.texts_to_json import texts2json
from textkit.package.tokens_to_text import tokens2text
from textkit.download import download

@click.group()
def cli():
    '''Text analysis from the command line.
    '''
    pass

cli.add_command(text2words)
cli.add_command(text2sentences)
cli.add_command(words2bigrams)
cli.add_command(words2ngrams)
cli.add_command(text2ngrams)
cli.add_command(text2punc)
cli.add_command(filterpunc)
cli.add_command(filterwords)
cli.add_command(filterlengths)
cli.add_command(showstops)
cli.add_command(tokens2lower)
cli.add_command(tokens2upper)
cli.add_command(nonewlines)
cli.add_command(tokens2stem)
cli.add_command(tokens2json)
cli.add_command(texts2json)
cli.add_command(tokens2text)
cli.add_command(tokens2counts)
cli.add_command(tokens2topbigrams)
cli.add_command(tokens2pos)
cli.add_command(transliterate)
cli.add_command(download)

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace PCGPS
{
    public partial class Form5 : Form
    {
        public Form5()
        {
            InitializeComponent();
        }

        delegate void SetDataCallback();
        public void SetLabel()
        {
            if (label2.InvokeRequired)
            {
                SetDataCallback c = new SetDataCallback(SetLabel);
                Invoke(c);
            }
            else
            {
                label2.Text = l;
            }
        }

        string l;
        public string Label
        {
            set
            {
                l = value;
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        private void Form5_Load(object sender, EventArgs e)
        {
            /*
            Thread t = new Thread(delegate()
            {
                while (DialogResult == DialogResult.None)
                {
                    SetLabel(l);
                    Thread.Sleep(100);
                }
            });
            t.IsBackground = true;
            t.Start();
             */
        }
    }
}


text:
<?php
if (!defined('AT_INCLUDE_PATH')) { exit; }

/* available header.tmpl.php variables:
 * $this->lang_code			the ISO language code
 * SITE_NAME				the site name from the config file
 * $this->page_title		the name of this page to use in the <title>
 * $this->lang_charset		the ISO language character set
 * $this->content_base_href	the <base href> to use for this page
 * $this->base_path			the absolute path to this atutor installation
 * $this->rtl_css			if set, the path to the RTL style sheet
 * $this->banner_style		-deprecated-
 * $this->theme				the directory name of the current theme
 * $this->base_href			the full url to this atutor installation
 * $this->onload			javascript onload() calls
 * $this->img				the absolute path to this theme's images/ directory
 * $this->sequence_links	associative array of 'previous', 'next', and/or 'resume' links
 * $this->path				associative array of path to this page: aka bread crumbs
 * $this->rel_url			the relative url from the installation root to this page
 * $this->nav_courses		associative array of this user's enrolled courses
 * $this->section_title		the title of this section (course, public, admin, my start page)
 * $this->top_level_pages	associative array of the top level navigation
 * $this->current_top_level_page	the full path to the current top level page with file name
 * $this->sub_level_pages			associate array of sub level navigation
 * $this->back_to_page				if set, the path and file name to the part of this page (if parent is not a top level nav)
 * $this->current_sub_level_page	the full path to the current sub level page with file name
 * $this->guide				the full path and file name to the guide page
 * ======================================
 * top_level_pages           array(array('url', 'title'))     the top level pages. ATutor default creates tabs.
 * section_title             string                           the name of the current section. either name of the course, administration, my start page, etc.
 * page_title                string                           the title of the current page.
 * path                      array(array('url', 'title'))     the path to the current page.
 * back_to_page              array('url', 'title')            the link back to the part of the current page, if needed.
 * current_top_level_page    string                           full url to the current top level page in "top_leve_pages"
 * current_sub_level_page    string                           full url to the current sub level page in the "sub_level_pages"
 * sub_level_pages           array(array('url', 'title'))     the sub level pages.
 */

// will have to be moved to the header.inc.php
global $system_courses;

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="<?php echo $this->lang_code; ?>">

	<title><?php echo SITE_NAME; ?> : <?php echo $this->page_title; ?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $this->lang_charset; ?>" />
	<meta name="Generator" content="ATutor - Copyright 2007 by http://atutor.ca" />
	<base href="<?php echo $this->content_base_href; ?>" />
	<link rel="shortcut icon" href="<?php echo $this->base_path; ?>favicon.ico" type="image/x-icon" />
	<link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/print.css" type="text/css" media="print" />
	<link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/styles.css" type="text/css" />

	<link rel="stylesheet" href="<?php echo $this->base_path.'themes/'.$this->theme; ?>/forms.css" type="text/css" />
	<?php if ($system_courses[$_SESSION['course_id']]['rss']): ?>
	<link rel="alternate" type="application/rss+xml" title="<?php echo SITE_NAME; ?> - RSS 2.0" href="<?php echo $this->base_path; ?>get_rss.php?<?php echo $_SESSION['course_id']; ?>-2" />
	<link rel="alternate" type="application/rss+xml" title="<?php echo SITE_NAME; ?> - RSS 1.0" href="<?php echo $this->base_path; ?>get_rss.php?<?php echo $_SESSION['course_id']; ?>-1" />
	<?php endif; ?>

    <?php echo $this->custom_css; ?>
    <?php echo $this->rtl_css; ?>

<body onload="<?php echo $this->onload; ?>">

	<a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES); ?>#content" style="border: 0px;" accesskey="c"><img src="<?php echo $this->base_path; ?>images/clr.gif" height="1" width="1" border="0" alt="<?php echo _AT('goto_content'); ?> ALT+c" />
	<a href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES); ?>#menu" style="border: 0px;" accesskey="m"><img src="<?php echo $this->base_path; ?>images/clr.gif" height="1" width="1" border="0" alt="<?php echo _AT('goto_menu'); ?> ALT+m" />

	<?php if ($_SESSION['is_super_admin']): ?>
		<a href="<?php echo $this->base_path; ?>bounce.php?admin"><?php echo _AT('return_to_admin_area'); ?> |
	<?php endif; ?>

	<?php if ($_SESSION['valid_user']): ?>
		<?php     if (!admin_authenticate(AT_ADMIN_PRIV_ADMIN, AT_PRIV_RETURN) && $last_path_part != 'preferences.php') {?>
		    <img border="0" alt="<?php echo _AT('preferences').' - '._AT('new_window'); ?>" src="<?php echo $this->base_href; ?>images/wand.png" /> |
		    <?php } ?>
		<?php echo get_display_name($_SESSION['member_id']); ?>  |
		<?php if ($_SESSION['course_id'] > -1): ?>
			<?php if (get_num_new_messages()): ?>
				<a href="<?php echo $this->base_path; ?>inbox/index.php"><?php echo _AT('inbox'); ?> - <?php echo get_num_new_messages(); ?> |
			<?php else: ?>
				<a href="<?php echo $this->base_path; ?>inbox/index.php"><?php echo _AT('inbox'); ?> |
			<?php endif; ?>
		<?php endif; ?>
		<a href="<?php echo $this->base_path; ?>search.php"><?php echo _AT('search'); ?> |
		<a href="<?php echo $this->base_path; ?>help/index.php"><?php echo _AT('help'); ?> |
		<a href="<?php echo $this->base_path; ?>logout.php"><?php echo _AT('logout'); ?>
	<?php elseif ($_SESSION['course_id'] == -1): ?>
		<img src="<?php echo $this->img;?>user-star.gif" style="vertical-align: middle;" class="img-size-star" alt="" /><?php echo get_display_name($_SESSION['member_id']); ?>  |
		<a href="<?php echo $this->base_path; ?>search.php"><?php echo _AT('search'); ?> |
		<a href="<?php echo $this->base_path; ?>help/index.php"><?php echo _AT('help'); ?> |
		<a href="<?php echo $this->base_path; ?>logout.php"><?php echo _AT('logout'); ?>
	<?php else: ?>
		<a href="<?php echo $this->base_path; ?>browse.php"><?php echo _AT('browse_courses'); ?> |
		<a href="<?php echo $this->base_path; ?>login.php?course=<?php echo $_SESSION['course_id']; ?>"><?php echo _AT('login'); ?> |
		<a href="<?php echo $this->base_path; ?>search.php"><?php echo _AT('search'); ?> |
		<a href="<?php echo $this->base_path; ?>help/index.php"><?php echo _AT('help'); ?>
	<?php endif; ?>

	<?php if (isset($_SESSION['member_id']) && $_SESSION['member_id']): ?>

		<?php if (empty($_GET)): ?>
			<form method="post" action="<?php echo $this->base_path; ?>bounce.php?p=<?php echo urlencode($this->rel_url); ?>" target="_top">
		<?php else: ?>
			<form method="post" action="<?php echo $this->base_path; ?>bounce.php" target="_top">
		<?php endif; ?>

		<select name="course" id="jumpmenu" title="<?php echo _AT('jump'); ?>:  Alt-j">
			<option value="0" id="start-page"><?php echo _AT('my_start_page'); ?></option>
			<optgroup label="<?php echo _AT('courses_below'); ?>">
				<?php foreach ($this->nav_courses as $this_course_id => $this_course_title): ?>
					<option value="<?php echo $this_course_id; ?>"><?php echo $this_course_title; ?></option>
				<?php endforeach; ?>
			</optgroup>
		</select> <input type="submit" name="jump" value="<?php echo _AT('jump'); ?>" id="jump-button" /></form>

	<?php endif; ?>

<?php if ($_SESSION["prefs"]["PREF_SHOW_BREAD_CRUMBS"]) { ?>

	<?php foreach ($this->path as $page): ?>
		<a href="<?php echo $page['url']; ?>" title="<?php echo _AT('back_to').' '.$page['title']; ?>"><?php echo htmlspecialchars($page['title'], ENT_COMPAT, "UTF-8"); ?> »
	<?php endforeach; ?> <?php echo $this->page_title; ?>

<?php } ?>

	<?php if ($_SESSION['valid_user']):
		echo ''.stripslashes(SITE_NAME).'';
	else:
		echo '
';
	endif; ?>

<?php echo $this->section_title; ?>
	<?php if (($_SESSION['course_id'] > 0) && ($_SESSION['enroll'] == AT_ENROLL_NO)) : ?>
		- <a href="<?php echo $this->base_path; ?>enroll.php?course=<?php echo $_SESSION['course_id']; ?>"><?php echo _AT('enroll_me'); ?>
	<?php endif; ?>

			<?php foreach ($this->top_level_pages as $page): ?>
				<?php ++$accesscounter; $accesscounter = ($accesscounter == 10 ? 0 : $accesscounter); ?>
				<?php $accesskey_text = ($accesscounter < 10 ? 'accesskey="'.$accesscounter.'"' : ''); ?>
				<?php $accesskey_title = ($accesscounter < 10 ? ' Alt+'.$accesscounter : ''); ?>
				<?php if ($page['url'] == $this->current_top_level_page): ?>

<a href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'] . $accesskey_title; ?>" class="active"><?php echo $page['title']; ?>

				<?php else: ?>

<a href="<?php echo $page['url']; ?>" <?php echo $accesskey_text; ?> title="<?php echo $page['title'] . $accesskey_title; ?>"><?php echo $page['title']; ?>

				<?php endif; ?>
				<?php $accesscounter = ($accesscounter == 0 ? 11 : $accesscounter); ?>
			<?php endforeach; ?>

<?php echo $this->current_date; ?>

<?php if ($this->sub_level_pages && !(count($this->sub_level_pages) == 1 && $this->sub_level_pages[0]['url'] == $this->current_sub_level_page)): ?>

		<?php if (isset($this->back_to_page)): ?>
			<a href="<?php echo $this->back_to_page['url']; ?>" id="back-to"><?php echo _AT('back_to'); ?> <?php echo $this->back_to_page['title']; ?> |
		<?php endif; ?>

		<?php $num_pages = count($this->sub_level_pages); ?>
		<?php for($i=0; $i<$num_pages; $i++): ?>
			<?php if ($this->sub_level_pages[$i]['url'] == $this->current_sub_level_page): ?>
				<?php echo $this->sub_level_pages[$i]['title']; ?>
			<?php else: ?>
				<a href="<?php echo $this->sub_level_pages[$i]['url']; ?>"><?php echo $this->sub_level_pages[$i]['title']; ?>
			<?php endif; ?>
			<?php if ($i < $num_pages-1): ?>
				|
			<?php endif; ?>
		<?php endfor; ?>

<?php else: ?>

<?php endif; ?>

		<?php if ($_SESSION['course_id'] > 0): ?>

		<?php else: ?>

		<?php endif; ?>

		<?php if ($this->guide && ($_SESSION["prefs"]["PREF_SHOW_GUIDE"] || $_SESSION["course_id"] == "-1")): ?>
			<a href="<?php echo $this->guide; ?>" id="guide" onclick="ATutor.poptastic('<?php echo $this->guide; ?>'); return false;" target="_new"><?php echo $this->page_title; ?>
		<?php endif; ?>

	<?php if ($_SESSION['course_id'] > 0 && $system_courses[$_SESSION['course_id']]['side_menu']): ?>

	<?php if ($_SESSION["prefs"]["PREF_SHOW_NEXT_PREVIOUS_BUTTONS"]) { ?>
		<?php if ($this->sequence_links['resume']): ?>
				<a style="color:white;" href="<?php echo $this->sequence_links['resume']['url']; ?>" accesskey="."><img src="<?php echo $this->img; ?>resume.gif" border="0" title="<?php echo _AT('resume').': '.$this->sequence_links['resume']['title']; ?> Alt+." alt="<?php echo $this->sequence_links['resume']['title']; ?> Alt+." class="img-size-ascdesc" />
		<?php else:
			if ($this->sequence_links['previous']): ?>
				<a href="<?php echo $this->sequence_links['previous']['url']; ?>" title="<?php echo _AT('previous_topic').': '. $this->sequence_links['previous']['title']; ?> Alt+," accesskey=","><img src="<?php echo $this->img; ?>previous.gif" border="0" alt="<?php echo _AT('previous_topic').': '. $this->sequence_links['previous']['title']; ?> Alt+," class="img-size-ascdesc" />
			<?php endif;
			if ($this->sequence_links['next']): ?>
				<a href="<?php echo $this->sequence_links['next']['url']; ?>" title="<?php echo _AT('next_topic').': '.$this->sequence_links['next']['title']; ?> Alt+." accesskey="."><img src="<?php echo $this->img; ?>next.gif" border="0" alt="<?php echo _AT('next_topic').': '.$this->sequence_links['next']['title']; ?> Alt+." class="img-size-ascdesc" />
			<?php endif; ?>
		<?php endif; ?>
	<?php } ?>

	<?php endif; ?>

<?php echo htmlspecialchars($this->page_title, ENT_COMPAT, "UTF-8"); ?>

<?php global $msg; $msg->printAll(); ?>


text:
module Admin
  class RolesController < ApplicationController
    before_action(:authenticate_user!) if defined?(Devise)
    before_action { EffectiveResources.authorize!(self, :admin, :effective_roles) }

    include Effective::CrudController

    if (config = EffectiveRoles.layout)
      layout(config.kind_of?(Hash) ? config[:admin] : config)
    end

    def index
      @page_title = 'Roles'
    end

  end
end


text:
module Filepicker
  module Rails
    module FormBuilder

      def filepicker_field(method, options = {})
        input_options = {
          'data-fp-apikey' =>
          ::Rails.application.config.filepicker_rails.api_key,

          'data-fp-button-text' => options.fetch(:button_text, "Pick File"),

          'data-fp-button-class' => options[:button_class],

          'data-fp-mimetypes' => options[:mimetypes],

          'data-fp-option-container' => options[:container],

          'data-fp-option-multiple' => false,

          'data-fp-option-services' => Array(options[:services]).join(","),
        }

        type = options[:dragdrop] ? 'filepicker-dragdrop' : 'filepicker'

        ActionView::Helpers::InstanceTag.new(@object_name, method, @template)
          .to_input_field_tag(type, input_options)
      end
    end
  end
end


text:
module Main ( main ) where

import qualified Data.Text as Text
import qualified Data.Aeson as Aeson
import qualified Network.WebSockets as WS
import qualified Graphics.QML as QML
import qualified Control.Concurrent as Concurrent

import qualified Types as T
import qualified Visualizer as V

main :: IO ()
main = WS.runClient "127.0.0.1" 8081 "/websocket" app

app :: WS.ClientApp ()
app conn = do
  game <- V.init

  WS.sendTextData conn (Aeson.encode $ T.Action "start" Nothing)
  loop game conn
  WS.sendClose conn ( Text.pack "Bye!" )
  print "Exited"

loop :: QML.ObjRef V.QMLGame -> WS.Connection -> IO ()
loop game conn = do
  res <- WS.receiveData conn
  let newGame = Aeson.decode res :: Maybe T.Game
  let act = decision (newGame)
  V.update game newGame

  case act of
    Nothing -> return ()
    Just act -> do
      WS.sendTextData conn (Aeson.encode act)
      Concurrent.threadDelay 2000000
      loop game conn

decision :: Maybe T.Game -> Maybe T.Action
decision Nothing = Nothing
decision (Just (T.Game _ _ _ _ _ _ _)) =
  (Just (T.Action "move" (Just "left")))


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <stroke android:width="1dip" android:color="@color/gris_text"/>
    <padding
        android:top="2dp"
        android:bottom="2dp"
        android:left="5dp"
        android:right="5dp"
        />
    <corners
        android:radius="2dp"/>

</shape>


text:
package com.gs.obevo.db.api.appdata;

import org.apache.commons.lang3.Validate;
import org.eclipse.collections.api.collection.ImmutableCollection;
import org.eclipse.collections.api.multimap.ImmutableMultimap;
import org.eclipse.collections.api.multimap.Multimap;

/**
 * Represents a set of privileges that should be provided to the given grantTargets (i.e. the users/groups).
 * The object would be specified separately.
 */
public class Grant {
    private ImmutableCollection<String> privileges;
    private ImmutableMultimap<GrantTargetType, String> grantTargets;

    public Grant(ImmutableCollection<String> privileges, ImmutableMultimap<GrantTargetType, String> grantTargets) {
        this.privileges = Validate.notNull(privileges);
        this.grantTargets = Validate.notNull(grantTargets);
    }

    public ImmutableCollection<String> getPrivileges() {
        return this.privileges;
    }

    public Multimap<GrantTargetType, String> getGrantTargets() {
        return grantTargets;
    }

    public void validate() {
        if (privileges.isEmpty()) {
            throw new RuntimeException("privileges cannot be empty!!!");
        }
        if (grantTargets.isEmpty()) {
            throw new RuntimeException("grantTargets (i.e. user or group list for a grant) cannot be empty!!!");
        }
    }
}


text:
class MatlabScalar {
public:

  // This constructor accepts as input a pointer to a Matlab array
  // which must be a scalar in double precision.
  explicit MatlabScalar (const mxArray* ptr);

  // This constructor creates a new Matlab array which is a scalar
  // in double precision.
  MatlabScalar (mxArray*& ptr, double value);

  // The copy constructor.
  MatlabScalar (MatlabScalar& source);

  // The destructor.
  ~MatlabScalar() { };

  // Access the value of the scalar.
  operator const double () const { return x; };

  // Assign the value of the scalar.
  MatlabScalar& operator= (double value);

protected:
  double& x;

  // The copy assignment operator is kept protected because it is
  // invalid.
  MatlabScalar& operator= (const MatlabScalar& source) { return *this; };
};

#endif


text:
<?php
/**
 * User: nikk
 * Date: 2/4/14
 * Time: 3:47 PM
 */

namespace Sp\AppBundle\Command;

use Doctrine\Bundle\DoctrineBundle\Registry;
use Sp\AppBundle\Entity\EventTemplate;
use Sp\AppBundle\Model\CourseManager;
use Sp\AppBundle\Model\DistanceManager;
use Sp\AppBundle\Model\SwimmingStyleManager;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class ImportEventsCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this
            ->setName('sp:app:import-events')
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $handle = fopen(__DIR__ . '\Event_ID.csv','r');
        $fields = fgetcsv($handle);

        $i = 0;
        $em = $this->getDoctrine()->getManager();
        while ( ($data = fgetcsv($handle) ) !== false ) {
            $data[0] = trim($data[0]);
            $params = explode(' ', $data[0]);
            if(count($params) === 4) {
                $params[1] = $params[1] . ' ' . $params[2];
                $params[2] = $params[3];
            }
            $distance = $this->getDistanceManager()->findOrCreate($params[0]);
            $swimmingStyle = $this->getSwimmingStyleManager()->findOrCreate($params[1]);
            $course = $this->getCourseManager()->findOrCreate($params[2]);

            $eventTemplate = new EventTemplate();
            $eventTemplate->setTitle($data[0]);
            $eventTemplate->setDistance($distance);
            $eventTemplate->setStyle($swimmingStyle);
            $eventTemplate->setCourse($course);

            $em->persist($eventTemplate);
            $em->flush();
        }
        $output->writeln('Done');
    }

    /**
     * @return Registry
     */
    protected function getDoctrine()
    {
        return $this->getContainer()->get('doctrine');
    }

    /**
     * @return CourseManager
     */
    protected function getCourseManager()
    {
        return $this->getContainer()->get('sp_app.course_manager');
    }

    /**
     * @return DistanceManager
     */
    protected function getDistanceManager()
    {
        return $this->getContainer()->get('sp_app.distance_manager');
    }

    /**
     * @return SwimmingStyleManager
     */
    protected function getSwimmingStyleManager()
    {
        return $this->getContainer()->get('sp_app.swimming_style_manager');
    }
}


text:
include_recipe "otspostgresql-replication::users"
include_recipe "otspostgresql-replication::directories"
include_recipe "otspostgresql-replication::installPostgreSQL"
include_recipe "otspostgresql-replication::postInstallPostgreSQL"


text:
.PHONY: all build test lint

BUILD_IN_CONTAINER ?= true
RM=--rm
BUILD_UPTODATE=backend/.image.uptodate
BUILD_IMAGE=checkpoint_build

all: build

$(BUILD_UPTODATE): backend/*
	docker build -t $(BUILD_IMAGE) backend
	touch $@

ifeq ($(BUILD_IN_CONTAINER),true)

build test lint: $(BUILD_UPTODATE)
	$(SUDO) docker run $(RM) -ti \
		-v $(shell pwd):/go/src/github.com/weaveworks/go-checkpoint \
		-e GOARCH -e GOOS -e BUILD_IN_CONTAINER=false \
		$(BUILD_IMAGE) $@

else

build:
	go get .
	go build .

test:
	go get -t .
	go test

lint:
	./tools/lint -notestpackage .

endif


text:
<?php

namespace DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRBackboneElement\FHIRImmunizationRecommendation;

use DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRBackboneElement;
use DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRInteger;
use DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRReference;
use DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRString;
use DCarbone\PHPFHIRGenerated\DSTU2\PHPFHIRConstants;
use DCarbone\PHPFHIRGenerated\DSTU2\PHPFHIRTypeInterface;

/**
 * A patient's point-in-time immunization and recommendation (i.e. forecasting a
 * patient's immunization eligibility according to a published schedule) with
 * optional supporting justification.
 *
 * Class FHIRImmunizationRecommendationProtocol
 * @package \DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRBackboneElement\FHIRImmunizationRecommendation
 */
class FHIRImmunizationRecommendationProtocol extends FHIRBackboneElement
{
    // name of FHIR type this class describes
    const FHIR_TYPE_NAME = PHPFHIRConstants::TYPE_NAME_IMMUNIZATION_RECOMMENDATION_DOT_PROTOCOL;
    const FIELD_AUTHORITY = 'authority';
    const FIELD_DESCRIPTION = 'description';
    const FIELD_DESCRIPTION_EXT = '_description';
    const FIELD_DOSE_SEQUENCE = 'doseSequence';
    const FIELD_DOSE_SEQUENCE_EXT = '_doseSequence';
    const FIELD_SERIES = 'series';
    const FIELD_SERIES_EXT = '_series';

    /** @var string */
    private $_xmlns = 'http://hl7.org/fhir';

    /**
     * A reference from one resource to another.
     * If the element is present, it must have a value for at least one of the defined
     * elements, an \@id referenced from the Narrative, or extensions
     *
     * Indicates the authority who published the protocol. For example, ACIP.
     *
     * @var null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRReference
     */
    protected $authority = null;

    /**
     * A sequence of Unicode characters
     * Note that FHIR strings may not exceed 1MB in size
     * If the element is present, it must have either a \@value, an \@id, or extensions
     *
     * Contains the description about the protocol under which the vaccine was
     * administered.
     *
     * @var null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRString
     */
    protected $description = null;

    /**
     * A whole number
     * 32 bit number; for values larger than this, use decimal
     * If the element is present, it must have either a \@value, an \@id, or extensions
     *
     * Indicates the nominal position in a series of the next dose. This is the
     * recommended dose number as per a specified protocol.
     *
     * @var null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRInteger
     */
    protected $doseSequence = null;

    /**
     * A sequence of Unicode characters
     * Note that FHIR strings may not exceed 1MB in size
     * If the element is present, it must have either a \@value, an \@id, or extensions
     *
     * One possible path to achieve presumed immunity against a disease - within the
     * context of an authority.
     *
     * @var null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRString
     */
    protected $series = null;

    /**
     * Validation map for fields in type ImmunizationRecommendation.Protocol
     * @var array
     */
    private static $_validationRules = [    ];

    /**
     * FHIRImmunizationRecommendationProtocol Constructor
     * @param null|array $data
     */
    public function __construct($data = null)
    {
        if (null === $data || [] === $data) {
            return;
        }
        if (!is_array($data)) {
            throw new \InvalidArgumentException(sprintf(
                'FHIRImmunizationRecommendationProtocol::_construct - $data expected to be null or array, %s seen',
                gettype($data)
            ));
        }
        parent::__construct($data);
        if (isset($data[self::FIELD_AUTHORITY])) {
            if ($data[self::FIELD_AUTHORITY] instanceof FHIRReference) {
                $this->setAuthority($data[self::FIELD_AUTHORITY]);
            } else {
                $this->setAuthority(new FHIRReference($data[self::FIELD_AUTHORITY]));
            }
        }
        if (isset($data[self::FIELD_DESCRIPTION]) || isset($data[self::FIELD_DESCRIPTION_EXT])) {
            if (isset($data[self::FIELD_DESCRIPTION])) {
                $value = $data[self::FIELD_DESCRIPTION];
            } else {
                $value = null;
            }
            if (isset($data[self::FIELD_DESCRIPTION_EXT]) && is_array($data[self::FIELD_DESCRIPTION_EXT])) {
                $ext = $data[self::FIELD_DESCRIPTION_EXT];
            } else {
                $ext = [];
            }
            if (null !== $value) {
                if ($value instanceof FHIRString) {
                    $this->setDescription($value);
                } else if (is_array($value)) {
                    $this->setDescription(new FHIRString(array_merge($ext, $value)));
                } else {
                    $this->setDescription(new FHIRString([FHIRString::FIELD_VALUE => $value] + $ext));
                }
            } else if ([] !== $ext) {
                $this->setDescription(new FHIRString($ext));
            }
        }
        if (isset($data[self::FIELD_DOSE_SEQUENCE]) || isset($data[self::FIELD_DOSE_SEQUENCE_EXT])) {
            if (isset($data[self::FIELD_DOSE_SEQUENCE])) {
                $value = $data[self::FIELD_DOSE_SEQUENCE];
            } else {
                $value = null;
            }
            if (isset($data[self::FIELD_DOSE_SEQUENCE_EXT]) && is_array($data[self::FIELD_DOSE_SEQUENCE_EXT])) {
                $ext = $data[self::FIELD_DOSE_SEQUENCE_EXT];
            } else {
                $ext = [];
            }
            if (null !== $value) {
                if ($value instanceof FHIRInteger) {
                    $this->setDoseSequence($value);
                } else if (is_array($value)) {
                    $this->setDoseSequence(new FHIRInteger(array_merge($ext, $value)));
                } else {
                    $this->setDoseSequence(new FHIRInteger([FHIRInteger::FIELD_VALUE => $value] + $ext));
                }
            } else if ([] !== $ext) {
                $this->setDoseSequence(new FHIRInteger($ext));
            }
        }
        if (isset($data[self::FIELD_SERIES]) || isset($data[self::FIELD_SERIES_EXT])) {
            if (isset($data[self::FIELD_SERIES])) {
                $value = $data[self::FIELD_SERIES];
            } else {
                $value = null;
            }
            if (isset($data[self::FIELD_SERIES_EXT]) && is_array($data[self::FIELD_SERIES_EXT])) {
                $ext = $data[self::FIELD_SERIES_EXT];
            } else {
                $ext = [];
            }
            if (null !== $value) {
                if ($value instanceof FHIRString) {
                    $this->setSeries($value);
                } else if (is_array($value)) {
                    $this->setSeries(new FHIRString(array_merge($ext, $value)));
                } else {
                    $this->setSeries(new FHIRString([FHIRString::FIELD_VALUE => $value] + $ext));
                }
            } else if ([] !== $ext) {
                $this->setSeries(new FHIRString($ext));
            }
        }
    }

    /**
     * @return string
     */
    public function _getFHIRTypeName()
    {
        return self::FHIR_TYPE_NAME;
    }

    /**
     * @return string
     */
    public function _getFHIRXMLElementDefinition()
    {
        $xmlns = $this->_getFHIRXMLNamespace();
        if (null !== $xmlns) {
            $xmlns = " xmlns=\"{$xmlns}\"";
        }
        return "<ImmunizationRecommendationProtocol{$xmlns}></ImmunizationRecommendationProtocol>";
    }

    /**
     * A reference from one resource to another.
     * If the element is present, it must have a value for at least one of the defined
     * elements, an \@id referenced from the Narrative, or extensions
     *
     * Indicates the authority who published the protocol. For example, ACIP.
     *
     * @return null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRReference
     */
    public function getAuthority()
    {
        return $this->authority;
    }

    /**
     * A reference from one resource to another.
     * If the element is present, it must have a value for at least one of the defined
     * elements, an \@id referenced from the Narrative, or extensions
     *
     * Indicates the authority who published the protocol. For example, ACIP.
     *
     * @param null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRReference $authority
     * @return static
     */
    public function setAuthority(FHIRReference $authority = null)
    {
        $this->authority = $authority;
        return $this;
    }

    /**
     * A sequence of Unicode characters
     * Note that FHIR strings may not exceed 1MB in size
     * If the element is present, it must have either a \@value, an \@id, or extensions
     *
     * Contains the description about the protocol under which the vaccine was
     * administered.
     *
     * @return null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRString
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * A sequence of Unicode characters
     * Note that FHIR strings may not exceed 1MB in size
     * If the element is present, it must have either a \@value, an \@id, or extensions
     *
     * Contains the description about the protocol under which the vaccine was
     * administered.
     *
     * @param null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRString $description
     * @return static
     */
    public function setDescription($description = null)
    {
        if (null === $description) {
            $this->description = null;
            return $this;
        }
        if ($description instanceof FHIRString) {
            $this->description = $description;
            return $this;
        }
        $this->description = new FHIRString($description);
        return $this;
    }

    /**
     * A whole number
     * 32 bit number; for values larger than this, use decimal
     * If the element is present, it must have either a \@value, an \@id, or extensions
     *
     * Indicates the nominal position in a series of the next dose. This is the
     * recommended dose number as per a specified protocol.
     *
     * @return null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRInteger
     */
    public function getDoseSequence()
    {
        return $this->doseSequence;
    }

    /**
     * A whole number
     * 32 bit number; for values larger than this, use decimal
     * If the element is present, it must have either a \@value, an \@id, or extensions
     *
     * Indicates the nominal position in a series of the next dose. This is the
     * recommended dose number as per a specified protocol.
     *
     * @param null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRInteger $doseSequence
     * @return static
     */
    public function setDoseSequence($doseSequence = null)
    {
        if (null === $doseSequence) {
            $this->doseSequence = null;
            return $this;
        }
        if ($doseSequence instanceof FHIRInteger) {
            $this->doseSequence = $doseSequence;
            return $this;
        }
        $this->doseSequence = new FHIRInteger($doseSequence);
        return $this;
    }

    /**
     * A sequence of Unicode characters
     * Note that FHIR strings may not exceed 1MB in size
     * If the element is present, it must have either a \@value, an \@id, or extensions
     *
     * One possible path to achieve presumed immunity against a disease - within the
     * context of an authority.
     *
     * @return null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRString
     */
    public function getSeries()
    {
        return $this->series;
    }

    /**
     * A sequence of Unicode characters
     * Note that FHIR strings may not exceed 1MB in size
     * If the element is present, it must have either a \@value, an \@id, or extensions
     *
     * One possible path to achieve presumed immunity against a disease - within the
     * context of an authority.
     *
     * @param null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRString $series
     * @return static
     */
    public function setSeries($series = null)
    {
        if (null === $series) {
            $this->series = null;
            return $this;
        }
        if ($series instanceof FHIRString) {
            $this->series = $series;
            return $this;
        }
        $this->series = new FHIRString($series);
        return $this;
    }

    /**
     * Returns the validation rules that this type's fields must comply with to be considered "valid"
     * The returned array is in ["fieldname[.offset]" => ["rule" => {constraint}]]
     *
     * @return array
     */
    public function _getValidationRules()
    {
        return self::$_validationRules;
    }

    /**
     * Validates that this type conforms to the specifications set forth for it by FHIR.  An empty array must be seen as
     * passing.
     *
     * @return array
     */
    public function _getValidationErrors()
    {
        $errs = parent::_getValidationErrors();
        $validationRules = $this->_getValidationRules();
        if (null !== ($v = $this->getAuthority())) {
            if ([] !== ($fieldErrs = $v->_getValidationErrors())) {
                $errs[self::FIELD_AUTHORITY] = $fieldErrs;
            }
        }
        if (null !== ($v = $this->getDescription())) {
            if ([] !== ($fieldErrs = $v->_getValidationErrors())) {
                $errs[self::FIELD_DESCRIPTION] = $fieldErrs;
            }
        }
        if (null !== ($v = $this->getDoseSequence())) {
            if ([] !== ($fieldErrs = $v->_getValidationErrors())) {
                $errs[self::FIELD_DOSE_SEQUENCE] = $fieldErrs;
            }
        }
        if (null !== ($v = $this->getSeries())) {
            if ([] !== ($fieldErrs = $v->_getValidationErrors())) {
                $errs[self::FIELD_SERIES] = $fieldErrs;
            }
        }
        if (isset($validationRules[self::FIELD_AUTHORITY])) {
            $v = $this->getAuthority();
            foreach($validationRules[self::FIELD_AUTHORITY] as $rule => $constraint) {
                $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_IMMUNIZATION_RECOMMENDATION_DOT_PROTOCOL, self::FIELD_AUTHORITY, $rule, $constraint, $v);
                if (null !== $err) {
                    if (!isset($errs[self::FIELD_AUTHORITY])) {
                        $errs[self::FIELD_AUTHORITY] = [];
                    }
                    $errs[self::FIELD_AUTHORITY][$rule] = $err;
                }
            }
        }
        if (isset($validationRules[self::FIELD_DESCRIPTION])) {
            $v = $this->getDescription();
            foreach($validationRules[self::FIELD_DESCRIPTION] as $rule => $constraint) {
                $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_IMMUNIZATION_RECOMMENDATION_DOT_PROTOCOL, self::FIELD_DESCRIPTION, $rule, $constraint, $v);
                if (null !== $err) {
                    if (!isset($errs[self::FIELD_DESCRIPTION])) {
                        $errs[self::FIELD_DESCRIPTION] = [];
                    }
                    $errs[self::FIELD_DESCRIPTION][$rule] = $err;
                }
            }
        }
        if (isset($validationRules[self::FIELD_DOSE_SEQUENCE])) {
            $v = $this->getDoseSequence();
            foreach($validationRules[self::FIELD_DOSE_SEQUENCE] as $rule => $constraint) {
                $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_IMMUNIZATION_RECOMMENDATION_DOT_PROTOCOL, self::FIELD_DOSE_SEQUENCE, $rule, $constraint, $v);
                if (null !== $err) {
                    if (!isset($errs[self::FIELD_DOSE_SEQUENCE])) {
                        $errs[self::FIELD_DOSE_SEQUENCE] = [];
                    }
                    $errs[self::FIELD_DOSE_SEQUENCE][$rule] = $err;
                }
            }
        }
        if (isset($validationRules[self::FIELD_SERIES])) {
            $v = $this->getSeries();
            foreach($validationRules[self::FIELD_SERIES] as $rule => $constraint) {
                $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_IMMUNIZATION_RECOMMENDATION_DOT_PROTOCOL, self::FIELD_SERIES, $rule, $constraint, $v);
                if (null !== $err) {
                    if (!isset($errs[self::FIELD_SERIES])) {
                        $errs[self::FIELD_SERIES] = [];
                    }
                    $errs[self::FIELD_SERIES][$rule] = $err;
                }
            }
        }
        if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {
            $v = $this->getModifierExtension();
            foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {
                $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_BACKBONE_ELEMENT, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);
                if (null !== $err) {
                    if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {
                        $errs[self::FIELD_MODIFIER_EXTENSION] = [];
                    }
                    $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;
                }
            }
        }
        if (isset($validationRules[self::FIELD_EXTENSION])) {
            $v = $this->getExtension();
            foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {
                $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);
                if (null !== $err) {
                    if (!isset($errs[self::FIELD_EXTENSION])) {
                        $errs[self::FIELD_EXTENSION] = [];
                    }
                    $errs[self::FIELD_EXTENSION][$rule] = $err;
                }
            }
        }
        if (isset($validationRules[self::FIELD_ID])) {
            $v = $this->getId();
            foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {
                $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);
                if (null !== $err) {
                    if (!isset($errs[self::FIELD_ID])) {
                        $errs[self::FIELD_ID] = [];
                    }
                    $errs[self::FIELD_ID][$rule] = $err;
                }
            }
        }
        return $errs;
    }

    /**
     * @param \SimpleXMLElement|string|null $sxe
     * @param null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRBackboneElement\FHIRImmunizationRecommendation\FHIRImmunizationRecommendationProtocol $type
     * @param null|int $libxmlOpts
     * @return null|\DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRBackboneElement\FHIRImmunizationRecommendation\FHIRImmunizationRecommendationProtocol
     */
    public static function xmlUnserialize($sxe = null, PHPFHIRTypeInterface $type = null, $libxmlOpts = 591872)
    {
        if (null === $sxe) {
            return null;
        }
        if (is_string($sxe)) {
            libxml_use_internal_errors(true);
            $sxe = new \SimpleXMLElement($sxe, $libxmlOpts, false);
            if ($sxe === false) {
                throw new \DomainException(sprintf('FHIRImmunizationRecommendationProtocol::xmlUnserialize - String provided is not parseable as XML: %s', implode(', ', array_map(function(\libXMLError $err) { return $err->message; }, libxml_get_errors()))));
            }
            libxml_use_internal_errors(false);
        }
        if (!($sxe instanceof \SimpleXMLElement)) {
            throw new \InvalidArgumentException(sprintf('FHIRImmunizationRecommendationProtocol::xmlUnserialize - $sxe value must be null, \\SimpleXMLElement, or valid XML string, %s seen', gettype($sxe)));
        }
        if (null === $type) {
            $type = new FHIRImmunizationRecommendationProtocol;
        } elseif (!is_object($type) || !($type instanceof FHIRImmunizationRecommendationProtocol)) {
            throw new \RuntimeException(sprintf(
                'FHIRImmunizationRecommendationProtocol::xmlUnserialize - $type must be instance of \DCarbone\PHPFHIRGenerated\DSTU2\FHIRElement\FHIRBackboneElement\FHIRImmunizationRecommendation\FHIRImmunizationRecommendationProtocol or null, %s seen.',
                is_object($type) ? get_class($type) : gettype($type)
            ));
        }
        FHIRBackboneElement::xmlUnserialize($sxe, $type);
        $xmlNamespaces = $sxe->getDocNamespaces(false, false);
        if ([] !== $xmlNamespaces) {
            $ns = reset($xmlNamespaces);
            if (false !== $ns && '' !== $ns) {
                $type->_xmlns = $ns;
            }
        }
        $attributes = $sxe->attributes();
        $children = $sxe->children();
        if (isset($children->authority)) {
            $type->setAuthority(FHIRReference::xmlUnserialize($children->authority));
        }
        if (isset($children->description)) {
            $type->setDescription(FHIRString::xmlUnserialize($children->description));
        }
        if (isset($attributes->description)) {
            $pt = $type->getDescription();
            if (null !== $pt) {
                $pt->setValue((string)$attributes->description);
            } else {
                $type->setDescription((string)$attributes->description);
            }
        }
        if (isset($children->doseSequence)) {
            $type->setDoseSequence(FHIRInteger::xmlUnserialize($children->doseSequence));
        }
        if (isset($attributes->doseSequence)) {
            $pt = $type->getDoseSequence();
            if (null !== $pt) {
                $pt->setValue((string)$attributes->doseSequence);
            } else {
                $type->setDoseSequence((string)$attributes->doseSequence);
            }
        }
        if (isset($children->series)) {
            $type->setSeries(FHIRString::xmlUnserialize($children->series));
        }
        if (isset($attributes->series)) {
            $pt = $type->getSeries();
            if (null !== $pt) {
                $pt->setValue((string)$attributes->series);
            } else {
                $type->setSeries((string)$attributes->series);
            }
        }
        return $type;
    }

    /**
     * @param null|\SimpleXMLElement $sxe
     * @param null|int $libxmlOpts
     * @return \SimpleXMLElement
     */
    public function xmlSerialize(\SimpleXMLElement $sxe = null, $libxmlOpts = 591872)
    {
        if (null === $sxe) {
            $sxe = new \SimpleXMLElement($this->_getFHIRXMLElementDefinition(), $libxmlOpts, false);
        }
        parent::xmlSerialize($sxe);
        if (null !== ($v = $this->getAuthority())) {
            $v->xmlSerialize($sxe->addChild(self::FIELD_AUTHORITY, null, $v->_getFHIRXMLNamespace()));
        }
        if (null !== ($v = $this->getDescription())) {
            $v->xmlSerialize($sxe->addChild(self::FIELD_DESCRIPTION, null, $v->_getFHIRXMLNamespace()));
        }
        if (null !== ($v = $this->getDoseSequence())) {
            $v->xmlSerialize($sxe->addChild(self::FIELD_DOSE_SEQUENCE, null, $v->_getFHIRXMLNamespace()));
        }
        if (null !== ($v = $this->getSeries())) {
            $v->xmlSerialize($sxe->addChild(self::FIELD_SERIES, null, $v->_getFHIRXMLNamespace()));
        }
        return $sxe;
    }

    /**
     * @return array
     */
    public function jsonSerialize()
    {
        $a = parent::jsonSerialize();
        if (null !== ($v = $this->getAuthority())) {
            $a[self::FIELD_AUTHORITY] = $v;
        }
        if (null !== ($v = $this->getDescription())) {
            $a[self::FIELD_DESCRIPTION] = $v->getValue();
            $enc = $v->jsonSerialize();
            $cnt = count($enc);
            if (0 < $cnt && (1 !== $cnt || (1 === $cnt && !array_key_exists(FHIRString::FIELD_VALUE, $enc)))) {
                unset($enc[FHIRString::FIELD_VALUE]);
                $a[self::FIELD_DESCRIPTION_EXT] = $enc;
            }
        }
        if (null !== ($v = $this->getDoseSequence())) {
            $a[self::FIELD_DOSE_SEQUENCE] = $v->getValue();
            $enc = $v->jsonSerialize();
            $cnt = count($enc);
            if (0 < $cnt && (1 !== $cnt || (1 === $cnt && !array_key_exists(FHIRInteger::FIELD_VALUE, $enc)))) {
                unset($enc[FHIRInteger::FIELD_VALUE]);
                $a[self::FIELD_DOSE_SEQUENCE_EXT] = $enc;
            }
        }
        if (null !== ($v = $this->getSeries())) {
            $a[self::FIELD_SERIES] = $v->getValue();
            $enc = $v->jsonSerialize();
            $cnt = count($enc);
            if (0 < $cnt && (1 !== $cnt || (1 === $cnt && !array_key_exists(FHIRString::FIELD_VALUE, $enc)))) {
                unset($enc[FHIRString::FIELD_VALUE]);
                $a[self::FIELD_SERIES_EXT] = $enc;
            }
        }
        if ([] !== ($vs = $this->_getFHIRComments())) {
            $a[PHPFHIRConstants::JSON_FIELD_FHIR_COMMENTS] = $vs;
        }
        return $a;
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return self::FHIR_TYPE_NAME;
    }
}


text:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class RoundManager : MonoBehaviour {

	public GUIStyle myGui;

	public float initialTimer = 250.0f;
	public float timer = 0.0f;
	public float interRoundTimer = 3.0f;
	public int currentRound = 0;

	public bool interRound = false;
	public bool upScore = false;
	bool gameOver = false;

	bool showTimerInterRound = false;
	bool startTimer = true;

	public int playerOneScore = 0;
	public int playerTwoScore = 0;

	public GameObject playerScript;
	public GameObject rotationScript;
	public GameObject[] geyserScript;
	public GameObject facetteScript;

	public int counter = 0;

	public Text player1ScoreUI;
	public Text player2ScoreUI;

	public GameObject inGameUI;

	public GameObject pouvoirsP1Panel;
	public GameObject pouvoirsP2Panel;
	public Image pouvoirRotationP1;
	public Image pouvoirRotationP2;
	public Sprite pouvoirRotationAvailable;
	public Sprite pouvoirRotationNotAvailable;
	public Image pouvoirSwitchP1;
	public Image pouvoirSwitchP2;
	public Sprite pouvoirSwitchAvailable;
	public Sprite pouvoirSwitchNotAvailable;
	public Image pouvoirGeyserP1;
	public Image pouvoirGeyserP2;
	public Sprite pouvoirGeyserAvailable;
	public Sprite pouvoirGeyserNotAvailable;

	public float pouvoirRotationTimer;
	private float lastRotationTime;

	public float pouvoirSwitchTimer;
	private float lastSwitchTime;

	public float pouvoirGeyserTimer;
	private float lastGeyserTime;

	private bool gameIsRunning;

	public bool IsGameRunning()
	{
		return gameIsRunning;
	}

	public bool IsRotationAvailable()
	{
		return (Time.time - lastRotationTime) > pouvoirRotationTimer;
	}
	public bool IsSwitchAvailable()
	{
		return (Time.time - lastSwitchTime) > pouvoirSwitchTimer;
	}
	public bool IsGeyserAvailable()
	{
		return (Time.time - lastGeyserTime) > pouvoirGeyserTimer;
	}

	private void UpdatePouvoirsAvailability()
	{
		pouvoirRotationP1.sprite = IsRotationAvailable() ? pouvoirRotationAvailable : pouvoirRotationNotAvailable;
		pouvoirRotationP2.sprite = IsRotationAvailable() ? pouvoirRotationAvailable : pouvoirRotationNotAvailable;
		pouvoirSwitchP1.sprite = IsSwitchAvailable() ? pouvoirSwitchAvailable : pouvoirSwitchNotAvailable;
		pouvoirSwitchP2.sprite = IsSwitchAvailable() ? pouvoirSwitchAvailable : pouvoirSwitchNotAvailable;
		pouvoirGeyserP1.sprite = IsGeyserAvailable() ? pouvoirGeyserAvailable : pouvoirGeyserNotAvailable;
		pouvoirGeyserP2.sprite = IsGeyserAvailable() ? pouvoirGeyserAvailable : pouvoirGeyserNotAvailable;
	}

	public void UseRotation()
	{
		lastRotationTime = Time.time;
	}
	public void UseSwitch()
	{
		lastSwitchTime = Time.time;
	}
	public void UseGeyser()
	{
		lastGeyserTime = Time.time;
	}

	private void ResetPowers()
	{
		UseRotation ();
		UseSwitch ();
		UseGeyser ();
	}

	// Use this for initialization
	void Start ()
	{
		gameIsRunning = false;
	}

	public void StartGame()
	{
		timer = initialTimer;
		playerOneScore = 0;
		playerTwoScore = 0;
		currentRound = 0;
		SetRound ();
		StartCoroutine (WaitAndChangeRound (initialTimer));
		playerScript.GetComponent<PlayerControls> ().StartGame ();
		inGameUI.SetActive (true);
		gameOver = false;
		gameIsRunning = true;
	}

	// Update is called once per frame
	void Update ()
	{
		if (gameIsRunning && !gameOver)
		{
			if (!interRound)
			{
				timer -= Time.deltaTime;
			}

			if (interRound || startTimer)
			{
				interRoundTimer -= Time.deltaTime;
				showTimerInterRound = true;
			}

			if (interRoundTimer <= 0.0f)
			{
				showTimerInterRound = false;
				interRoundTimer = 3.0f;
				startTimer = false;
				interRound = false;
			}

			/*
			if (timer <= 0.0f)
			{
				currentRound++;
				timer = initialTimer;
				interRound = true;
			}

			if(currentRound == 0 || currentRound == 2)
			{
				playerScript.GetComponent<PlayerControls>().P1isHunted = true;
				rotationScript.GetComponent<LevelRotationBehaviour>().P1isHunted = true;
				facetteScript.GetComponent<FacetteSwitchManager>().P1isHunted = true;

				UpdatePouvoirsVisibility(true);

				ResetPowers();

				while(counter < geyserScript.Length)
				{
					geyserScript[counter].GetComponent<Geyser2BehaviourScript>().P1isHunted = true;
					counter++;
				}

				counter = 0;
			}

			else if(currentRound == 1 || currentRound == 3)
			{
				playerScript.GetComponent<PlayerControls>().P1isHunted = false;
				rotationScript.GetComponent<LevelRotationBehaviour>().P1isHunted = false;
				facetteScript.GetComponent<FacetteSwitchManager>().P1isHunted = false;

				UpdatePouvoirsVisibility(false);

				ResetPowers();

				while(counter < geyserScript.Length)
				{
					geyserScript[counter].GetComponent<Geyser2BehaviourScript>().P1isHunted = false;
					counter++;
				}

				counter = 0;
			}
			*/

			if (currentRound == 0 && upScore == true && ! startTimer || currentRound == 2 && upScore == true && ! startTimer)
			{
				playerTwoScore += 10;
				player2ScoreUI.text = playerTwoScore.ToString();
				upScore = false;
			}

			if (currentRound == 1 && upScore == true && ! startTimer || currentRound == 3 && upScore == true && ! startTimer)
			{
				playerOneScore += 10;
				player1ScoreUI.text = playerOneScore.ToString();
				upScore = false;
			}

			UpdatePouvoirsAvailability();
		}
	}

	public MenuEngine menuEngine;

	IEnumerator WaitAndChangeRound(float timer)
	{
		yield return new WaitForSeconds (timer);

		currentRound++;
		timer = initialTimer;
		interRound = true;

		SetRound ();

		if (currentRound == 4)
		{
			gameOver = true;
			menuEngine.ShowGameOver(playerOneScore, playerTwoScore);
		}
		else
		{
			StartCoroutine (WaitAndChangeRound (initialTimer));
		}
	}

	private void SetRound()
	{
		if(currentRound == 0 || currentRound == 2)
		{
			playerScript.GetComponent<PlayerControls>().SetP1IsHunted(true);
			rotationScript.GetComponent<LevelRotationBehaviour>().P1isHunted = true;
			facetteScript.GetComponent<FacetteSwitchManager>().P1isHunted = true;

			UpdatePouvoirsVisibility(true);

			ResetPowers();

			while(counter < geyserScript.Length)
			{
				geyserScript[counter].GetComponent<Geyser2BehaviourScript>().P1isHunted = true;
				counter++;
			}

			counter = 0;
		}

		else if(currentRound == 1 || currentRound == 3)
		{
			playerScript.GetComponent<PlayerControls>().SetP1IsHunted(false);
			rotationScript.GetComponent<LevelRotationBehaviour>().P1isHunted = false;
			facetteScript.GetComponent<FacetteSwitchManager>().P1isHunted = false;

			UpdatePouvoirsVisibility(false);

			ResetPowers();

			while(counter < geyserScript.Length)
			{
				geyserScript[counter].GetComponent<Geyser2BehaviourScript>().P1isHunted = false;
				counter++;
			}

			counter = 0;
		}
	}

	private void UpdatePouvoirsVisibility (bool P1Hunted)
	{
		pouvoirsP1Panel.SetActive (!P1Hunted);
		pouvoirsP2Panel.SetActive (P1Hunted);
	}

}


text:
// Client.cs
//
// Authors:
//   Andrzej Wytyczak-Partyka <iapart@gmail.com>
//   James Willcox <snorp@snorp.net>
//
// Copyright (C) 2008 Andrzej Wytyczak-Partyka
// Copyright (C) 2005  James Willcox <snorp@snorp.net>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//

using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.IO;
using System.Web;
using System.Net;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace DPAP
{

	public class Client
	{

		private const int UpdateSleepInterval = 2 * 60 * 1000; // 2 minutes

        private IPAddress address;
        private UInt16 port;
        private ContentCodeBag bag;
        private ServerInfo server_info;
        private List<Database> databases = new List<Database> ();
        private ContentFetcher fetcher;
        private int revision;
        private bool update_running;
		private string service_name;

        public event EventHandler Updated;

        internal int Revision {
            get { return revision; }
        }

        public string Name {
            get { return service_name; }
        }

        public IPAddress Address {
            get { return address; }
        }

        public ushort Port {
            get { return port; }
        }

        public AuthenticationMethod AuthenticationMethod {
            get { return server_info.AuthenticationMethod; }
        }

        public IList<Database> Databases {
            get { return new ReadOnlyCollection<Database> (databases); }
        }

        internal ContentCodeBag Bag {
            get { return bag; }
        }

        internal ContentFetcher Fetcher {
            get { return fetcher; }
        }

        public Client (Service service) : this (service.Address, service.Port, service.Name) {
        }

        public Client (string host, UInt16 port) : this (Dns.GetHostEntry (host).AddressList [0], port, "") {
        }

        public Client (IPAddress address, UInt16 port, String name) {
            this.address = address;
            this.port = port;
			this.service_name = name;
            fetcher = new ContentFetcher (address, port);
			Login (null,null);

        }

        ~Client () {
            Dispose ();
        }

        public void Dispose () {
            update_running = false;

            if (fetcher != null) {
                fetcher.Dispose ();
                fetcher = null;
            }
        }

        private void ParseSessionId (ContentNode node) {
            fetcher.SessionId = (int) node.GetChild ("dmap.sessionid").Value;
        }

        public void Login () {
            Login (null, null);
        }

        public void Login (string password) {
            Login (null, password);
        }

        public void Login (string username, string password) {
            fetcher.Username = username;
            fetcher.Password = password;

            try {
                bag = ContentCodeBag.ParseCodes (fetcher.Fetch ("/content-codes"));

                ContentNode node = ContentParser.Parse (bag, fetcher.Fetch ("/login"));
                ParseSessionId (node);

                FetchDatabases ();
                Refresh ();
               // FIXME - the update handling mechanism is currently disabled
               /* if (server_info.SupportsUpdate) {
                    update_running = true;
                    Thread thread = new Thread (UpdateLoop);
                    thread.IsBackground = true;
                    thread.Start ();
                }*/
            } catch (WebException e) {
                if (e.Response != null && (e.Response as HttpWebResponse).StatusCode == HttpStatusCode.Unauthorized)
                    throw new AuthenticationException ("Username or password incorrect");
                else
                    throw new LoginException ("Failed to login", e);
            } catch (Exception e) {
                throw new LoginException ("Failed to login", e);
            }
        }

        public void Logout () {
            try {
                update_running = false;
                fetcher.KillAll ();
                fetcher.Fetch ("/logout");
            } catch (WebException) {
                // some servers don't implement this, etc.
            }

            fetcher.SessionId = 0;
        }

        private void FetchDatabases () {
            ContentNode dbnode = ContentParser.Parse (bag, fetcher.Fetch ("/databases"));
			// DEBUG
			//dbnode.Dump ();

            foreach (ContentNode child in (ContentNode []) dbnode.Value) {
                if (child.Name != "dmap.listing")
                    continue;

                foreach (ContentNode item in (ContentNode []) child.Value) {
					// DEBUG
					//item.Dump ();
                    Database db = new Database (this, item);
					Console.WriteLine ("Adding database {0} with id={1} and album count={2}." , db.Name,db.Id,db.Albums.Count);
					//Console.WriteLine ("Photo " + db.Photos [0].FileName);
                    databases.Add (db);
                }
            }
        }

        private int GetCurrentRevision () {
            ContentNode rev_node = ContentParser.Parse (bag, fetcher.Fetch ("/update"), "dmap.serverrevision");
            return (int) rev_node.Value;
        }

        private int WaitForRevision (int currentRevision) {
            ContentNode rev_node = ContentParser.Parse (bag, fetcher.Fetch ("/update",
                                                                           "revision-number=" + currentRevision));

            return (int) rev_node.GetChild ("dmap.serverrevision").Value;
        }

        private void Refresh () {
            int newrev = 0;

           /* if (server_info.SupportsUpdate) {
                if (revision == 0)
                    newrev = GetCurrentRevision ();
                else
                    newrev = WaitForRevision (revision);

                if (newrev == revision)
                    return;
            }
             */
            // Console.WriteLine ("Got new revision: " + newrev);
            foreach (Database db in databases) {
                db.Refresh (newrev);
            }

            revision = newrev;
            if (Updated != null)
                Updated (this, new EventArgs ());
        }

        private void UpdateLoop () {
            while (true) {
                try {
                    if (!update_running)
                        break;

                    Refresh ();
                } catch (WebException) {
                    if (!update_running)
                        break;

                    // chill out for a while, maybe the server went down
                    // temporarily or something.
                    Thread.Sleep (UpdateSleepInterval);
                } catch (Exception e) {
                    if (!update_running)
                        break;

                    Console.Error.WriteLine ("Exception in update loop: " + e);
                    Thread.Sleep (UpdateSleepInterval);
                }
            }
        }
    }
}


text:
class Solution(object):
    def isValidSudoku(self, board):
        """
        :type board: List[List[str]]
        :rtype: bool
        """
        if len(board) <> 9 or len(board[0]) <> 9:return false

        def testSudoku(boardlist):
            itemmap = set()
            for item in boardlist:
                if item == '.':continue
                if item in itemmap:
                    return False
                else:itemmap.add(item)
            return True

        for column in board:
            if not testSudoku(column):return False
        for i in range(9):
            row = [r[i] for r in board]
            if not testSudoku(row):return False
        for i in range(0,9,3):
            for j in range(0,9,3):
                block = [board[i+x][j+y] for x in range(3) for y in range(3)]
                if not testSudoku(block):return False

        return True


text:
<?php

namespace Wdi\Http\Handlers\Paste;

use Illuminate\View\View;
use Wdi\Http\Handlers\Handler;

/**
 * Class CreatePasteHandler
 *
 * @package Wdi\Http\Handlers
 */
final class CreatePasteHandler extends Handler
{
    /**
     * Display the right view to create a new paste
     *
     * @return \Illuminate\View\View
     */
    public function __invoke() : View
    {
        return view("paste.create");
    }
}


text:
hft-exe
=======

Make Exe/App/package for HappyFunTimes

This program makes a native Windows and OSX installer and native like app for [happyFunTimes](http://greggman.github.io/HappyFunTimes).

It does this by packaging up node and building an installer.

For Windows it uses the [Nullsoft Installer](http://nsis.sourceforge.net/) to create
the installer. The app is just node which when launched will open a command prompt.

For OSX it uses tools included with XCode to create the installer. It launches node
through [a small app](http://github.com/greggman/hft-osx-launcher) that provides
a simple GUI wrapper for a command line app.


text:
require File.dirname(__FILE__) + '/../spec_helper'

describe 'With the contents and users fixtures loaded' do
  before(:each) do
    User.stub!(:salt).and_return('change-me')
  end

  it 'Calling User.authenticate with a valid user/password combo returns a user' do
    User.authenticate('bob', 'test').should == users(:bob)
  end

  it 'User.authenticate(user,invalid) returns nil' do
    User.authenticate('bob', 'wrong password').should be_nil
  end

  it 'User.authenticate(invalid,whatever) returns nil' do
    User.authenticate('userwhodoesnotexist', 'what ever').should be_nil
  end

  it 'The various article finders work appropriately' do
    users(:tobi).articles.size.should == 7
#    User.find(1).articles.find_published.size.should == Article.find(:all, :conditions => {:published => true}).size
    users(:tobi).articles.published.size.should == 6
  end

  it 'authenticate? works as expected' do
    User.should be_authenticate('bob', 'test')
    User.should_not be_authenticate('bob', 'duff password')
  end
end

describe 'With a new user' do
  before(:each) do
    @user = User.new :login => 'not_bob'
    set_password 'a secure password'
  end

  it 'password cannot be too short' do
    set_password 'tiny'
    @user.should_not be_valid
    @user.errors.should be_invalid('password')
  end

  it 'password cannot be too long' do
    set_password 'x' * 80
    @user.should_not be_valid
    @user.errors.should be_invalid('password')
  end

  it 'password cannot be blank' do
    set_password ''
    @user.should_not be_valid
    @user.errors.should be_invalid('password')
  end

  it 'password can be just right' do
    set_password 'Just right'
    @user.should be_valid
  end

  it 'login cannot be too short' do
    @user.login = 'x'
    @user.should_not be_valid
    @user.errors.should be_invalid('login')
  end

  it 'login cannot be too long' do
    @user.login = 'repetitivebob' * 10
    @user.should_not be_valid
    @user.errors.should be_invalid('login')
  end

  it 'login cannot be blank' do
    @user.login = ''
    @user.should_not be_valid
    @user.errors.should be_invalid('login')
  end

  it 'login can be just right' do
    @user.login = 'okbob'
    @user.should be_valid
  end

  def set_password(newpass)
    @user.password = @user.password_confirmation = newpass
  end
end

describe 'With a user, "bob" in the database' do
  before(:each) do
    User.delete_all
    u = User.new(:login => 'bob')
    u.password = u.password_confirmation = 'secure password'
    u.save!
  end

  it 'should not be able to create another user with the same login' do
    u = User.new(:login => 'bob') {|u| u.password = u.password_confirmation = 'secure password'}

    u.should_not be_valid
    u.errors.should be_invalid('login')
  end
end


text:
import React from 'react'
import renderer from 'react-test-renderer'
import 'jest-styled-components'
import { VerticalStepper } from './index'

describe('<VerticalStepper />', () => {
  let component

  describe('with all sub-components', () => {
    beforeEach(() => {
      component = renderer
        .create(
          <VerticalStepper>
            <VerticalStepper.Step success href="#">
              <VerticalStepper.Title>Title</VerticalStepper.Title>

              <VerticalStepper.Link>Link</VerticalStepper.Link>
            </VerticalStepper.Step>

            <VerticalStepper.Step valid href="#">
              <VerticalStepper.Title>Title</VerticalStepper.Title>

              <VerticalStepper.List>
                <VerticalStepper.List.Item>Item</VerticalStepper.List.Item>
                <VerticalStepper.List.Item>Item</VerticalStepper.List.Item>
                <VerticalStepper.List.Item>…</VerticalStepper.List.Item>
              </VerticalStepper.List>

              <VerticalStepper.Link>Link</VerticalStepper.Link>
            </VerticalStepper.Step>

            <VerticalStepper.Step error href="#">
              <VerticalStepper.Title>Title</VerticalStepper.Title>

              <VerticalStepper.List>
                <VerticalStepper.List.Item>Item</VerticalStepper.List.Item>
                <VerticalStepper.List.Item>Item</VerticalStepper.List.Item>
              </VerticalStepper.List>

              <VerticalStepper.Link as="a" href="#">
                Link
              </VerticalStepper.Link>
            </VerticalStepper.Step>

            <VerticalStepper.Step waiting href="#">
              <VerticalStepper.Title>Title</VerticalStepper.Title>

              <VerticalStepper.Link>Link</VerticalStepper.Link>
            </VerticalStepper.Step>

            <VerticalStepper.Step href="#">
              <VerticalStepper.Title>Title</VerticalStepper.Title>

              <VerticalStepper.Link>Link</VerticalStepper.Link>
            </VerticalStepper.Step>
          </VerticalStepper>,
        )
        .toJSON()
    })

    it('matches with snapshot', () => {
      expect(component).toMatchSnapshot()
    })
  })
})


text:
<?php

class Google_Service_CloudResourceManager_GetPolicyOptions extends Google_Model
{
  public $requestedPolicyVersion;

  public function setRequestedPolicyVersion($requestedPolicyVersion)
  {
    $this->requestedPolicyVersion = $requestedPolicyVersion;
  }
  public function getRequestedPolicyVersion()
  {
    return $this->requestedPolicyVersion;
  }
}


text:
    Backend services

    <ui-select
      multiple
      nested
      required
      ng-model="$ctrl.command.backendServices[$ctrl.loadBalancerName]"
      class="form-control input-sm"
    >
      <ui-select-match>{{ $item }}</ui-select-match>
      <ui-select-choices
        repeat="backendService in $ctrl.command.backingData.filtered.loadBalancerIndex[$ctrl.loadBalancerName].backendServices | filter: $select.search"
      >

      </ui-select-choices>
    </ui-select>


text:
<!DOCTYPE html>

    <title></title>

Name:

Id:

Description:

                This scenario demonstrates the use of the Windows.Devices.Enumeration.DevicePicker. DevicePicker is a UI control that allows users of your app to pick a device

                Choose a device selector:

                <select id="selectorComboBox" class="win-dropdown"></select>

            <button id="pickSingleDeviceButton" class="win-button">Pick Single Device</button>
            <button id="showDevicePickerButton" class="win-button">Show Device Picker</button>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
        <group>
            <file>file:/E:/Sebastian/Trabajos%20U/3%20Semestre/Multinivel/ProyFactura/src/Logica/Producto.java</file>
            <file>file:/E:/Sebastian/Trabajos%20U/3%20Semestre/Multinivel/ProyFactura/src/Vista/JIProducto.java</file>
            <file>file:/E:/Sebastian/Trabajos%20U/3%20Semestre/Multinivel/ProyFactura/src/Vista/FrmPrincipal.java</file>
            <file>file:/E:/Sebastian/Trabajos%20U/3%20Semestre/Multinivel/ProyFactura/src/Vista/JIFactura.java</file>
        </group>
        <group name="Proyectos U"/>
    </open-files>
</project-private>


text:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<TITLE>curs_bkgd 3x</TITLE>
<link rev=made href="mailto:bug-ncurses@gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

curs_bkgd 3x

curs_bkgd(3x)                                             curs_bkgd(3x)

NAME

       bkgdset,  wbkgdset,  bkgd,  wbkgd, getbkgd - curses window
       background manipulation routines

SYNOPSIS

       #include <curses.h>

       void bkgdset(chtype ch);
       void wbkgdset(WINDOW *win, chtype ch);
       int bkgd(chtype ch);
       int wbkgd(WINDOW *win, chtype ch);
       chtype getbkgd(WINDOW *win);

DESCRIPTION

       The bkgdset and wbkgdset  routines  manipulate  the  back-
       ground  of  the  named window.  The window background is a
       chtype consisting of any combination of attributes  (i.e.,
       rendition)  and  a  character.   The attribute part of the
       background is combined (OR'ed) with all non-blank  charac-
       ters  that  are written into the window with waddch.  Both
       the character and attribute parts of  the  background  are
       combined   with  the  blank  characters.   The  background
       becomes a property of the character  and  moves  with  the
       character   through   any   scrolling   and  insert/delete
       line/character operations.

       To the extent  possible  on  a  particular  terminal,  the
       attribute  part  of  the  background  is  displayed as the
       graphic rendition of the character put on the screen.

       The bkgd and wbkgd functions set the  background  property
       of  the  current  or  specified window and then apply this
       setting to every character position in that window:

              The rendition of every character on the  screen  is
              changed to the new background rendition.

              Wherever  the  former background character appears,
              it is changed to the new background character.

       The getbkgd function returns the  given  window's  current
       background character/attribute pair.

RETURN VALUE

       The  routines  bkgd  and wbkgd return the integer OK.  The
       SVr4.0 manual says "or a non-negative integer  if  immedok
       is set", but this appears to be an error.

NOTES

       Note that bkgdset and bkgd may be macros.

PORTABILITY

       These  functions are described in the XSI Curses standard,
       Issue 4.  It specifies that bkgd and wbkgd return  ERR  on
       failure, but gives no failure conditions.

SEE ALSO

       curses(3x),   curs_addch(3x),   curs_attr(3x),   curs_out-
       opts(3x)

                                                          curs_bkgd(3x)

<ADDRESS>
Man(1) output converted with
man2html
</ADDRESS>


text:
class ofApp : public ofxAudioVisualApp {
public:
    void setup();
	void draw();
    void keyPressed(int key);
    void onSettingChanged(ofAbstractParameter &p);
    void onVisualizationChanged(ofAbstractParameter &p);
    void onBinSizeChanged(ofAbstractParameter &p);
    void reset();

    bool resetting;

    void setupGui();
    void drawGui(ofEventArgs & args);
    void guiKeyPressed(ofKeyEventArgs & args);
    void saveScreenShots(string contextName);

    History history;

    ofParameterGroup visualizations;
    ofParameter<bool> isHistory;

    vector< ofParameter<bool>* > visGroup;

//    GradientSampler gradientSampler;
};


text:
const {
  assertSame, assertEquals
} = Assert;

loadRelativeToScript("../../lib/recorder.js");

// Object without @@unscopables, property is not present, single access
{
  let fallbackCalled = 0;
  let history = [];
  let object = Recorder.watch({}, history);
  with ({get property() { fallbackCalled += 1 }}) {
    with (object) {
      property;
    }
  }
  assertEquals([
    {name: "get", target: object, property: Symbol.unscopables, result: void 0, receiver: object},
    {name: "has", target: object, property: "property", result: false},
  ], history);
  assertSame(1, fallbackCalled);
}

// Object without @@unscopables, property is not present, multi access
{
  let fallbackCalled = 0;
  let history = [];
  let object = Recorder.watch({}, history);
  with ({get property() { fallbackCalled += 1 }}) {
    with (object) {
      property;
      property;
    }
  }
  assertEquals([
    {name: "get", target: object, property: Symbol.unscopables, result: void 0, receiver: object},
    {name: "has", target: object, property: "property", result: false},
    {name: "get", target: object, property: Symbol.unscopables, result: void 0, receiver: object},
    {name: "has", target: object, property: "property", result: false},
  ], history);
  assertSame(2, fallbackCalled);
}

// Object without @@unscopables, property is present, single access
{
  let fallbackCalled = 0;
  let getterCalled = 0;
  let history = [];
  let object = Recorder.watch({get property() { getterCalled += 1 }}, history);
  with ({get property() { fallbackCalled += 1 }}) {
    with (object) {
      property;
    }
  }
  assertEquals([
    {name: "get", target: object, property: Symbol.unscopables, result: void 0, receiver: object},
    {name: "has", target: object, property: "property", result: true},
    {name: "has", target: object, property: "property", result: true},
    {name: "get", target: object, property: "property", result: void 0, receiver: object},
  ], history);
  assertSame(1, getterCalled);
  assertSame(0, fallbackCalled);
}

// Object without @@unscopables, property is present, multi access
{
  let fallbackCalled = 0;
  let getterCalled = 0;
  let history = [];
  let object = Recorder.watch({get property() { getterCalled += 1 }}, history);
  with ({get property() { fallbackCalled += 1 }}) {
    with (object) {
      property;
      property;
    }
  }
  assertEquals([
    {name: "get", target: object, property: Symbol.unscopables, result: void 0, receiver: object},
    {name: "has", target: object, property: "property", result: true},
    {name: "has", target: object, property: "property", result: true},
    {name: "get", target: object, property: "property", result: void 0, receiver: object},
    {name: "get", target: object, property: Symbol.unscopables, result: void 0, receiver: object},
    {name: "has", target: object, property: "property", result: true},
    {name: "has", target: object, property: "property", result: true},
    {name: "get", target: object, property: "property", result: void 0, receiver: object},
  ], history);
  assertSame(2, getterCalled);
  assertSame(0, fallbackCalled);
}


text:
import { CanAccessUserComponentGuard } from './can-access-user-component.guard';
import { CanActivateAdminComponentGuard } from './can-activate-admin-component.guard';
import { CanActivateUnprotectedComponentGuard } from './can-activate-unprotected-component.guard';
import { CanActivateUserComponentGuard } from './can-activate-user-component.guard';
import { CanDeactivateComponent } from './can-leave-exam.guard';
import { CanAccessAdminComponentGuard } from './can-access-admin-component.guard';

export {
    CanAccessUserComponentGuard,
    CanActivateAdminComponentGuard,
    CanActivateUnprotectedComponentGuard,
    CanActivateUserComponentGuard,
    CanDeactivateComponent,
    CanAccessAdminComponentGuard
};