text:
<?php

namespace yii\rbac;

/**
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
interface ManagerInterface
{
    /**
     * Checks if the user has the specified permission.
     * @param string|integer $userId the user ID. This should be either an integer or a string representing
     * the unique identifier of a user. See [[\yii\web\User::id]].
     * @param string $permissionName the name of the permission to be checked against
     * @param array $params name-value pairs that will be passed to the rules associated
     * with the roles and permissions assigned to the user.
     * @return boolean whether the user has the specified permission.
     * @throws \yii\base\InvalidParamException if $permissionName does not refer to an existing permission
     */
    public function checkAccess($userId, $permissionName, $params = []);

    /**
     * Creates a new Role object.
     * Note that the newly created role is not added to the RBAC system yet.
     * You must fill in the needed data and call [[add()]] to add it to the system.
     * @param string $name the role name
     * @return Role the new Role object
     */
    public function createRole($name);

    /**
     * Creates a new Permission object.
     * Note that the newly created permission is not added to the RBAC system yet.
     * You must fill in the needed data and call [[add()]] to add it to the system.
     * @param string $name the permission name
     * @return Permission the new Permission object
     */
    public function createPermission($name);

    /**
     * Adds a role, permission or rule to the RBAC system.
     * @param Role|Permission|Rule $object
     * @return boolean whether the role, permission or rule is successfully added to the system
     * @throws \Exception if data validation or saving fails (such as the name of the role or permission is not unique)
     */
    public function add($object);

    /**
     * Removes a role, permission or rule from the RBAC system.
     * @param Role|Permission|Rule $object
     * @return boolean whether the role, permission or rule is successfully removed
     */
    public function remove($object);

    /**
     * Updates the specified role, permission or rule in the system.
     * @param string $name the old name of the role, permission or rule
     * @param Role|Permission|Rule $object
     * @return boolean whether the update is successful
     * @throws \Exception if data validation or saving fails (such as the name of the role or permission is not unique)
     */
    public function update($name, $object);

    /**
     * Returns the named role.
     * @param string $name the role name.
     * @return null|Role the role corresponding to the specified name. Null is returned if no such role.
     */
    public function getRole($name);

    /**
     * Returns all roles in the system.
     * @return Role[] all roles in the system. The array is indexed by the role names.
     */
    public function getRoles();

    /**
     * Returns the roles that are assigned to the user via [[assign()]].
     * Note that child roles that are not assigned directly to the user will not be returned.
     * @param string|integer $userId the user ID (see [[\yii\web\User::id]])
     * @return Role[] all roles directly or indirectly assigned to the user. The array is indexed by the role names.
     */
    public function getRolesByUser($userId);

    /**
     * Returns the named permission.
     * @param string $name the permission name.
     * @return null|Permission the permission corresponding to the specified name. Null is returned if no such permission.
     */
    public function getPermission($name);

    /**
     * Returns all permissions in the system.
     * @return Permission[] all permissions in the system. The array is indexed by the permission names.
     */
    public function getPermissions();

    /**
     * Returns all permissions that the specified role represents.
     * @param string $roleName the role name
     * @return Permission[] all permissions that the role represents. The array is indexed by the permission names.
     */
    public function getPermissionsByRole($roleName);

    /**
     * Returns all permissions that the user has.
     * @param string|integer $userId the user ID (see [[\yii\web\User::id]])
     * @return Permission[] all permissions that the user has. The array is indexed by the permission names.
     */
    public function getPermissionsByUser($userId);

    /**
     * Returns the rule of the specified name.
     * @param string $name the rule name
     * @return null|Rule the rule object, or null if the specified name does not correspond to a rule.
     */
    public function getRule($name);

    /**
     * Returns all rules available in the system.
     * @return Rule[] the rules indexed by the rule names
     */
    public function getRules();

    /**
     * Adds an item as a child of another item.
     * @param Item $parent
     * @param Item $child
     * @throws \yii\base\Exception if the parent-child relationship already exists or if a loop has been detected.
     */
    public function addChild($parent, $child);

    /**
     * Removes a child from its parent.
     * Note, the child item is not deleted. Only the parent-child relationship is removed.
     * @param Item $parent
     * @param Item $child
     * @return boolean whether the removal is successful
     */
    public function removeChild($parent, $child);

    /**
     * Removed all children form their parent.
     * Note, the children items are not deleted. Only the parent-child relationships are removed.
     * @param Item $parent
     * @return boolean whether the removal is successful
     */
    public function removeChildren($parent);

    /**
     * Returns a value indicating whether the child already exists for the parent.
     * @param Item $parent
     * @param Item $child
     * @return boolean whether `$child` is already a child of `$parent`
     */
    public function hasChild($parent, $child);

    /**
     * Returns the child permissions and/or roles.
     * @param string $name the parent name
     * @return Item[] the child permissions and/or roles
     */
    public function getChildren($name);

    /**
     * Assigns a role to a user.
     *
     * @param Role $role
     * @param string|integer $userId the user ID (see [[\yii\web\User::id]])
     * @return Assignment the role assignment information.
     * @throws \Exception if the role has already been assigned to the user
     */
    public function assign($role, $userId);

    /**
     * Revokes a role from a user.
     * @param Role $role
     * @param string|integer $userId the user ID (see [[\yii\web\User::id]])
     * @return boolean whether the revoking is successful
     */
    public function revoke($role, $userId);

    /**
     * Revokes all roles from a user.
     * @param mixed $userId the user ID (see [[\yii\web\User::id]])
     * @return boolean whether the revoking is successful
     */
    public function revokeAll($userId);

    /**
     * Returns the assignment information regarding a role and a user.
     * @param string|integer $userId the user ID (see [[\yii\web\User::id]])
     * @param string $roleName the role name
     * @return null|Assignment the assignment information. Null is returned if
     * the role is not assigned to the user.
     */
    public function getAssignment($roleName, $userId);

    /**
     * Returns all role assignment information for the specified user.
     * @param string|integer $userId the user ID (see [[\yii\web\User::id]])
     * @return Assignment[] the assignments indexed by role names. An empty array will be
     * returned if there is no role assigned to the user.
     */
    public function getAssignments($userId);

    /**
     * Removes all authorization data, including roles, permissions, rules, and assignments.
     */
    public function removeAll();

    /**
     * Removes all permissions.
     * All parent child relations will be adjusted accordingly.
     */
    public function removeAllPermissions();

    /**
     * Removes all roles.
     * All parent child relations will be adjusted accordingly.
     */
    public function removeAllRoles();

    /**
     * Removes all rules.
     * All roles and permissions which have rules will be adjusted accordingly.
     */
    public function removeAllRules();

    /**
     * Removes all role assignments.
     */
    public function removeAllAssignments();
}


text:
package com.gooddata.projecttemplate;

import com.gooddata.AbstractService;
import com.gooddata.GoodDataException;
import com.gooddata.GoodDataRestException;
import com.gooddata.GoodDataSettings;
import com.gooddata.dataset.DatasetManifest;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;

import java.util.Collection;
import java.util.stream.Collectors;

import static com.gooddata.util.Validate.notEmpty;
import static com.gooddata.util.Validate.notNull;

/**
 * Service enabling access to project templates, under /projectTemplates/...
 */
public class ProjectTemplateService extends AbstractService {

    /**
     * Sets RESTful HTTP Spring template. Should be called from constructor of concrete service extending
     * this abstract one.
     *
     * @param restTemplate RESTful HTTP Spring template
     * @param settings settings
     */
    public ProjectTemplateService(final RestTemplate restTemplate, final GoodDataSettings settings) {
        super(restTemplate, settings);
    }

    /**
     * Sets RESTful HTTP Spring template. Should be called from constructor of concrete service extending
     * this abstract one.
     *
     * @param restTemplate RESTful HTTP Spring template
     * @deprecated use ProjectTemplateService(RestTemplate) constructor instead
     */
    @Deprecated
    public ProjectTemplateService(final RestTemplate restTemplate) {
        super(restTemplate);
    }

    /**
     * List of all projects' templates
     * @return list of templates
     */
    public Collection<Template> getTemplates() {
        try {
            return restTemplate.getForObject(Templates.URI, Templates.class).getTemplates();
        } catch (GoodDataRestException | RestClientException e) {
            throw new GoodDataException("Unable to get templates", e);
        }
    }

    /**
     * Get project template by given uri.
     * @param uri uri of the template
     * @return project template
     */
    public Template getTemplateByUri(String uri) {
        notEmpty(uri, "template uri");
        try {
            return restTemplate.getForObject(uri, Template.class);
        } catch (GoodDataRestException | RestClientException e) {
            throw new GoodDataException("Unable to get template of uri=" + uri, e);
        }
    }

