text:
import { TAPi18n } from 'meteor/tap:i18n';

// Utilities
import classnames from 'classnames';
import React from 'react';
import ReactSelect from 'react-select';
import t from 'tcomb-form';
import { FormattedMessage } from 'react-intl';

// Components
import Checkboxes from '../../ui/components/Checkboxes.jsx';

class OrgTypesCollection extends TAPi18n.Collection {
  // insert(profile, callback) {
  // }
  // remove(selector, callback) {
  // }
}

export const OrgTypes = new OrgTypesCollection('OrgTypes');

// Deny all client-side updates since we will be using methods to manage this collection
OrgTypes.deny({
  insert() { return true; },
  update() { return true; },
  remove() { return true; },
});

OrgTypes.publicFields = {
  value: 1,
  label: 1,
};

export const orgTypesSelectFactory = (locale) => {
  // orgTypesSelectFactory options
  const sortKey = (!locale || locale === 'en') ? 'label' : `i18n.${locale}.label`;
  const sort = {};
  sort[sortKey] = 1;

  const allOrgTypes = OrgTypes.find({}, { sort }).fetch();

  // orgTypesSelectFactory template
  const allOrgTypesTags = t.form.Form.templates.select.clone({
    renderLabel: (locals) => {
      const className = {
        'control-label': true,
        disabled: locals.disabled,
      };
      return (
        <label
          title="For Organizational profiles only"
          htmlFor={locals.attrs.id}
          className={classnames(className)}
        >
          {locals.label}
        </label>
      );
    },

    renderSelect: (locals) => {
      function onChange(options) {
        const values = (options || []).map(({ value }) => value);
        locals.onChange(values);
      }

      const placeholder = (
        <FormattedMessage
          id="forms.selectPlaceholder"
          description="Select widget placeholder"
          defaultMessage="Select..."
        />
      );

      return (
        <ReactSelect
          multi
          autoBlur
          disabled={locals.disabled}
          options={allOrgTypes}
          value={locals.value}
          onChange={onChange}
          className="profile-organization-types-edit"
          placeholder={placeholder}
        />
      );
    },

    renderHelp: (locals) => {
      const className = {
        'help-block': true,
        disabled: locals.disabled,
      };

      return (
        <span
          id={`${locals.attrs.id}-tip`}
          className={classnames(className)}
        >
          {locals.help}
        </span>
      );
    },
  });

  allOrgTypesTags.renderVertical = (locals) => ([
    allOrgTypesTags.renderLabel(locals),
    allOrgTypesTags.renderHelp(locals),
    allOrgTypesTags.renderError(locals),
    allOrgTypesTags.renderSelect(locals),
  ]);

  class OrgTypesReactSelectFactory extends t.form.Component {
    getTemplate() {
      return allOrgTypesTags;
    }
  }

  OrgTypesReactSelectFactory.transformer = t.form.List.transformer;

  return OrgTypesReactSelectFactory;
};

export const orgTypesCheckboxFactory = (locale) => {
  // orgTypesCheckboxFactory options
  const sortKey = (!locale || locale === 'en') ? 'label' : `i18n.${locale}.label`;
  const sort = {};
  sort[sortKey] = 1;

  const allOrgTypes = OrgTypes.find({}, { sort }).fetch();

  // orgTypesCheckboxFactory template
  const orgTypesCheckboxes = t.form.Form.templates.select.clone({
    renderLabel: (locals) => {
      const className = {
        'control-label': true,
        disabled: locals.disabled,
      };
      return (
        <label
          title="For Organizational profiles only"
          htmlFor={locals.attrs.id}
          className={classnames(className)}
        >
          {locals.label}
        </label>
      );
    },

    renderSelect: (locals) => (
      <Checkboxes
        options={allOrgTypes}
        values={locals.value}
        name="organization-types"
        onChange={locals.onChange}
        disabled={locals.disabled}
      />
    ),

    renderHelp: (locals) => {
      const className = {
        'help-block': true,
        disabled: locals.disabled,
      };

      return (
        <span
          id={`${locals.attrs.id}-tip`}
          className={classnames(className)}
        >
          {locals.help}
        </span>
      );
    },
  });

  orgTypesCheckboxes.renderVertical = (locals) => ([
    orgTypesCheckboxes.renderLabel(locals),
    orgTypesCheckboxes.renderHelp(locals),
    orgTypesCheckboxes.renderError(locals),
    orgTypesCheckboxes.renderSelect(locals),
  ]);

  // orgTypesCheckboxFactory factory function
  class OrgTypesCheckboxesFactory extends t.form.Component {
    getTemplate() {
      return orgTypesCheckboxes;
    }
  }

  OrgTypesCheckboxesFactory.transformer = t.form.List.transformer;

  return OrgTypesCheckboxesFactory;
};


text:
class CoderwallUploader < CarrierWave::Uploader::Base
  include CarrierWave::MiniMagick
  include Sprockets::Helpers::RailsHelper
  include Sprockets::Helpers::IsolatedHelper
  include ::CarrierWave::Backgrounder::Delay

  def store_dir
    if Rails.env.development? || Rails.env.test?
      "development/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    else
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end
  end

end

redpajama_set_name: RedPajamaGithub


text:
<template name="Footer">

          SignMeUp {{version}}

          In loving memory of Will Povell '20. We'll miss you.

            About

            Privacy Policy

            Report an Issue

            Contact

</template>


text:
<?php
/**
 * Created by PhpStorm.
 * User: jonastheis
 * Date: 03.01.16
 * Time: 11:54
 */

namespace App;

trait DynamicHiddenVisible
{
    public static $_hidden = null;
    public static $_visible = null;

    public static function setStaticHidden(array $value) {
        self::$_hidden = $value;
        return self::$_hidden;
    }

    public static function getStaticHidden() {
        return self::$_hidden;
    }

    public static function setStaticVisible(array $value) {
        self::$_visible = $value;
        return self::$_visible;
    }

    public static function getStaticVisible() {
        return self::$_visible;
    }

    public static function getDefaultHidden() {
        return with(new static)->getHidden();
    }

    public static function geDefaultVisible() {
        return with(new static)->getVisible();
    }

    public function toArray()    {
        if (self::getStaticVisible())
            $this->visible = self::getStaticVisible();
        else if (self::getStaticHidden())
            $this->hidden = self::getStaticHidden();
        return parent::toArray();
    }
}


text:
module Napa
  module Representable
    module IncludeNil
      def self.included base
        base.extend ClassMethods
      end

      module ClassMethods
        def property(name, options={}, &block)
          super(name, options.merge(render_nil: true), &block)
        end
      end
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BodeAbp.MessageBroker
{
    class Bootstrap
    {
    }
}


text:
@interface UIScreen (Additions)

+ (float)screenWidth;
+ (float)screenHeight;
+ (BOOL)isRetina;

@end


text:
@interface AKTwitterClient : AKOAuthClient

- (instancetype)initWithConsumerKey:(NSString *)consumerKey consumerSecret:(NSString *)consumerSecret;

@end


