text:
{#
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
 #
 # http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-#}

{% macro humanize(timestamp) -%}
<time class="-js-relative-time" datetime="{{ timestamp|format_datetime('yyyy-MM-ddTHH:mm:ssZ') }}" data-controller="localized-time" data-localized-time-relative="true">
  {{ timestamp|format_date()}}
</time>
{%- endmacro %}

{% macro localize(timestamp) -%}
<time class="-js-relative-time" datetime="{{ timestamp|format_datetime('yyyy-MM-ddTHH:mm:ssZ') }}" data-controller="localized-time">
  {{ timestamp|format_date()}}
</time>
{%- endmacro %}

{% macro password_strength_gauge(data_target=None) -%}

  Choose a strong password that contains letters (uppercase and lowercase), numbers and special characters. Avoid common words or repetition.

  Password strength:

      Password field is empty

{%- endmacro %}

{% macro main_navigation_logged_out() -%}

  Help
  Donate
  Log in
  Register

{%- endmacro %}

<!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="defaultLanguage" content="en">
    <meta name="availableLanguages" content="en">

    {% if request.registry.settings.get("warehouse.domain") == "test.pypi.org" %}
      {% set testPyPI = true %}
    {% endif %}

    <title>{% block title_base %}{% block title %}{% endblock %}{% if self.title() %} · {% endif %}{{ request.registry.settings['site.name'] }}{% endblock %}</title>
    <meta name="description" content="{% block description %}The Python Package Index (PyPI) is a repository of software for the Python programming language.{% endblock %}">

    <link rel="stylesheet" href="{{ request.static_path('warehouse:static/dist/css/warehouse.css') }}">
    <link rel="stylesheet" href="{{ request.static_path('warehouse:static/dist/css/fontawesome.css') }}">
    <link rel="stylesheet" href="{{ request.static_path('warehouse:static/dist/css/regular.css') }}">
    <link rel="stylesheet" href="{{ request.static_path('warehouse:static/dist/css/solid.css') }}">
    <link rel="stylesheet" href="{{ request.static_path('warehouse:static/dist/css/brands.css') }}">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,600,600italic,700,700italic|Source+Code+Pro:500">

      <link rel="stylesheet" href="{{ request.static_path('warehouse:static/dist/css/noscript.css') }}">

    {% block extra_css %}{% endblock %}

    <link rel="icon" href="{{ request.static_path('warehouse:static/dist/images/favicon.ico') }}" type="image/x-icon">

    <link rel="alternate" type="application/rss+xml" title="RSS: 40 latest updates" href="{{ request.route_path('rss.updates') }}">
    <link rel="alternate" type="application/rss+xml" title="RSS: 40 newest packages" href="{{ request.route_path('rss.packages') }}">
    {% if self.canonical_url() %}
    <link rel="canonical" href="{% block canonical_url %}{% endblock %}">
    {% endif %}

    <meta property="og:url" content="{% if request.matched_route %}{{ request.current_route_url() }}{% else %}{{ request.urll }}{% endif %}">
    <meta property="og:site_name" content="PyPI">
    <meta property="og:type" content="website">
    <meta property="og:image" content="{{ request.static_url('warehouse:static/dist/images/twitter.jpg') }}">
    <meta property="og:title" content="{{ self.title()|default('Python Package Index') }}">
    <meta property="og:description" content="{{ self.description() }}">

    <link rel="search" type="application/opensearchdescription+xml" title="PyPI" href="{{ request.route_path('opensearch.xml') }}">

    {# This needs to be included first (in order to capture errors when
     # executing other JS scripts. It also can't be async, because then order
     # of execution is not guaranteed, and it can't be deferred, because most
     # of our JS would then execute before it, and we might miss exceptions.
     #}
    {% if request.registry.settings.get("sentry.frontend_dsn") -%}

    {% endif -%}
    {# All of our JavaScript should be loaded using the async attribute so it's
     # fine to have it in the header. This will allow the browser to start
     # downloading it ASAP while still not blocking the parser.
     #}

    {% block extra_js %}
    {% endblock %}
    {% if request.registry.settings.get("ga.tracking_id") -%}

    {% endif -%}

    {% block body %}

    Skip to main content

    <button class="button button--primary button--switch-to-mobile hidden" data-target="viewport-toggle.switchToMobile" data-action="viewport-toggle#switchToMobile">
      Switch to mobile version
    </button>

      {% if testPyPI %}

          Warning:

        You are using TestPyPI – a separate instance of the Python Package Index that allows you to try distribution tools and processes without affecting the real index.

      {% endif %}

        {# TODO: This should be removed once GH-3828 is fixed. #}

          Warning:

        Some features may not work without JavaScript. Please try enabling it if you encounter problems.

    {% block flash_messages %}
      {% csi request.route_path("includes.flash-messages") %}
      {% endcsi %}
    {% endblock %}

    {% for flag in request.flags.notifications() %}

      {{ flag.description }}

    {% endfor %}

    {% block session_notifications %}{% endblock %}

          {% block brand %}

            <form class="search-form search-form--primary" action="{{ request.route_path('search') }}">

                Search PyPI
                <input id="search" class="search-form__search" type="text" name="q" placeholder="Search projects" value="{{ term }}">
                {% block search_form_extra_inputs %}{% endblock %}
                <button type="submit" class="search-form__button">

                  Search
                </button>

            </form>

          {% endblock %}

          {% csi request.route_path("includes.current-user-indicator") %}
            {{ main_navigation_logged_out() }}
          {% endcsi %}

    {% block mobile_search %}

      <form class="search-form search-form--fullwidth" action="{{ request.route_path('search') }}">

          Search PyPI
          <input id="mobile-search" class="search-form__search" type="text" name="q" placeholder="Search projects" value="{{ term }}">
          {{ self.search_form_extra_inputs() }}
          <button type="submit" class="search-form__button">

            Search
          </button>
          </button>

      </form>

    {% endblock mobile_search %}

      {% block content %}
      {% endblock content %}

Help

Installing packages

Uploading packages

User guide

FAQs

About PyPI

PyPI on Twitter

Infrastructure dashboard

Package index name retention

Our sponsors

Contributing to PyPI

Bugs and feedback

Contribute on GitHub

Development credits

Using PyPI

Code of conduct

Report security issue

Privacy policy

Terms of use

        {% if request.registry.settings.get("statuspage.url") %}

Status: all systems operational

        {% endif %}

          Developed and maintained by the Python community, for the Python community.

          Donate today!

© {{ now()|format_date('yyyy') }} Python Software Foundation

        <button class="button button--switch-to-desktop hidden" data-target="viewport-toggle.switchToDesktop" data-action="viewport-toggle#switchToDesktop">
          Desktop version
        </button>

    {% include "warehouse:templates/includes/sponsors.html" %}

    {% endblock body %}


text:
from lxml import html
import requests, os, sys, argparse, string

# Get argument values
parser = argparse.ArgumentParser(description='Scrape all articles from an archive page')
parser.add_argument('arg_url', metavar='A', type=str, nargs=1,  help='The letter index')

args = vars(parser.parse_args())

url = args['arg_url'][0]

# Get page
page = requests.get(url)
tree = html.fromstring(page.text)

# Get links
links = tree.xpath('//*[@id="post-4"]/div[2]/div/p/a/@href')

review_links = [k for k in links if 'http' in k]

print string.join(review_links, '\n')

redpajama_set_name: RedPajamaGithub


text:
using namespace boost::mpi;
using namespace std;
using boost::is_base_and_derived;

int test_main(int argc, char* argv[])
{
  boost::mpi::environment env(argc, argv);

  // Check each predefined MPI_Op type that we support directly.
  BOOST_CHECK((is_mpi_op<maximum<int>, int>::op() == MPI_MAX));
  BOOST_CHECK((is_mpi_op<minimum<float>, float>::op() == MPI_MIN));
  BOOST_CHECK((is_mpi_op<plus<double>, double>::op() == MPI_SUM));
  BOOST_CHECK((is_mpi_op<multiplies<long>, long>::op() == MPI_PROD));
  BOOST_CHECK((is_mpi_op<logical_and<int>, int>::op() == MPI_LAND));
  BOOST_CHECK((is_mpi_op<bitwise_and<int>, int>::op() == MPI_BAND));
  BOOST_CHECK((is_mpi_op<logical_or<int>, int>::op() == MPI_LOR));
  BOOST_CHECK((is_mpi_op<bitwise_or<int>, int>::op() == MPI_BOR));
  BOOST_CHECK((is_mpi_op<logical_xor<int>, int>::op() == MPI_LXOR));
  BOOST_CHECK((is_mpi_op<bitwise_xor<int>, int>::op() == MPI_BXOR));

  return 0;
}


text:
#pragma once
#include <aws/securityhub/SecurityHub_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace SecurityHub
{
namespace Model
{

  /**
   *
A prefix list ID.

See Also:
   AWS
   * API Reference

   */
  class AWS_SECURITYHUB_API AwsEc2SecurityGroupPrefixListId
  {
  public:
    AwsEc2SecurityGroupPrefixListId();
    AwsEc2SecurityGroupPrefixListId(Aws::Utils::Json::JsonView jsonValue);
    AwsEc2SecurityGroupPrefixListId& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The ID of the prefix.

     */
    inline const Aws::String& GetPrefixListId() const{ return m_prefixListId; }

    /**
     *
The ID of the prefix.

     */
    inline bool PrefixListIdHasBeenSet() const { return m_prefixListIdHasBeenSet; }

    /**
     *
The ID of the prefix.

     */
    inline void SetPrefixListId(const Aws::String& value) { m_prefixListIdHasBeenSet = true; m_prefixListId = value; }

    /**
     *
The ID of the prefix.

     */
    inline void SetPrefixListId(Aws::String&& value) { m_prefixListIdHasBeenSet = true; m_prefixListId = std::move(value); }

    /**
     *
The ID of the prefix.

     */
    inline void SetPrefixListId(const char* value) { m_prefixListIdHasBeenSet = true; m_prefixListId.assign(value); }

    /**
     *
The ID of the prefix.

     */
    inline AwsEc2SecurityGroupPrefixListId& WithPrefixListId(const Aws::String& value) { SetPrefixListId(value); return *this;}

    /**
     *
The ID of the prefix.

     */
    inline AwsEc2SecurityGroupPrefixListId& WithPrefixListId(Aws::String&& value) { SetPrefixListId(std::move(value)); return *this;}

    /**
     *
The ID of the prefix.

     */
    inline AwsEc2SecurityGroupPrefixListId& WithPrefixListId(const char* value) { SetPrefixListId(value); return *this;}

  private:

    Aws::String m_prefixListId;
    bool m_prefixListIdHasBeenSet = false;
  };

} // namespace Model
} // namespace SecurityHub
} // namespace Aws


text:
module SimpleCov
  module Formatter
    class RcovFormatter
      class Setup
        VERSION = '0.0.7'
      end
    end
  end
end


text:
@startDocuBlock get_api_database_list
@brief retrieves a list of all existing databases

@RESTHEADER{GET /_api/database, List of databases, getDatabases:all}

@RESTDESCRIPTION
Retrieves the list of all existing databases

**Note**: retrieving the list of databases is only possible from within the *_system* database.

**Note**: You should use the [*GET user API*](../UserManagement/README.md#list-the-accessible-databases-for-a-user) to fetch the list of the available databases now.

@RESTRETURNCODES

@RESTRETURNCODE{200}
is returned if the list of database was compiled successfully.

@RESTRETURNCODE{400}
is returned if the request is invalid.

@RESTRETURNCODE{403}
is returned if the request was not executed in the *_system* database.

@EXAMPLES

@EXAMPLE_ARANGOSH_RUN{RestDatabaseGet}
    var url = "/_api/database";
    var response = logCurlRequest('GET', url);

    assert(response.code === 200);

    logJsonResponse(response);
@END_EXAMPLE_ARANGOSH_RUN
@endDocuBlock


text:
<?php

/**
 * Description of Observer
 *
 * @author rterrani
 */
class Oink_MatrixrateIntegration_Model_Observer
{
    const MATRIXRATE_SHIPPING_METHOD_CODE="matrixrate";
    const MATRIXRATE_SHIPPING_METHODS_CONFIG_PATH="oink/matrixrate/shipping_methods";

    public function oinkAfterSetShippingMethod(Varien_Event_Observer $observer)
    {
        $shippingMethod = $observer->getShippingMethod();
        $availableShippingMethods = $observer->getAvailableShippingMethods();
        $shippingMethodCode=$shippingMethod->getCode();
        $_shippingMethod=explode("_",$shippingMethodCode);
        $carrier=array_shift($_shippingMethod);
        if ($carrier == self::MATRIXRATE_SHIPPING_METHOD_CODE) {
            $newShippingMethod = $this->_getAvailableMethod($availableShippingMethods,$shippingMethodCode);
            $shippingMethod->setCode($newShippingMethod);
        }
    }

    protected function _getAvailableMethod($availableShippingMethods)
    {
        $configuredShippingMethods = Mage::getStoreConfig(self::MATRIXRATE_SHIPPING_METHODS_CONFIG_PATH);
        $matrixrateShippingRates=$availableShippingMethods[self::MATRIXRATE_SHIPPING_METHOD_CODE];
        foreach ($configuredShippingMethods as $key => $shippingMethod) {
            foreach ($matrixrateShippingRates as $matrixrateKey => $matrixrateShippingRate) {
                if($matrixrateShippingRate->getMethodTitle()==$shippingMethod["method"]){
                    return $matrixrateShippingRate->getCode();
                }
            }
        }
        return $defaultShipmentMethod;
    }

}


text:
package org.apache.wicket.model;

import org.apache.wicket.Component;

/**
 * Quick model that is implements the IComponentAssignedModel and the IModel interfaces. Its a quick
 * replacement for the current setObject(Component,Object) and getObject(Component) methods when the
 * component is needed in the model.
 *
 * @author jcompagner
 * @param <T>
 *            type of model object
 */
public class ComponentModel<T> implements IModel<T>, IComponentAssignedModel<T>
{
	private static final long serialVersionUID = 1L;

	/**
	 * This getObject throws an exception.
	 *
	 * @see org.apache.wicket.model.IModel#getObject()
	 */
	@Override
	public final T getObject()
	{
		throw new RuntimeException("get object call not expected on a IComponentAssignedModel");
	}

	/**
	 * @see org.apache.wicket.model.IModel#setObject(java.lang.Object)
	 */
	@Override
	public final void setObject(Object object)
	{
		throw new RuntimeException("set object call not expected on a IComponentAssignedModel");
	}

	/**
	 * Returns the object from the model with the use of the component where it is attached to.
	 *
	 * @param component
	 *            The component which has this model.
	 * @return The object of the model.
	 */
	protected T getObject(Component component)
	{
		return null;
	}

	/**
	 * Sets the model object for this model.
	 *
	 * @param component
	 *            The component which has this model.
	 * @param object
	 *            The object that will be set in the model.
	 */
	protected void setObject(Component component, Object object)
	{
	}

	/**
	 * @see org.apache.wicket.model.IDetachable#detach()
	 */
	@Override
	public void detach()
	{
	}

	/**
	 * @see org.apache.wicket.model.IComponentAssignedModel#wrapOnAssignment(org.apache.wicket.Component)
	 */
	@Override
	public IWrapModel<T> wrapOnAssignment(Component comp)
	{
		return new WrapModel(comp);
	}

	private class WrapModel implements IWrapModel<T>
	{
		private static final long serialVersionUID = 1L;

		private final Component component;

		/**
		 * @param comp
		 */
		public WrapModel(Component comp)
		{
			component = comp;
		}

		/**
		 * @see org.apache.wicket.model.IWrapModel#getWrappedModel()
		 */
		@Override
		public IModel<T> getWrappedModel()
		{
			return ComponentModel.this;
		}

		/**
		 * @see org.apache.wicket.model.IModel#getObject()
		 */
		@Override
		public T getObject()
		{
			return ComponentModel.this.getObject(component);
		}

		/**
		 * @see org.apache.wicket.model.IModel#setObject(java.lang.Object)
		 */
		@Override
		public void setObject(Object object)
		{
			ComponentModel.this.setObject(component, object);
		}

		/**
		 * @see org.apache.wicket.model.IDetachable#detach()
		 */
		@Override
		public void detach()
		{
			ComponentModel.this.detach();
		}

	}
}


text: //# sourceMappingURL=index.spec.js.map


text:
values="1 5 10 50 100 500 1000"
#wiGenRunner="\basura\wigen-0.0.1\wigen-0.0.1\bin\wigen.bat"
wiGenRunner=./wigen

for value in $values
do
outName="outCompsNR"
params="--countries 1 --dataSets 1 --slices 1 --observations 1 --computations $value --Indicators 1 --Organizations 1 --shex schemas/webindex_NonRecursive.shex --allTypes --time"
paramsSingle="$params --no-scopeNodes"
paramsBad="$params --badComps 1"
$wiGenRunner $params >> $outName
$wiGenRunner $paramsSingle >> $outName
$wiGenRunner $paramsBad >> $outName
done


text:
var path = require('path');
var electron = require('electron');
var BrowserWindow = electron.BrowserWindow;
var options = {
    //  ALL POSSIBLE OPTIONS FOR ELECTRON WINDOW OBJECT [ http://electron.atom.io/docs/v0.36.5/api/browser-window/ ]
    // width Integer - Window's width in pixels. Default is 800
    width: 500,
    // height Integer - Window's height in pixels. Default is 600.
    height: 500,
};
var html = path.join('file://' + __dirname + '/window-main.html');
module.exports = function (windowRef) {
    windowRef = new BrowserWindow(options); // Create the browser window using the mainWindowOptions object.
    windowRef.loadURL(html); // and load the index.html of the app.
    var webContents = windowRef.webContents;
    // Open the DevTools.
    windowRef.on('closed', function () { return (windowRef = null); });
};


text:
import React, { PropTypes } from 'react';
import IconPlace from 'material-ui/svg-icons/maps/place';
import IconLocalPhone from 'material-ui/svg-icons/maps/local-phone';
import IconAccessTime from 'material-ui/svg-icons/device/access-time';
import { TimeDisplay, IconParagraph } from '../app_widgets';
import { ListItem } from 'material-ui/List';

let OrderProfile = ({address, unit_number, postal_code, contact_no,
	pickupTime, pickupDate, dropOffDate, dropOffTime}) => (

    <ListItem primaryText={`${address}${unit_number?(', ' + unit_number):''}, ${postal_code}`}
      leftIcon={<IconPlace/>}/>
    {contact_no&&
	    <ListItem primaryText={contact_no}
	      leftIcon={<IconLocalPhone/>}/>
    }
    <ListItem primaryText={
Pickup time: {(typeof pickupTime === 'object')?<TimeDisplay format='LT'>{pickupTime}</TimeDisplay>:pickupTime}, <TimeDisplay format='MMMM Do YYYY'>{pickupDate}</TimeDisplay>
}
      leftIcon={<IconAccessTime/>}/>
    {dropOffDate&&
      <ListItem primaryText={
Drop off time: {dropOffTime}, <TimeDisplay format='MMMM Do YYYY'>{dropOffDate}</TimeDisplay>
}
        leftIcon={<IconAccessTime/>}/>
    }

);

OrderProfile.propTypes = {
	address: PropTypes.string,
	unit_number: PropTypes.any,
	postal_code: PropTypes.any,
	contact_no: PropTypes.any,
	pickupTime: PropTypes.any,
	pickupDate: PropTypes.any,
	dropOffDate: PropTypes.any,
	dropOffTime: PropTypes.any
};

export default OrderProfile;


text:
<?php

declare(strict_types=1);

namespace Phpcq\Runner\Config\Builder;

use Phpcq\Runner\Config\Validation\Constraints;
use Phpcq\Runner\Config\Validation\Validator;
use Phpcq\Runner\Exception\ConfigurationValidationErrorException;
use Phpcq\PluginApi\Version10\Configuration\Builder\OptionsListOptionBuilderInterface;
use Phpcq\PluginApi\Version10\Exception\InvalidConfigurationException;
use Throwable;

use function sprintf;

/** @extends AbstractOptionBuilder<OptionsListOptionBuilderInterface, list<array<string,mixed>>> */
final class OptionsListOptionBuilder extends AbstractOptionBuilder implements OptionsListOptionBuilderInterface
{
    use OptionsBuilderTrait;

    public function isRequired(): OptionsListOptionBuilderInterface
    {
        return parent::isRequired();
    }

    public function withNormalizer(callable $normalizer): OptionsListOptionBuilderInterface
    {
        return parent::withNormalizer($normalizer);
    }

    public function withValidator(callable $validator): OptionsListOptionBuilderInterface
    {
        return parent::withValidator($validator);
    }

    public function withDefaultValue(array $defaultValue): OptionsListOptionBuilderInterface
    {
        $this->defaultValue = $defaultValue;

        return $this;
    }

    public function normalizeValue($raw): ?array
    {
        if (null === $raw) {
            $raw = $this->defaultValue;
        }
        if ($raw === null) {
            if ($this->required) {
                throw new InvalidConfigurationException(sprintf('Configuration key "%s" has to be set', $this->name));
            }

            return null;
        }

        /** @psalm-var list<array<string,mixed>> $raw */
        $raw = Constraints::listConstraint($raw);
        foreach ($raw as $index => $options) {
            foreach ($this->normalizer as $normalizer) {
                try {
                    /** @psalm-var array<string,mixed> */
                    $raw[$index] = $normalizer($options);
                } catch (ConfigurationValidationErrorException $exception) {
                    throw $exception->withOuterPath([$this->name, (string) $index]);
                } catch (Throwable $exception) {
                    throw ConfigurationValidationErrorException::fromError([$this->name, (string) $index], $exception);
                }
            }

            $raw[$index] = $this->normalizeOptions($raw[$index]);
        }

        return $raw;
    }

    public function validateValue($value): void
    {
        if (null === $value) {
            if (!$this->required) {
                return;
            }

            throw new InvalidConfigurationException(sprintf('Configuration key "%s" has to be set', $this->name));
        }

        /** @psalm-var list<array<string,mixed>> $value */
        $value = Constraints::listConstraint($value, Validator::arrayValidator());
        foreach ($value as $key => $option) {
            foreach ($this->validators as $validator) {
                try {
                    $validator($option);
                } catch (ConfigurationValidationErrorException $exception) {
                    throw $exception->withOuterPath([$this->name, (string) $key]);
                } catch (Throwable $exception) {
                    throw ConfigurationValidationErrorException::fromError([$this->name, (string) $key], $exception);
                }
            }
        }
    }
}


text:
require "time"
require "net/http"
require "net/https"
require "json"

require "xmlstats/endpoint"
require "xmlstats/version"

require "xmlstats/object"

require "xmlstats/objects/standing"
require "xmlstats/objects/team"
require "xmlstats/objects/site"
require "xmlstats/objects/event"
require "xmlstats/objects/basketball_stat"
require "xmlstats/objects/batter"
require "xmlstats/objects/event_information"
require "xmlstats/objects/official"
require "xmlstats/objects/pitcher"
require "xmlstats/objects/mlb_box_score"
require "xmlstats/objects/nba_box_score"
require "xmlstats/objects/team_result"
require "xmlstats/objects/nba_leader"
require "xmlstats/objects/player"

require "xmlstats/cachers/memory"
require "xmlstats/cachers/redis"

require "xmlstats/http_getters/net_http"

require "xmlstats/endpoints/events"
require "xmlstats/endpoints/mlb_standing"
require "xmlstats/endpoints/nba_standing"
require "xmlstats/endpoints/mlb_wild_card_standing"
require "xmlstats/endpoints/mlb_box_score"
require "xmlstats/endpoints/nba_box_score"
require "xmlstats/endpoints/mlb_teams"
require "xmlstats/endpoints/nba_teams"
require "xmlstats/endpoints/mlb_team_results"
require "xmlstats/endpoints/nba_team_results"
require "xmlstats/endpoints/nba_leaders"
require "xmlstats/endpoints/nba_roster"
require "xmlstats/endpoints/mlb_roster"

module Xmlstats

  class << self

    # Manage api key

    def api_key
      @api_key ||= ENV["XMLSTATS_API_KEY"]
    end

    def api_key= api_key
      @api_key = api_key
    end

    # Manage contact info

    def contact_info
      error = "specify user-agent contact info with: Xmlstats.contact_info = 'you@example.com'"
      @contact_info ||= ENV["XMLSTATS_CONTACT_INFO"]
      @contact_info or raise(error)
    end

    def contact_info= contact_info
      @contact_info = contact_info
    end

    # Manage http getter

    def http_getter
      @http_getter ||= Xmlstats::HttpGetters::NetHttp.new
    end

    def http_getter= http_getter
      @http_getter = http_getter
    end

    # Manage cacher

    def cacher
      @cacher ||= Xmlstats::Cachers::Memory.new
    end

    def cacher= cacher
      case cacher.class.name
      when "Redis" then @cacher = Xmlstats::Cachers::Redis.new(cacher)
      else              @cacher = cacher
      end
    end

    # Methods to retrieve current rate limit status

    def limit_total
      (cacher.get("rate_limit.limit_total") || 6).to_i
    end

    def limit_total=(count)
      cacher.set("rate_limit.limit_total", count)
    end

    def limit_remaining
      (cacher.get("rate_limit.limit_remaining") || 6).to_i
    end

    def limit_remaining=(count)
      cacher.set("rate_limit.limit_remaining", count)
    end

    def limit_reset_time
      if ( reset_time = cacher.get("rate_limit.limit_reset_time") )
        Time.parse(reset_time)
      else
        Time.now
      end
    end

    def limit_reset_time=(time)
      cacher.set("rate_limit.limit_reset_time", time.iso8601)
    end

    # Wrapper methods to each endpoint

    def events *args
      Xmlstats::Endpoints::Events.fetch *args
    end

    def mlb_box_score *args
      Xmlstats::Endpoints::MlbBoxScore.fetch *args
    end

    def nba_box_score *args
      Xmlstats::Endpoints::NbaBoxScore.fetch *args
    end

    def mlb_standing *args
      Xmlstats::Endpoints::MlbStanding.fetch *args
    end

    def nba_standing *args
      Xmlstats::Endpoints::NbaStanding.fetch *args
    end

    def mlb_wild_card_standing *args
      Xmlstats::Endpoints::MlbWildCardStanding.fetch *args
    end

    def mlb_team_results *args
      Xmlstats::Endpoints::MlbTeamResults.fetch *args
    end

    def nba_team_results *args
      Xmlstats::Endpoints::NbaTeamResults.fetch *args
    end

    def mlb_teams *args
      Xmlstats::Endpoints::MlbTeams.fetch *args
    end

    def nba_teams *args
      Xmlstats::Endpoints::NbaTeams.fetch *args
    end

    def nba_leaders *args
      Xmlstats::Endpoints::NbaLeaders.fetch *args
    end

    def nba_roster *args
      Xmlstats::Endpoints::NbaRoster.fetch *args
    end

    def mlb_roster *args
      Xmlstats::Endpoints::MlbRoster.fetch *args
    end

  end

end


text:
var env = require('../spec/environment.js');

// Examples of tests to show how timeouts works with Protractor. Tests
// should be run against the testapp.
exports.config = {
  seleniumAddress: env.seleniumAddress,

  // Spec patterns are relative to the current working directly when
  // protractor is called.
  specs: [
    'timeout_spec.js',
  ],

  capabilities: env.capabilities,

  baseUrl: env.baseUrl,

  // ----- Options to be passed to minijasminenode.
  jasmineNodeOpts: {
    onComplete: null,
    isVerbose: false,
    showColors: true,
    includeStackTrace: true
  }
};


text:
package ReplacePublishDate::L10N;
use strict;
use base 'MT::Plugin::L10N';

1;


text:
<?
namespace Acme\DemoBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Acme\DemoBundle\Entity\User
 *
 * @ORM\Table(name="survey")
 * @ORM\Entity
 */
class Survey
{

    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(type="string", length=100)
     */
    protected $superHero;

    /**
     * @ORM\Column(type="string", length=100)
     */
    protected $movieStar;

    /**
     * @ORM\Column(type="string", length=100)
     */
    protected $iceCream;

    /**
     * @ORM\Column(type="string", length=100)
     */
    protected $worldEndTime;

    /**
     * @ORM\Column(type="string", length=100, nullable=true)
     */
    protected $winner;

    /**
     * @var \Doctrine\Common\Collections\ArrayCollection
     * @ORM\ManyToOne(targetEntity="User", inversedBy="survey")
     */
    protected $user;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set superHero
     *
     * @param string $superHero
     *
     * @return Survey
     */
    public function setSuperHero($superHero)
    {
        $this->superHero = $superHero;

        return $this;
    }

    /**
     * Get superHero
     *
     * @return string
     */
    public function getSuperHero()
    {
        return $this->superHero;
    }

    /**
     * Set movieStar
     *
     * @param string $movieStar
     *
     * @return Survey
     */
    public function setMovieStar($movieStar)
    {
        $this->movieStar = $movieStar;

        return $this;
    }

    /**
     * Get movieStar
     *
     * @return string
     */
    public function getMovieStar()
    {
        return $this->movieStar;
    }

    /**
     * Set iceCream
     *
     * @param string $iceCream
     *
     * @return Survey
     */
    public function setIceCream($iceCream)
    {
        $this->iceCream = $iceCream;

        return $this;
    }

    /**
     * Get iceCream
     *
     * @return string
     */
    public function getIceCream()
    {
        return $this->iceCream;
    }

    /**
     * Set worldEndTime
     *
     * @param string $worldEndTime
     *
     * @return Survey
     */
    public function setWorldEndTime($worldEndTime)
    {
        $this->worldEndTime = $worldEndTime;

        return $this;
    }

    /**
     * Get worldEndTime
     *
     * @return string
     */
    public function getWorldEndTime()
    {
        return $this->worldEndTime;
    }

    /**
     * Set winner
     *
     * @param string $winner
     *
     * @return Survey
     */
    public function setWinner($winner)
    {
        $this->winner = $winner;

        return $this;
    }

    /**
     * Get winner
     *
     * @return string
     */
    public function getWinner()
    {
        return $this->winner;
    }

    /**
     * Set user
     *
     * @param User $user
     *
     * @return Survey
     */
    public function setUser(User $user = null)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return User
     */
    public function getUser()
    {
        return $this->user;
    }
}


text:
Getting Started
=========================================================

There are 2 ways of running the XP3000 GUI:

- Running the *Pump3000.exe* [Windows only]
- Running *from source* [Python required]

Either way the user must first download the necessary files for the software,
located at http://www.github.com/bergercookie/Pump3000. This can be
done either by downloading the project locally from the github page or by cloning the project

The user can **download the software** by visiting the github page:
http://www.github.com/bergercookie/Pump3000 and then pressing
the *Download Zip* button

.. _downloading:

.. figure::  ../Images/downloading.png
   :height: 7000px
   :scale:  10 %
   :align:  center

   Downloading the software

Alternatively the user can **clone** the project. In order to do that he must first make sure that git is installed
on the platform. If it isn't then installing it requires issuing::

    sudo apt-get install git "for Linux users - command-line
    sudo port install git "MacOS users - command-line

Then in order to clone the project the user can run the git clone command::

    git clone http://wwww.github.com/bergercookie/Cavro-Pump-XP3000-GUI.git

For windows users, the desktop version of Github is suggested:
https://help.github.com/articles/set-up-git#platform-windows


text:
using GBAHL.Drawing;
using GBAHL.Text;
using System;
using System.Diagnostics;
using System.IO;

namespace GBAHL
{
    /// <summary>
    /// Writes primitive types to a stream.
    /// </summary>
    public class RomWriter : IDisposable
    {
        protected const int BufferSize = 8;

        private Stream _stream;
        private byte[] _buffer = new byte[BufferSize];
        private bool _leaveOpen;
        private bool _isDisposed;

        /// <summary>
        /// Initializes a new instance of the <see cref="RomWriter"/> class based on the specified file.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <exception cref="FileNotFoundException"></exception>
        public RomWriter(RomFileInfo file)
            : this(file.OpenWrite(), false)
        { }

        /// <summary>
        /// Initializes a new instance of the <see cref="RomWriter"/> class based on the specified stream.
        /// </summary>
        /// <param name="stream">The input stream.</param>
        public RomWriter(Stream stream)
            : this(stream, false)
        { }

        /// <summary>
        /// Initializes a new instance of the <see cref="RomWriter"/> class based on the specified stream,
        /// and optionally leaves the stream open.
        /// </summary>
        /// <param name="stream">The input stream.</param>
        /// <param name="leaveOpen">
        /// true to leave the stream open after the <see cref="RomWriter"/> object is disposed; otherwise, false.
        /// </param>
        public RomWriter(Stream stream, bool leaveOpen)
        {
            _stream = stream ?? throw new ArgumentNullException(nameof(stream));
            _buffer = new byte[BufferSize];
            _leaveOpen = leaveOpen;
            _isDisposed = false;
        }

        ~RomWriter()
        {
            Dispose(false);
        }

        #region Methods

        /// <summary>
        /// Releases all resources used by the current instance of the <see cref="RomWriter"/> class.
        /// </summary>
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        protected virtual void Dispose(bool disposing)
        {
            if (!_isDisposed)
            {
                if (!_leaveOpen)
                {
                    _stream?.Dispose();
                    _stream = null;
                }

                _isDisposed = true;
            }
        }

        [DebuggerNonUserCode]
        protected void AssertNotDisposed()
        {
            if (_isDisposed)
            {
                throw new ObjectDisposedException(nameof(RomWriter));
            }
        }

        /// <summary>
        /// Forces data to be written to the underlying disk.
        /// </summary>
        /// <exception cref="IOException"></exception>
        public void Flush()
        {
            _stream.Flush();
        }

        /// <summary>
        /// Sets the position of the stream.
        /// </summary>
        /// <param name="offset">A byte offset relative to 0.</param>
        public int Seek(int offset) => Seek(offset, SeekOrigin.Begin);

        /// <summary>
        /// Sets the position of the stream.
        /// </summary>
        /// <param name="offset">A byte offset relative to the origin parameter.</param>
        /// <param name="origin">A value of type <see cref="SeekOrigin"/> indicating the reference point used to obtain the new position.</param>
        public int Seek(int offset, SeekOrigin origin)
        {
            return (int)_stream.Seek(offset, origin);
        }

        /// <summary>
        /// Sets the position of the stream.
        /// </summary>
        /// <param name="offset"></param>
        /// <returns></returns>
        public int Seek(Ptr offset) => Seek(offset, SeekOrigin.Begin);

        /// <summary>
        /// Sets the position of the stream.
        /// </summary>
        /// <param name="offset"></param>
        /// <param name="origin"></param>
        /// <returns></returns>
        public int Seek(Ptr offset, SeekOrigin origin)
        {
            if (offset.IsValid)
            {
                return (int)_stream.Seek(offset.Address, origin);
            }

            return (int)_stream.Position;
        }

        /// <summary>
        /// Moves the position of the stream by the specified number of bytes.
        /// </summary>
        /// <param name="bytes">The number of bytes to move; sign determines direction.</param>
        public int Skip(int bytes)
        {
            return (int)_stream.Seek(bytes, SeekOrigin.Current);
        }

        /// <summary>
        /// Writes a byte to the stream and advances the position by one byte.
        /// </summary>
        /// <param name="value">The <see cref="byte"/> value to write.</param>
        public void WriteByte(byte value)
        {
            _stream.WriteByte(value);
        }

        /// <summary>
        /// Writes a signed byte to the stream and advances the position by one byte.
        /// </summary>
        /// <param name="value">The <see cref="sbyte"/> value to write.</param>
        public void WriteSByte(sbyte value)
        {
            _stream.WriteByte((byte)value);
        }

        /// <summary>
        /// Writes a 2-byte unsigned integer to the stream and advances the position by two bytes.
        /// </summary>
        /// <param name="value">The <see cref="ushort"/> value to write.</param>
        public void WriteUInt16(ushort value)
        {
            _buffer[0] = (byte)value;
            _buffer[1] = (byte)(value >> 8);
            _stream.Write(_buffer, 0, 2);
        }

        /// <summary>
        /// Writes a 4-byte signed integer to the stream and advances the position by four bytes.
        /// </summary>
        /// <param name="value">The <see cref="int"/> value to write.</param>
        public void WriteInt32(int value)
        {
            _buffer[0] = (byte)value;
            _buffer[1] = (byte)(value >> 8);
            _buffer[2] = (byte)(value >> 16);
            _buffer[3] = (byte)(value >> 24);
            _stream.Write(_buffer, 0, 4);
        }

        /// <summary>
        /// Writes a 4-byte unsigned integer to the stream and advances the position by four bytes.
        /// </summary>
        /// <param name="value">The <see cref="uint"/> value to write.</param>
        public void WriteUInt32(uint value)
        {
            _buffer[0] = (byte)value;
            _buffer[1] = (byte)(value >> 8);
            _buffer[2] = (byte)(value >> 16);
            _buffer[3] = (byte)(value >> 24);
            _stream.Write(_buffer, 0, 4);
        }

        /// <summary>
        /// Writes an 8-byte unsigned integer to the stream and advances the position by eight bytes.
        /// </summary>
        /// <param name="value">The <see cref="ulong"/> value to write.</param>
        public void WriteUInt64(ulong value)
        {
            _buffer[0] = (byte)value;
            _buffer[1] = (byte)(value >> 8);
            _buffer[2] = (byte)(value >> 16);
            _buffer[3] = (byte)(value >> 24);
            _buffer[3] = (byte)(value >> 32);
            _buffer[1] = (byte)(value >> 40);
            _buffer[2] = (byte)(value >> 48);
            _buffer[3] = (byte)(value >> 56);
            _stream.Write(_buffer, 0, 8);
        }

        /// <summary>
        /// Writes a <see cref="byte"/> array to the stream and advances the position by the length of the array.
        /// </summary>
        /// <param name="bytes">The <see cref="byte"/> array to write.</param>
        /// <exception cref="ArgumentNullException">bytes is null.</exception>
        public void WriteBytes(byte[] bytes)
        {
            if (bytes == null)
                throw new ArgumentNullException("bytes");

            _stream.Write(bytes, 0, bytes.Length);
        }

        /// <summary>
        /// Writes a <see cref="byte"/> to the stream the specified number of times and advances the position by that many bytes.
        /// </summary>
        /// <param name="value">The <see cref="byte"/> value to write.</param>
        /// <param name="count">The number of times to write the value.</param>
        public void WriteBytes(byte value, int count)
        {
            for (int i = 0; i < count; i++)
                _stream.WriteByte(value);
        }

        /// <summary>
        /// Writes a UTF-8 encoded string to the stream and advances the position.
        /// </summary>
        /// <param name="str">The <see cref="string"/> value to write.</param>
        public void WriteString(string str)
        {
            // TODO: We can avoid allocation here.
            //WriteBytes(System.Text.Encoding.UTF8.GetBytes(str));

            foreach (var c in str)
            {
                WriteByte((byte)c);
            }
        }

        /// <summary>
        /// Writes a 4-byte pointer to the stream and advances the position by four bytes.
        /// </summary>
        /// <param name="value">The <see cref="Ptr"/> value to write.</param>
        /// <exception cref="ArgumentException"><paramref name="value"/> is invalid.</exception>
        public void WritePtr(Ptr value)
        {
            if (value.IsZero)
            {
                WriteInt32(0);
            }
            else if (value.IsValid)
            {
                WriteInt32((value.Bank << 24) | value.Address);
            }
            else
            {
                throw new ArgumentException("Cannot write an invalid pointer.", nameof(value));
            }
        }

        /// <summary>
        /// Compresses and writes an array of bytes to the stream and advances the position.
        /// </summary>
        /// <param name="buffer">The <see cref="byte"/> array to compress.</param>
        public void WriteCompressedBytes(byte[] buffer)
        {
            // TODO: Allow choice of compression method
            var compressed = Compression.LZ.Compress(buffer);
            WriteBytes(compressed);
        }

        public void WriteText(string str, Encoding encoding)
        {
            WriteBytes(encoding.Encode(str));
        }

        public void WriteText(string str, int length, Encoding encoding)
        {
            // Encode the string
            byte[] buffer = encoding.Encode(str);

            // Ensure proper length
            if (buffer.Length != length)
                Array.Resize(ref buffer, length);

            // Ensure the string is terminated
            buffer[length - 1] = encoding.TerminatingChar;

            WriteBytes(buffer);
        }

        public void WriteTextTable(string[] table, int entryLength, Encoding encoding)
        {
            foreach (var str in table)
                WriteText(str, entryLength, encoding);
        }

        public void WriteColor(Bgr555 color)
        {
            WriteUInt16(color.ToUInt16());
        }

        public void WritePalette(Palette palette)
        {
            foreach (var color in palette)
            {
                WriteColor(color);
            }
        }

        public void WriteCompressedPalette(Palette palette)
        {
            // Buffer to hold uncompressed color data
            byte[] buffer = new byte[palette.Length * 2];

            // Copy colors to buffer
            for (int i = 0; i < palette.Length; i++)
            {
                ushort bgr = palette[i].ToUInt16();

                buffer[i * 2]     = (byte)bgr;
                buffer[i * 2 + 1] = (byte)(bgr >> 8);
            }

            // Write compressed bytes
            WriteCompressedBytes(buffer);
        }

        public void WriteTiles4(Tileset tiles)
        {
            if (tiles == null)
                throw new ArgumentNullException(nameof(tiles));

            WriteBytes(BitDepth.Encode4(tiles));
        }

        public void WriteTiles4(Tile[] tiles)
        {
            if (tiles == null)
                throw new ArgumentNullException(nameof(tiles));

            WriteBytes(BitDepth.Encode4(tiles));
        }

        public void WriteTiles8(Tileset tiles)
        {
            if (tiles == null)
                throw new ArgumentNullException(nameof(tiles));

            WriteBytes(BitDepth.Encode8(tiles));
        }

        public void WriteTiles8(Tile[] tiles)
        {
            if (tiles == null)
                throw new ArgumentNullException(nameof(tiles));

            WriteBytes(BitDepth.Encode8(tiles));
        }

        public void WriteCompressedTiles4(Tileset tiles)
        {
            if (tiles == null)
                throw new ArgumentNullException(nameof(tiles));

            WriteCompressedBytes(BitDepth.Encode4(tiles));
        }

        public void WriteCompressedTiles4(Tile[] tiles)
        {
            if (tiles == null)
                throw new ArgumentNullException(nameof(tiles));

            WriteCompressedBytes(BitDepth.Encode4(tiles));
        }

        public void WriteCompressedTiles8(Tileset tiles)
        {
            if (tiles == null)
                throw new ArgumentNullException(nameof(tiles));

            WriteCompressedBytes(BitDepth.Encode8(tiles));
        }

        public void WriteCompressedTiles8(Tile[] tiles)
        {
            if (tiles == null)
                throw new ArgumentNullException(nameof(tiles));

            WriteCompressedBytes(BitDepth.Encode8(tiles));
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets the length of the stream.
        /// </summary>
        public int Length => (int)_stream.Length;

        /// <summary>
        /// Gets or sets the position of the stream.
        /// </summary>
        public int Position
        {
            get => (int)_stream.Position;
            set => _stream.Position = value;
        }

        /// <summary>
        /// Gets whether the stream has read to the end.
        /// </summary>
        public bool EndOfStream => _stream.Position >= _stream.Length;

        #endregion
    }
}


text:
<?php

namespace Sylius\Component\Core\Model;

use FOS\UserBundle\Model\GroupInterface as BaseGroupInterface;

/**
 * Group model.
 *
 * @author Paweł Jędrzejewski <pjedrzejewski@diweb.pl>
 */
interface GroupInterface extends BaseGroupInterface
{
}


text:
package runtime

func checkgoarm() {
	// TODO(minux): FP checks like in os_linux_arm.go.

	// NaCl/ARM only supports ARMv7
	if goarm != 7 {
		print("runtime: NaCl requires ARMv7. Recompile using GOARM=7.\n")
		exit(1)
	}
}

//go:nosplit
func cputicks() int64 {
	// Currently cputicks() is used in blocking profiler and to seed runtime·fastrand1().
	// runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
	// TODO: need more entropy to better seed fastrand1.
	return nanotime()
}


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="A portfolio template that uses Material Design Lite.">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
    <title>Front-end Projects</title>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en">
    <link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.grey-pink.min.css" />
    <link rel="stylesheet" href="styles.css" />
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

                    Pankajashree R

                    Portfolio
                    Blog
                    About
                    Contact

                Portfolio
                Blog
                About
                Contact

Front-end projects

Includes projects created using pure CSS, vanilla Javascript and front end frameworks.

FCC Front-End Web Apps

                        Projects completed for Free Code Camp Front-end Certification.

                        View Projects

WebTao - Momentum Clone

                        A Chingu team collaboration project. A Chrome extension clone of Momentum Dash with a web-dev touch.

                        View Project

Front-end apps using VueJS.

                        Front end web apps designed using VueJS Framework.

                        View Projects

                    © Pankajashree's portfolio website


text:
package org.spongepowered.common.event.damage;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;

import net.minecraft.entity.item.EntityFallingBlock;
import org.spongepowered.api.data.manipulator.immutable.entity.ImmutableFallingBlockData;
import org.spongepowered.api.entity.Entity;
import org.spongepowered.api.entity.FallingBlock;
import org.spongepowered.api.event.cause.entity.damage.source.FallingBlockDamageSource;
import org.spongepowered.api.event.cause.entity.damage.source.common.AbstractDamageSourceBuilder;

import java.lang.ref.WeakReference;

public class SpongeFallingBlockDamgeSourceBuilder extends AbstractDamageSourceBuilder<FallingBlockDamageSource, FallingBlockDamageSource.Builder>
    implements FallingBlockDamageSource.Builder {

    protected WeakReference<Entity> reference = null;
    private ImmutableFallingBlockData blockData = null;

    @Override
    public SpongeFallingBlockDamgeSourceBuilder fallingBlock(ImmutableFallingBlockData fallingBlock) {
        this.blockData = fallingBlock;
        return this;
    }

    @Override
    public SpongeFallingBlockDamgeSourceBuilder entity(Entity entity) {
        checkArgument(entity instanceof FallingBlock);
        this.reference = new WeakReference<>(entity);
        return this;
    }

    @Override
    public FallingBlockDamageSource build() throws IllegalStateException {
        checkState(this.reference.get() != null);
        checkState(this.blockData != null);
        checkState(this.damageType != null);
        MinecraftFallingBlockDamageSource damageSource =
            new MinecraftFallingBlockDamageSource(this.damageType.getId(),
                (EntityFallingBlock) this.reference.get(),
                this.blockData);
        if (this.creative) {
            damageSource.setDamageAllowedInCreativeMode();
        }
        if (this.scales) {
            damageSource.setDifficultyScaled();
        }
        if (this.magical) {
            damageSource.setMagicDamage();
        }
        if (this.bypasses) {
            damageSource.setDamageBypassesArmor();
        }
        if (this.absolute) {
            damageSource.setDamageIsAbsolute();
        }
        if (this.explosion) {
            damageSource.setExplosion();
        }
        return (FallingBlockDamageSource) damageSource;
    }

    @Override
    public FallingBlockDamageSource.Builder from(FallingBlockDamageSource value) {
        super.from(value);
        this.reference = new WeakReference<>(value.getSource());
        this.blockData = value.getFallingBlockData();
        return this;
    }

    @Override
    public SpongeFallingBlockDamgeSourceBuilder reset() {
        super.reset();
        this.reference = null;
        this.blockData = null;
        return this;
    }
}


text:
#include "tm_stm32f4_general.h"

/* System speed in MHz */
uint16_t GENERAL_SystemSpeedInMHz = 0;

/* Private functions */
static uint32_t x_na_y(uint32_t x, uint8_t y) {
	uint32_t output = 1;

	/* Make a "power" multiply */
	while (y--) {
		output *= x;
	}

	/* Return output value */
	return output;
}

void TM_GENERAL_SystemReset(void) {
	/* Call use function */
	TM_GENERAL_SoftwareResetCallback();

	/* Perform a system software reset */
	NVIC_SystemReset();
}

uint32_t TM_GENERAL_GetClockSpeed(TM_GENERAL_Clock_t clock) {
	static RCC_ClocksTypeDef RCC_Clocks;
	uint32_t c = 0;

	/* Check RCC clocks */
	if (RCC_Clocks.HCLK_Frequency == 0) {
		/* Read clocks */
		RCC_GetClocksFreq(&RCC_Clocks);
	}

	/* Return clock speed */
	switch (clock) {
		case TM_GENERAL_Clock_HSI:
			c = HSI_VALUE;
			break;
		case TM_GENERAL_Clock_HSE:
			c = HSE_VALUE;
			break;
		case TM_GENERAL_Clock_HCLK:
			c = RCC_Clocks.HCLK_Frequency;
			break;
		case TM_GENERAL_Clock_PCLK1:
			c = RCC_Clocks.PCLK1_Frequency;
			break;
		case TM_GENERAL_Clock_PCLK2:
			c = RCC_Clocks.PCLK2_Frequency;
			break;
		case TM_GENERAL_Clock_SYSCLK:
			c = RCC_Clocks.SYSCLK_Frequency;
			break;
		default:
			break;
	}

	/* Return clock */
	return c;
}

TM_GENERAL_ResetSource_t TM_GENERAL_GetResetSource(uint8_t reset_flags) {
	TM_GENERAL_ResetSource_t source = TM_GENERAL_ResetSource_None;

	/* Check bits */
	if (RCC->CSR & RCC_CSR_LPWRRSTF) {
		source = TM_GENERAL_ResetSource_LowPower;
	} else if (RCC->CSR & RCC_CSR_WWDGRSTF) {
		source = TM_GENERAL_ResetSource_WWDG;
	} else if (RCC->CSR & RCC_CSR_WDGRSTF) {
		source = TM_GENERAL_ResetSource_IWDG;
	} else if (RCC->CSR & RCC_CSR_SFTRSTF) {
		source = TM_GENERAL_ResetSource_Software;
	} else if (RCC->CSR & RCC_CSR_PORRSTF) {
		source = TM_GENERAL_ResetSource_POR;
	} else if (RCC->CSR & RCC_CSR_BORRSTF) {
		source = TM_GENERAL_ResetSource_BOR;
	} else if (RCC->CSR & RCC_CSR_PADRSTF) {
		source = TM_GENERAL_ResetSource_PIN;
	}

	/* Check for clearing flags */
	if (reset_flags) {
		RCC->CSR = RCC_CSR_RMVF;
	}

	/* Return source */
	return source;
}

uint8_t TM_GENERAL_DWTCounterEnable(void) {
	uint32_t c;

	/* Set clock speed if not already */
	if (GENERAL_SystemSpeedInMHz == 0) {
		/* Get clock speed in MHz */
		GENERAL_SystemSpeedInMHz = TM_GENERAL_GetClockSpeed(TM_GENERAL_Clock_SYSCLK) / 1000000;
	}

    /* Enable TRC */
    CoreDebug->DEMCR &= ~0x01000000;
    CoreDebug->DEMCR |=  0x01000000;

    /* Enable counter */
    DWT->CTRL &= ~0x00000001;
    DWT->CTRL |=  0x00000001;

    /* Reset counter */
    DWT->CYCCNT = 0;

	/* Check if DWT has started */
	c = DWT->CYCCNT;

	/* 2 dummys */
	__ASM volatile ("NOP");
	__ASM volatile ("NOP");

	/* Return difference, if result is zero, DWT has not started */
	return (DWT->CYCCNT - c);
}

void TM_GENERAL_ConvertFloat(TM_GENERAL_Float_t* Float_Struct, float Number, uint8_t decimals) {
	/* Check decimals */
	if (decimals > 9) {
		decimals = 9;
	}

	/* Get integer part */
	Float_Struct->Integer = (int32_t)Number;

	/* Get decimal part */
	if (Number < 0) {
		Float_Struct->Decimal = (int32_t)((float)(Float_Struct->Integer - Number) * x_na_y(10, decimals));
	} else {
		Float_Struct->Decimal = (int32_t)((float)(Number - Float_Struct->Integer) * x_na_y(10, decimals));
	}
}

float TM_GENERAL_RoundFloat(float Number, uint8_t decimals) {
	float x;

	/* Check decimals */
	if (decimals > 9) {
		decimals = 9;
	}

	x = x_na_y(10, decimals);

	/* Make truncating */
	if (Number > 0) {
		return (float)(Number * x + (float)0.5) / x;
	} else if (Number < 0) {
		return (float)(Number * x - (float)0.5) / x;
	}

	/* Return number */
	return 0;
}


text:
package me.panpf.sketch.util;

import androidx.annotation.NonNull;

import java.util.LinkedList;
import java.util.Queue;

@SuppressWarnings("WeakerAccess")
public class ObjectPool<T> {
    private static final int MAX_POOL_SIZE = 10;
    private final Object editLock = new Object();

    @NonNull
    private Queue<T> cacheQueue;
    @NonNull
    private ObjectFactory<T> objectFactory;
    private int maxPoolSize;

    public ObjectPool(@NonNull ObjectFactory<T> objectFactory, int maxPoolSize) {
        this.objectFactory = objectFactory;
        this.maxPoolSize = maxPoolSize;
        this.cacheQueue = new LinkedList<T>();
    }

    public ObjectPool(@NonNull ObjectFactory<T> objectFactory) {
        this(objectFactory, MAX_POOL_SIZE);
    }

    public ObjectPool(@NonNull final Class<T> classType, int maxPoolSize) {
        this(new ObjectFactory<T>() {
            @NonNull
            @Override
            public T newObject() {
                try {
                    return classType.newInstance();
                } catch (InstantiationException e) {
                    throw new RuntimeException(e);
                } catch (IllegalAccessException e) {
                    throw new RuntimeException(e);
                }
            }
        }, maxPoolSize);
    }

    public ObjectPool(@NonNull final Class<T> classType) {
        this(classType, MAX_POOL_SIZE);
    }

    @NonNull
    public T get() {
        synchronized (editLock) {
            T t = !cacheQueue.isEmpty() ? cacheQueue.poll() : objectFactory.newObject();
            if (t instanceof CacheStatus) {
                ((CacheStatus) t).setInCachePool(false);
            }
            return t;
        }
    }

    public void put(@NonNull T t) {
        synchronized (editLock) {
            if (cacheQueue.size() < maxPoolSize) {
                if (t instanceof CacheStatus) {
                    ((CacheStatus) t).setInCachePool(true);
                }
                cacheQueue.add(t);
            }
        }
    }

    public void clear() {
        synchronized (editLock) {
            cacheQueue.clear();
        }
    }

    public int getMaxPoolSize() {
        return maxPoolSize;
    }

    public void setMaxPoolSize(int maxPoolSize) {
        this.maxPoolSize = maxPoolSize;

        synchronized (editLock) {
            if (cacheQueue.size() > maxPoolSize) {
                int number = maxPoolSize - cacheQueue.size();
                int count = 0;
                while (count++ < number) {
                    cacheQueue.poll();
                }
            }
        }
    }

    public int size() {
        synchronized (editLock) {
            return cacheQueue.size();
        }
    }

    public interface ObjectFactory<T> {
        @NonNull
        T newObject();
    }

    public interface CacheStatus {

        boolean isInCachePool();

        void setInCachePool(boolean inCachePool);
    }
}


text:
package lambdasinaction.chap11.v1;

import java.util.List;
import java.util.function.Supplier;

public class BestPriceFinderMain {

    private static BestPriceFinder bestPriceFinder = new BestPriceFinder();

    public static void main(String[] args) {
        execute("sequential", () -> bestPriceFinder.findPricesSequential("myPhone27S"));
        execute("parallel", () -> bestPriceFinder.findPricesParallel("myPhone27S"));
        execute("composed CompletableFuture", () -> bestPriceFinder.findPricesFuture("myPhone27S"));
        execute("combined USD CompletableFuture", () -> bestPriceFinder.findPricesInUSD("myPhone27S"));
        execute("combined USD CompletableFuture v2", () -> bestPriceFinder.findPricesInUSD2("myPhone27S"));
        execute("combined USD CompletableFuture v3", () -> bestPriceFinder.findPricesInUSD3("myPhone27S"));
    }

    private static void execute(String msg, Supplier<List<String>> s) {
        long start = System.nanoTime();
        System.out.println(s.get());
        long duration = (System.nanoTime() - start) / 1_000_000;
        System.out.println(msg + " done in " + duration + " msecs");
    }
}


text:
<?php

namespace umi\orm\metadata\field;

use umi\dbal\builder\IInsertBuilder;
use umi\dbal\builder\IQueryBuilder;
use umi\dbal\builder\IUpdateBuilder;
use umi\i18n\ILocalizable;
use umi\i18n\TLocalizable;
use umi\orm\exception\NonexistentEntityException;
use umi\orm\exception\UnexpectedValueException;
use umi\orm\object\IObject;
use umi\orm\object\property\IProperty;

/**
 * Поле типа данных.
 */
abstract class BaseField implements IField, ILocalizable
{
    use TLocalizable;

    /**
     * @var string $name имя поля
     */
    protected $name;
    /**
     * @var string $type тип поля
     */
    protected $type;
    /**
     * @var bool $isReadOnly флаг "доступно только на чтение"
     */
    protected $isReadOnly = false;
    /**
     * @var mixed $defaultValue значение поля по умолчанию, которое сохраняется в БД
     */
    protected $defaultValue = null;
    /**
     * @var string $columnName имя столбца в таблице, связанного с полем
     */
    protected $columnName;
    /**
     * @var string $accessor имя getter'а для доступа к значению поля объекта
     */
    protected $accessor;
    /**
     * @var string $mutator имя setter'а для установки значения поля объекта
     */
    protected $mutator;
    /**
     * @var array $validatorsConfig список валидаторов в формате [$validatorType => [$optionName => $value, ...], ...]
     */
    protected $validatorsConfig = [];
    /**
     * @var array $filtersConfig список фильтров в формате [$filterType => [$optionName => $value, ...], ...]
     */
    protected $filtersConfig = [];
    /**
     * @var array $localizations список локализаций в виде
     * [$localeId => ['columnName' => $columnName, 'defaultValue' => $defaultValue], ...]
     */
    protected $localizations = [];

    /**
     * Конструктор.
     * @param string $name имя поля
     * @param string $type тип поля
     * @param array $config конфигурация
     * @throws UnexpectedValueException в случае некорректного конфига
     */
    public function __construct($name, $type, array $config = [])
    {
        $this->name = $name;
        $this->type = $type;
        $this->applyCommonConfiguration($config);
        $this->applyConfiguration($config);
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * {@inheritdoc}
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * {@inheritdoc}
     */
    public function getIsReadOnly()
    {
        return $this->isReadOnly;
    }

    /**
     * {@inheritdoc}
     */
    public function getColumnName($localeId = null)
    {
        if (!$localeId) {
            return $this->columnName;
        }

        if (!isset($this->localizations[$localeId]) || !isset($this->localizations[$localeId]['columnName'])) {
            throw new NonexistentEntityException($this->translate(
                'Information about column name for field "{field}" in locale "{locale}" does not exist.',
                ['field' => $this->getName(), 'locale' => $localeId]
            ));
        }

        return $this->localizations[$localeId]['columnName'];
    }

    /**
     * {@inheritdoc}
     */
    public function getAccessor()
    {
        return $this->accessor;
    }

    /**
     *{@inheritdoc}
     */
    public function getMutator()
    {
        return $this->mutator;
    }

    /**
     * {@inheritdoc}
     */
    public function getDefaultValue($localeId = null)
    {
        if (!$localeId) {
            return $this->defaultValue;
        }

        if (!isset($this->localizations[$localeId])) {
            throw new NonexistentEntityException($this->translate(
                'Cannot get default value for field "{field}" in locale "{locale}".',
                ['field' => $this->getName(), 'locale' => $localeId]
            ));
        }

        $defaultValue =
            isset($this->localizations[$localeId]['defaultValue'])
                ? $this->localizations[$localeId]['defaultValue']
                : null;

        return $defaultValue;

    }

    /**
     * {@inheritdoc}
     */
    public function getValidatorsConfig($localeId = null)
    {
        if (!$localeId) {
            return $this->validatorsConfig;
        }

        if (!isset($this->localizations[$localeId])) {
            throw new NonexistentEntityException($this->translate(
                'Cannot get validators for field "{field}" in locale "{locale}".',
                ['field' => $this->getName(), 'locale' => $localeId]
            ));
        }

        $validatorsConfig =
            isset($this->localizations[$localeId]['validators'])
                ? $this->localizations[$localeId]['validators']
                : [];

        if (!is_array($validatorsConfig)) {
            throw new UnexpectedValueException($this->translate(
                'Validators configuration for field "{field}" in locale "{locale}" should be an array.',
                ['field' => $this->getName(), 'locale' => $localeId]
            ));
        }

        return $validatorsConfig;
    }

    /**
     * {@inheritdoc}
     */
    public function getFiltersConfig($localeId = null)
    {
        if (!$localeId) {
            return $this->filtersConfig;
        }

        if (!isset($this->localizations[$localeId])) {
            throw new NonexistentEntityException($this->translate(
                'Cannot get filters for field "{field}" in locale "{locale}".',
                ['field' => $this->getName(), 'locale' => $localeId]
            ));
        }

        $filtersConfig =
            isset($this->localizations[$localeId]['filters'])
                ? $this->localizations[$localeId]['filters']
                : [];

        if (!is_array($filtersConfig)) {
            throw new UnexpectedValueException($this->translate(
                'Filters configuration for field "{field}" in locale "{locale}" should be an array.',
                ['field' => $this->getName(), 'locale' => $localeId]
            ));
        }

        return $filtersConfig;
    }

    /**
     * {@inheritdoc}
     */
    public function getIsLocalized()
    {
        return (bool) count($this->getLocalizations());
    }

    /**
     * {@inheritdoc}
     */
    public function getLocalizations()
    {
        return $this->localizations;
    }

    /**
     * {@inheritdoc}
     */
    public function hasLocale($localeId)
    {
        return isset($this->localizations[$localeId]);
    }

    /**
     * {@inheritdoc}
     */
    public function getLocaleDefaultValue($localeId = null)
    {

    }

    /**
     * {@inheritdoc}
     */
    public function compareValue($currentValue, $newValue)
    {
        return ($currentValue === $newValue);
    }

    /**
     * {@inheritdoc}
     */
    public function persistProperty(IObject $object, IProperty $property, IQueryBuilder $builder)
    {
        /**
         * @var IUpdateBuilder $builder
         */
        if ($builder instanceof IInsertBuilder || $builder instanceof IUpdateBuilder) {

            $localeId = $property->getLocaleId();

            if ($localeId && !$this->hasLocale($localeId)) {
                return $this;
            }

            $builder->set($this->getColumnName($localeId));
            $builder->bindValue(':' . $this->getColumnName($localeId), $property->getDbValue(), $this->getDataType());
        }

        return $this;
    }

    /**
     * Разбирает и применяет общую конфигурацию поля
     * @param array $config конфигурация поля
     * @throws UnexpectedValueException при ошибках в конфигурации
     */
    protected function applyCommonConfiguration($config)
    {
        $this->columnName = isset($config['columnName']) ? strval($config['columnName']) : $this->name;

        if (isset($config['readOnly'])) {
            $this->isReadOnly = (bool) $config['readOnly'];
        }
        if (isset($config['defaultValue'])) {
            $this->defaultValue = $config['defaultValue'];
        }
        if (isset($config['accessor'])) {
            $this->accessor = strval($config['accessor']);
        }
        if (isset($config['mutator'])) {
            $this->mutator = strval($config['mutator']);
        }

        if (isset($config['validators'])) {
            $validators = $config['validators'];
            if (!is_array($validators)) {
                throw new UnexpectedValueException($this->translate(
                    'Validators configuration for field "{field}" should be an array.',
                    ['field' => $this->getName()]
                ));
            }
            $this->validatorsConfig = $validators;
        }

        if (isset($config['filters'])) {
            $filters = $config['filters'];
            if (!is_array($filters)) {
                throw new UnexpectedValueException($this->translate(
                    'Filters configuration for field "{field}" should be an array.',
                    ['field' => $this->getName()]
                ));
            }
            $this->filtersConfig = $filters;
        }

        if (isset($config['localizations'])) {
            $localizations = $config['localizations'];
            if (!is_array($localizations)) {
                throw new UnexpectedValueException($this->translate(
                    'Localization configuration for localizable field "{field}" should be an array.',
                    ['field' => $this->getName()]
                ));
            }
            $this->localizations = $localizations;
        }
    }

    /**
     * Разбирает и применяет конфигурацию для поля
     * @param array $config конфигурация поля
     */
    protected function applyConfiguration(array $config)
    {
    }
}


text:
namespace NuGetGallery.FunctionalTests
{
    using Microsoft.VisualStudio.TestTools.WebTesting;
    using Microsoft.VisualStudio.TestTools.WebTesting.Rules;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using NuGetGallery.FunctionalTests.TestBase;
    using NuGetGallery.FunctionTests.Helpers;
    using System;
    using System.Collections.Generic;
    using System.Text;

    public class AggregateStatsInHomePage : WebTest
    {
        /// <summary>
        /// Verifies that the aggregate stats in home page gets incremented appropriately after downloading a package.
        /// </summary>
        public AggregateStatsInHomePage()
        {
            this.PreAuthenticate = true;
        }

        public override IEnumerator<WebTestRequest> GetRequestEnumerator()
        {
            //send a request to the stats/totals to get the initial count.
            WebTestRequest statsRequestBeforeDownload = GetWebRequestForAggregateStats();
            yield return statsRequestBeforeDownload;
            statsRequestBeforeDownload = null;

            int aggregateStatsBeforeDownload = GetAggregateStatsFromContext();

            //upload a new package and download it.
            string packageId = DateTime.Now.Ticks.ToString() + this.Name;
            AssertAndValidationHelper.UploadNewPackageAndVerify(packageId);
            AssertAndValidationHelper.DownloadPackageAndVerify(packageId);

            //wait either the download count changes or till 5 minutes which ever is earlier.
            int waittime = 0;
            int aggregateStatsAfterDownload = aggregateStatsBeforeDownload;
            while (aggregateStatsAfterDownload == aggregateStatsBeforeDownload && waittime <= 300)
            {
                //send a request stats to keep polling the new download count.
                statsRequestBeforeDownload = GetWebRequestForAggregateStats();
                yield return statsRequestBeforeDownload;
                statsRequestBeforeDownload = null;

                aggregateStatsAfterDownload = GetAggregateStatsFromContext();
                System.Threading.Thread.Sleep(30 * 1000);//sleep for 30 seconds.
                waittime += 30;
            }

            //check download count. New download count should be old one + 1.
            Assert.IsTrue( aggregateStatsBeforeDownload == (aggregateStatsAfterDownload -1 ), "Aggregate stats count is not increased by 1 after downloading. Aggregate stats before download :{0}. Stats after download : {1}", aggregateStatsBeforeDownload, aggregateStatsAfterDownload);
        }

        #region PrivateMethods

        private ExtractText GetExtractionRuleForDownloadCount()
        {
            //Extract the download count value from the response.
            ExtractText extractDownLoadCount = new ExtractText();
            extractDownLoadCount.StartsWith = "\"Downloads\":\"";
            extractDownLoadCount.EndsWith = "\",\"";
            extractDownLoadCount.IgnoreCase = true;
            extractDownLoadCount.UseRegularExpression = false;
            extractDownLoadCount.Required = true;
            extractDownLoadCount.ExtractRandomMatch = false;
            extractDownLoadCount.Index = 0;
            extractDownLoadCount.HtmlDecode = true;
            extractDownLoadCount.ContextParameterName = "DownloadCount";
            return extractDownLoadCount;
        }

        private WebTestRequest GetWebRequestForAggregateStats()
        {
            //send a request to the stats/totals.
            WebTestRequest statsRequestBeforeDownload = new WebTestRequest(UrlHelper.AggregateStatsPageUrl);
            //Extract the download count value from the response.
            ExtractText extractDownLoadCount = GetExtractionRuleForDownloadCount();
            statsRequestBeforeDownload.ExtractValues += new EventHandler<ExtractionEventArgs>(extractDownLoadCount.Extract);
            return statsRequestBeforeDownload;

        }

        private int GetAggregateStatsFromContext()
        {
            int aggregateStatsBeforeDownload = Convert.ToInt32(this.Context["DownloadCount"].ToString().Replace(",", "").Replace(".", ""));
            return aggregateStatsBeforeDownload;
        }
        #endregion PrivateMethods
    }
}


text:
package com.cognifide.qa.bb.appium;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;

import org.junit.jupiter.api.Test;

import com.cognifide.qa.bb.appium.modules.AppiumModule;
import com.google.inject.Guice;
import com.google.inject.Stage;

class AppiumModuleTest {

  @Test
  void allBindingsAreConfiguredCorrectly() {
    assertDoesNotThrow(() -> Guice.createInjector(Stage.TOOL, new AppiumModule()));
  }
}


text:
<?php
/**
 * Todo generator for Laravel-lang project.
 *
 * @author  arcanedev-maroc
 */
class TodoGenerator
{
    /**
     * Base path.
     *
     * @var string
     */
    protected $basePath;

    /**
     * Excluded directories.
     *
     * @var array
     */
    protected $excluded = [];

    /**
     * Path of output file.
     *
     * @var string
     */
    protected $output = null;

    /**
     * Construct.
     *
     * @param string $basePath Base path.
     * @param array  $excluded Excluded directories.
     */
    public function __construct($basePath, $excluded = [])
    {
        $this->basePath = realpath($basePath);
        $this->excluded = $excluded;
        $this->load();
    }

    /**
     * Returns object.
     *
     * @param string $basePath Base path.
     * @param array  $excluded Excluded directories.
     *
     * @return TodoGenerator
     */
    public static function make($basePath, $excluded = [])
    {
        return new self($basePath, $excluded);
    }

    /**
     * Compare translations and generate file.
     */
    private function load()
    {
        // Get English version
        $english = $this->getTranslations(__DIR__.'/en');
        $languages = $this->getLanguages();

        $this->output = "# Todo list\n\n";
        $this->compareTranslations($english, $languages);
    }

    /**
     * Returns array of translations by language.
     *
     * @param string $language Language code.
     *
     * @return array
     */
    private function getTranslations($language)
    {
        return [
            'auth'       => include($language.'/auth.php'),
            'pagination' => include($language.'/pagination.php'),
            'passwords'  => include($language.'/passwords.php'),
            'validation' => include($language.'/validation.php'),
        ];
    }

    /**
     * Returns list of languages.
     *
     * @return array
     */
    private function getLanguages()
    {
        $directories = glob($this->basePath.'/*', GLOB_ONLYDIR);

        $languages = array_map(function ($dir) {
            $name = basename($dir);

            return in_array($name, $this->excluded) ? null : $name;
        }, $directories);

        return array_filter($languages);
    }

    /**
     * Compare translations.
     *
     * @param array $default   Language by default.
     * @param array $languages Others languages.
     */
    private function compareTranslations(array $default, array $languages)
    {
        // Return diff language by language
        foreach ($languages as $language) {
            $this->output .= "\n * ".$language.":\n";
            $current = $this->getTranslations("{$this->basePath}/{$language}");

            foreach ($default as $key => $values) {
                foreach ($values as $key2 => $value2) {
                    if (in_array($key2, ['custom', 'attributes'])) {
                        continue;
                    }

                    if (!isset($current[$key][$key2])) {
                        $this->output .= '    * '.$key.' : '.$key2." : not present\n";
                    } elseif ($current[$key][$key2] == $default[$key][$key2]) {
                        $this->output .= '    * '.$key.' : '.$key2."\n";
                    }
                }
            }
        }
    }

    /**
     * Save todo list.
     *
     * @param string $path Path.
     */
    public function save($path)
    {
        file_put_contents($path, $this->output);
    }
}

TodoGenerator::make(__DIR__.'/../src')->save(__DIR__.'/../todo.md');


text:
<!doctype html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>Photo - A History of UCSF</title>
<link href='http://fonts.googleapis.com/css?family=Gilda+Display|PT+Sans+Narrow:300' rel='stylesheet' type='text/css'>
<link href="ucsf_history.css" rel="stylesheet" type="text/css" media="all" />
{% include google_analytics.html %}

{% include ucsf_banner.html %}

A History of UCSF

Photos

View of San Francisco

San Francisco before the Gold Rush, March 1847, with Montgomery Street bordering the bay.

{% include search_include.html %}

  THE STORY

  SPECIAL TOPICS

  PEOPLE

PHOTOS

  BUILDINGS

  HOME

{% include footer.html %}

{% include bottom_js.html %}