    /**
     * Get manifests of given template
     * @param template template
     * @return manifests linked from project template
     */
    public Collection<DatasetManifest> getManifests(Template template) {
        notNull(template, "template");
        notNull(template.getManifestsUris(), "template.manifestsUris");
        try {
            return template.getManifestsUris().stream()
                    .map(manifestUri -> restTemplate.getForObject(manifestUri, DatasetManifest.class))
                    .collect(Collectors.toList());
        } catch (GoodDataRestException | RestClientException e) {
            throw new GoodDataException("Unable to get manifests for template of uri=" + template.getUri(), e);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
require 'fastlane/actions/actions_helper'
require 'forwardable'

module Fastlane
  class Action
    AVAILABLE_CATEGORIES = [
      :testing,
      :building,
      :screenshots,
      :project,
      :code_signing,
      :documentation,
      :beta,
      :push,
      :production,
      :source_control,
      :notifications,
      :app_store_connect,
      :misc,
      :deprecated # This should be the last item
    ]

    RETURN_TYPES = [
      :string,
      :array_of_strings,
      :hash_of_strings,
      :hash,
      :bool,
      :int
    ]

    class << self
      attr_accessor :runner

      extend(Forwardable)

      # to allow a simple `sh` in the custom actions
      def_delegator(Actions, :sh_control_output, :sh)
    end

    def self.run(params)
    end

    # Implement in subclasses
    def self.description
      "No description provided".red
    end

    def self.details
      nil # this is your chance to provide a more detailed description of this action
    end

    def self.available_options
      # [
      #   FastlaneCore::ConfigItem.new(key: :ipa_path,
      #                                env_name: "CRASHLYTICS_IPA_PATH",
      #                                description: "Value Description")
      # ]
      nil
    end

    def self.output
      # Return the keys you provide on the shared area
      # [
      #   ['IPA_OUTPUT_PATH', 'The path to the newly generated ipa file']
      # ]
      nil
    end

    def self.return_type
      # Describes what type of data is expected to be returned, see RETURN_TYPES
      nil
    end

    def self.return_value
      # Describes what this method returns
      nil
    end

    def self.sample_return_value
      # Very optional
      # You can return a sample return value, that might be returned by the actual action
      # This is currently only used when generating the documentation and running its tests
      nil
    end

    def self.author
      nil
    end

    def self.authors
      nil
    end

    def self.is_supported?(platform)
      # you can do things like
      #  true
      #
      #  platform == :ios
      #
      #  [:ios, :mac].include?(platform)
      #
      UI.crash!("Implementing `is_supported?` for all actions is mandatory. Please update #{self}")
    end

    # Returns an array of string of sample usage of this action
    def self.example_code
      nil
    end

    # Is printed out in the Steps: output in the terminal
    # Return nil if you don't want any logging in the terminal/JUnit Report
    def self.step_text
      self.action_name
    end

    # Documentation category, available values defined in AVAILABLE_CATEGORIES
    def self.category
      :undefined
    end

    # instead of "AddGitAction", this will return "add_git" to print it to the user
    def self.action_name
      self.name.split('::').last.gsub('Action', '').fastlane_underscore
    end

    def self.lane_context
      Actions.lane_context
    end

    # Allows the user to call an action from an action
    def self.method_missing(method_sym, *arguments, &_block)
      UI.error("Unknown method '#{method_sym}'")
      UI.user_error!("To call another action from an action use `other_action.#{method_sym}` instead")
    end

    # When shelling out from the actoin, should we use `bundle exec`?
    def self.shell_out_should_use_bundle_exec?
      return File.exist?('Gemfile') && !Helper.contained_fastlane?
    end

    # Return a new instance of the OtherAction action
    # We need to do this, since it has to have access to
    # the runner object
    def self.other_action
      return OtherAction.new(self.runner)
    end

    # Describes how the user should handle deprecated an action if its deprecated
    # Returns a string (or nil)
    def self.deprecated_notes
      nil
    end
  end
end

class String
  def markdown_preserve_newlines
    self.gsub(/(\n|$)/, '|\1') # prepend new lines with "|" so the erb template knows *not* to replace them with "<br>"s
  end

  def markdown_sample(is_first = false)
    self.markdown_clean_heredoc!
    self.markdown_details(is_first)
  end

  def markdown_list(is_first = false)
    self.markdown_clean_heredoc!
    self.gsub!(/^/, "- ") # add list dashes
    self.prepend(">") unless is_first # the empty line that will be added breaks the quote
    self.markdown_details(is_first)
  end

  def markdown_details(is_first)
    self.prepend("\n") unless is_first
    self << "\n>" # continue the quote
    self.markdown_preserve_newlines
  end

  def markdown_clean_heredoc!
    self.chomp! # remove the last new line added by the heredoc
    self.dedent! # remove the leading whitespace (similar to the squigly heredoc `<<~`)
  end

  def dedent!
    first_line_indent = self.match(/^\s*/)[0]

    self.gsub!(/^#{first_line_indent}/, "")
  end

  def remove_markdown
    string = self.gsub(/^>/, "") # remove Markdown quotes
    string = string.gsub(/\[http[^\]]+\]\(([^)]+)\)/, '\1 🔗') # remove Markdown links
    string = string.gsub(/\[([^\]]+)\]\(([^\)]+)\)/, '"\1" (\2 🔗)') # remove Markdown links with custom text
    string = string.gsub("|", "") # remove new line preserve markers
    return string
  end
end


text:
<?php namespace Fisharebest\Localization\Locale;

use Fisharebest\Localization\Territory\TerritoryCl;