text:
sap.ui.define([
	"sap/ui/core/Control"
	], function (Control) {
	"use strict";
	var ui5CodeMirror = Control.extend("PropertyPage.LumiraDesigner.CodeMirror",{
		metadata : {
			properties : {
				value : "string"
			},
			events : {
				change : { }
			}
		},
		changeHandler : function(instance){
			try{
				if(instance && instance.getValue()){
					this.setProperty("value", instance.getValue(), true);
					//this.setValue(instance.getValue());
					this.fireChange();
				}
				event.cancelBubble = true;	// Prevent Browser Save
			}catch(e){
				alert("An error occured in CodeMirror:\n\n" + e);
			}
		},
		renderer : {
			render : function(oRm, oControl){
				oRm.write("
");
				oRm.write("<textarea id='" + oControl.getId() + "_cm'>");
				oRm.write(oControl.getValue());
				oRm.write("</textarea>");
				oRm.write("
");
			}
		},
		onAfterRendering : function(){
			var that = this;
			this.editor = CodeMirror.fromTextArea(document.getElementById(this.getId() + "_cm"), {
				 mode: "application/json",
				 lineNumbers: true,
				 gutters: ["CodeMirror-linenumbers", "CodeMirror-lint-markers"],
				 lint: true,
				 viewportMargin: Infinity,
				 extraKeys: {
					"Ctrl-Space": "autocomplete",
					"Ctrl-S": function(oControl){return function(instance){oControl.changeHandler(instance)}}(this)
				}
			});
		}
	});
	return ui5CodeMirror;
});


text:
package com.github.pockethub.android.core;

import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Generic weak store of ids to items
 */
public abstract class ItemStore {

    private static class ItemReference<V> extends WeakReference<V> {

        private Object id;

        /**
         * Create item reference
         *
         * @param item
         * @param id
         * @param queue
         */
        public ItemReference(V item, Object id, ReferenceQueue<? super V> queue) {
            super(item, queue);
            this.id = id;
        }
    }

    /**
     * Generic reference store
     *
     * @param <V>
     */
    protected static class ItemReferences<V> {

        private final ReferenceQueue<V> queue;

        private final Map<Object, ItemReference<V>> items;

        /**
         * Create reference store
         */
        public ItemReferences() {
            queue = new ReferenceQueue<>();
            items = new ConcurrentHashMap<>();
        }

        @SuppressWarnings("rawtypes")
        private void expungeEntries() {
            ItemReference ref;
            while ((ref = (ItemReference) queue.poll()) != null) {
                items.remove(ref.id);
            }
        }

        /**
         * Get item with id from store
         *
         * @param id
         * @return item
         */
        public V get(final Object id) {
            expungeEntries();
            WeakReference<V> ref = items.get(id);
            return ref != null ? ref.get() : null;
        }

        /**
         * Insert item with id into store
         *
         * @param id
         * @param item
         */
        public void put(Object id, V item) {
            expungeEntries();
            items.put(id, new ItemReference<>(item, id, queue));
        }
    }
}


text:
[SonarQube](https://www.sonarqube.org/) is the leading tool for continuously inspecting the Code Quality and Security of your codebases, and guiding development teams during Code Reviews. Covering 27 programming languages, while pairing-up with your existing software pipeline, SonarQube provides clear remediation guidance for developers to understand and fix issues, and for teams overall to deliver better and safer software. With over 225,000 deployments helping small development teams as well as global organizations, SonarQube provides the means for all teams and companies around the world to own and impact their Code Quality and Security.

%%LOGO%%

# How to use this image

Here you'll find the Docker images for the Community Edition, Developer Edition, Enterprise Edition, and Data Center Edition of SonarQube.

## Docker Host Requirements

Because SonarQube uses an embedded Elasticsearch, make sure that your Docker host configuration complies with the [Elasticsearch production mode requirements](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run-prod-mode) and [File Descriptors configuration](https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html).

For example, on Linux, you can set the recommended values for the current session by running the following commands as root on the host:

```console
sysctl -w vm.max_map_count=524288
sysctl -w fs.file-max=131072
ulimit -n 131072
ulimit -u 8192
```

## Try Out SonarQube

To quickly run a demo instance, see Using Docker on the [Try Out SonarQube](https://docs.sonarqube.org/latest/setup/get-started-2-minutes/) page. When you are ready to move to a more sustainable setup, take some time to read the **Installation** and **Configuration** sections below.

## Installation

For installation instructions, see Installing the Server from the Docker Image on the [Install the Server](https://docs.sonarqube.org/latest/setup/install-server/) page.

To run a cluster with the Data Center Edition, please refer to Installing SonarQube from the Docker Image on the [Install the Server as a Cluster](https://docs.sonarqube.org/latest/setup/install-cluster/) page.

## Configuration

### Database

By default, the image will use an embedded H2 database that is not suited for production.

> **Warning:** Only a single instance of SonarQube can connect to a database schema. If you're using a Docker Swarm or Kubernetes, make sure that multiple SonarQube instances are never running on the same database schema simultaneously. This will cause SonarQube to behave unpredictably and data will be corrupted. There is no safeguard until [SONAR-10362](https://jira.sonarsource.com/browse/SONAR-10362). The Data Center Edition has the same limitation in that only one cluster can connect to one database schema at the same time.

Set up a database by following the "Installing the Database" section of https://docs.sonarqube.org/latest/setup/install-server/.

### Use volumes

We recommend creating volumes for the following directories:

-	`/opt/sonarqube/data`: data files, such as the embedded H2 database and Elasticsearch indexes
-	`/opt/sonarqube/logs`: contains SonarQube logs about access, web process, CE process, Elasticsearch logs
-	`/opt/sonarqube/extensions`: for 3rd party plugins

> **Warning:** You cannot use the same volumes on multiple instances of SonarQube.

## Upgrading

For upgrade instructions, see Upgrading from the Docker Image on the [Upgrade the Server](https://docs.sonarqube.org/latest/setup/upgrading/) page.

## Advanced configuration

### Customized image

In some environments, it may make more sense to prepare a custom image containing your configuration. A `Dockerfile` to achieve this may be as simple as:

```dockerfile
FROM sonarqube:8.9-community
COPY sonar-custom-plugin-1.0.jar /opt/sonarqube/extensions/
```

You could then build and try the image with something like:

```console
$ docker build --tag=sonarqube-custom .
$ docker run -ti sonarqube-custom
```

### Avoid hard termination of SonarQube

A SonarQube instance will stop gracefully, waiting for any tasks in progress to finish. Waiting for in-progress tasks to finish can take a large amount of time which the docker does not expect by default when stopping. To avoid having the SonarQube instance killed by the Docker daemon after 10 seconds, it is best to configure a timeout to stop the container with `--stop-timeout`. For example:

```console
docker run --stop-timeout 3600 %%IMAGE%%
```

## Administration

The administration guide can be found [here](https://redirect.sonarsource.com/doc/administration-guide.html).


text:
namespace akkapatterns {
namespace daemon {

  const int32_t message_signature = 0x1000acca;

  typedef struct {
    int32_t signature;
    int32_t size1;
    int32_t size2;

  } message_header_t;

  struct MessageError: virtual boost::exception { };
  typedef boost::error_info<struct errinfo_message_, std::string const> errinfo_message;

}
}
#endif


text:
create table schedules (
  id bigserial not null primary key,
  planned_schedule_id bigint not null,
  start timestamp not null,
  end timestamp,
  other_details varchar(512),
  created_at timestamp not null,
  updated_at timestamp not null
)


text:
package org.apache.camel.processor.async;

import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @version
 */
public class AsyncEndpointRedeliveryErrorHandlerNonBlockedDelayTest extends ContextTestSupport {

    private static final Logger LOG = LoggerFactory.getLogger(AsyncEndpointRedeliveryErrorHandlerNonBlockedDelayTest.class);

    private static volatile int attempt;
    private static String beforeThreadName;
    private static String afterThreadName;

    public void testRedelivery() throws Exception {
        MockEndpoint before = getMockEndpoint("mock:result");
        before.expectedBodiesReceived("Hello World", "Hello Camel");

        MockEndpoint result = getMockEndpoint("mock:result");
        result.expectedBodiesReceived("Bye Camel", "Bye Camel");

        template.sendBody("seda:start", "World");
        template.sendBody("seda:start", "Camel");

        assertMockEndpointsSatisfied();

        assertFalse("Should use different threads", beforeThreadName.equalsIgnoreCase(afterThreadName));
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                context.addComponent("async", new MyAsyncComponent());

                errorHandler(defaultErrorHandler().maximumRedeliveries(5).redeliveryDelay(100).asyncDelayedRedelivery());

                from("seda:start")
                    .to("log:before")
                    .to("mock:before")
                    .process(new Processor() {
                        public void process(Exchange exchange) throws Exception {
                            LOG.info("Processing at attempt " + attempt + " " + exchange);

                            String body = exchange.getIn().getBody(String.class);
                            if (body.contains("World")) {
                                if (++attempt <= 2) {
                                    LOG.info("Processing failed will thrown an exception");
                                    throw new IllegalArgumentException("Damn");
                                }
                            }

                            exchange.getIn().setBody("Hello " + body);
                            LOG.info("Processing at attempt " + attempt + " complete " + exchange);
                        }
                    })
                    .to("log:after")
                    .process(new Processor() {
                        public void process(Exchange exchange) throws Exception {
                            beforeThreadName = Thread.currentThread().getName();
                        }
                    })
                    .to("async:bye:camel")
                    .process(new Processor() {
                        public void process(Exchange exchange) throws Exception {
                            afterThreadName = Thread.currentThread().getName();
                        }
                    })
                    .to("mock:result");
            }
        };
    }
}


text:
```scala
/*
`append` simply replaces the `Nil` constructor of the first list with the second list, which is exactly the operation
performed by `foldRight`.
*/
def appendViaFoldRight[A](l: List[A], r: List[A]): List[A] =
  foldRight(l, r, Cons(_,_))

```


text:
package controller

import (
	"encoding/json"
	"fmt"
	"github.com/ServiceComb/service-center/pkg/util"
	pb "github.com/ServiceComb/service-center/server/core/proto"
	"net/http"
	"strconv"
)

func WriteJsonObject(status int, obj interface{}, w http.ResponseWriter) {
	serviceJSON, err := json.Marshal(obj)
	if err != nil {
		util.Logger().Error("marshal response error", err)
		WriteText(http.StatusInternalServerError, fmt.Sprintf("marshal response error, %s", err.Error()), w)
		return
	}
	WriteJson(status, serviceJSON, w)
}

func WriteJson(status int, json []byte, w http.ResponseWriter) {
	w.Header().Set("Content-Type", "application/json;charset=utf-8")
	w.Header().Add("x-response-status", strconv.Itoa(status))
	w.WriteHeader(status)
	w.Write(json)
}

func WriteText(status int, text string, w http.ResponseWriter) {
	w.Header().Add("x-response-status", strconv.Itoa(status))
	w.WriteHeader(status)
	w.Write(util.StringToBytesWithNoCopy(text))
}

func WriteTextResponse(resp *pb.Response, err error, textIfSuccess string, w http.ResponseWriter) {
	if err != nil {
		WriteText(http.StatusInternalServerError, err.Error(), w)
		return
	}
	if resp.Code != pb.Response_SUCCESS {
		WriteText(http.StatusBadRequest, resp.Message, w)
		return
	}
	WriteText(http.StatusOK, textIfSuccess, w)
}

func WriteJsonResponse(resp *pb.Response, obj interface{}, err error, w http.ResponseWriter) {
	if err != nil {
		WriteText(http.StatusInternalServerError, err.Error(), w)
		return
	}
	if resp.Code != pb.Response_SUCCESS {
		WriteText(http.StatusBadRequest, resp.Message, w)
		return
	}
	objJson, err := json.Marshal(obj)
	if err != nil {
		WriteText(http.StatusInternalServerError, err.Error(), w)
		return
	}
	WriteJson(http.StatusOK, objJson, w)
}


text:
var http = require('http');
var fs = require('fs');
http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    fs.readFile('../public/index.html', function(err, contents){
        res.write(contents);
        res.end();
    });
}).listen(80, '127.0.0.1');

console.log('Server running at http://127.0.0.1/');


text:
class QuestionsController < ApplicationController

  def index
    @questions = Question.all.order(total: :desc)
  end

  def new

    if session[:user_id] == nil
      redirect_to login_path
    else
      @question = Question.new
    end
  end

  def create
    user = User.find(session[:user_id])
    @question = user.questions.create(question_params)
    redirect_to question_path(@question)
  end

  def show
    @question = Question.find(params["id"])
    @answer = Answer.new
    @comment = Comment.new
  end

  def edit
    @question = Question.find(params[:id])
  end

  def update
    @question = Question.find(params[:id])
    if params[:type] == "correct"
      @question.correct_answer = params[:answer]
      @question.save
      redirect_to question_path(@question.id)
    else
      @question.title = params[:question][:title]
      @question.text = params[:question][:text]
      @question.save
      redirect_to questions_path
    end
  end

  def destroy
    @question = Question.find(params[:id])
    @question.destroy
    redirect_to questions_path
  end

  private

  def question_params
    params.require(:question).permit(:title, :text)
  end

end


text:
require "formula_installer"
require "development_tools"
require "messages"

module Homebrew
  module_function

  def reinstall_formula(f, args:, build_from_source: false)
    return if args.dry_run?

    if f.opt_prefix.directory?
      keg = Keg.new(f.opt_prefix.resolved_path)
      tab = Tab.for_keg(keg)
      keg_had_linked_opt = true
      keg_was_linked = keg.linked?
      backup keg
    end

    build_options = BuildOptions.new(Options.create(args.flags_only), f.options)
    options = build_options.used_options
    options |= f.build.used_options
    options &= f.options

    build_from_source_formulae = args.build_from_source_formulae
    build_from_source_formulae << f.full_name if build_from_source

    fi = FormulaInstaller.new(
      f,
      **{
        options:                    options,
        link_keg:                   keg_had_linked_opt ? keg_was_linked : nil,
        installed_as_dependency:    tab&.installed_as_dependency,
        installed_on_request:       tab&.installed_on_request,
        build_bottle:               args.build_bottle? || tab&.built_bottle?,
        force_bottle:               args.force_bottle?,
        build_from_source_formulae: build_from_source_formulae,
        git:                        args.git?,
        interactive:                args.interactive?,
        keep_tmp:                   args.keep_tmp?,
        force:                      args.force?,
        debug:                      args.debug?,
        quiet:                      args.quiet?,
        verbose:                    args.verbose?,
      }.compact,
    )
    fi.prelude
    fi.fetch

    oh1 "Reinstalling #{Formatter.identifier(f.full_name)} #{options.to_a.join " "}"

    fi.install
    fi.finish
  rescue FormulaInstallationAlreadyAttemptedError
    nil
  rescue Exception # rubocop:disable Lint/RescueException
    ignore_interrupts { restore_backup(keg, keg_was_linked, verbose: args.verbose?) }
    raise
  else
    begin
      backup_path(keg).rmtree if backup_path(keg).exist?
    rescue Errno::EACCES, Errno::ENOTEMPTY
      odie <<~EOS
        Could not remove #{backup_path(keg).parent.basename} backup keg! Do so manually:
          sudo rm -rf #{backup_path(keg)}
      EOS
    end
  end

  def backup(keg)
    keg.unlink
    begin
      keg.rename backup_path(keg)
    rescue Errno::EACCES, Errno::ENOTEMPTY
      odie <<~EOS
        Could not rename #{keg.name} keg! Check/fix its permissions:
          sudo chown -R $(whoami) #{keg}
      EOS
    end
  end

  def restore_backup(keg, keg_was_linked, verbose:)
    path = backup_path(keg)

    return unless path.directory?

    Pathname.new(keg).rmtree if keg.exist?

    path.rename keg
    keg.link(verbose: verbose) if keg_was_linked
  end

  def backup_path(path)
    Pathname.new "#{path}.reinstall"
  end
end


text:
"""A setuptools based setup module.

See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
import os
import re

def get_version(package):
    """
    Return package version as listed in `__version__` in `init.py`.
    """
    init_py = open(os.path.join(package, '__init__.py')).read()
    return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)

setup(
    name='figure-sdk',

    # Versions should comply with PEP440.  For a discussion on single-sourcing
    # the version across setup.py and the project code, see
    # https://packaging.python.org/en/latest/single_source_version.html
    version=get_version('figure'),

    description='Figure SDK for Python',

    # The project's main homepage.
    url='https://github.com/Postcard/figure-sdk-python',

    download_url='https://github.com/Postcard/figure-sdk-python/archive/v0.2.0.tar.gz',

    # Author details
    author='Figure',
    author_email='benoit@figure.co',

    # Choose your license
    license='MIT',

    # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        # How mature is this project? Common values are
        #   3 - Alpha
        #   4 - Beta
        #   5 - Production/Stable
        'Development Status :: 3 - Alpha',

        # Indicate who your project is intended for
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Build Tools',

        # Pick your license as you wish (should match "license" above)
        'License :: OSI Approved :: MIT License',

        # Specify the Python versions you support here. In particular, ensure
        # that you indicate whether you support Python 2, Python 3 or both.
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.8',

    ],

    # What does your project relate to?
    keywords='figure api sdk',

    # You can just specify the packages manually here if your project is
    # simple. Or you can use find_packages().
    packages=find_packages(exclude=['tests*']),

    # List run-time dependencies here.  These will be installed by pip when
    # your project is installed. For an analysis of "install_requires" vs pip's
    # requirements files see:
    # https://packaging.python.org/en/latest/requirements.html
    install_requires=['requests >= 2.23.0'],

    # List additional groups of dependencies here (e.g. development
    # dependencies). You can install these using the following syntax,
    # for example:
    # $ pip install -e .[dev,test]
    # extras_require={
    #     'dev': [],
    #     'test': [],
    # },

    # If there are data files included in your packages that need to be
    # installed, specify them here.  If using Python 2.6 or less, then these
    # have to be included in MANIFEST.in as well.
    # package_data={
    #    'description': ['DESCRIPTION.rst'],
    # },

    # Although 'package_data' is the preferred approach, in some case you may
    # need to place data files outside of your packages. See:
    # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
    # In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
    # data_files=[('my_data', ['data/data_file'])],

    # To provide executable scripts, use entry points in preference to the
    # "scripts" keyword. Entry points provide cross-platform support and allow
    # pip to create the appropriate form of executable for the target platform.
    # entry_points={
    #    'console_scripts': [
    #        'sample=sample:main',
    #    ],
    # },
)


text:
Genus is a theme for [Pelican](http://blog.getpelican.com/) static site generator designed mobile first and SEO in mind.

This theme draws inspiration from [Cayman](https://github.com/jasonlong/cayman-theme) GitHub Pages theme, [Type](https://github.com/rohanchandra/type-theme) theme for Jekyll, [Medius](https://github.com/onur/medius) for Pelican and [Medium](https://medium.com/).

## Screenshot

![Screenshot](doc/img/posts.png)

[Screenshot of a blog post](doc/img/single_post.png)

## License

The MIT License ([LICENSE](LICENSE.txt))


text:
package org.apache.cassandra.cql3;

import java.util.Collections;

import com.google.common.collect.Iterables;

import org.apache.cassandra.cql3.functions.Function;

public class Terms
{

    private static com.google.common.base.Function<Term, Iterable<Function>> TO_FUNCTION_ITERABLE =
    new com.google.common.base.Function<Term, Iterable<Function>>()
    {
        public Iterable<Function> apply(Term term)
        {
            return term.getFunctions();
        }
    };

    public static Iterable<Function> getFunctions(Iterable<Term> terms)
    {
        if (terms == null)
            return Collections.emptySet();

        return Iterables.concat(Iterables.transform(terms, TO_FUNCTION_ITERABLE));
    }
}


text:
<!DOCTYPE html>

    <title>Rubinius : Use Ruby™</title>
  	<meta charset="UTF-8">
  	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta content='en' http-equiv='content-language'>
    <meta content='Rubinius is an implementation of the Ruby programming language. The Rubinius bytecode virtual machine is written in C++. The bytecode compiler is written in pure Ruby. The vast majority of the core library is also written in Ruby, with some supporting primitives that interact with the VM directly.' name='description'>
    <link href='/' rel='home'>
    <link href='/' rel='start'>

    <link href="/stylesheets/blueprint/screen.css" media="screen" rel="stylesheet" />
    <link href="/stylesheets/application.css"      media="screen" rel="stylesheet" />
    <link href="/stylesheets/blueprint/print.css"  media="print"  rel="stylesheet" />

    <link href="/stylesheets/pygments.css" media="screen" rel="stylesheet" />

    <link href="/favicon.ico"                 rel="shortcut icon"    type="image/vnd.microsoft.icon" />
    <link href="/images/apple-touch-icon.png" rel="apple-touch-icon" type="image/png" />
    <link href="/images/apple-touch-icon.png" rel="apple-touch-icon" type="image/png" sizes="72x72"   />
    <link href="/images/apple-touch-icon.png" rel="apple-touch-icon" type="image/png" sizes="114x114" />

Home

Blog

Documentation

Projects

Roadmap

Releases

Rubinius

Use Ruby™

    1.2.4

Overview

The Rubinius team is proud to announce the availability of 1.2.3.

1.2.3 is a bugfix release for 1.2.2. It contains a complement of bugfixes
and performance improvements.

About

Rubinius is a high performance environment for running code written in the
Ruby programming language. It provides a number of virtual machine features
found in other popular language runtimes such as generational garbage
collection, Just-In-Time compilation, and compatibility with existing C APIs.

Summary

Stats

Release Date: Mar 15, 2011

Commits: 212

Days since last release: 21

Issues fixed: 10 since 1.2.2

Authors

Evan Phoenix

Chuck Remes

Brian Ford

Dirkjan Bussink

Graham (stormbrew)

burningTyger

Jeff Siegel

Christopher Bertels

Wayne E. Seguin

Eoin Coffey

David Waite

Jari Bakken

John Mair

Thiago Pradi

Ivan Samsonov

Evan Shaw

Semyon Perepelitsa

Wim Looman

Benedikt Müller

Aman Gupta

Closed Issues

678ac9d Use Type.obj_kind_of? to a mocked #kind_of? Fixes #762

acfa7b7 Module#include should return the target include is called on, Fixes #756

a6fa69b Revert “Use empty binding to eval gemspecs for caching. Fixes #725”

ee0c62a Use empty binding to eval gemspecs for caching. Fixes #725

dda607b Handle last_match in an inline block properly. Fixes #720

f92ec4e Bound the C-API cache for a String when first creating it. Fixes #702

33c8117 Handle an Alias for an indistinct superclass method. Fixes #722

5bd938b Fix typo in doc links. Fixes #717

ca0c7ef Fixed arity checking for BlockAsMethod. Fixes #686

27a4872 Fixed File.expand_path. Fixes #708

Performance

Begin fleshing out benchmarks with new ips framework

Performance improvements for Hash#replace, #dup, #reject!, and #reject

Speed up String#chomp! quite a bit

Speed up Date._parse by removing clever and adding simple

Improve performance of Time.at with float values

Speed up Dir[] by breaking out specific cases and reducing stats

Improve Array#flatten[!] substantially

Speed up: Array#delete_at, Array#slice!, and Array#[]=

Additions

Add JOBS= and .be_gentle to control the number of parallel builds

Introdue Daedalus, a new native code builder

Update to RubyGems 1.5.2

C-API

Handle ST_DELETE returns from the rb_hash_foreach callback

Use single identifier to cause compile error on RHASH(_TBL).

Platform

FreeBSD doesn’t need -ldl and OpenBSD already explicitly has it

Store the make to use in a variable and default to gmake on BSD platforms

Modify configuration and VM to support both LLVM 2.8 and 2.9 (rc)

Bug Fixes

(CRASH) Handle break and return in various scopes properly

(CRASH) Fix reading the number of slots a tuple has

(CRASH) Ensure VM doesn’t improperly unwind into a process exit.

JIT: Fix returning from a lambda closure

JIT: Be sure to sign extend the result of an FFI call

Remove bad $~ assignment code

Use correct constness for strings returned from the C API

Update the -v build rev hash every build.

Fix Hash marshal dump

Fix YARD bug, don’t use the custom classes #initialize

Fixed Kernel#abort to coerce non-String arguments.

JIT: Handle raise_return in all contexts properly (fancy)

Clarify language/break specs for non-compliant rbx behavior.

Preserve ancestor chain of singleton class for a dupped class.

Fix for Exception#backtrace returning nil when @locations are missing.

Fix URI() to return the argument if it is a URI object

Remove old references to Rubinius::Scheduler

Run IO finalizers after we’ve shut down all other threads

Eval the gemspec cache in an empty binding.

Fix how and where eval locals are created

Fixing Hash[] method when passing an array

Properly detect a constant directory in Dir::Glob

Permit inspecting a Method having NativeMethod.

Reset allocations_ so we don’t keep recontributing them

JIT: Use the custom static scope in a block (dbussink)

Fixed Kernel#singleton_methods to return a unique list.

Added Module#define_method with block specs for arity checking.

raise ArgumentError when no block is given in Module#define_method

Follow Rubinius on Twitter

Fork Rubinius on github

An Engine Yard project


text:
class CPubKey;

namespace GRC {
//!
//! \brief Contains the reward claim context embedded in each generated block.
//!
//! Gridcoin blocks require some auxiliary information about claimed rewards to
//! facilitate and secure the reward protocol. Nodes embed the data represented
//! by a \c Claim instance in generated blocks to provide this context.
//!
class Claim : public IContractPayload
{
public:
    //!
    //! \brief Version number of the current format for a serialized reward
    //! claim block.
    //!
    //! CONSENSUS: Increment this value when introducing a breaking change and
    //! ensure that the serialization/deserialization routines also handle all
    //! of the previous versions.
    //!
    static constexpr uint32_t CURRENT_VERSION = 3;

    //!
    //! \brief The maximum length of a serialized client version in a claim.
    //!
    static constexpr size_t MAX_VERSION_SIZE = 30;

    //!
    //! \brief The maximum length of a serialized organization value in a claim.
    //!
    static constexpr size_t MAX_ORGANIZATION_SIZE = 50;

    //!
    //! \brief Number of places after the decimal point of serialized magnitude
    //! unit values.
    //!
    static constexpr size_t MAG_UNIT_PLACES = 6;

    //!
    //! \brief Version number of the serialized reward claim format.
    //!
    //! Defaults to the most recent version for a new claim instance.
    //!
    //! Version 1: Parsed from legacy "BoincBlock"-formatted string data stored
    //! in the \c hashBoinc field of a coinbase transaction.
    //!
    //! Version 2: Claim data serializable in binary format. Stored in a block
    //! as the first contract in the coinbase transaction.
    //!
    //! Version 3: Includes the coinstake transaction in the signature.
    //!
    uint32_t m_version = CURRENT_VERSION;

    //!
    //! \brief Indicates whether the claim is for a researcher or investor.
    //!
    //! If the claim declares research rewards, this field shall contain the
    //! external CPID of the researcher. For this case, it must match a CPID
    //! advertised in a verified beacon.
    //!
    MiningId m_mining_id;

    //!
    //! \brief The version string of the wallet software running on the node
    //! that submits the claim.
    //!
    //! Informational. This provides a rough metric of the distribution of
    //! the software versions installed on staking nodes. No protocol rule
    //! exists that depends on this value.
    //!
    //! Max length: 30 bytes. Blocks that contain a claim structure with a
    //! version field longer than 30 characters are rejected.
    //!
    std::string m_client_version;

    //!
    //! \brief A user-customizable field that may contain any arbitrary data.
    //!
    //! Informational. This field is intended to demonstrate an affiliation of
    //! a staked block with the staking party. For example, testnet guidelines
    //! recommend that participants set the organization value to recognizable
    //! identities to facilitate communication when needed.
    //!
    //! Max length: 50 bytes. Blocks that contain a claim structure with an
    //! organization field longer than 50 characters are rejected.
    //!
    std::string m_organization;

    //!
    //! \brief The value minted for generating the new block in units of
    //! 1/100000000 GRC.
    //!
    //! Below the switch to constant block rewards, this field contains the
    //! amount of accrued interest claimed by the staking node. It contains
    //! the constant block reward rate after the switch.
    //!
    //! Claims do not strictly need to contain the block subsidy or research
    //! subsidy values. Nodes will calculate these values anyway to validate
    //! incoming reward claims and can index those calculated values without
    //! this field. It can be considered informational.
    //!
    CAmount m_block_subsidy;

    //!
    //! \brief The value of the research rewards claimed by the node in units
    //! of 1/100000000 GRC.
    //!
    //! Contains a value of zero for investor claims.
    //!
    //! Claims do not strictly need to contain the block subsidy or research
    //! subsidy values. Nodes will calculate these values anyway to validate
    //! incoming reward claims and can index those calculated values without
    //! this field. It can be considered informational.
    //!
    CAmount m_research_subsidy;

    //!
    //! \brief The researcher magnitude value from the superblock at the time
    //! of the claim.
    //!
    //! Informational. The magnitude value may better enable off-chain services
    //! like explorers to more easily produce historical logs of the researcher
    //! magnitudes over time. The protocol only checks that this magnitude does
    //! not exceed the magnitude in a superblock for the same CPID.
    //!
    //! Previous protocol versions used the magnitude in reward calculations.
    //!
    uint16_t m_magnitude;

    //!
    //! \brief The magnitude ratio of the network at the time of the claim.
    //!
    //! Informational.
    //!
    double m_magnitude_unit;

    //!
    //! \brief Produced by signing the CPID and last block hash with a beacon
    //! public key.
    //!
    //! Nodes verify this signature with the CPID's stored beacon key to prevent
    //! unauthorized claim or replay of the research reward subsidy.
    //!
    std::vector<unsigned char> m_signature;

    //!
    //! \brief Hash of the superblock to vote for.
    //!
    //! When a superblock is due for a day, nodes will vote for a particular
    //! superblock contract by submitting in this field the contract hash of
    //! the pending superblock that the node caches locally.
    //!
    QuorumHash m_quorum_hash;

    //!
    //! \brief The default wallet address of the node submitting the claim.
    //!
    //! This address matches the address advertised in the beacon for the CPID
    //! owned by the node. It will determine whether a node may participate in
    //! the superblock quorum for a particular day.
    //!
    std::string m_quorum_address;

    //!
    //! \brief The complete superblock data when the node submitting the claim
    //! also publishes the daily superblock in the generated block.
    //!
    //! Must be accompanied by a valid superblock hash in the \c m_quorum_hash
    //! field.
    //!
    SuperblockPtr m_superblock;

    //!
    //! \brief Initialize an empty, invalid reward claim object.
    //!
    Claim();

    //!
    //! \brief Initialize an empty, invalid reward claim object of the specified
    //! version.
    //!
    //! \param version Version number of the serialized reward claim format.
    //!
    Claim(uint32_t version);

    //!
    //! \brief Parse a claim object from a legacy, delimited string (hashBoinc).
    //!
    //! \param claim         Legacy "BoincBlock"-formatted claim string data.
    //! \param block_version Format version of the block that contains the claim
    //! to parse.
    //!
    //! \return A new claim instance that contains the parsed reward context.
    //!
    static Claim Parse(const std::string& claim, int block_version);

    //!
    //! \brief Get the type of contract that this payload contains data for.
    //!
    GRC::ContractType ContractType() const override
    {
        return GRC::ContractType::CLAIM;
    }

    //!
    //! \brief Determine whether the object contains a well-formed payload.
    //!
    //! \param action The action declared for the contract that contains the
    //! payload. It may determine how to validate the payload.
    //!
    //! \return \c true if the payload is complete.
    //!
    bool WellFormed(const GRC::ContractAction action) const override
    {
        return WellFormed(); // Claims do not have contract actions.
    }

    //!
    //! \brief Determine whether the instance represents a complete claim.
    //!
    //! The result of this method call does NOT guarantee that the claim is
    //! valid. The return value of \c true only indicates that the instance
    //! received each of the pieces of data needed for a well-formed claim.
    //!
    //! \return \c true if the claim contains each of the required elements.
    //!
    bool WellFormed() const;

    //!
    //! \brief Get a string for the key used to construct a legacy contract.
    //!
    std::string LegacyKeyString() const override
    {
        return ""; // No legacy contract key representation exists.
    }

    //!
    //! \brief Get a string for the value used to construct a legacy contract.
    //!
    std::string LegacyValueString() const override
    {
        return ""; // No legacy contract value representation exists.
    }

    //!
    //! \brief Get the burn fee amount required to send a particular contract.
    //!
    //! \return Burn fee in units of 1/100000000 GRC.
    //!
    CAmount RequiredBurnAmount() const override
    {
        // Prevent users from sending this contract manually:
        return MAX_MONEY;
    }

    //!
    //! \brief Determine whether the instance represents a claim that includes
    //! accrued research rewards.
    //!
    //! \return \c true if the claim contains a valid CPID.
    //!
    bool HasResearchReward() const;

    //!
    //! \brief Determine whether the claim instance includes a superblock.
    //!
    //! \return \c true if the claim contains a valid superblock object.
    //!
    bool ContainsSuperblock() const;

    //!
    //! \brief Get the sum of the claimed block and research rewards.
    //!
    //! \return The sum of the block subsidy and research subsidy declared in
    //! the claim.
    //!
    CAmount TotalSubsidy() const;

    //!
    //! \brief Sign an instance that claims research rewards.
    //!
    //! \param private_key     The private key of the beacon to sign the claim
    //! with.
    //! \param last_block_hash Hash of the block that precedes the block that
    //! contains the claim.
    //! \param coinstake_tx    Coinstake transaction of the block that contains
    //! the claim.
    //!
    //! \return \c false if the claim does not contain a valid CPID or if the
    //! signing fails.
    //!
    bool Sign(
        CKey& private_key,
        const uint256& last_block_hash,
        const CTransaction& coinstake_tx);

    //!
    //! \brief Validate the authenticity of a research reward claim by verifying
    //! the digital signature.
    //!
    //! \param public_key      The public key of the beacon that signed the
    //! claim.
    //! \param last_block_hash Hash of the block that precedes the block that
    //! contains the claim.
    //! \param coinstake_tx    Coinstake transaction of the block that contains
    //! the claim.
    //!
    //! \return \c true if the signature check passes using the supplied key.
    //!
    bool VerifySignature(
        const CPubKey& public_key,
        const uint256& last_block_hash,
        const CTransaction& coinstake_tx) const;

    //!
    //! \brief Compute a hash of the claim data.
    //!
    //! \return Hash of the data in the claim.
    //!
    uint256 GetHash() const;

    //!
    //! \brief Get the legacy string representation of the claim.
    //!
    //! CONSENSUS: Although this method produces a legacy string compatible
    //! with older protocols, it does not guarantee that the string matches
    //! exactly to legacy input string versions imported by Claim::Parse().
    //! Use this method to produce a new claim context for generated legacy
    //! blocks or for informational output. Do not reproduce existing claim
    //! data with this routine if it will be retransmitted to other nodes.
    //!
    //! \param block_version Determines the number of subsidy places.
    //!
    //! \return A "BoincBlock"-formatted string that contains the claim data.
    //!
    std::string ToString(const int block_version) const;

    //
    // Serialize and deserialize the claim in binary format instead of parsing
    // and formatting the legacy delimited string representation.
    //
    // For Claim::m_version >= 2.
    //
    ADD_CONTRACT_PAYLOAD_SERIALIZE_METHODS;

    template <typename Stream, typename Operation>
    inline void SerializationOp(
        Stream& s,
        Operation ser_action,
        const ContractAction contract_action)
    {
        // Claim contracts do not use the contract action specifier:
        SerializationOp(s, ser_action);
    }

    template <typename Stream, typename Operation>
    inline void SerializationOp(Stream& s, Operation ser_action)
    {
        READWRITE(m_version);
        READWRITE(m_mining_id);
        READWRITE(LIMITED_STRING(m_client_version, MAX_VERSION_SIZE));
        READWRITE(LIMITED_STRING(m_organization, MAX_ORGANIZATION_SIZE));

        READWRITE(m_block_subsidy);

        // Serialize research-related fields only for researcher claims:
        //
        if (m_mining_id.Which() == MiningId::Kind::CPID) {
            READWRITE(m_research_subsidy);
            READWRITE(m_signature);
        }

        READWRITE(m_quorum_hash);

        if (!(s.GetType() & (SER_GETHASH|SER_SKIPSUPERBLOCK))
            && m_quorum_hash.Valid())
        {
            READWRITE(m_superblock);
        }
    }
}; // Claim
}


text:
package externalservice

import (
	"context"

	"github.com/openshift/origin/pkg/monitor"
	"github.com/openshift/origin/pkg/monitor/backenddisruption"
	"k8s.io/client-go/rest"
)

const (
	LivenessProbeBackend = "ci-cluster-network-liveness"
	externalServiceURL   = "http://static.redhat.com/test/rhel-networkmanager.txt"
)

// StartExternalServiceMonitoring runs a monitor against a public http endpoint we can poll to ensure the cluster
// running the tests can reach and external service. This is used to compare to disruption observed against the
// ephemeral cluster under test, and compare to see if the build cluster where the tests are running is having
// network issues, or if we're seeing real disruption.
func StartExternalServiceMonitoring(ctx context.Context, m monitor.Recorder, clusterConfig *rest.Config) error {
	if err := startExternalServiceMonitoringWithNewConnections(ctx, m, clusterConfig); err != nil {
		return err
	}
	if err := startExternalServiceMonitoringWithReusedConnections(ctx, m, clusterConfig); err != nil {
		return err
	}
	return nil
}

func startExternalServiceMonitoringWithNewConnections(ctx context.Context, m monitor.Recorder, clusterConfig *rest.Config) error {
	backendSampler := backenddisruption.NewSimpleBackend(
		externalServiceURL,
		LivenessProbeBackend,
		"",
		backenddisruption.NewConnectionType)
	return backendSampler.StartEndpointMonitoring(ctx, m, nil)
}

func startExternalServiceMonitoringWithReusedConnections(ctx context.Context, m monitor.Recorder, clusterConfig *rest.Config) error {
	backendSampler := backenddisruption.NewSimpleBackend(
		externalServiceURL,
		LivenessProbeBackend,
		"",
		backenddisruption.ReusedConnectionType)
	return backendSampler.StartEndpointMonitoring(ctx, m, nil)
}


text:
<?php
$theme_options = get_option('sevinci_settings');
$facebook   = $theme_options['facebook'];
$twitter    = $theme_options['twitter'];
$linkedin   = $theme_options['linkedin'];
$gplus      = $theme_options['gplus'];
$instagram  = $theme_options['instagram'];
$pinterest  = $theme_options['pinterest'];
$youtube    = $theme_options['youtube'];
$vimeo      = $theme_options['vimeo'];
$skype      = $theme_options['skype'];

$social_media = array(
    'facebook'      => $facebook,
    'twitter'       => $twitter,
    'linkedin'      => $linkedin,
    'google plus'   => $gplus,
    'instagram'     => $instagram,
    'pinterest'     => $pinterest,
    'youtube'       => $youtube,
    //'vimeo'         => $vimeo,
    //'skype'         => $skype
);

?>

                    <img src="<?php echo get_stylesheet_directory_uri() ?>/assets/images/logo/sevinci-logo-red-full.svg" alt="" width="150px"/>

                    <?php _e('A business toolbox to help people direct and manage business projects efficiently','sage'); ?>

<?php _e('Menu','sage') ?>

                    <?php dynamic_sidebar('sidebar-footer'); ?>

<?php _e('Contribute','sage') ?>

                    <?php dynamic_sidebar( 'sidebar-contribution' ); ?>

<?php _e('Contact','sage') ?>

                    <?php foreach ($social_media as $social => $social_url): ?>
                        <?php if (!empty($social_url)): ?>
                            <a href="<?php echo $social_url; ?>" target="_blank">
                                <div class="ui circular <?php echo $social; ?> icon button">
                                    <i class="<?php echo $social; ?> icon">

                        <?php endif; ?>
                    <?php endforeach; ?>


text:
<?php

declare(strict_types=1);

namespace Leevel\Mail\Provider;

use Leevel\Di\IContainer;
use Leevel\Di\Provider;
use Leevel\Mail\IMail;
use Leevel\Mail\Mail;
use Leevel\Mail\Manager;

/**
 * 邮件服务提供者.
 */
class Register extends Provider
{
    /**
     * {@inheritDoc}
     */
    public function register(): void
    {
        $this->mails();
        $this->mail();
    }

    /**
     * {@inheritDoc}
     */
    public static function providers(): array
    {
        return [
            'mails' => Manager::class,
            'mail'  => [IMail::class, Mail::class],
        ];
    }

    /**
     * {@inheritDoc}
     */
    public static function isDeferred(): bool
    {
        return true;
    }

    /**
     * 注册 mails 服务.
     */
    protected function mails(): void
    {
        $this->container
            ->singleton(
                'mails',
                fn (IContainer $container): Manager => new Manager($container),
            );
    }

    /**
     * 注册 mail 服务.
     */
    protected function mail(): void
    {
        $this->container
            ->singleton(
                'mail',
                fn (IContainer $container): IMail => $container['mails']->connect(),
            );
    }
}


text:
package org.spongepowered.common.launch;

import static org.spongepowered.asm.mixin.MixinEnvironment.Side.SERVER;

import net.minecraft.launchwrapper.LaunchClassLoader;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.Mixins;
import org.spongepowered.lwts.AbstractTestTweaker;

import java.io.File;

public class TestTweaker extends AbstractTestTweaker {

    @Override
    public void injectIntoClassLoader(LaunchClassLoader loader) {
        super.injectIntoClassLoader(loader);
        loader.addClassLoaderExclusion("org.slf4j.");

        registerAccessTransformer("META-INF/common_at.cfg");

        SpongeLaunch.initPaths(new File("."));

        SpongeLaunch.setupMixinEnvironment();
        Mixins.addConfiguration("mixins.common.test.json");
        MixinEnvironment.getDefaultEnvironment().setSide(SERVER);
    }

    @Override
    public String getLaunchTarget() {
        return "org.spongepowered.common.test.TestMain";
    }

}


text:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (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.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is mozilla.org code.
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 1998-1999
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either of the GNU General Public License Version 2 or later (the "GPL"),
 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef nsIScriptContext_h__
#define nsIScriptContext_h__

#include "nscore.h"
#include "nsStringGlue.h"
#include "nsISupports.h"
#include "nsCOMPtr.h"
#include "nsIProgrammingLanguage.h"

class nsIScriptGlobalObject;
class nsIScriptSecurityManager;
class nsIPrincipal;
class nsIAtom;
class nsIArray;
class nsIVariant;
class nsIObjectInputStream;
class nsIObjectOutputStream;
class nsScriptObjectHolder;

typedef void (*nsScriptTerminationFunc)(nsISupports* aRef);

#define NS_ISCRIPTCONTEXT_IID \
{ /* {e7b9871d-3adc-4bf7-850d-7fb9554886bf} */ \
  0xe7b9871d, 0x3adc, 0x4bf7, \
 { 0x85, 0x0d, 0x7f, 0xb9, 0x55, 0x48, 0x86, 0xbf } }

/* This MUST match JSVERSION_DEFAULT.  This version stuff if we don't
   know what language we have is a little silly... */
#define SCRIPTVERSION_DEFAULT JSVERSION_DEFAULT

/**
 * It is used by the application to initialize a runtime and run scripts.
 * A script runtime would implement this interface.
 *
It does have a bit too much java script information now, that
 * should be removed in a short time. Ideally this interface will be
 * language neutral
 */
class nsIScriptContext : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTCONTEXT_IID)

  /* Get the ID of this language. */
  virtual PRUint32 GetScriptTypeID() = 0;

  /**
   * Compile and execute a script.
   *
   * @param aScript a string representing the script to be executed
   * @param aScopeObject a script object for the scope to execute in, or
   *                     nsnull to use a default scope
   * @param aPrincipal the principal that produced the script
   * @param aURL the URL or filename for error messages
   * @param aLineNo the starting line number of the script for error messages
   * @param aVersion the script language version to use when executing
   * @param aRetValue the result of executing the script, or null for no result.
   *        If this is a JS context, it's the caller's responsibility to
   *        preserve aRetValue from GC across this call
   * @param aIsUndefined true if the result of executing the script is the
   *                     undefined value
   *
   * @return NS_OK if the script was valid and got executed
   *
   **/
  virtual nsresult EvaluateString(const nsAString& aScript,
                                  void *aScopeObject,
                                  nsIPrincipal *aPrincipal,
                                  const char *aURL,
                                  PRUint32 aLineNo,
                                  PRUint32 aVersion,
                                  nsAString *aRetValue,
                                  PRBool* aIsUndefined) = 0;

  // Note JS bigotry remains here - 'void *aRetValue' is assumed to be a
  // jsval.  This must move to JSObject before it can be made agnostic.
  virtual nsresult EvaluateStringWithValue(const nsAString& aScript,
                                           void *aScopeObject,
                                           nsIPrincipal *aPrincipal,
                                           const char *aURL,
                                           PRUint32 aLineNo,
                                           PRUint32 aVersion,
                                           void* aRetValue,
                                           PRBool* aIsUndefined) = 0;

  /**
   * Compile a script.
   *
   * @param aText a PRUnichar buffer containing script source
   * @param aTextLength number of characters in aText
   * @param aScopeObject an object telling the scope in which to execute,
   *                     or nsnull to use a default scope
   * @param aPrincipal the principal that produced the script
   * @param aURL the URL or filename for error messages
   * @param aLineNo the starting line number of the script for error messages
   * @param aVersion the script language version to use when executing
   * @param aScriptObject an executable object that's the result of compiling
   *                      the script.
   *
   * @return NS_OK if the script source was valid and got compiled.
   *
   **/
  virtual nsresult CompileScript(const PRUnichar* aText,
                                 PRInt32 aTextLength,
                                 void* aScopeObject,
                                 nsIPrincipal* aPrincipal,
                                 const char* aURL,
                                 PRUint32 aLineNo,
                                 PRUint32 aVersion,
                                 nsScriptObjectHolder &aScriptObject) = 0;

  /**
   * Execute a precompiled script object.
   *
   * @param aScriptObject an object representing the script to be executed
   * @param aScopeObject an object telling the scope in which to execute,
   *                     or nsnull to use a default scope
   * @param aRetValue the result of executing the script, may be null in
   *                  which case no result string is computed
   * @param aIsUndefined true if the result of executing the script is the
   *                     undefined value, may be null for "don't care"
   *
   * @return NS_OK if the script was valid and got executed
   *
   */
  virtual nsresult ExecuteScript(void* aScriptObject,
                                 void* aScopeObject,
                                 nsAString* aRetValue,
                                 PRBool* aIsUndefined) = 0;

  /**
   * Compile the event handler named by atom aName, with function body aBody
   * into a function object returned if ok via aHandler.  Does NOT bind the
   * function to anything - BindCompiledEventHandler() should be used for that
   * purpose.  Note that this event handler is always considered 'shared' and
   * hence is compiled without principals.  Never call the returned object
   * directly - it must be bound (and thereby cloned, and therefore have the
   * correct principals) before use!
   *
   * @param aName an nsIAtom pointer naming the function; it must be lowercase
   *        and ASCII, and should not be longer than 63 chars.  This bound on
   *        length is enforced only by assertions, so caveat caller!
   * @param aEventName the name that the event object should be bound to
   * @param aBody the event handler function's body
   * @param aURL the URL or filename for error messages
   * @param aLineNo the starting line number of the script for error messages
   * @param aVersion the script language version to use when executing
   * @param aHandler the out parameter in which a void pointer to the compiled
   *        function object is stored on success
   *
   * @return NS_OK if the function body was valid and got compiled
   */
  virtual nsresult CompileEventHandler(nsIAtom* aName,
                                       PRUint32 aArgCount,
                                       const char** aArgNames,
                                       const nsAString& aBody,
                                       const char* aURL,
                                       PRUint32 aLineNo,
                                       PRUint32 aVersion,
                                       nsScriptObjectHolder &aHandler) = 0;

  /**
   * Call the function object with given args and return its boolean result,
   * or true if the result isn't boolean.
   *
   * @param aTarget the event target
   * @param aScript an object telling the scope in which to call the compiled
   *        event handler function.
   * @param aHandler function object (function and static scope) to invoke.
   * @param argv array of arguments.  Note each element is assumed to
   *        be an nsIVariant.
   * @param rval out parameter returning result
   **/
  virtual nsresult CallEventHandler(nsISupports* aTarget,
                                    void *aScope, void* aHandler,
                                    nsIArray *argv, nsIVariant **rval) = 0;

  /**
   * Bind an already-compiled event handler function to a name in the given
   * scope object.  The same restrictions on aName (lowercase ASCII, not too
   * long) applies here as for CompileEventHandler.  Scripting languages with
   * static scoping must re-bind the scope chain for aHandler to begin (after
   * the activation scope for aHandler itself, typically) with aTarget's scope.
   *
   * Logically, this 'bind' operation is more of a 'copy' - it simply
   * stashes/associates the event handler function with the event target, so
   * it can be fetched later with GetBoundEventHandler().
   *
   * @param aTarget an object telling the scope in which to bind the compiled
   *        event handler function.  The context will presumably associate
   *        this nsISupports with a native script object.
   * @param aName an nsIAtom pointer naming the function; it must be lowercase
   *        and ASCII, and should not be longer than 63 chars.  This bound on
   *        length is enforced only by assertions, so caveat caller!
   * @param aHandler the function object to name, created by an earlier call to
   *        CompileEventHandler
   * @return NS_OK if the function was successfully bound to the name
   *
   * XXXmarkh - fold this in with SetProperty?  Exactly the same concept!
   */
  virtual nsresult BindCompiledEventHandler(nsISupports* aTarget, void *aScope,
                                            nsIAtom* aName,
                                            void* aHandler) = 0;

  /**
   * Lookup a previously bound event handler for the specified target.  This
   * will return an object equivilent to the one passed to
   * BindCompiledEventHandler (although the pointer may not be the same).
   *
   */
  virtual nsresult GetBoundEventHandler(nsISupports* aTarget, void *aScope,
                                        nsIAtom* aName,
                                        nsScriptObjectHolder &aHandler) = 0;

  /**
   * Compile a function that isn't used as an event handler.
   *
   * NOTE: Not yet language agnostic (main problem is XBL - not yet agnostic)
   * Caller must make sure aFunctionObject is a JS GC root.
   *
   **/
  virtual nsresult CompileFunction(void* aTarget,
                                   const nsACString& aName,
                                   PRUint32 aArgCount,
                                   const char** aArgArray,
                                   const nsAString& aBody,
                                   const char* aURL,
                                   PRUint32 aLineNo,
                                   PRUint32 aVersion,
                                   PRBool aShared,
                                   void **aFunctionObject) = 0;

  /**
   * Set the default scripting language version for this context, which must
   * be a context specific to a particular scripting language.
   *
   **/
  virtual void SetDefaultLanguageVersion(PRUint32 aVersion) = 0;

  /**
   * Return the global object.
   *
   **/
  virtual nsIScriptGlobalObject *GetGlobalObject() = 0;

  /**
   * Return the native script context
   *
   **/
  virtual void *GetNativeContext() = 0;

  /**
   * Return the native global object for this context.
   *
   **/
  virtual void *GetNativeGlobal() = 0;

  /**
   * Create a new global object that will be used for an inner window.
   * Return the native global and an nsISupports 'holder' that can be used
   * to manage the lifetime of it.
   */
  virtual nsresult CreateNativeGlobalForInner(
                                      nsIScriptGlobalObject *aNewInner,
                                      PRBool aIsChrome,
                                      void **aNativeGlobal,
                                      nsISupports **aHolder) = 0;

  /**
   * Connect this context to a new inner window, to allow "prototype"
   * chaining from the inner to the outer.
   * Called after both the the inner and outer windows are initialized
   **/
  virtual nsresult ConnectToInner(nsIScriptGlobalObject *aNewInner,
                                  void *aOuterGlobal) = 0;

  /**
   * Init this context ready for use.  If aGlobalObject is not NULL, this
   * function may initialize based on this global (for example, using the
   * global to locate a chrome window, create a new 'scope' for this
   * global, etc)
   *
   * @param aGlobalObject the gobal object, which may be nsnull.
   *
   * @return NS_OK if context initialization was successful
   *
   **/
  virtual nsresult InitContext(nsIScriptGlobalObject *aGlobalObject) = 0;

  /**
   * Check to see if context is as yet intialized. Used to prevent
   * reentrancy issues during the initialization process.
   *
   * @return PR_TRUE if initialized, PR_FALSE if not
   *
   */
  virtual PRBool IsContextInitialized() = 0;

  /**
   * Called as the global object discards its reference to the context.
   */
  virtual void FinalizeContext() = 0;

  /**
   * For garbage collected systems, do a synchronous collection pass.
   * May be a no-op on other systems
   *
   * @return NS_OK if the method is successful
   */
  virtual void GC() = 0;

  /**
   * Inform the context that a script was evaluated.
   * A GC may be done if "necessary."
   * This call is necessary if script evaluation is done
   * without using the EvaluateScript method.
   * @param aTerminated If true then call termination function if it was
   *    previously set. Within DOM this will always be true, but outside
   *    callers (such as xpconnect) who may do script evaluations nested
   *    inside DOM script evaluations can pass false to avoid premature
   *    calls to the termination function.
   * @return NS_OK if the method is successful
   */
  virtual void ScriptEvaluated(PRBool aTerminated) = 0;

  virtual nsresult Serialize(nsIObjectOutputStream* aStream,
                             void *aScriptObject) = 0;

  /* Deserialize a script from a stream.
   */
  virtual nsresult Deserialize(nsIObjectInputStream* aStream,
                               nsScriptObjectHolder &aResult) = 0;

  /**
   * JS only - this function need not be implemented by languages other
   * than JS (ie, this should be moved to a private interface!)
   * Called to specify a function that should be called when the current
   * script (if there is one) terminates. Generally used if breakdown
   * of script state needs to happen, but should be deferred till
   * the end of script evaluation.
   *
   * @throws NS_ERROR_OUT_OF_MEMORY if that happens
   */
  virtual nsresult SetTerminationFunction(nsScriptTerminationFunc aFunc,
                                          nsISupports* aRef) = 0;

  /**
   * Called to disable/enable script execution in this context.
   */
  virtual PRBool GetScriptsEnabled() = 0;
  virtual void SetScriptsEnabled(PRBool aEnabled, PRBool aFireTimeouts) = 0;

  // SetProperty is suspect and jst believes should not be needed.  Currenly
  // used only for "arguments".
  virtual nsresult SetProperty(void *aTarget, const char *aPropName, nsISupports *aVal) = 0;
  /**
   * Called to set/get information if the script context is
   * currently processing a script tag
   */
  virtual PRBool GetProcessingScriptTag() = 0;
  virtual void SetProcessingScriptTag(PRBool aResult) = 0;

  /**
   * Tell the context whether or not to GC when destroyed.  An optimization
   * used when the window is a [i]frame, so GC will happen anyway.
   */
  virtual void SetGCOnDestruction(PRBool aGCOnDestruction) = 0;

  /**
   * Initialize DOM classes on aGlobalObj, always call
   * WillInitializeContext() before calling InitContext(), and always
   * call DidInitializeContext() when a context is fully
   * (successfully) initialized.
   */
  virtual nsresult InitClasses(void *aGlobalObj) = 0;

  /**
   * Clear the scope object - may be called either as we are being torn down,
   * or before we are attached to a different document.
   *
   * aClearFromProtoChain is probably somewhat JavaScript specific.  It
   * indicates that the global scope polluter should be removed from the
   * prototype chain and that the objects in the prototype chain should
   * also have their scopes cleared.  We don't do this all the time
   * because the prototype chain is shared between inner and outer
   * windows, and needs to stay with inner windows that we're keeping
   * around.
   */
  virtual void ClearScope(void* aGlobalObj, PRBool aClearFromProtoChain) = 0;

  /**
   * Tell the context we're about to be reinitialize it.
   */
  virtual void WillInitializeContext() = 0;

  /**
   * Tell the context we're done reinitializing it.
   */
  virtual void DidInitializeContext() = 0;

  /**
   * Tell the context our global has a new document, and the scope
   * used by it.  Use nsISupports to avoid dependency issues - but expect
   * a QI for nsIDOMDocument and/or nsIDocument.
   */
  virtual void DidSetDocument(nsISupports *aDoc, void *aGlobal) = 0;

  /* Memory managment for script objects.  Used by the implementation of
   * nsScriptObjectHolder to manage the lifetimes of the held script objects.
   *
   * See also nsIScriptRuntime, which has identical methods and is useful
   * in situations when you do not have an nsIScriptContext.
   *
   */
  virtual nsresult DropScriptObject(void *object) = 0;
  virtual nsresult HoldScriptObject(void *object) = 0;

  /* Report a pending exception if there is one on the native context */
  virtual void ReportPendingException() = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptContext, NS_ISCRIPTCONTEXT_IID)

#endif // nsIScriptContext_h__


text:
\documentclass{beamer}
\usepackage{lmodern}

\usepackage{xeCJK}

\usepackage[safe]{silence}
\WarningFilter*{latexfont}{Font}

\usetheme{CambridgeUS} % try Madrid, Pittsburgh
\usecolortheme{beaver}
\usefonttheme[onlymath]{serif} % try "professionalfonts"

\setbeamertemplate{theorems}[normal font]
\setbeamertemplate{itemize items}[default]
\setbeamertemplate{enumerate items}[default]

\usepackage{amsmath, amsfonts, latexsym, mathtools, extarrows}
% \usepackage{kbordermatrix}
% \usepackage{ntheorem}

\usepackage{centernot}

\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}

% colors
\newcommand{\red}[1]{\textcolor{red}{#1}}
\newcommand{\green}[1]{\textcolor{green}{#1}}
\newcommand{\blue}[1]{\textcolor{blue}{#1}}
\newcommand{\purple}[1]{\textcolor{purple}{#1}}

% color box
\newcommand{\rbox}[1]{\red{\boxed{#1}}}
\newcommand{\gbox}[1]{\green{\boxed{#1}}}
\newcommand{\bbox}[1]{\blue{\boxed{#1}}}
\newcommand{\pbox}[1]{\purple{\boxed{#1}}}

\usepackage{tikz}
% see http://tex.stackexchange.com/a/7045/23098
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\usepackage{tikz-qtree}
\usetikzlibrary{backgrounds, fit}

\usepackage{pifont}
\usepackage{wasysym}

\usepackage[normalem]{ulem}
\newcommand{\middlewave}[1]{\raisebox{0.5em}{\uwave{\hspace{#1}}}}

\usepackage{graphicx, subcaption}

\usepackage{algorithm}
\usepackage[noend]{algpseudocode}

\newcommand{\pno}[1]{\textcolor{blue}{\scriptsize [Problem: #1]}}
\newcommand{\set}[1]{\{#1\}}
\DeclareMathOperator{\lcm}{lcm}

\newcommand{\cmark}{\green{\ding{51}}}
\newcommand{\xmark}{\red{\ding{55}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% for fig without caption: #1: width/size; #2: fig file
\newcommand{\fignocaption}[2]{
  \begin{figure}[htp]
    \centering
      \includegraphics[#1]{#2}
  \end{figure}
}

% for fig with caption: #1: width/size; #2: fig file; #3: fig caption
\newcommand{\fig}[3]{
  \begin{figure}[htp]
    \centering
      \includegraphics[#1]{#2}
      \caption[labelInTOC]{#3}
  \end{figure}
}

\newcommand{\p}{\text{P}}
\newcommand{\np}{\text{NP}}
\newcommand{\conp}{\text{coNP}}
\newcommand{\pr}{\le_{p}} % polynomial reduction
\newcommand{\nph}{\text{NP-hard}}
\newcommand{\npc}{\text{NP-complete}}
\newcommand{\npi}{\text{NP-intermediate}}
\newcommand{\conpc}{\text{coNP-complete}}
\newcommand{\expcls}{\text{EXP}}
\newcommand{\rcls}{\text{R}}
\newcommand{\dtime}{\text{DTIME}}
\newcommand{\dspace}{\text{SPACE}}
\newcommand{\pspace}{\text{PSPACE}}
\newcommand{\pspacec}{\text{PSPACE-complete}}
\newcommand{\ph}{\text{PH}}
\newcommand{\hp}{\text{HAM-PATH}}
\newcommand{\hc}{\text{HAM-CYCLE}}
\newcommand{\fp}{\text{FP}}
\newcommand{\poly}{\text{Poly}}
\newcommand{\po}{\text{PO}}
\newcommand{\fptas}{\text{FPTAS}}
\newcommand{\ptas}{\text{PTAS}}
\newcommand{\apx}{\text{APX}}
\newcommand{\logapx}{\text{Log-APX}}
\newcommand{\polyapx}{\text{Poly-APX}}
\newcommand{\expapx}{\text{Exp-APX}}
\newcommand{\npo}{\text{NPO}}
\newcommand{\ms}{\text{MS}}

\newcommand{\titletext}{Approximation Algorithms}

\newcommand{\tx}{%
  \section*{}
  \begin{frame}[noframenumbering]
	\fignocaption{width = 0.50\textwidth}{figs/thankyou.jpg}
  \end{frame}
}
%%%%%%%%%%%%%%%%%%%%
\title[\titletext]{\titletext}
% \subtitle{}

\author[Hengfeng Wei]{Hengfeng Wei}
\titlegraphic{\includegraphics[height = 1.5cm]{figs/qrcode-approx-alg-20170518.png}}
\institute{hfwei@nju.edu.cn}
\date{May 14 $\sim$ May 18, 2017}

\AtBeginSection[]{
  \begin{frame}[noframenumbering, plain]
    \frametitle{\titletext}
    \tableofcontents[currentsection, sectionstyle=show/shaded, subsectionstyle=show/show/hide]
  \end{frame}
}
%%%%%%%%%%
\begin{document}
\maketitle

\input{sections/approx-class}
\input{sections/approx-alg}
\tx{}

\end{document}
%%%%%%%%%%


text:
<?php

final class ArcanistSemicolonSpacingXHPASTLinterRuleTestCase
  extends ArcanistXHPASTLinterRuleTestCase {

  public function testLinter() {
    $this->executeTestsInDirectory(dirname(__FILE__).'/semicolon-spacing/');
  }

}


text:
package org.apache.solr.core;

import junit.framework.Assert;

import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.analysis.core.KeywordTokenizerFactory;
import org.apache.lucene.analysis.ngram.NGramFilterFactory;
import org.apache.solr.common.SolrException;
import org.apache.solr.handler.admin.LukeRequestHandler;
import org.apache.solr.handler.component.FacetComponent;
import org.apache.solr.response.JSONResponseWriter;
import org.apache.lucene.analysis.util.ResourceLoaderAware;
import org.apache.solr.util.plugin.SolrCoreAware;

import java.io.File;
import java.io.InputStream;
import java.nio.charset.CharacterCodingException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

public class ResourceLoaderTest extends LuceneTestCase
{
  public void testInstanceDir() throws Exception {
    SolrResourceLoader loader = new SolrResourceLoader(null);
    String instDir = loader.getInstanceDir();
    assertTrue(instDir + " is not equal to " + "solr/", instDir.equals("solr/") == true);

    loader = new SolrResourceLoader("solr");
    instDir = loader.getInstanceDir();
    assertTrue(instDir + " is not equal to " + "solr/", instDir.equals("solr" + File.separator) == true);
  }

  public void testAwareCompatibility()
  {
    SolrResourceLoader loader = new SolrResourceLoader( "." );

    Class clazz = ResourceLoaderAware.class;
    // Check ResourceLoaderAware valid objects
    loader.assertAwareCompatibility( clazz, new NGramFilterFactory(new HashMap<String,String>()) );
    loader.assertAwareCompatibility( clazz, new KeywordTokenizerFactory(new HashMap<String,String>()) );

    // Make sure it throws an error for invalid objects
    Object[] invalid = new Object[] {
        // new NGramTokenFilter( null ),
        "hello",  new Float( 12.3f ),
        new LukeRequestHandler(),
        new JSONResponseWriter()
    };
    for( Object obj : invalid ) {
      try {
        loader.assertAwareCompatibility( clazz, obj );
        Assert.fail( "Should be invalid class: "+obj + " FOR " + clazz );
      }
      catch( SolrException ex ) { } // OK
    }

    clazz = SolrCoreAware.class;
    // Check ResourceLoaderAware valid objects
    loader.assertAwareCompatibility( clazz, new LukeRequestHandler() );
    loader.assertAwareCompatibility( clazz, new FacetComponent() );
    loader.assertAwareCompatibility( clazz, new JSONResponseWriter() );

    // Make sure it throws an error for invalid objects
    invalid = new Object[] {
        new NGramFilterFactory(new HashMap<String,String>()),
        "hello",  new Float( 12.3f ),
        new KeywordTokenizerFactory(new HashMap<String,String>())
    };
    for( Object obj : invalid ) {
      try {
        loader.assertAwareCompatibility( clazz, obj );
        Assert.fail( "Should be invalid class: "+obj + " FOR " + clazz );
      }
      catch( SolrException ex ) { } // OK
    }
  }

  public void testBOMMarkers() throws Exception {
    final String fileWithBom = "stopwithbom.txt";
    SolrResourceLoader loader = new SolrResourceLoader("solr/collection1");

    // preliminary sanity check
    InputStream bomStream = loader.openResource(fileWithBom);
    try {
      final byte[] bomExpected = new byte[] { -17, -69, -65 };
      final byte[] firstBytes = new byte[3];

      assertEquals("Should have been able to read 3 bytes from bomStream",
                   3, bomStream.read(firstBytes));

      assertTrue("This test only works if " + fileWithBom +
                 " contains a BOM -- it appears someone removed it.",
                 Arrays.equals(bomExpected, firstBytes));
    } finally {
      try { bomStream.close(); } catch (Exception e) { /* IGNORE */ }
    }

    // now make sure getLines skips the BOM...
    List<String> lines = loader.getLines(fileWithBom);
    assertEquals(1, lines.size());
    assertEquals("BOMsAreEvil", lines.get(0));
  }

  public void testWrongEncoding() throws Exception {
    String wrongEncoding = "stopwordsWrongEncoding.txt";
    SolrResourceLoader loader = new SolrResourceLoader("solr/collection1");
    // ensure we get our exception
    try {
      List<String> lines = loader.getLines(wrongEncoding);
      fail();
    } catch (SolrException expected) {
      assertTrue(expected.getCause() instanceof CharacterCodingException);
    }
  }
}


text:
//********************************************************************
//*
//* Warning: This file was generated by ecore4CPP Generator
//*
//********************************************************************

#ifndef FUML_SEMANTICS_ACTIVITIES_ACTIVITYNODEACTIVATIONACTIVITYNODEACTIVATIONIMPL_HPP
#define FUML_SEMANTICS_ACTIVITIES_ACTIVITYNODEACTIVATIONACTIVITYNODEACTIVATIONIMPL_HPP

//*********************************
// generated Includes

// namespace macro header include
#include "fUML/fUML.hpp"

// model includes
#include "../ActivityNodeActivation.hpp"

#include "fUML/Semantics/Activities/impl/ActivitiesFactoryImpl.hpp"
#include "fUML/Semantics/Loci/impl/SemanticVisitorImpl.hpp"

//*********************************
namespace fUML::Semantics::Activities
{
	class FUML_API ActivityNodeActivationImpl : virtual public fUML::Semantics::Loci::SemanticVisitorImpl, virtual public ActivityNodeActivation
	{
		public:
			ActivityNodeActivationImpl(const ActivityNodeActivationImpl & obj);
			virtual std::shared_ptr<ecore::EObject> copy() const = 0;
			ActivityNodeActivationImpl& operator=(ActivityNodeActivationImpl const&);

		protected:
			friend class fUML::Semantics::Activities::ActivitiesFactoryImpl;
			ActivityNodeActivationImpl();
			virtual std::shared_ptr<fUML::Semantics::Activities::ActivityNodeActivation> getThisActivityNodeActivationPtr() const;
			virtual void setThisActivityNodeActivationPtr(std::weak_ptr<fUML::Semantics::Activities::ActivityNodeActivation> thisActivityNodeActivationPtr);

			//Additional constructors for the containments back reference
			ActivityNodeActivationImpl(std::weak_ptr<fUML::Semantics::Activities::ActivityNodeActivationGroup> par_group);

		public:
			//destructor
			virtual ~ActivityNodeActivationImpl() = 0;

			//*********************************
			// Operations
			//*********************************
			virtual void addIncomingEdge(std::shared_ptr<fUML::Semantics::Activities::ActivityEdgeInstance> edge) ;
			virtual void addOutgoingEdge(std::shared_ptr<fUML::Semantics::Activities::ActivityEdgeInstance> edge) ;
			virtual void addToken(std::shared_ptr<fUML::Semantics::Activities::Token> token) ;
			virtual void addTokens(std::shared_ptr<Bag<fUML::Semantics::Activities::Token>> tokens) ;
			virtual void clearTokens() ;
			virtual void createEdgeInstances() ;
			virtual void createNodeActivations() ;
			virtual void fire(std::shared_ptr<Bag<fUML::Semantics::Activities::Token>> incomingTokens) ;
			virtual std::shared_ptr<fUML::Semantics::Activities::ActivityExecution> getActivityExecution() ;
			virtual std::shared_ptr<fUML::Semantics::StructuredClassifiers::Object> getExecutionContext() ;
			virtual std::shared_ptr<fUML::Semantics::Loci::Locus> getExecutionLocus() ;
			virtual std::shared_ptr<fUML::Semantics::Activities::ActivityNodeActivation> getNodeActivation(std::shared_ptr<uml::ActivityNode> node) ;
			virtual bool getRunning() ;
			virtual std::shared_ptr<Bag<fUML::Semantics::Activities::Token> > getTokens() ;
			virtual bool isReady() ;
			virtual bool isSourceFor(std::shared_ptr<fUML::Semantics::Activities::ActivityEdgeInstance> edgeInstances) ;
			virtual void receiveOffer() ;
			virtual int removeToken(std::shared_ptr<fUML::Semantics::Activities::Token> token) ;
			virtual void resume() ;
			virtual void run() ;
			virtual void sendOffers(std::shared_ptr<Bag<fUML::Semantics::Activities::Token>> tokens) ;
			virtual void suspend() ;
			virtual std::shared_ptr<Bag<fUML::Semantics::Activities::Token> > takeOfferedTokens() ;
			virtual std::shared_ptr<Bag<fUML::Semantics::Activities::Token> > takeTokens() ;
			virtual void terminate() ;

			//*********************************
			// Attribute Getters & Setters
			//*********************************
			virtual bool isRunning() const ;
			virtual void setRunning (bool _running);

			//*********************************
			// Reference Getters & Setters
			//*********************************
			virtual std::weak_ptr<fUML::Semantics::Activities::ActivityNodeActivationGroup> getGroup() const ;
			virtual void setGroup(std::weak_ptr<fUML::Semantics::Activities::ActivityNodeActivationGroup>) ;
			virtual std::shared_ptr<Bag<fUML::Semantics::Activities::Token>> getHeldTokens() const ;
			virtual std::shared_ptr<Bag<fUML::Semantics::Activities::ActivityEdgeInstance>> getIncomingEdges() const ;
			virtual std::shared_ptr<uml::ActivityNode> getNode() const ;
			virtual void setNode(std::shared_ptr<uml::ActivityNode>) ;
			virtual std::shared_ptr<Bag<fUML::Semantics::Activities::ActivityEdgeInstance>> getOutgoingEdges() const ;

			//*********************************
			// Union Reference Getters
			//*********************************

			//*********************************
			// Container Getter
			//*********************************
			virtual std::shared_ptr<ecore::EObject> eContainer() const ;

			//*********************************
			// Persistence Functions
			//*********************************
			virtual void load(std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler) ;
			virtual void loadAttributes(std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler, std::map<std::string, std::string> attr_list);
			virtual void loadNode(std::string nodeName, std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler);
			virtual void resolveReferences(const int featureID, std::vector<std::shared_ptr<ecore::EObject> > references) ;
			virtual void save(std::shared_ptr<persistence::interfaces::XSaveHandler> saveHandler) const ;
			virtual void saveContent(std::shared_ptr<persistence::interfaces::XSaveHandler> saveHandler) const;

		protected:
			virtual std::shared_ptr<ecore::EClass> eStaticClass() const;

			//*********************************
			// EStructuralFeature Get/Set/IsSet
			//*********************************
			virtual Any eGet(int featureID, bool resolve, bool coreType) const ;
			virtual bool eSet(int featureID, Any newValue) ;
			virtual bool internalEIsSet(int featureID) const ;

			//*********************************
			// EOperation Invoke
			//*********************************
			virtual Any eInvoke(int operationID, std::shared_ptr<std::list<Any>> arguments) ;

		private:
			std::weak_ptr<fUML::Semantics::Activities::ActivityNodeActivation> m_thisActivityNodeActivationPtr;
	};
}
#endif /* end of include guard: FUML_SEMANTICS_ACTIVITIES_ACTIVITYNODEACTIVATIONACTIVITYNODEACTIVATIONIMPL_HPP */


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <usb-accessory manufacturer="Xcellent Creations"
        model="AccessoryController"
        version="1.0" />
</resources>


text:
<?php

namespace Magento\Quote\Model;

use Magento\Framework\Exception\CouldNotSaveException;
use Magento\Framework\Exception\InputException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Exception\StateException;
use Magento\Quote\Api\Data\AddressInterface;
use Magento\Quote\Api\Data\EstimateAddressInterface;
use Magento\Quote\Api\ShipmentEstimationInterface;
use Magento\Quote\Model\Quote;

/**
 * Shipping method read service.
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 */
class ShippingMethodManagement implements
    \Magento\Quote\Api\ShippingMethodManagementInterface,
    \Magento\Quote\Model\ShippingMethodManagementInterface,
    ShipmentEstimationInterface
{
    /**
     * Quote repository.
     *
     * @var \Magento\Quote\Api\CartRepositoryInterface
     */
    protected $quoteRepository;

    /**
     * Shipping method converter
     *
     * @var \Magento\Quote\Model\Cart\ShippingMethodConverter
     */
    protected $converter;

    /**
     * Customer Address repository
     *
     * @var \Magento\Customer\Api\AddressRepositoryInterface
     */
    protected $addressRepository;

    /**
     * @var Quote\TotalsCollector
     */
    protected $totalsCollector;

    /**
     * Constructs a shipping method read service object.
     *
     * @param \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
     * @param Cart\ShippingMethodConverter $converter
     * @param \Magento\Customer\Api\AddressRepositoryInterface $addressRepository
     * @param Quote\TotalsCollector $totalsCollector
     */
    public function __construct(
        \Magento\Quote\Api\CartRepositoryInterface $quoteRepository,
        Cart\ShippingMethodConverter $converter,
        \Magento\Customer\Api\AddressRepositoryInterface $addressRepository,
        \Magento\Quote\Model\Quote\TotalsCollector $totalsCollector
    ) {
        $this->quoteRepository = $quoteRepository;
        $this->converter = $converter;
        $this->addressRepository = $addressRepository;
        $this->totalsCollector = $totalsCollector;
    }

    /**
     * {@inheritDoc}
     */
    public function get($cartId)
    {
        /** @var \Magento\Quote\Model\Quote $quote */
        $quote = $this->quoteRepository->getActive($cartId);

        /** @var \Magento\Quote\Model\Quote\Address $shippingAddress */
        $shippingAddress = $quote->getShippingAddress();
        if (!$shippingAddress->getCountryId()) {
            throw new StateException(__('Shipping address not set.'));
        }

        $shippingMethod = $shippingAddress->getShippingMethod();
        if (!$shippingMethod) {
            return null;
        }

        $shippingAddress->collectShippingRates();
        /** @var \Magento\Quote\Model\Quote\Address\Rate $shippingRate */
        $shippingRate = $shippingAddress->getShippingRateByCode($shippingMethod);
        if (!$shippingRate) {
            return null;
        }
        return $this->converter->modelToDataObject($shippingRate, $quote->getQuoteCurrencyCode());
    }

    /**
     * {@inheritDoc}
     */
    public function getList($cartId)
    {
        $output = [];

        /** @var \Magento\Quote\Model\Quote $quote */
        $quote = $this->quoteRepository->getActive($cartId);

        // no methods applicable for empty carts or carts with virtual products
        if ($quote->isVirtual() || 0 == $quote->getItemsCount()) {
            return [];
        }

        $shippingAddress = $quote->getShippingAddress();
        if (!$shippingAddress->getCountryId()) {
            throw new StateException(__('Shipping address not set.'));
        }
        $shippingAddress->collectShippingRates();
        $shippingRates = $shippingAddress->getGroupedAllShippingRates();
        foreach ($shippingRates as $carrierRates) {
            foreach ($carrierRates as $rate) {
                $output[] = $this->converter->modelToDataObject($rate, $quote->getQuoteCurrencyCode());
            }
        }
        return $output;
    }

    /**
     * {@inheritDoc}
     */
    public function set($cartId, $carrierCode, $methodCode)
    {
        /** @var \Magento\Quote\Model\Quote $quote */
        $quote = $this->quoteRepository->getActive($cartId);
        try {
            $this->apply($cartId, $carrierCode, $methodCode);
        } catch (\Exception $e) {
            throw $e;
        }

        try {
            $this->quoteRepository->save($quote->collectTotals());
        } catch (\Exception $e) {
            throw new CouldNotSaveException(__('Cannot set shipping method. %1', $e->getMessage()));
        }
        return true;
    }

    /**
     * @param int $cartId The shopping cart ID.
     * @param string $carrierCode The carrier code.
     * @param string $methodCode The shipping method code.
     * @return void
     * @throws InputException The shipping method is not valid for an empty cart.
     * @throws CouldNotSaveException The shipping method could not be saved.
     * @throws NoSuchEntityException Cart contains only virtual products. Shipping method is not applicable.
     * @throws StateException The billing or shipping address is not set.
     */
    public function apply($cartId, $carrierCode, $methodCode)
    {
        /** @var \Magento\Quote\Model\Quote $quote */
        $quote = $this->quoteRepository->getActive($cartId);
        if (0 == $quote->getItemsCount()) {
            throw new InputException(__('Shipping method is not applicable for empty cart'));
        }
        if ($quote->isVirtual()) {
            throw new NoSuchEntityException(
                __('Cart contains virtual product(s) only. Shipping method is not applicable.')
            );
        }
        $shippingAddress = $quote->getShippingAddress();
        if (!$shippingAddress->getCountryId()) {
            throw new StateException(__('Shipping address is not set'));
        }
        $shippingAddress->setShippingMethod($carrierCode . '_' . $methodCode);
    }

    /**
     * {@inheritDoc}
     */
    public function estimateByAddress($cartId, \Magento\Quote\Api\Data\EstimateAddressInterface $address)
    {
        /** @var \Magento\Quote\Model\Quote $quote */
        $quote = $this->quoteRepository->getActive($cartId);

        // no methods applicable for empty carts or carts with virtual products
        if ($quote->isVirtual() || 0 == $quote->getItemsCount()) {
            return [];
        }

        return $this->getEstimatedRates(
            $quote,
            $address->getCountryId(),
            $address->getPostcode(),
            $address->getRegionId(),
            $address->getRegion()
        );
    }

    /**
     * @inheritdoc
     */
    public function estimateByExtendedAddress($cartId, AddressInterface $address)
    {
        /** @var \Magento\Quote\Model\Quote $quote */
        $quote = $this->quoteRepository->getActive($cartId);

        // no methods applicable for empty carts or carts with virtual products
        if ($quote->isVirtual() || 0 == $quote->getItemsCount()) {
            return [];
        }
        return $this->getShippingMethods($quote, $address->getData());
    }

    /**
     * {@inheritDoc}
     */
    public function estimateByAddressId($cartId, $addressId)
    {
        /** @var \Magento\Quote\Model\Quote $quote */
        $quote = $this->quoteRepository->getActive($cartId);

        // no methods applicable for empty carts or carts with virtual products
        if ($quote->isVirtual() || 0 == $quote->getItemsCount()) {
            return [];
        }
        $address = $this->addressRepository->getById($addressId);

        return $this->getEstimatedRates(
            $quote,
            $address->getCountryId(),
            $address->getPostcode(),
            $address->getRegionId(),
            $address->getRegion()
        );
    }

    /**
     * Get estimated rates
     *
     * @param Quote $quote
     * @param int $country
     * @param string $postcode
     * @param int $regionId
     * @param string $region
     * @return \Magento\Quote\Api\Data\ShippingMethodInterface[] An array of shipping methods.
     */
    protected function getEstimatedRates(\Magento\Quote\Model\Quote $quote, $country, $postcode, $regionId, $region)
    {
        $data = [
            EstimateAddressInterface::KEY_COUNTRY_ID => $country,
            EstimateAddressInterface::KEY_POSTCODE => $postcode,
            EstimateAddressInterface::KEY_REGION_ID => $regionId,
            EstimateAddressInterface::KEY_REGION => $region
        ];
        return $this->getShippingMethods($quote, $data);
    }

    /**
     * Get list of available shipping methods
     * @param \Magento\Quote\Model\Quote $quote
     * @param array $addressData
     * @return \Magento\Quote\Api\Data\ShippingMethodInterface[]
     */
    private function getShippingMethods(Quote $quote, array $addressData)
    {
        $output = [];
        $shippingAddress = $quote->getShippingAddress();
        $shippingAddress->addData($addressData);
        $shippingAddress->setCollectShippingRates(true);

        $this->totalsCollector->collectAddressTotals($quote, $shippingAddress);
        $shippingRates = $shippingAddress->getGroupedAllShippingRates();
        foreach ($shippingRates as $carrierRates) {
            foreach ($carrierRates as $rate) {
                $output[] = $this->converter->modelToDataObject($rate, $quote->getQuoteCurrencyCode());
            }
        }
        return $output;
    }
}


text:
<?php
/*
Template Name: Join DAMN Plus
*/
?>

<?php while (have_posts()) : the_post(); ?>

  <?php if ( has_post_thumbnail()) { ?>

      <?php the_post_thumbnail('large'); ?>

  <?php } ?>

      <?php get_template_part('templates/snippet-latest-cover'); ?>

      <article <?php post_class(''); ?>>

          <?php the_content(); ?>

          <?php if(get_field('profile_shortcode')) { ?>

                <?php the_field('profile_shortcode'); ?>

          <?php } ?>

<?php endwhile; ?>