class LocaleEsCl extends LocaleEs {
	public function territory() {
		return new TerritoryCl;
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to Apereo under one or more contributor license
    agreements. See the NOTICE file distributed with this work
    for additional information regarding copyright ownership.
    Apereo 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 the following location:

      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.

-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:lang="http://www.springframework.org/schema/lang"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
                        http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd">

    <lang:groovy id="weatherParsingService"
        script-source="classpath:org/jasig/portlet/weather/dao/yahoo/YahooWeatherParsingServiceImpl.groovy"/>

    <lang:groovy id="locationParsingService"
        script-source="classpath:org/jasig/portlet/weather/dao/yahoo/YahooLocationParsingServiceImpl.groovy"/>

    <!--messages.properties Configuration -->
    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basenames">
            <list>
                <value>messages</value>
            </list>
        </property>
    </bean>

</beans>


text:
module Puppet::Parser::Functions
  newfunction(:merge, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
    Merges two or more hashes together and returns the resulting hash.

    For example:

        $hash1 = {'one' => 1, 'two', => 2}
        $hash2 = {'two' => 'dos', 'three', => 'tres'}
        $merged_hash = merge($hash1, $hash2)
        # The resulting hash is equivalent to:
        # $merged_hash =  {'one' => 1, 'two' => 'dos', 'three' => 'tres'}

    When there is a duplicate key, the key in the rightmost hash will "win."

    ENDHEREDOC

    if args.length < 2
      raise Puppet::ParseError, ("merge(): wrong number of arguments (#{args.length}; must be at least 2)")
    end

    # The hash we accumulate into
    accumulator = Hash.new
    # Merge into the accumulator hash
    args.each do |arg|
      unless arg.is_a?(Hash)
        raise Puppet::ParseError, "merge: unexpected argument type #{arg.class}, only expects hash arguments"
      end
      accumulator.merge!(arg)
    end
    # Return the fully merged hash
    accumulator
  end
end


text:
<?php

namespace Double\Bundle\VytautasBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
{
    public function indexAction($id)
    {
        return $this->render('DoubleVytautasBundle:Default:index.html.twig', array('name' => $id));
    }
}


text:
package org.sculptor.framework.errorhandling;

import static org.sculptor.framework.errorhandling.ExceptionHelper.excMessage;

import java.lang.reflect.Method;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.ThrowsAdvice;

/**
 * This advice logs exceptions (the basic ones - excluding the JPA ones).
 * <p>
 * RuntimeExceptions are caught and new {@link SystemException} (subclasses) are
 * thrown. {@link SystemException} and RuntimeException are logged at error or
 * fatal level. {@link ApplicationException} is logged at debug level.
 *
 * @author Patrik Nordwall
 */
public class BasicErrorHandlingAdvice implements ThrowsAdvice {

    public BasicErrorHandlingAdvice() {
    }

    /**
     * Possibility for subclass to override and map logCodes.
     */
    protected String mapLogCode(String logCode) {
        return logCode;
    }

    public void afterThrowing(Method m, Object[] args, Object target, ValidationException e) {
        if (e.isLogged()) {
            return;
        }
        Logger log = LoggerFactory.getLogger(target.getClass());
        LogMessage message = new LogMessage(mapLogCode(e.getErrorCode()), excMessage(e));
        log.debug(message.toString());
        e.setLogged(true);
    }

    public void afterThrowing(Method m, Object[] args, Object target, SystemException e) {
        if (e.isLogged()) {
            return;
        }
        Logger log = LoggerFactory.getLogger(target.getClass());
        LogMessage message = new LogMessage(mapLogCode(e.getErrorCode()), excMessage(e));
        if (e.isFatal()) {
            log.error(message.toString(), e);
        } else {
            log.error(message.toString(), e);
        }
        e.setLogged(true);
    }

    public void afterThrowing(Method m, Object[] args, Object target, ApplicationException e) {
        if (e.isLogged()) {
            return;
        }
        Logger log = LoggerFactory.getLogger(target.getClass());
        if (log.isDebugEnabled()) {
            LogMessage message = new LogMessage(mapLogCode(e.getErrorCode()), excMessage(e));
            log.debug(message.toString(), e);
            e.setLogged(true);
        }
    }

    public void afterThrowing(Method m, Object[] args, Object target, RuntimeException e) {
        SystemException wrappedSystemException = SystemException.unwrapSystemException(e);
        if (wrappedSystemException == null) {
            Logger log = LoggerFactory.getLogger(target.getClass());
            // null message is useless, e.g. NullPointerException
            String message = excMessage(e);
            LogMessage logMessage = new LogMessage(mapLogCode(UnexpectedRuntimeException.ERROR_CODE), message);
            log.error(logMessage.toString(), e);
            UnexpectedRuntimeException newException = new UnexpectedRuntimeException(message);
            newException.setLogged(true);
            throw newException;
        } else {
            afterThrowing(m, args, target, wrappedSystemException);
        }
    }

    public void afterThrowing(Method m, Object[] args, Object target, OutOfMemoryError e) {
        // OutOfMemoryError is important and therefore handled separatly from
        // other Errors
        handleError(target, e);
    }

    public void afterThrowing(Method m, Object[] args, Object target, Error e) {
        handleError(target, e);
    }

    protected void handleError(Object target, Error e) {
        Logger log = LoggerFactory.getLogger(target.getClass());
        String errorCode = e.getClass().getName();
        String mappedErrorCode = mapLogCode(errorCode);
        LogMessage message = new LogMessage(mappedErrorCode, excMessage(e));
        log.error(message.toString(), e);
    }

}


text:
using System;
namespace AltairStudios.Core.Tests.Web.Models.Plugin.Hello
{
	public class Hello : AltairStudios.Core.Plugin.PluginBase, AltairStudios.Core.Plugin.iPlugin
	{
		public Hello ()
		{
		}
	}
}


text:
===========================
Neutron Release Notes Howto
===========================

Release notes are a new feature for documenting new features in
OpenStack projects. Background on the process, tooling, and
methodology is documented in a `mailing list post by Doug Hellman <http://lists.openstack.org/pipermail/openstack-dev/2015-November/078301.html>`_.

For information on how to create release notes, please consult the
`Release Notes documentation <http://docs.openstack.org/developer/reno/>`_.


text:
require "test_helper"

class SymbolExtensionsTest < UnitTestCase
  def test_hello
    assert_equal "Hello world", :hello.t
  end

  def test_the_birds_flew_by
    assert_equal "The birds flew by", :they_flew_by.t(they: "birds")
  end

  def test_birds_fly
    assert_equal "Birds fly", :they_fly.t(they: "birds")
  end

  def test_quotes
    assert_equal 'This has “quotes”', :quote_test.t
  end

  def test_quote_birds
    assert_equal 'This has “Birds”', :quote_them.t(them: "birds")
  end

  def test_Yep
    assert_equal "Yes", :YEP.t
  end

  def test_yep
    assert_equal "yes", :yep.t
  end

  def test_Nope
    assert_equal "No", :NOPE.t
  end

  def test_nope
    assert_equal "no", :nope.t
  end

  def test_with_newlines
    assert_equal "This
\nhas
\nnewlines", :with_newlines.t
  end

  def test_with_a_link
    assert_equal "See this link", :with_a_link.t
  end

  def test_hello_has_translation
    assert :hello.has_translation?
  end

  def test_Hello_has_translation
    assert :Hello.has_translation?
  end

  def test_no_translation
    assert !:no_translation.has_translation?
  end
end


text:
package org.planteome.samara

import org.mapdb.{DBMaker, Fun}

import scala.collection.JavaConverters._
import scala.util.Random

trait TermFinderTaxonCacheMapDBStatic extends TermFinderTaxonCacheMapDB {

  override lazy val mapdbIterator: Iterator[Fun.Tuple2[String, List[Integer]]] = {
    val iter = new Iterator[Fun.Tuple2[String, List[Integer]]] {
      override def hasNext: Boolean = {
        true
      }

      override def next(): Fun.Tuple2[String, List[Integer]] = {
        new Fun.Tuple2[String, List[Integer]](Random.nextString(50), List(1, 2))
      }
    }
    iter.slice(0, 10000)
  }
}


text:
module ObjectSpaceDiff
  VERSION = "0.0.1"
end


text:
using System;
using Newtonsoft.Json;
using PinnacleWrapper.Enums;

namespace PinnacleWrapper.Data
{
    public class Bet
    {
        [JsonProperty(PropertyName = "betId")]
        public int BetId;

        [JsonProperty(PropertyName = "wagerNumber")]
        public int WagerNumber;

        [JsonProperty(PropertyName = "placedAt")]
        public DateTime PlacedAt;

        [JsonProperty(PropertyName = "win")]
        public decimal Win;

        [JsonProperty(PropertyName = "risk")]
        public decimal Risk;

        [JsonProperty(PropertyName = "winLoss")]
        public decimal? WinLoss;

        [JsonProperty(PropertyName = "betStatus")]
        public BetStatus BetStatus;

        [JsonProperty(PropertyName = "betType")]
        public BetType BetType;

        [JsonProperty(PropertyName = "sportId")]
        public int SportId;

        [JsonProperty(PropertyName = "leagueId")]
        public int LeagueId;

        [JsonProperty(PropertyName = "eventId")]
        public int EventId;

        [JsonProperty(PropertyName = "handicap")]
        public decimal? Handicap;

        [JsonProperty(PropertyName = "price")]
        public decimal Price;

        [JsonProperty(PropertyName = "teamName")]
        public string TeamName;

        [JsonProperty(PropertyName = "side")]
        public SideType? Side;

        [JsonProperty(PropertyName = "oddsFormat")]
        public OddsFormat OddsFormat;

        [JsonProperty(PropertyName = "customerCommission")]
        public decimal? ClientCommission;

        [JsonProperty(PropertyName = "pitcher1")]
        public string Pitcher1;

        [JsonProperty(PropertyName = "pitcher2")]
        public string Pitcher2;

        [JsonProperty(PropertyName = "pitcher1MustStart")]
        public bool? Pitcher1MustStart;

        [JsonProperty(PropertyName = "pitcher2MustStart")]
        public bool? Pitcher2MustStart;

        [JsonProperty(PropertyName = "team1")]
        public string Team1;

        [JsonProperty(PropertyName = "team2")]
        public string Team2;

        [JsonProperty(PropertyName = "periodNumber")]
        public string PeriodNumber;

        [JsonProperty(PropertyName = "team1Score")]
        public decimal? Team1Score;

        [JsonProperty(PropertyName = "team2Score")]
        public decimal? Team2Score;

        [JsonProperty(PropertyName = "ftTeam1Score")]
        public decimal? FullTimeTeam1Score;

        [JsonProperty(PropertyName = "ftTeam2Score")]
        public decimal? FullTimeTeam2Score;

        [JsonProperty(PropertyName = "pTeam1Score")]
        public decimal? PartTimeTeam1Score;

        [JsonProperty(PropertyName = "pTeam2Score")]
        public decimal? PartTimeTeam2Score;

        [JsonProperty(PropertyName = "isLive")]
        public bool IsLive;
    }
}


text:
using System;
using System.Collections.Generic;
using Spark.Parser;

namespace Spark
{
    public enum NullBehaviour
    {
        /// Catch NullReferenceExceptions, and either render the literal expression, or render nothing, respectively, when ${expression} or $!{expression} syntax is used
        /// <remarks><c>Lenient</c> is the default setting.</remarks>
        Lenient,
        /// Do not wrap expressions in try/catch blocks.  Intended for fail-fast in development environment.
        Strict
    }

    public enum AttributeBehaviour
    {
        ///
        /// Follows original Spark behavior, where all attributes that contain code are treated as
        /// direct c# snippets. e.g. hello="'string no. ' + index"
        ///
        CodeOriented,
        ///
        /// Follows a text-oriented behavior, where many attributes that contain code are treated as
        /// text which may contain expression. e.g. hello="string no. ${index}"
        /// Expressions are not html encoded.
        ///
        TextOriented,
    }

    public interface ISparkSettings : IParserSettings
    {
        ///
        /// Gets the base path of the directory containing the application.
        ///
        string RootPath { get; }

        bool Debug { get; }
        NullBehaviour NullBehaviour { get; }
        string Prefix { get; }
        string PageBaseType { get; set; }
        LanguageType DefaultLanguage { get; }

        IEnumerable<string> UseNamespaces { get; }
        IEnumerable<string> UseAssemblies { get; }
        IEnumerable<IResourceMapping> ResourceMappings { get; }
        IEnumerable<IViewFolderSettings> ViewFolders { get; }
        bool ParseSectionTagAsSegment { get; }
        AttributeBehaviour AttributeBehaviour { get; }
    }

    public interface IResourceMapping
    {
        bool IsMatch(string path);
        string Map(string path);
        bool Stop { get; }
    }

    public class SimpleResourceMapping : IResourceMapping
    {
        public string Match { get; set; }
        public string Location { get; set; }
        public bool Stop { get; set; }

        public bool IsMatch(string path)
        {
            return path.StartsWith(Match, StringComparison.InvariantCultureIgnoreCase);
        }

        public string Map(string path)
        {
            return Location + path.Substring(Match.Length);
        }
    }

    public interface IViewFolderSettings
    {
        string Name { get; set; }
        string Type { get; set; }
        string Subfolder { get; set; }
        IDictionary<string, string> Parameters { get; set; }
    }

    internal class ViewFolderSettings : IViewFolderSettings
    {
        public string Name { get; set; }
        public string Type { get; set; }
        public string Subfolder { get; set; }
        public IDictionary<string, string> Parameters { get; set; }
    }
}


text:
<?php

namespace RDV\Bundle\MigrationBundle\Tools;

trait SchemaTrait
{
    /**
     * Unfortunately due a poor design of the Doctrine\ORM\Tools\SchemaTool::getSchemaFromMetadata
     * we have to use "class_alias" to replace "Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets"
     * with "RDV\Bundle\EntityExtendBundle\Tools\ExtendSchemaUpdateRemoveNamespacedAssets".
     */
    public function overrideRemoveNamespacedAssets()
    {
        if (!class_exists('Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets', false)) {
            class_alias(
                'RDV\Bundle\EntityExtendBundle\Tools\ExtendSchemaUpdateRemoveNamespacedAssets',
                'Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets'
            );
        }
    }

    /**
     * to disable automatic rename of autogenerated indices
     * we have to use "class_alias" to replace "Doctrine\DBAL\Schema\SchemaDiff"
     * with "RDV\Bundle\MigrationBundle\Migration\Schema\SchemaDiff"
     */
    public function overrideSchemaDiff()
    {
        if (!class_exists('Doctrine\DBAL\Schema\SchemaDiff', false)) {
            class_alias(
                'RDV\Bundle\MigrationBundle\Migration\Schema\SchemaDiff',
                'Doctrine\DBAL\Schema\SchemaDiff'
            );
        }
    }
}


text:
/*
 * GameObject.cpp

 *
 *  Created on: Mar 29, 2016
 *      Author: rick
 */

#include "../include/GameObject.h"
#include "../include/Game.h"

GameObject::GameObject(int x, int y, Type type, Direction dir) {
	// TODO Auto-generated constructor stub
	GameObjectStruct structure;
	structure.x = x;
	structure.y = y;
	structure.type = type;
	structure.dir = dir;

	setStruct(structure);
	this->DefaultStruct = structure;

	//Set Flags as if empty space
	setLethal(false);
	setPassable(true);
	setEdible(false);
	setScore(0);

}

void GameObject::setStruct(GameObjectStruct gos){
	this->Info = gos;
}

GameObjectStruct GameObject::getStruct(){
	return this->Info;
}

void GameObject::setLocation(int x,int y){
	this->Info.x = x;
	this->Info.y = y;
}

void GameObject::setLethal(bool input){
	this->Lethal = input;
}

void GameObject::setPassable(bool input){
	this->Passable = input;
}

void GameObject::setEdible(bool input){
	this->Edible = input;
}

bool GameObject::getLethal(){
	return this->Lethal;
}

bool GameObject::getPassable(){
	return this->Passable;
}

bool GameObject::getEdible(){
	return this->Edible;
}

void GameObject::setType(Type type){
	this->Info.type = type;
}

void GameObject::setSpriteDirection(Direction dir){
	this->Info.dir = dir;
}

void GameObject::setScore(int input){
	this->Score = input;
}

int GameObject::getScore(){
	return this->Score;
}

void GameObject::setPtr(Game *ptr){
	this->GamePtr = ptr;
}

Game* GameObject::getPtr(){
	return this->GamePtr;
}

void GameObject::Reset(){
	this->setStruct(this->DefaultStruct);
}


text:
using DotVVM.Framework.Runtime;
using DotVVM.Framework.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DotVVM.Framework.Binding;
using DotVVM.Framework.Hosting;

namespace DotVVM.Framework.Controls
{
	/// <summary>
	/// Renders <c>select</c> HTML element control.
	/// </summary>
    public abstract class SelectHtmlControlBase : Selector
	{

        /// <summary>
        /// Initializes a new instance of the <see cref="SelectHtmlControlBase"/> class.
        /// </summary>
        public SelectHtmlControlBase() : base("select")
        {
        }

        /// <summary>
        /// Adds all attributes that should be added to the control begin tag.
        /// </summary>
        protected override void AddAttributesToRender(IHtmlWriter writer, IDotvvmRequestContext context)
        {
            RenderEnabledProperty(writer);
            RenderOptionsProperties(writer);
            RenderChangedEvent(writer);
            RenderSelectedValueProperty(writer);

            base.AddAttributesToRender(writer, context);
        }

        protected virtual void RenderEnabledProperty(IHtmlWriter writer)
        {
            SelectHtmlControlHelpers.RenderEnabledProperty(writer, this);
        }

        protected virtual void RenderOptionsProperties(IHtmlWriter writer)
        {
            SelectHtmlControlHelpers.RenderOptionsProperties(writer, this);
        }

        protected virtual void RenderChangedEvent(IHtmlWriter writer)
        {
            SelectHtmlControlHelpers.RenderChangedEvent(writer, this);
        }

        protected virtual void RenderSelectedValueProperty(IHtmlWriter writer)
	    {
	        writer.AddKnockoutDataBind("value", this, SelectedValueProperty, renderEvenInServerRenderingMode: true);
	    }
	}
}


text:
typedef void (^ServiceCompletion)(NSArray *responseArr);
typedef void (^ServiceError)(NSError *error);

@interface DBBaseService : NSManagedObject
// Core Data
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;

- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;
- (void) flushDatabase;

@end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Bilimbia vallistellinae f. pallescens Anzi

### Remarks
null


text:
module RatholeMarkdown
  VERSION = "0.0.1"
end


text:
Description
===========

`Fabric <http://fabfile.org/>`_ task to install `graphite <http://graphite.wikidot.com/>`_, using `fabtools <http://github.com/ronnix/fabtools>`_.

How to use
==========

Import the task in your project's ``fabfile.py`` to make it available::

    from fabtools.recipes.graphite import install_graphite

Then you can call it from the ``fab`` command::

    fab install_graphite


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content="">
		<meta name="author" content="">
		<title>Jordan Smith - {{ page.title }}</title>

		<link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css">

		<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
		<link href='http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
		<link rel="stylesheet" href="/font-awesome/css/font-awesome.min.css" type="text/css">

		<link rel="stylesheet" href="/css/creative.css" type="text/css">
		<link rel="stylesheet" href="/css/custom.css" type="text/css">

		<link rel="shortcut icon" href="/img/title_profile.ico" />

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

					</button>
					Front

							About

							Blog

			{{ content }}

Contact & Social


text:
---
uid: SolidEdgeDraft.TableCell.Parent
summary:
remarks:
---


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

using Brew;

namespace Brew.Webforms.Widgets {

	/// <summary>
	/// Extend a TextBox with the jQuery UI Button http://api.jqueryui.com/button/
	/// </summary>
	/// <remarks>Click Events should be handled on the extended control, natively.</remarks>
	public class Button : Widget {

		public Button() : base("button") { }

		public Button(String widgetName) : base(widgetName) { } // adds support for Buttonset class.

		public override List<WidgetEvent> GetEvents() {
			return new List<WidgetEvent>() { new WidgetEvent("create") };
		}

		public override List<WidgetOption> GetOptions() {
			return new List<WidgetOption>() {
				new WidgetOption { Name = "text", DefaultValue = true },
				new WidgetOption { Name = "icons", DefaultValue = "{}" },
				new WidgetOption { Name = "label", DefaultValue = null }
			};
		}

		#region .    Options    .

		/// <summary>
		/// Whether to show any text - when set to false (display no text), icons (see icons option) must be enabled, otherwise it'll be ignored.
		/// Reference: http://api.jqueryui.com/button/#option-text
		/// </summary>
		[Category("Appearance")]
		[DefaultValue(true)]
		[Description("Whether to show any text - when set to false (display no text), icons (see icons option) must be enabled, otherwise it'll be ignored.")]
		public bool Text { get; set; }

		/// <summary>
		/// Icons to display, with or without text (see text option). The primary icon is displayed by default on the left of the label text, the secondary by default is on the right. Value for the primary and secondary properties must be a classname (String), eg. "ui-icon-gear". For using only one icon: icons: {primary:'ui-icon-locked'}. For using two icons: icons: {primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}
		/// Reference: http://api.jqueryui.com/button/#option-icons
		/// </summary>
		[TypeConverter(typeof(Brew.TypeConverters.JsonObjectConverter))]
		[Category("Appearance")]
		[DefaultValue("{}")]
		[Description("Icons to display, with or without text (see text option). The primary icon is displayed by default on the left of the label text, the secondary by default is on the right. Value for the primary and secondary properties must be a classname (String), eg. \"ui-icon-gear\". For using only one icon: icons: {primary:'ui-icon-locked'}. For using two icons: icons: {primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'}")]
		public string Icons { get; set; }

		/// <summary>
		/// Text to show on the button. When not specified (null), the element's html content is used, or its value attribute when it's an input element of type submit or reset; or the html content of the associated label element if its an input of type radio or checkbox
		/// Reference: http://api.jqueryui.com/button/#option-label
		/// </summary>
		[Category("Appearance")]
		[DefaultValue(null)]
		[Description("Text to show on the button. When not specified (null), the element's html content is used, or its value attribute when it's an input element of type submit or reset; or the html content of the associated label element if its an input of type radio or checkbox")]
		public string Label { get; set; }

		#endregion
	}
}


text:
<?php
	/*-------------------------
	Autor: Obed Alvarado
	Web: obedalvarado.pw
	Mail: info@obedalvarado.pw
	---------------------------*/
	session_start();
	if (!isset($_SESSION['user_login_status']) AND $_SESSION['user_login_status'] != 1) {
        header("location: login.php");
		exit;
        }

	/* Connect To Database*/
	require_once ("config/db.php");//Contiene las variables de configuracion para conectar a la base de datos
	require_once ("config/conexion.php");//Contiene funcion que conecta a la base de datos
	$active_facturas="";
	$active_productos="";
	$active_clientes="";
	$active_usuarios="active";
	$title="Usuarios | Simple Invoice";
?>
<!DOCTYPE html>

	<?php include("head.php");?>

 	<?php
	include("navbar.php");
	?>

				<button type='button' class="btn btn-info" data-toggle="modal" data-target="#myModal"> Nuevo Usuario</button>

 Buscar Usuarios

			<?php
			include("modal/registro_usuarios.php");
			include("modal/editar_usuarios.php");
			include("modal/cambiar_password.php");
			?>
			<form class="form-horizontal" role="form" id="datos_cotizacion">

							Nombres:

								<input type="text" class="form-control" id="q" placeholder="Nombre" onkeyup='load(1);'>

								<button type="button" class="btn btn-default" onclick='load(1);'>
									 Buscar</button>

			</form>

	<?php
	include("footer.php");
	?>


text:
/* e-agent that moves along road segments and randomly turns at intersections.
*/

#include <iostream>
#include <fstream>
#include <vector>
#include <utility>
#include <string>
#include <cmath>
#include <cassert>
#include <unistd.h>

#include "roadnet.hpp"

#include "ros/ros.h"
#include "tf/tf.h"
#include "nav_msgs/Odometry.h"
#include "gazebo_msgs/ModelStates.h"

#include "geometry_msgs/Twist.h"
#include "sensor_msgs/LaserScan.h"

using namespace dubins_traffic;

const double min_dist = 0.5;
bool safe_to_move = true;

void laser_cb( const sensor_msgs::LaserScan &scan )
{
    for (int i = 0; i < scan.ranges.size(); i++) {
        if (scan.ranges[i] < min_dist) {
            safe_to_move = false;
            return;
        }
    }
    safe_to_move = true;
}

class ModelStatesWatcher {
public:

    ModelStatesWatcher( ros::NodeHandle &nh, std::string topic_name = "/gazebo/model_states" );

    // Callback function for messages from the "/gazebo/model_states" topic
    void ms_cb( const gazebo_msgs::ModelStates &ms );

    /* Get current pose estimate
     *
     * If an estimate is available, return true and place the estimate in the
     * given array. Otherwise, return false and do nothing to the array.
     */
    bool get_pose_estimate( double *x );

    bool is_near_ego_vehicle() const
        { return near_ego_vehicle; }

private:
    double last_mspose[3];
    bool valid_mspose;
    std::string model_name;
    ros::Subscriber mssub;
    bool near_ego_vehicle;
};

ModelStatesWatcher::ModelStatesWatcher( ros::NodeHandle &nh, std::string topic_name )
    : valid_mspose(false), model_name(nh.getNamespace()), near_ego_vehicle(true),
      mssub(nh.subscribe( topic_name, 1, &ModelStatesWatcher::ms_cb, this ))
{
    while (model_name[0] == '/')
        model_name = std::string(model_name.c_str()+1);
}

void ModelStatesWatcher::ms_cb( const gazebo_msgs::ModelStates &ms )
{
    int this_model_idx = -1;
    int ego_model_idx = -1;
    for (int idx = 0; idx < ms.name.size(); idx++) {
        if (ms.name[idx] == model_name) {
            this_model_idx = idx;
            continue;
        }
        if (ms.name[idx] == "ego") {
            ego_model_idx = idx;
            continue;
        }
    }
    if (this_model_idx < 0)
        return;

    if (ego_model_idx >= 0
        && std::sqrt( (ms.pose[this_model_idx].position.x - ms.pose[ego_model_idx].position.x)*(ms.pose[this_model_idx].position.x - ms.pose[ego_model_idx].position.x)
                      + (ms.pose[this_model_idx].position.y - ms.pose[ego_model_idx].position.y)*(ms.pose[this_model_idx].position.y - ms.pose[ego_model_idx].position.y) ) > 1.0) {

        near_ego_vehicle = false;

    } else {

        near_ego_vehicle = true;  // Be cautious

    }

    valid_mspose = false;
    last_mspose[0] = ms.pose[this_model_idx].position.x;
    last_mspose[1] = ms.pose[this_model_idx].position.y;
    last_mspose[2] = tf::getYaw( ms.pose[this_model_idx].orientation );
    valid_mspose = true;
}

bool ModelStatesWatcher::get_pose_estimate( double *x )
{
    if (valid_mspose) {
        for (int i = 0; i < 3; i++)
            x[i] = last_mspose[i];
        return true;
    } else {
        return false;
    }
}

class OdomWatcher {
public:

    OdomWatcher( ros::NodeHandle &nh, std::string topic_name = "odom" );

    // Callback function for messages from the "odom" topic
    void odom_cb( const nav_msgs::Odometry &od );

    /* Get current pose estimate
     *
     * If an estimate is available, return true and place the estimate in the
     * given array. Otherwise, return false and do nothing to the array.
     */
    bool get_pose_estimate( double *x );

private:
    double last_opose[3];
    bool valid_opose;
    ros::Subscriber odomsub;
};

OdomWatcher::OdomWatcher( ros::NodeHandle &nh, std::string topic_name )
    : valid_opose(false),
      odomsub(nh.subscribe( topic_name, 1, &OdomWatcher::odom_cb, this ))
{ }

void OdomWatcher::odom_cb( const nav_msgs::Odometry &od )
{
    valid_opose = false;
    last_opose[0] = od.pose.pose.position.x;
    last_opose[1] = od.pose.pose.position.y;
    last_opose[2] = tf::getYaw( od.pose.pose.orientation );
    valid_opose = true;
}

bool OdomWatcher::get_pose_estimate( double *x )
{
    if (valid_opose) {
        for (int i = 0; i < 3; i++)
            x[i] = last_opose[i];
    }
    return valid_opose;
}

int main( int argc, char **argv )
{
    std::srand( getpid() );

    if (argc <= 1) {
        std::cerr << "Usage: " << argv[0] << " FILE" << std::endl;
        return 1;
    }

    std::ifstream infile( argv[1] );
    if (!infile.is_open()) {
        std::cerr << "Failed to open " << argv[1] << std::endl;
        return 1;
    }
    RoadNetwork rd( infile );
    assert( rd.number_of_segments() > 0 );

    std::pair<size_t, bool> current_segment_idx( std::rand() % rd.number_of_segments(), true );
    Eigen::Vector4d road_segment = rd.mapped_segment( current_segment_idx.first, current_segment_idx.second ? -1 : 1 );
    std::vector<Eigen::Vector2d> waypoints = { Eigen::Vector2d( road_segment(0), road_segment(1) ),
                                               Eigen::Vector2d( road_segment(2), road_segment(3) ) };
/* Pre-generated list of waypoints. This routine will be provided later as an alternative mode.
    std::vector< std::pair<size_t, bool> > visited_indices = {std::pair<size_t, bool>( 0, true )};
    Eigen::Vector4d road_segment = rd.mapped_segment( visited_indices.back().first );

    std::vector<Eigen::Vector2d> waypoints = { Eigen::Vector2d( road_segment(0), road_segment(1) ),
                                               Eigen::Vector2d( road_segment(2), road_segment(3) ) };

    while (true) {
        std::vector<size_t> end_indices;
        if (visited_indices.back().second) {  // Direction on previous segment?
            end_indices = rd.segments_at_end( visited_indices.back().first );
        } else {
            end_indices = rd.segments_at_start( visited_indices.back().first );
        }
        if (end_indices.size() == 0)  // Dead-end
            break;
        std::vector<size_t>::iterator end_it;
        for (end_it = end_indices.begin(); end_it != end_indices.end(); end_it++) {
            std::vector< std::pair<size_t, bool> >::iterator visited_it;
            for (visited_it = visited_indices.begin();
                 visited_it != visited_indices.end(); visited_it++) {
                if ((*visited_it).first == *end_it)
                    break;
            }
            if (visited_it == visited_indices.end())
                break;
        }
        if (end_it != end_indices.end()) {
            Eigen::Vector4d this_segment = rd.mapped_segment( *end_it );
            if ((this_segment.segment<2>(0) - waypoints.back()).norm() < 1e-6) {
                waypoints.push_back( this_segment.segment<2>(2) );
                visited_indices.push_back( std::pair<size_t, bool>( *end_it, true ) );
            } else {
                assert( (this_segment.segment<2>(2) - waypoints.back()).norm() < 1e-6 );
                waypoints.push_back( this_segment.segment<2>(0) );
                visited_indices.push_back( std::pair<size_t, bool>( *end_it, false ) );
            }
        } else {
            break;
        }
    }
*/

    // Configure turning rate and other motion parameters here
    double turning_rate = 0.9;  // rad/s
    double forward_speed = 0.5;  // m/s

    // Thresholds for switching among modes of motion
    double min_angle_err = 0.07;  // Minimum relative angle to drive forward toward waypoint
    double min_reach_err = 0.075;  // Distance from waypoint before it is declared as "reached"

    safe_to_move = true;
    ros::init( argc, argv, "Oscar", ros::init_options::AnonymousName );
    ros::NodeHandle nh;

    ros::Publisher action = nh.advertise<geometry_msgs::Twist>( "cmd_vel", 1 );
    ros::Subscriber lmssub = nh.subscribe( "scan", 10, &laser_cb );

    ModelStatesWatcher pose_watcher( nh );

    int current_index = 0;  // Visit waypoints in order
    double current_pose[3];
    double angle_diff;

    ros::Rate rate( 30. );

    while (ros::ok()) {

        geometry_msgs::Twist mot;

        if (safe_to_move && pose_watcher.get_pose_estimate( current_pose )) {

            angle_diff = atan2( waypoints[current_index](1) - current_pose[1],
                                waypoints[current_index](0) - current_pose[0] ) - current_pose[2];
            while (angle_diff >= M_PI)
                angle_diff -= 2*M_PI;
            while (angle_diff < -M_PI)
                angle_diff += 2*M_PI;

            if (std::sqrt( (waypoints[current_index](0) - current_pose[0])*(waypoints[current_index](0) - current_pose[0])
                           + (waypoints[current_index](1) - current_pose[1])*(waypoints[current_index](1) - current_pose[1]) ) < min_reach_err) {
                std::cout << "Reached waypoint " << waypoints[current_index].transpose() << std::endl;
                // current_index = (current_index+1) % waypoints.size();
                if (current_index < 1) {
                    current_index++;
                } else {
                    std::vector<size_t> end_indices;
                    if (current_segment_idx.second) {  // Direction on previous segment?
                        end_indices = rd.segments_at_end( current_segment_idx.first );
                    } else {
                        end_indices = rd.segments_at_start( current_segment_idx.first );
                    }
                    if (end_indices.size() == 0) { // Dead-end
                        Eigen::Vector2d tmp = waypoints[0];
                        waypoints[0] = waypoints[current_index];
                        waypoints[current_index] = tmp;
                        current_segment_idx.second = current_segment_idx.second ? false : true;
                    } else {

                        Eigen::Vector4d this_segment = rd.mapped_segment( current_segment_idx.first );
                        waypoints[current_index] = this_segment.segment<2>( current_segment_idx.second ? 2 : 0 );
                        current_segment_idx.first = end_indices[std::rand() % end_indices.size()];
                        this_segment = rd.mapped_segment( current_segment_idx.first );
                        if ((this_segment.segment<2>(0) - waypoints[current_index]).norm() < 1e-6) {
                            current_segment_idx.second = true;
                        } else {
                            assert( (this_segment.segment<2>(2) - waypoints[current_index]).norm() < 1e-6 );
                            current_segment_idx.second = false;
                        }
                        this_segment = rd.mapped_segment( current_segment_idx.first, current_segment_idx.second ? -1 : 1 );
                        waypoints[current_index] = this_segment.segment<2>( current_segment_idx.second ? 2 : 0 );

                    }
                }
            } else if (fabs( angle_diff ) > min_angle_err) {

                if (angle_diff > 0) {
                    mot.angular.z = turning_rate;
                } else {
                    mot.angular.z = -turning_rate;
                }

            } else {
                mot.linear.x = forward_speed;
            }

        }

        if (pose_watcher.is_near_ego_vehicle())
            mot.linear.x = 0.0;

        action.publish( mot );
        ros::spinOnce();
        rate.sleep();
    }

    return 0;
}


text:
***(in Progress: Zielversion LRC 0.9 M2)***

LazarusRegistryControls (LRC)
=============================

Sammlung von Lazarus-Steuerelementen, welche direkt mit der Registry verbunden
werden (lesen/schreiben)

**Inhaltsübersicht:**

- 0     Anmerkung zur neuen Version
- 1     Einleitung
- 2     Packagenamen
- 3     Installation
- 3.1   Versionen
- 3.2   Reihenfolge
- 3.3   Absolute Pfade
- 4     LazarusRegistryControls (LRC) Funktionalität
- 4.1   `HKEY_CURRENT_USER`
- 4.2   Standardwerte
- 4.3   Synchronisierung und Gruppierung
- 4.3.1 Synchronisierung
- 4.3.2 Gruppierung

0 Anmerkung zur neuen Version
-----------------------------
Mit der ersten Änderung für die *LRC 0.9 M2* wird die Beispielanwendung: `example.exe` nicht
mehr lauffähig sein. Eine lauffähige Version der *LRC* mit Beispielanwendung finden sie unter folgendem Link:

* [Pre-release LRC 0.9 M1](https://github.com/AlfredGerke/LazarusRegistryControls/releases/tag/v0.9-M.1/ "Pre-release LRC 0.9 M1")

Die Änderungen zur Zielversion *LRC 0.9 M2* werden zentrale Bestandteile der aktuellen Version
*LRC 0.9 M1* betreffen. Die neue Version wird definitv nicht abwärtskompatibel sein.

Folgende Änderungen sind vorgesehen (s. Issues):

* Packages umorganisieren
* RegistrySettings überarbeiten
* Neue Komponenten
* Neue Methoden für TRegistrySource
* Vorhandene Komponenten erweitern
* Beispielanwendung überarbeiten
* Automatisierter Test

1 Einleitung
------------
Die LazarusRegistryControls (LRC) sind direkte Ableitung einer Teilmenge aus den
Standard- und den Additional-Steuerelemte der LCL von Lazarus. Sie werden auf einem
eigenen Reiter der Komponentenpalette "Registry Controls" installiert. Die Auswahl
der abgeleiteten Steuerelement richtet sich nach der Häufigkeit ihrer Nutzung
(TEdit, TLabel, TComboBox, TCheckBox, TListBox, TRadioButton, TRadioGroup, TCheckListBox,
TCheckGroup, TValueListEditor). Diese Steuerelemente sollten nur genutzt werden,
um Werte in der Registry zu verwalten. Sie sind in der vorliegenden Version nur
für den Einsatz unter Windows sinnvoll.

2 Packagenamen
--------------

- registrysource.lpk:

  * TRegistrySource
  * Erweiterung der Eigenschaften
  * Property- und Komponenteneditoren

- registrycontrols.lpk:

  * TRegEdit
  * TRegLabel
  * TRegComboBox
  * TRegCheckBox
  * TRegListBox
  * TRegRadioButton
  * TRegRadioGroup
  * TRegCheckListBox
  * TRegCheckGroup
  * TRegValueListEditor

3 Installation
--------------
Für die Installation sind keine zusätzlichen Packages (etc.) notwendig. In der
vorliegenden Version nur unter Windows sinnvoll.

## 3.1 Versionen
Lazarus: 1.4.0
FPC: 2.6.4
DebugServer: [s. readme.md in ./test](https://github.com/AlfredGerke/LazarusRegistryControls/tree/master/test#0-debugserver "readme.md")
LazarusRegistryControls (LRC): *Zielversion LRC 0.9 M2*

## 3.2 Reihenfolge
- registrysource.lpk
- registrycontrols.lpk

## 3.3 Absolute Pfade
Bei der Entwicklung wurde auf relative Pfadangaben für die IDE-Umgebung geachtet.
Trotzdem haben sich in einigen Dateien absoulte Pfade eingefunden. Dabei handelt
es sich immer um Pfadangaben für die Dokumentation. Der Pfadanteil
`C:\Users\Alfred\Sourcen\GitHub\LazarusRegistryControls\` muss in folgenden Dateien angepasst
werden:

- docuProject.ldp in ..\doc\
- docuProjectCtrl.ldp in ..\doc\
- registrycontrols.lpk in ..\package\
- registrysource.lpk in ..\package\
- _makeskel.bat in ..\soruce\
- createDocu.bat in ..\documentation\

4 LazarusRegistryControls (LRC) Funktionalität
----------------------------------------------
Mit Hilfe der **LRC** soll Ordnung bezüglich des Registryzugriff in einem Projekt hergestellt werden.
Dabei wurde darauf geachtet, das so wenig wie möglich an Quelltext vom Entwickler geschrieben werden muß,
um auf Daten in der Registry zu zugreifen.

Die abgeleiteten Steuerelement werden über die zentrale Komponente
(TRegistrySource) mit der Registry verbunden. Über eine Erweiterung der
Eigenschaften (RegistrySettings) der abgeleiteten Steuerelement können spezifische
Informationen für Schlüssel der Registry hinterlegt werden, welche genutzt werden,
um Daten aus der Registry zu lesen und in die Registry zu schreiben.

Die TRegistrySource-Komponente stellt den gesamten Zugriff auf die Registry zur Verfügung.
Sie kann auch direkt, unabhängig von Steuerelementen, verwendet werden, um einen Zugriff auf die Registry herzustellen:

    try
        Screen.Cursor := crHourGlass;
        // Zentraler Registryzugriff, eventuel auch verbunden mit Steuerlementen (z.B.: TRegEdit)
        // Alle notwendigen Einstellungen für den Zugriff auf die Registgry finden sich in den
        // Eigenschaften dieser Komponente wieder
        with RegistrySource1 do
        begin
            // Schaltet die Synchronisierung von angebundenen Steuerelementen ab
            DoSyncData := False;
            // Veranlasst das ein Grundschlüssel mit Standardwerten aufgebaut wird
            WriteDefaults := True;
            // Schreibt einen String
            WriteString('Section1', 'Ident', 'Value');
            // Schreibt einen Integer`
            WriteInteger('Section2', 'Ident', 1);
            // Schreibt einen Boolean
            WriteBool('Section3', 'Ident', True);
            // Aktualisert alle angebundenene Steuerelemente
            RefreshClientData('', 0);
            DoSyncData := True;
        end;
    finally
        Screen.Cursor := crDefault;
    end;

## 4.1 `HKEY_CURRENT_USER`
Die Steuerelemente schreiben und lesen immer in das Registryroot: `HKEY_CURRENT_USER`.
Unterhalb vom Registryroot wird eine Grundschlüssel eingerichtet. Dieser Grundschlüssel
sollte immer in den Schlüssel *Software* verweisen.
Unterhalb des Schlüssel *Software* sollte der Name der Firma oder der Organisation,
welche das Projekt/Programm vertreibt aufgeführt werden.
Unterhalb des Schlüssels für die Firma/Organisation sollte eine Bezeichnung für das
Projekt eingeführt werden.
Um meherere Versionen eines Projektes unter Umständen mit verschiedenen Schlüssel
versorgen zu können sollte, unterhalb des Schlüssels für das Projekt eine eindeutige
Kennung angegeben werden. Eine solche eindeutige Kennung könnte eine GUID sein.
In der RegistrySource (TRegistrySource) werden für diese Einzelelemente Eigenschaften
angeboten *(Eigenschaften: GUID, ORGANISATION, PROJECT)*.
Diese Eigenschaften können in einem Grundschlüssel als Variablen hinterlegt werden.
*(Variablen: %%GUID%%, %%ORGANISATION%%, %%PROJECT%%)*
Ein Grundschlüssel könnte also wie folgt aussehen:
`SOFTWARE\%%ORGANISATION%%\%%PROJECT%%\%%GUID%%`
In dem Beispielprogramm wird daraus:
`Software\ExampleFactory\LazarusRegistryControls\{51D8EEB4-A549-4B08-BFCB-731DEC3E82AE}`

## 4.2 Standardwerte
Standardwerte für nicht erfolgreiche Zugriffe auf die Registry (in der Regel
Schlüssel nicht vorhanden) können direkt am Steuerelement in den RegistrySettings
(Eigenschaft: Default) definiert werden. Als zweite Möglichkeit kann man am
Steuerelement einen Schlüsselpfad definieren, über den Defaults in der Registry
verwaltet werden können. Dies ermöglicht personalisierte Standardwerte, die z.B.
durch die Installation oder einem Update eingerichtet werden. Ein Administarionswerkzeug
könnte ebenfalls diese Standards bearbeiten.
Der Grundschlüssel für Standards, sollte nach ähnlichen Regeln aufgebaut werden,
wie der Grundschlüssel im `HKEY_CURRENT_USER`. Die Eigenschaften: *GUID, ORGANISATION, PROJECT* und
deren Einsatz durch die entsprechenden Variablen stehen in gleichwer Weise zur Verfügung.
Ein Grundschlüssel könnte also wie folgt aussehen:
`SOFTWARE\%%ORGANISATION%%\%%PROJECT%%\DEFAULTS\%%GUID%%`
In dem Beispielprogramm wird daraus:
`Software\ExampleFactory\LazarusRegistryControls\DEFAULTS\{51D8EEB4-A549-4B08-BFCB-731DEC3E82AE}`

Wenn als Grundschlüssel `HKEY_LOCAL_MACHINE` gewählt wird muss bedacht werden das bei eingeschalteter
UAC das Bearbeiten von Inhalten in diesem Grundschlüssel nur mit Adminrechten erlaubt ist. Das Lesen
von Inhalten hingegen ist schon einem Standardbenutzer erlaubt.

## 4.3 Synchronisierung und Gruppierung

### 4.3.1 Synchronisierung
Auf Wunsch können Steuerelemente automatisch veranlasst werden, sich zu aktualisieren,
wenn der Inhalt eines beliebigen Steuerelementes geändert wurde. Voraussetzung ist,
das alle diese Steuerelement mit der selben RegistrySoruce (TRegistrySource)
verbunden sind, wie das Steuerelement dessen Wert geändert wurde. Jedes Steuerelement
kann über die Eigenschaft DoSyncData bestimmen, ob es an einer automatischen
Synchronisierung teilnimmt. Die Eigenschaft DoSyncData an der zentralen Komponente
(TRegistrySource) bestimmt ob überhaupt synchronisiert werden soll.

### 4.3.2 Gruppierung
Über die Eigenschaft GroupIndex der erweiterten Eigenschaften (RegistrySettings)
können Steuerelemente zu Gruppen zusammengefasst werden. Der GroupIndex=0 steht
dabei immer für "keine Zuordnung zu einer Gruppe".

### Beispiel 1:
Wenn ein Steuerelement mit dem GroupIndex=0 seinen Wert ändert, die Synchronisierung
überall eingeschaltet ist, dann werden auch alle anderen Steuerelemente veranlasst,
ihre Daten zu aktualisieren, unabhängig ob deren GroupIndex<>0 ist.

### Beispiel 2:
Wenn ein Steuerelement mit dem GroupIndex=1 seinen Wert ändert, dann werden nur
die Steuerelemente zur Synchronisierung veranlasst, welche ebenfalls den GroupIndex=1
besitzen.


text:
package home.manager.system.hardware.modules;

public class RaspberryPiHubModule extends HubModule {
    @Override
    public boolean turnOff() {
        System.out.println("Turning OFF. => Module Id: " + this.getId());
        return super.turnOff();
    }

    @Override
    public boolean turnOn() {
        System.out.println("Turning ON. => Module Id: " + this.getId());
        return super.turnOn();
    }
}


text:
Shrinking
=========

When one of the generated examples makes a test fail, it is useful for debugging purposes to try and generate the simplest possible input that still triggers this failure.

Eris, like all QuickCheck implementations, performs a process called shrinking which:

- stops each test at the first failure
- asks the Generator to turn the currently generated value to another, simpler value
- perform the test with the new value.

Shrinking repeats this process until the test does not fail anymore, or the value cannot be simplified further. The last input in the shrinking sequence that still makes the test fail is the one reported to the user, while all other values are regarded as more complex and thrown away.

Simplest example
----------------

.. literalinclude:: ../examples/ShrinkingTest.php
   :language: php

``testShrinkingAString`` is the simplest shrinking example. Each iteration generates random strings and test them to check that they do not contain the letter ``B``. This is an example sequence of generated values (which by default will change at every run):

.. code-block:: php

    string(0) ""
    string(1) "K"
    string(2) "g,"
    string(3) "=%,"
    string(7) "jGHr38i"
    string(15) "L(uw^K)/&hf!mQK"
    string(9) ":W}W[+<GR"
    string(20) ":e|$dI,[Bj(Kx-4`-"3X"
    string(19) ":e|$dI,[Bj(Kx-4`-"3"
    string(18) ":e|$dI,[Bj(Kx-4`-""
    string(17) ":e|$dI,[Bj(Kx-4`-"
    string(16) ":e|$dI,[Bj(Kx-4`"
    string(15) ":e|$dI,[Bj(Kx-4"
    string(14) ":e|$dI,[Bj(Kx-"
    string(13) ":e|$dI,[Bj(Kx"
    string(12) ":e|$dI,[Bj(K"
    string(11) ":e|$dI,[Bj("
    string(10) ":e|$dI,[Bj"
    string(9) ":e|$dI,[B"
    string(8) ":e|$dI,["

All the values up to ``string(9) ":W}W[+<GR"`` pass the test. The value ``string(20) ":e|$dI,[Bj(Kx-4`-"3X"`` is the first to fail.

From there, the value is shrunk by chopping away a single character at the end of the string. The value ``string(8) ":e|$dI,["`` is the first one in the shrinking sequence that does not fail the test, so the process stops there. The last simplified value to still fail the test is ``string(9) ":e|$dI,[B"`` and it's the one presented to the user:

.. code-block:: bash

    1) ShrinkingTest::testShrinkingAString
    Failed asserting that ':e|$dI,[B' does not contain "B".

    /home/giorgio/code/eris/examples/ShrinkingTest.php:16
    /home/giorgio/code/eris/src/Eris/Quantifier/Evaluation.php:51
    /home/giorgio/code/eris/src/Eris/Shrinker/Random.php:68
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:128
    /home/giorgio/code/eris/src/Eris/Quantifier/Evaluation.php:53
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:130
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:158
    /home/giorgio/code/eris/examples/ShrinkingTest.php:17
    /home/giorgio/code/eris/examples/ShrinkingTest.php:17

    FAILURES!
    Tests: 1, Assertions: 119, Failures: 1.

Shrinking and preconditions
--------------------------

``testShrinkingRespectsAntecedents`` generates a random number from 0 to 20 and tries to check that it is multiple of 29. All generated numbers will fail this test, but shrinking will try to present the lowest possible number; still, the ``when()`` antecedent has to be satisfied and so the number cannot decrease down to 0 but has to stop at 11:

.. code-block:: bash

    1) ShrinkingTest::testShrinkingRespectsAntecedents
    The number 11 is not multiple of 29
    Failed asserting that false is true.

    /home/giorgio/code/eris/examples/ShrinkingTest.php:18
    /home/giorgio/code/eris/src/Eris/Quantifier/Evaluation.php:51
    /home/giorgio/code/eris/src/Eris/Shrinker/Random.php:68
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:128
    /home/giorgio/code/eris/src/Eris/Quantifier/Evaluation.php:53
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:130
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:158
    /home/giorgio/code/eris/examples/ShrinkingTest.php:19
    /home/giorgio/code/eris/examples/ShrinkingTest.php:19

    FAILURES!
    Tests: 1, Assertions: 4, Failures: 1.

Shrinking is only performed when assertions fail: generic exceptions bubbling up out of the ``then()`` will just interrupt the test.

Shrinking time limit
--------------------

You can set a time limit for shrinking if you prefer to be presented with more complex examples with respect to spending test suite running time:

.. literalinclude:: ../examples/ShrinkingTest.php
   :language: php

The shrinking for this test will not run for more than 2 seconds (although the test as a whole may take more):

.. code-block:: bash

    1) ShrinkingTimeLimitTest::testLengthPreservation
    RuntimeException: Eris has reached the time limit for shrinking (2s elapsed of 2s), here it is presenting the simplest failure case.
    If you can afford to spend more time to find a simpler failing input, increase it with the annotation '@eris-shrink {seconds}' or $this->shrinkingTimeLimit($seconds).

    /home/giorgio/code/eris/src/Eris/Shrinker/Random.php:71
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:128
    /home/giorgio/code/eris/src/Eris/Quantifier/Evaluation.php:53
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:130
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:158
    /home/giorgio/code/eris/examples/ShrinkingTimeLimitTest.php:32
    /home/giorgio/code/eris/examples/ShrinkingTimeLimitTest.php:32

    Caused by
    PHPUnit_Framework_ExpectationFailedException: Concatenating 'hW4N*:fD0&%+D_' to 'p:\(,N\7A6' gives 'hW4N*:fD0&%+D_p:\(,N\7A6ERROR'

    Failed asserting that 29 matches expected 24.

    /home/giorgio/code/eris/examples/ShrinkingTimeLimitTest.php:31
    /home/giorgio/code/eris/src/Eris/Quantifier/Evaluation.php:51
    /home/giorgio/code/eris/src/Eris/Shrinker/Random.php:68
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:128
    /home/giorgio/code/eris/src/Eris/Quantifier/Evaluation.php:53
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:130
    /home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:158
    /home/giorgio/code/eris/examples/ShrinkingTimeLimitTest.php:32
    /home/giorgio/code/eris/examples/ShrinkingTimeLimitTest.php:32

    FAILURES!
    Tests: 1, Assertions: 8, Errors: 1.

Tree-based shrinking
--------------------

- for some generators what goes on under the hood is not a linear shrinking, write test that demonstrates that with Sample class
-- optimistic path
-- pessimistic path
-- average path (choose the middle)

Disabling shrinking
-------------------

In some cases the ``then()`` method is non-deterministic as it spawns other processes or talks to other services. Moreover, ``then()`` can be very slow to execute when targeting APIs for end-to-end tests. Finally, if it performs any cleanup executing it for shrinking may clean lods or databases traces from the actual test failure, preventing effective debugging.

Therefore, it is possible to configure Eris to disable the shrinking process. As a result, the first assertion failure will stop the test and let the exception bubble up:

.. literalinclude:: ../examples/DisableShrinkingTest.php
   :language: php

This test will show a failure message containing ``Total calls: 1``.


text:
package nl.tudelft.ewi.git.web.api;

import nl.tudelft.ewi.git.models.CommitModel;

import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.Collection;

/**
 * API for interacting with commit objects.
 *
 * @author Jan-Willem Gmelig Meyling
 */
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.APPLICATION_JSON)
public interface CommitsApi {

	/**
	 * List all commits.
	 *
	 * @return a collection of commits.
	 */
	@GET
	@Path("commits")
	Collection<CommitModel> listCommits();

	/**
	 * Get a specific commit.
	 *
	 * @param commitId Commit id of the commit.
	 * @return {@link CommitApi} for the commit.
	 */
	@Path("commits/{commitId}")
	CommitApi getCommit(@NotNull @PathParam("commitId") String commitId);

}


text:
"""
                     The LLVM Compiler Infrastructure

This file is distributed under the University of Illinois Open Source
License. See LICENSE.TXT for details.

Helper functions for working with sockets.
"""

# Python modules:
import io
import socket

# LLDB modules
import use_lldb_suite

def recvall(sock, size):
    bytes = io.BytesIO()
    while size > 0:
        this_result = sock.recv(size)
        bytes.write(this_result)
        size -= len(this_result)
    return bytes.getvalue()


text:
#include <openspace/properties/list/stringlistproperty.h>

#include <openspace/json.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/lua/ghoul_lua.h>
#include <ghoul/lua/lua_helper.h>
#include <ghoul/misc/misc.h>

namespace openspace::properties {

StringListProperty::StringListProperty(Property::PropertyInfo info,
                                       std::vector<std::string> values)
    : ListProperty(std::move(info), std::move(values))
{}

std::string_view StringListProperty::className() const {
    return "StringListProperty";
}

int StringListProperty::typeLua() const {
    return LUA_TTABLE;
}

std::vector<std::string> StringListProperty::fromLuaConversion(lua_State* state,
                                                               bool& success) const
{
    if (!lua_istable(state, -1)) {
        success = false;
        LERRORC(className(), "Conversion from Lua failed. The input was not a table");
        return {};
    }

    std::vector<std::string> result;
    lua_pushnil(state);
    while (lua_next(state, -2) != 0) {
        if (lua_isstring(state, -1)) {
            result.emplace_back(lua_tostring(state, -1));
        }
        else {
            success = false;
            return {};
        }
        lua_pop(state, 1);
    }
    success = true;
    return result;
}

void StringListProperty::toLuaConversion(lua_State* state) const {
    lua_createtable(state, static_cast<int>(_value.size()), 0);

    int i = 1;
    for (const std::string& v : _value) {
        ghoul::lua::push(state, i);
        ghoul::lua::push(state, v.c_str());
        lua_settable(state, -3);
        ++i;
    }
}

std::string StringListProperty::toStringConversion() const {
    nlohmann::json json(_value);
    return json.dump();
}

} // namespace openspace::properties


text:
module.exports = (function () {
  // Global dependencies
  var m = require('mithril');
  // Local dependencies
  var auth = require('../auth.js');
  var layout = require('./layout.js');

  var home = {
    controller: function () {
      if (auth.isAuthenticated()) {
        m.route('/mypads');
      } else {
        m.route('/login');
      }
    },
    view: function () {
      return layout.view(m('p', 'empty home'), m('p', 'empty aside'));
    }
  };

  return home;
}).call(this);


text:
#!/usr/bin/env node

'use strict';

/* eslint-disable no-console */

/** @typedef {{tracePath: string, devtoolsLogPath: string}} GoldenUnthrottled */
/** @typedef {Record<string, number|undefined>} GoldenWpt3g */
/**
 * @typedef Wpt3gUnthrottled
 * @property {number|undefined} firstContentfulPaint
 * @property {number|undefined} firstMeaningfulPaint
 * @property {number|undefined} timeToFirstInteractive
 * @property {number|undefined} timeToConsistentlyInteractive
 * @property {number|undefined} speedIndex
 * @property {number|undefined} largestContentfulPaint
 */
/** @typedef {{url:string, unthrottled: GoldenUnthrottled, wpt3g: Wpt3gUnthrottled}} GoldenSite */
/** @typedef {{sites: GoldenSite[]}} Golden */

const fs = require('fs');
const path = require('path');
const execFileSync = require('child_process').execFileSync;
const constants = require('./constants.js');

const INPUT_PATH = process.argv[2] || constants.SITE_INDEX_WITH_GOLDEN_PATH;
const SITE_INDEX_PATH = path.resolve(process.cwd(), INPUT_PATH);
const SITE_INDEX_DIR = path.dirname(SITE_INDEX_PATH);
const RUN_ONCE_PATH = path.join(__dirname, 'run-once.js');

if (!fs.existsSync(SITE_INDEX_PATH)) throw new Error('Usage $0 <expectations file>');

/** @type {Golden} */
const expectations = require(SITE_INDEX_PATH);

for (const site of expectations.sites) {
  const trace = path.join(SITE_INDEX_DIR, site.unthrottled.tracePath);
  const log = path.join(SITE_INDEX_DIR, site.unthrottled.devtoolsLogPath);

  console.log('Running', site.url, '...');
  try {
    const rawOutput = execFileSync(RUN_ONCE_PATH, [trace, log])
      .toString()
      .trim();
    if (!rawOutput) console.log('ERROR EMPTY OUTPUT!');
    const lantern = JSON.parse(rawOutput);
    Object.assign(site, {lantern});
  } catch (e) {
    console.error(e);
  }
}

// eslint-disable-next-line max-len
fs.writeFileSync(constants.SITE_INDEX_WITH_GOLDEN_WITH_COMPUTED_PATH, JSON.stringify(expectations, null, 2));


text:
@interface FriendDetailController : UITableViewController{
    UIImageView *tempAvatar;
    UIImageView *fullScreenAvatar;
}

@property (nonatomic, strong) NSNumber *userId;
@property (nonatomic, strong) NSString *displayedName;
@property (nonatomic, strong) UIImage *avatar;

@property (nonatomic, strong) NSString *nickname;
@property (nonatomic, strong) NSString *gender;

@property (nonatomic, strong) NSMutableArray *friendDetails;

@end


text:
module Github

  # The Releases API
  class Repos::Releases < API

    PREVIEW_MEDIA = 'application/vnd.github.manifold-preview'.freeze # :nodoc:

    VALID_RELEASE_PARAM_NAMES = %w[
      tag_name
      target_commitish
      name
      body
      draft
      prerelease
    ].freeze # :nodoc:

    # List releases for a repository
    #
    # Users with push access to the repository will receive all releases
    # (i.e., published releases and draft releases). Users with pull access
    # will receive published releases only.
    #
    # = Examples
    #  github = Github.new
    #  github.repos.releases.list 'owner', 'repo'
    #  github.repos.releases.list 'owner', 'repo' { |release| ... }
    #
    def list(*args)
      params = arguments(args, required: [:owner, :repo]).params
      params['accept'] ||= PREVIEW_MEDIA

      response = get_request("/repos/#{owner}/#{repo}/releases", params)
      return response unless block_given?
      response.each { |el| yield el }
    end
    alias :all :list

    # Get a single release
    #
    # = Examples
    #  github = Github.new
    #  github.repos.releases.get 'owner', 'repo', 'id'
    #
    def get(*args)
      params = arguments(args, required: [:owner, :repo, :id]).params
      params['accept'] ||= PREVIEW_MEDIA

      get_request("/repos/#{owner}/#{repo}/releases/#{id}" , params)
    end
    alias :find :get

    # Create a release
    #
    # = Inputs
    # * <tt>:tag_name</tt> - Required string
    # * <tt>:target_commitish</tt> - Optional string - Specifies the commitish
    #       value that determines where the Git tag is created from. Can be
    #       any branch or commit SHA. Defaults to the repository's default
    #       branch (usually 'master'). Unused if the Git tag already exists.
    # * <tt>:name</tt> - Optional string
    # * <tt>:body</tt> - Optional string
    # * <tt>:draft</tt> - Optional boolean - <tt>true</tt> to create a draft
    #                    (unpublished) release, <tt>false</tt> to create
    #                     a published one. Default is false.
    # * <tt>:prerelease</tt> - Optional boolean - <tt>true</tt> to identify
    #                       the release as a prerelease. false to identify
    #                       the release as a full release. Default is false.
    #
    # = Examples
    #  github = Github.new
    #  github.repos.releases.create 'owner', 'repo', 'tag-name',
    #    "tag_name": "v1.0.0",
    #    "target_commitish": "master",
    #    "name": "v1.0.0",
    #    "body": "Description of the release",
    #    "draft": false,
    #    "prerelease": false
    #
    def create(*args)
      arguments(args, required: [:owner, :repo, :tag_name]) do
        sift VALID_RELEASE_PARAM_NAMES
      end
      params = arguments.params
      params['accept'] ||= PREVIEW_MEDIA
      params['tag_name'] = tag_name

      post_request("/repos/#{owner}/#{repo}/releases", params)
    end

    # Edit a release
    #
    # = Inputs
    # * <tt>:tag_name</tt> - Required string
    # * <tt>:target_commitish</tt> - Optional string - Specifies the commitish
    #       value that determines where the Git tag is created from. Can be
    #       any branch or commit SHA. Defaults to the repository's default
    #       branch (usually 'master'). Unused if the Git tag already exists.
    # * <tt>:name</tt> - Optional string
    # * <tt>:body</tt> - Optional string
    # * <tt>:draft</tt> - Optional boolean - <tt>true</tt> to create a draft
    #                    (unpublished) release, <tt>false</tt> to create
    #                     a published one. Default is false.
    # * <tt>:prerelease</tt> - Optional boolean - <tt>true</tt> to identify
    #                       the release as a prerelease. false to identify
    #                       the release as a full release. Default is false.
    #
    # = Examples
    #  github = Github.new
    #  github.repos.releases.edit 'owner', 'repo', 'id',
    #    "tag_name": "v1.0.0",
    #    "target_commitish": "master",
    #    "name": "v1.0.0",
    #    "body": "Description of the release",
    #    "draft": false,
    #    "prerelease": false
    #
    def edit(*args)
      arguments(args, required: [:owner, :repo, :id]) do
        sift VALID_RELEASE_PARAM_NAMES
      end
      params = arguments.params
      params['accept'] ||= PREVIEW_MEDIA

      patch_request("/repos/#{owner}/#{repo}/releases/#{id}", params)
    end
    alias :update :edit

    # Delete a release
    #
    # Users with push access to the repository can delete a release.
    #
    # = Examples
    #  github = Github.new
    #  github.repos.releases.delete 'owner', 'repo', 'id'
    #
    def delete(*args)
      params = arguments(args, required: [:owner, :repo, :id]).params
      params['accept'] ||= PREVIEW_MEDIA

      delete_request("/repos/#{owner}/#{repo}/releases/#{id}", params)
    end

  end # Repos::Statuses
end # Github