text:
class CameraGoToPositionEffect : public EffectWithDuration {
private:
  const Geodetic3D _fromPosition;
  const Geodetic3D _toPosition;

  const Angle _fromHeading;
  const Angle _toHeading;

  const Angle _fromPitch;
  const Angle _toPitch;

  const bool       _linearHeight;
  double           _middleHeight;

  double calculateMaxHeight(const Planet* planet) {
    // curve parameters
    const double distanceInDegreesMaxHeight = 180;
    const double maxHeight = planet->getRadii().axisAverage() * 5;

    // rough estimation of distance using lat/lon degrees
    const double deltaLatInDeg = _fromPosition._latitude._degrees  - _toPosition._latitude._degrees;
    const double deltaLonInDeg = _fromPosition._longitude._degrees - _toPosition._longitude._degrees;
    const double distanceInDeg = IMathUtils::instance()->sqrt((deltaLatInDeg * deltaLatInDeg) +
                                                              (deltaLonInDeg * deltaLonInDeg));

    if (distanceInDeg >= distanceInDegreesMaxHeight) {
      return maxHeight;
    }

    const double middleHeight = (distanceInDeg / distanceInDegreesMaxHeight) * maxHeight;

    const double averageHeight = (_fromPosition._height + _toPosition._height) / 2;
    if (middleHeight < averageHeight) {
      const double delta = (averageHeight - middleHeight) / 2.0;
      return averageHeight + delta;
    }
    //    const double averageHeight = (_fromPosition._height + _toPosition._height) / 2;
    //    if (middleHeight < averageHeight) {
    //      return (averageHeight + middleHeight) / 2.0;
    //    }

    return middleHeight;
  }

public:

  CameraGoToPositionEffect(const TimeInterval& duration,
                           const Geodetic3D& fromPosition,
                           const Geodetic3D& toPosition,
                           const Angle& fromHeading,
                           const Angle& toHeading,
                           const Angle& fromPitch,
                           const Angle& toPitch,
                           const bool linearTiming,
                           const bool linearHeight):
  EffectWithDuration(duration, linearTiming),
  _fromPosition(fromPosition),
  _toPosition(toPosition),
  _fromHeading(fromHeading),
  _toHeading(toHeading),
  _fromPitch(fromPitch),
  _toPitch(toPitch),
  _linearHeight(linearHeight)
  {
  }

  void doStep(const G3MRenderContext* rc,
              const TimeInterval& when) {
    const double alpha = getAlpha(when);

    double height;
    if (_linearHeight) {
      height = IMathUtils::instance()->linearInterpolation(_fromPosition._height,
                                                           _toPosition._height,
                                                           alpha);
    }
    else {
      height = IMathUtils::instance()->quadraticBezierInterpolation(_fromPosition._height,
                                                                    _middleHeight,
                                                                    _toPosition._height,
                                                                    alpha);
    }

    Camera *camera = rc->getNextCamera();
    camera->setGeodeticPosition(Angle::linearInterpolation(_fromPosition._latitude,  _toPosition._latitude,  alpha),
                                Angle::linearInterpolation(_fromPosition._longitude, _toPosition._longitude, alpha),
                                height);

    const Angle heading = Angle::linearInterpolation(_fromHeading, _toHeading, alpha);
    camera->setHeading(heading);

    const Angle middlePitch = Angle::fromDegrees(-90);
    //    const Angle pitch =  (alpha < 0.5)
    //    ? Angle::linearInterpolation(_fromPitch, middlePitch, alpha*2)
    //    : Angle::linearInterpolation(middlePitch, _toPitch, (alpha-0.5)*2);

    if (alpha <= 0.1) {
      camera->setPitch( Angle::linearInterpolation(_fromPitch, middlePitch, alpha*10) );
    }
    else if (alpha >= 0.9) {
      camera->setPitch( Angle::linearInterpolation(middlePitch, _toPitch, (alpha-0.9)*10) );
    }
    else {
      camera->setPitch(middlePitch);
    }

  }

  void stop(const G3MRenderContext* rc,
            const TimeInterval& when) {
    Camera* camera = rc->getNextCamera();
    camera->setGeodeticPosition(_toPosition);
    camera->setPitch(_toPitch);
    camera->setHeading(_toHeading);
  }

  void cancel(const TimeInterval& when) {
    // do nothing, just leave the effect in the intermediate state
  }

  void start(const G3MRenderContext* rc,
             const TimeInterval& when) {
    EffectWithDuration::start(rc, when);

    _middleHeight = calculateMaxHeight(rc->getPlanet());
  }
};

#endif


text:
package net.machinemuse.numina.item

import net.machinemuse.numina.network.{MusePacketModeChangeRequest, PacketSender}
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.item.ItemStack
import net.minecraft.util.IIcon

/**
 * Author: MachineMuse (Claire Semple)
 * Created: 7:11 PM, 9/3/13
 */
trait ModeChangingItem {
  def setActiveMode(stack: ItemStack, newMode: String) = {
    NuminaItemUtils.getTagCompound(stack).setString("mode", newMode)
  }

  def getActiveMode(stack: ItemStack, player: EntityPlayer): String = {
    val modeFromNBT = NuminaItemUtils.getTagCompound(stack).getString("mode")
    if (!modeFromNBT.isEmpty) {
      modeFromNBT
    } else {
      val validModes = getValidModes(stack, player)
      if (validModes.nonEmpty) {
        validModes.head
      } else {
        ""
      }
    }
  }

  def cycleMode(stack: ItemStack, player: EntityPlayer, dMode: Int) {
    val modes = getValidModes(stack, player)
    if (modes.nonEmpty) {
      val newindex = clampMode(modes.indexOf(getActiveMode(stack, player)) + dMode, modes.size)
      val newmode = modes(newindex)
      setActiveMode(stack, newmode)
      PacketSender.sendToServer(new MusePacketModeChangeRequest(player,newmode, player.inventory.currentItem))
    }
  }

  def nextMode(stack: ItemStack, player: EntityPlayer) = {
    val modes = getValidModes(stack, player)
    if (modes.nonEmpty) {
      val newindex = clampMode(modes.indexOf(getActiveMode(stack, player)) + 1, modes.size)
      modes(newindex)
    } else {
      ""
    }
  }

  def prevMode(stack: ItemStack, player: EntityPlayer) = {
    val modes = getValidModes(stack, player)
    if (modes.nonEmpty) {
      val newindex = clampMode(modes.indexOf(getActiveMode(stack, player)) - 1, modes.size)
      modes(newindex)
    } else {
      ""
    }
  }

  private def clampMode(selection: Int, modesSize: Int): Int = {
    if (selection > 0) {
      selection % modesSize
    } else {
      (selection + modesSize * (-selection)) % modesSize
    }
  }

  def getModeIcon(mode: String, stack: ItemStack, player: EntityPlayer): Option[IIcon]

  def getValidModes(stack: ItemStack, player: EntityPlayer): Seq[String]

}

redpajama_set_name: RedPajamaGithub


text:
from pathlib import Path

import click

from .core import Config, Repo, Queue, Target, Job, CrossbowError
from .reports import EmailReport, ConsoleReport
from ..utils.source import ArrowSources

_default_arrow_path = ArrowSources.find().path
_default_queue_path = _default_arrow_path.parent / "crossbow"
_default_config_path = _default_arrow_path / "dev" / "tasks" / "tasks.yml"

@click.group()
@click.option('--github-token', '-t', default=None,
              envvar="CROSSBOW_GITHUB_TOKEN",
              help='OAuth token for GitHub authentication')
@click.option('--arrow-path', '-a',
              type=click.Path(), default=_default_arrow_path,
              help='Arrow\'s repository path. Defaults to the repository of '
                   'this script')
@click.option('--queue-path', '-q',
              type=click.Path(), default=_default_queue_path,
              help='The repository path used for scheduling the tasks. '
                   'Defaults to crossbow directory placed next to arrow')
@click.option('--queue-remote', '-qr', default=None,
              help='Force to use this remote URL for the Queue repository')
@click.option('--output-file', metavar='<output>',
              type=click.File('w', encoding='utf8'), default='-',
              help='Capture output result into file.')
@click.pass_context
def crossbow(ctx, github_token, arrow_path, queue_path, queue_remote,
             output_file):
    """
    Schedule packaging tasks or nightly builds on CI services.
    """
    ctx.ensure_object(dict)
    ctx.obj['output'] = output_file
    ctx.obj['arrow'] = Repo(arrow_path)
    ctx.obj['queue'] = Queue(queue_path, remote_url=queue_remote,
                             github_token=github_token, require_https=True)

@crossbow.command()
@click.option('--config-path', '-c',
              type=click.Path(exists=True), default=_default_config_path,
              help='Task configuration yml. Defaults to tasks.yml')
@click.pass_obj
def check_config(obj, config_path):
    # load available tasks configuration and groups from yaml
    config = Config.load_yaml(config_path)
    config.validate()

    output = obj['output']
    config.show(output)

@crossbow.command()
@click.argument('tasks', nargs=-1, required=False)
@click.option('--group', '-g', 'groups', multiple=True,
              help='Submit task groups as defined in task.yml')
@click.option('--param', '-p', 'params', multiple=True,
              help='Additional task parameters for rendering the CI templates')
@click.option('--job-prefix', default='build',
              help='Arbitrary prefix for branch names, e.g. nightly')
@click.option('--config-path', '-c',
              type=click.Path(exists=True), default=_default_config_path,
              help='Task configuration yml. Defaults to tasks.yml')
@click.option('--arrow-version', '-v', default=None,
              help='Set target version explicitly.')
@click.option('--arrow-remote', '-r', default=None,
              help='Set GitHub remote explicitly, which is going to be cloned '
                   'on the CI services. Note, that no validation happens '
                   'locally. Examples: https://github.com/apache/arrow or '
                   'https://github.com/kszucs/arrow.')
@click.option('--arrow-branch', '-b', default=None,
              help='Give the branch name explicitly, e.g. master, ARROW-1949.')
@click.option('--arrow-sha', '-t', default=None,
              help='Set commit SHA or Tag name explicitly, e.g. f67a515, '
                   'apache-arrow-0.11.1.')
@click.option('--fetch/--no-fetch', default=True,
              help='Fetch references (branches and tags) from the remote')
@click.option('--dry-run/--commit', default=False,
              help='Just display the rendered CI configurations without '
                   'committing them')
@click.option('--no-push/--push', default=False,
              help='Don\'t push the changes')
@click.pass_obj
def submit(obj, tasks, groups, params, job_prefix, config_path, arrow_version,
           arrow_remote, arrow_branch, arrow_sha, fetch, dry_run, no_push):
    output = obj['output']
    queue, arrow = obj['queue'], obj['arrow']

    # load available tasks configuration and groups from yaml
    config = Config.load_yaml(config_path)
    try:
        config.validate()
    except CrossbowError as e:
        raise click.ClickException(str(e))

    # Override the detected repo url / remote, branch and sha - this aims to
    # make release procedure a bit simpler.
    # Note, that the target resivion's crossbow templates must be
    # compatible with the locally checked out version of crossbow (which is
    # in case of the release procedure), because the templates still
    # contain some business logic (dependency installation, deployments)
    # which will be reduced to a single command in the future.
    target = Target.from_repo(arrow, remote=arrow_remote, branch=arrow_branch,
                              head=arrow_sha, version=arrow_version)

    # parse additional job parameters
    params = dict([p.split("=") for p in params])

    # instantiate the job object
    try:
        job = Job.from_config(config=config, target=target, tasks=tasks,
                              groups=groups, params=params)
    except CrossbowError as e:
        raise click.ClickException(str(e))

    job.show(output)
    if dry_run:
        return

    if fetch:
        queue.fetch()
    queue.put(job, prefix=job_prefix)

    if no_push:
        click.echo('Branches and commits created but not pushed: `{}`'
                   .format(job.branch))
    else:
        queue.push()
        click.echo('Pushed job identifier is: `{}`'.format(job.branch))

@crossbow.command()
@click.argument('task', required=True)
@click.option('--config-path', '-c',
              type=click.Path(exists=True), default=_default_config_path,
              help='Task configuration yml. Defaults to tasks.yml')
@click.option('--arrow-version', '-v', default=None,
              help='Set target version explicitly.')
@click.option('--arrow-remote', '-r', default=None,
              help='Set GitHub remote explicitly, which is going to be cloned '
                   'on the CI services. Note, that no validation happens '
                   'locally. Examples: https://github.com/apache/arrow or '
                   'https://github.com/kszucs/arrow.')
@click.option('--arrow-branch', '-b', default=None,
              help='Give the branch name explicitly, e.g. master, ARROW-1949.')
@click.option('--arrow-sha', '-t', default=None,
              help='Set commit SHA or Tag name explicitly, e.g. f67a515, '
                   'apache-arrow-0.11.1.')
@click.option('--param', '-p', 'params', multiple=True,
              help='Additional task parameters for rendering the CI templates')
@click.pass_obj
def render(obj, task, config_path, arrow_version, arrow_remote, arrow_branch,
           arrow_sha, params):
    """
    Utility command to check the rendered CI templates.
    """
    from .core import _flatten

    def highlight(code):
        try:
            from pygments import highlight
            from pygments.lexers import YamlLexer
            from pygments.formatters import TerminalFormatter
            return highlight(code, YamlLexer(), TerminalFormatter())
        except ImportError:
            return code

    arrow = obj['arrow']

    target = Target.from_repo(arrow, remote=arrow_remote, branch=arrow_branch,
                              head=arrow_sha, version=arrow_version)
    config = Config.load_yaml(config_path)
    params = dict([p.split("=") for p in params])
    params["queue_remote_url"] = "https://github.com/org/crossbow"
    job = Job.from_config(config=config, target=target, tasks=[task],
                          params=params)

    for task_name, rendered_files in job.render_tasks().items():
        for path, content in _flatten(rendered_files).items():
            click.echo('#' * 80)
            click.echo('### {:^72} ###'.format("/".join(path)))
            click.echo('#' * 80)
            click.echo(highlight(content))

@crossbow.command()
@click.argument('job-name', required=True)
@click.option('--fetch/--no-fetch', default=True,
              help='Fetch references (branches and tags) from the remote')
@click.pass_obj
def status(obj, job_name, fetch):
    output = obj['output']
    queue = obj['queue']
    if fetch:
        queue.fetch()
    job = queue.get(job_name)
    ConsoleReport(job).show(output)

@crossbow.command()
@click.argument('prefix', required=True)
@click.option('--fetch/--no-fetch', default=True,
              help='Fetch references (branches and tags) from the remote')
@click.pass_obj
def latest_prefix(obj, prefix, fetch):
    queue = obj['queue']
    if fetch:
        queue.fetch()
    latest = queue.latest_for_prefix(prefix)
    click.echo(latest.branch)

@crossbow.command()
@click.argument('job-name', required=True)
@click.option('--sender-name', '-n',
              help='Name to use for report e-mail.')
@click.option('--sender-email', '-e',
              help='E-mail to use for report e-mail.')
@click.option('--recipient-email', '-r',
              help='Where to send the e-mail report')
@click.option('--smtp-user', '-u',
              help='E-mail address to use for SMTP login')
@click.option('--smtp-password', '-P',
              help='SMTP password to use for report e-mail.')
@click.option('--smtp-server', '-s', default='smtp.gmail.com',
              help='SMTP server to use for report e-mail.')
@click.option('--smtp-port', '-p', default=465,
              help='SMTP port to use for report e-mail.')
@click.option('--poll/--no-poll', default=False,
              help='Wait for completion if there are tasks pending')
@click.option('--poll-max-minutes', default=180,
              help='Maximum amount of time waiting for job completion')
@click.option('--poll-interval-minutes', default=10,
              help='Number of minutes to wait to check job status again')
@click.option('--send/--dry-run', default=False,
              help='Just display the report, don\'t send it')
@click.option('--fetch/--no-fetch', default=True,
              help='Fetch references (branches and tags) from the remote')
@click.pass_obj
def report(obj, job_name, sender_name, sender_email, recipient_email,
           smtp_user, smtp_password, smtp_server, smtp_port, poll,
           poll_max_minutes, poll_interval_minutes, send, fetch):
    """
    Send an e-mail report showing success/failure of tasks in a Crossbow run
    """
    output = obj['output']
    queue = obj['queue']
    if fetch:
        queue.fetch()

    job = queue.get(job_name)
    report = EmailReport(
        job=job,
        sender_name=sender_name,
        sender_email=sender_email,
        recipient_email=recipient_email
    )

    if poll:
        job.wait_until_finished(
            poll_max_minutes=poll_max_minutes,
            poll_interval_minutes=poll_interval_minutes
        )

    if send:
        report.send(
            smtp_user=smtp_user,
            smtp_password=smtp_password,
            smtp_server=smtp_server,
            smtp_port=smtp_port
        )
    else:
        report.show(output)

@crossbow.command()
@click.argument('job-name', required=True)
@click.option('-t', '--target-dir',
              default=_default_arrow_path / 'packages',
              type=click.Path(file_okay=False, dir_okay=True),
              help='Directory to download the build artifacts')
@click.option('--dry-run/--execute', default=False,
              help='Just display process, don\'t download anything')
@click.option('--fetch/--no-fetch', default=True,
              help='Fetch references (branches and tags) from the remote')
@click.pass_obj
def download_artifacts(obj, job_name, target_dir, dry_run, fetch):
    """Download build artifacts from GitHub releases"""
    output = obj['output']

    # fetch the queue repository
    queue = obj['queue']
    if fetch:
        queue.fetch()

    # query the job's artifacts
    job = queue.get(job_name)

    # create directory to download the assets to
    target_dir = Path(target_dir).absolute() / job_name
    target_dir.mkdir(parents=True, exist_ok=True)

    # download the assets while showing the job status
    def asset_callback(task_name, task, asset):
        if asset is not None:
            path = target_dir / task_name / asset.name
            path.parent.mkdir(exist_ok=True)
            if not dry_run:
                asset.download(path)

    click.echo('Downloading {}\'s artifacts.'.format(job_name))
    click.echo('Destination directory is {}'.format(target_dir))
    click.echo()

    report = ConsoleReport(job)
    report.show(output, asset_callback=asset_callback)

@crossbow.command()
@click.argument('patterns', nargs=-1, required=True)
@click.option('--sha', required=True, help='Target committish')
@click.option('--tag', required=True, help='Target tag')
@click.option('--method', default='curl', help='Use cURL to upload')
@click.pass_obj
def upload_artifacts(obj, tag, sha, patterns, method):
    queue = obj['queue']
    queue.github_overwrite_release_assets(
        tag_name=tag, target_commitish=sha, method=method, patterns=patterns
    )


text:
namespace realm {
namespace _impl {

class ServerImplBase {
public:
    static constexpr int get_oldest_supported_protocol_version() noexcept;
};

constexpr int ServerImplBase::get_oldest_supported_protocol_version() noexcept
{
    // See sync::get_current_protocol_version() for information about the
    // individual protocol versions.
    return 2;
}

static_assert(ServerImplBase::get_oldest_supported_protocol_version() >= 1, "");
static_assert(ServerImplBase::get_oldest_supported_protocol_version() <= sync::get_current_protocol_version(), "");

} // namespace _impl
} // namespace realm

#endif // REALM_NOINST_SERVER_IMPL_BASE_HPP


text:
import sys
import radical.pilot as rp

#------------------------------------------------------------------------------
#
def pilot_state_cb (pilot, state) :
    """ this callback is invoked on all pilot state changes """

    print "[Callback]: ComputePilot '%s' state: %s." % (pilot.uid, state)

    if  state in [rp.FAILED, rp.DONE] :
        sys.exit (1)

#------------------------------------------------------------------------------
#
def unit_state_change_cb (unit, state) :
    """ this callback is invoked on all unit state changes """

    print "[Callback]: ComputeUnit  '%s' state: %s." % (unit.uid, state)

    if  state == rp.FAILED :
        print "                         '%s' stderr: %s." % (unit.uid, unit.stderr)
        print "                         '%s' stdout: %s." % (unit.uid, unit.stdout)
        sys.exit (1)

#------------------------------------------------------------------------------
#
# Create a new session. A session is the 'root' object for all other
# RADICAL-Pilot objects. It encapsulates the MongoDB connection(s) as
# well as security contexts.
session = rp.Session()

try:

    # Add an ssh identity to the session.
    c = rp.Context('ssh')
  # c.user_id = 'merzky'
    session.add_context(c)

    # Add a Pilot Manager. Pilot managers manage one or more ComputePilots.
    pmgr = rp.PilotManager(session=session)

    # Register our callback with the PilotManager. This callback will get
    # called every time any of the pilots managed by the PilotManager
    # change their state.
    pmgr.register_callback(pilot_state_cb)

    # Define a X-core that runs for N minutes.
    pdesc = rp.ComputePilotDescription()
    pdesc.resource = "nersc.edison"
    #pdesc.access_schema = "go"
    pdesc.runtime  = 10 # N minutes
    pdesc.cores    = 24 # X cores
    pdesc.queue    = "debug"

    # Launch the pilot.
    pilot = pmgr.submit_pilots(pdesc)

    cud_list = []

    pilot_globe = {
        'source':   'go://marksant#netbook/Users/mark/proj/radical.pilot/examples/helloworld_mpi.py',
        'target':   'go://nersc#edison/scratch2/scratchdirs/marksant/go/',
        #'target':   'staging:///go/',
        'action':   rp.TRANSFER
    }
    pilot.stage_in(pilot_globe)

    unit_globe = {
        'source':   '/scratch2/scratchdirs/marksant/go/helloworld_mpi.py',
        #'source':   'staging:///go/helloworld_mpi.py',
        'action':   rp.LINK,
    }

    for unit_count in range(0, 1):

        mpi_test_task = rp.ComputeUnitDescription()

        mpi_test_task.pre_exec      = [
            "module load python",
            "module load mpi4py"
        ]
        mpi_test_task.input_staging = [unit_globe]
        mpi_test_task.executable    = "python-mpi"
        mpi_test_task.arguments     = ["helloworld_mpi.py"]
        mpi_test_task.mpi           = True
        mpi_test_task.cores         = 24

        cud_list.append(mpi_test_task)

    # Combine the ComputePilot, the ComputeUnits and a scheduler via
    # a UnitManager object.
    umgr = rp.UnitManager(session, scheduler=rp.SCHED_DIRECT)

    # Register our callback with the UnitManager. This callback will get
    # called every time any of the units managed by the UnitManager
    # change their state.
    umgr.register_callback(unit_state_change_cb)

    # Add the previously created ComputePilot to the UnitManager.
    umgr.add_pilots(pilot)

    # Submit the previously created ComputeUnit descriptions to the
    # PilotManager. This will trigger the selected scheduler to start
    # assigning ComputeUnits to the ComputePilots.
    units = umgr.submit_units(cud_list)

    # Wait for all compute units to reach a terminal state (DONE or FAILED).
    umgr.wait_units()

    if not isinstance(units, list):
        units = [units]

    for unit in units:
        print "* Task %s - state: %s, exit code: %s, started: %s, finished: %s, stdout: %s" \
            % (unit.uid, unit.state, unit.exit_code, unit.start_time, unit.stop_time, unit.stdout)

        assert (unit.state == rp.DONE)

except Exception as e:
    print "TEST FAILED"
    raise

finally:
    # Remove session from database
    session.close()


text:
module.exports = {
  schemaTag: 'current',
  generateClientInfo: ({ request }) => {
    if (!request || !request.http) return {};
    const clientName = request.http.headers.get('client-name');
    const clientVersion = request.http.headers.get('client-version');
    return { clientName, clientVersion };
  },
};


text:
class IFTTTPrivate;

class IFTTT : public QObject
{
    Q_OBJECT
    Q_DECLARE_PRIVATE(IFTTT)
    Q_DISABLE_COPY(IFTTT)

public:
    explicit IFTTT(QObject* parent = nullptr);
    virtual ~IFTTT();

    void setSecretKey(const QString& key);
    QString secretKey() const;

public slots:
    void trigger(const QString& eventName,
                 const QString& value1 = QString(),
                 const QString& value2 = QString(),
                 const QString& value3 = QString());

private:
    IFTTTPrivate* d_ptr;
};

#endif // IFTTT_H


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
   xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
   version="2.5">

  <servlet>
    <servlet-name>nerdf</servlet-name>
    <servlet-class>com.kasabi.labs.nerdf.NERDFServlet</servlet-class>
    <init-param>
      <param-name>tdb.location</param-name>
      <param-value>data.tsv.gz,/tmp/nerdf/target/tdb,http://api.kasabi.com/dataset/italy/apis/sparql,http://api.kasabi.com/dataset/nasa/apis/sparql</param-value>
      <!--
           You can point to a TDB location: /tmp/nerdf/target/tdb
           Or, to a SPARQL endpoint: http://api.kasabi.com/dataset/italy/apis/sparql
      -->
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>nerdf</servlet-name>
    <url-pattern>*.html</url-pattern>
  </servlet-mapping>

</web-app>


text:
'use strict';

import React, { Component } from 'react-native';
import { createStore, applyMiddleware, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import thunk from 'redux-thunk';

import * as reducers from '../reducers';
import AppContainer from './AppContainer';

const reducer = combineReducers(reducers);
const store = createStore(
    reducer,
    applyMiddleware(thunk)
)

export default class App extends Component {

    render() {
        return (
        <Provider store={store}>
             <AppContainer/>
        </Provider>
      );
    }
}


text:
#pragma once

#include <cmath>
#include <limits>
#include "Yoga-internal.h"

struct YGFloatOptional {
private:
  float value_ = std::numeric_limits<float>::quiet_NaN();

public:
  explicit constexpr YGFloatOptional(float value) : value_(value) {}
  constexpr YGFloatOptional() = default;

  // returns the wrapped value, or a value x with YGIsUndefined(x) == true
  constexpr float unwrap() const { return value_; }

  bool isUndefined() const { return std::isnan(value_); }
};

// operators take YGFloatOptional by value, as it is a 32bit value

inline bool operator==(YGFloatOptional lhs, YGFloatOptional rhs) {
  return lhs.unwrap() == rhs.unwrap() ||
      (lhs.isUndefined() && rhs.isUndefined());
}
inline bool operator!=(YGFloatOptional lhs, YGFloatOptional rhs) {
  return !(lhs == rhs);
}

inline bool operator==(YGFloatOptional lhs, float rhs) {
  return lhs == YGFloatOptional{rhs};
}
inline bool operator!=(YGFloatOptional lhs, float rhs) {
  return !(lhs == rhs);
}

inline bool operator==(float lhs, YGFloatOptional rhs) {
  return rhs == lhs;
}
inline bool operator!=(float lhs, YGFloatOptional rhs) {
  return !(lhs == rhs);
}

inline YGFloatOptional operator+(YGFloatOptional lhs, YGFloatOptional rhs) {
  return YGFloatOptional{lhs.unwrap() + rhs.unwrap()};
}

inline bool operator>(YGFloatOptional lhs, YGFloatOptional rhs) {
  return lhs.unwrap() > rhs.unwrap();
}

inline bool operator<(YGFloatOptional lhs, YGFloatOptional rhs) {
  return lhs.unwrap() < rhs.unwrap();
}

inline bool operator>=(YGFloatOptional lhs, YGFloatOptional rhs) {
  return lhs > rhs || lhs == rhs;
}

inline bool operator<=(YGFloatOptional lhs, YGFloatOptional rhs) {
  return lhs < rhs || lhs == rhs;
}


text:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Secure {

	var $CI;

	public function __construct(){
        //parent::__construct();

        $this->CI =& get_instance();

        $this->phpver =  phpversion();

        //$this->college_reg_no = $this->CI->config->item('college_reg_number');
        //$this->student_status = $this->CI->config->item('student_status');

        //$this->_KISS_DB = $this->CI->load->database('kiss', TRUE);
        //$this->_KISS_DB->save_queries = FALSE;
    }

    public function isLogged(){
        if($this->CI->session->userdata('isExist') && $this->CI->session->userdata('isLogged')){
            return TRUE;
        }else{
            return FALSE;
        }
    }

    public function isEmailNull(){
        if($this->CI->session->userdata('emailAddress') == null){
            return TRUE;
        }else{
            return FALSE;
        }
    }

    public function getSex(){
        if($this->CI->session->userdata('sex') == 'MALE'){
            return "Mr. ";
        }else{
            return "Ms. ";
        }
    }

    public function getAge(){

    }

    public function getCampus(){

    }

    public function getCourseCode(){

    }
}


text:
<input type="button" value="Configure Widget" onclick="openConfigure<?php print $instance['token'] ?>();" class="simpleSetupButton button-primary">

<input type="button" value="Refresh Settings" class="simpleSetupButton button" id="refreshButton<?php print $instance['token'] ?>" onclick="refreshWidget<?php print $instance['token'] ?>();">

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


text:
ACCEPTED

#### According to
Euro+Med Plantbase

#### Published in
null

#### Original name
Hieracium epiphaeum Sudre

### Remarks
null


text:
.. _man-strings:

*********
 Strings
*********

Strings are finite sequences of characters. Of course, the real trouble
comes when one asks what a character is. The characters that English
speakers are familiar with are the letters ``A``, ``B``, ``C``, etc.,
together with numerals and common punctuation symbols. These characters
are standardized together with a mapping to integer values between 0 and
127 by the `ASCII <http://en.wikipedia.org/wiki/ASCII>`_ standard. There
are, of course, many other characters used in non-English languages,
including variants of the ASCII characters with accents and other
modifications, related scripts such as Cyrillic and Greek, and scripts
completely unrelated to ASCII and English, including Arabic, Chinese,
Hebrew, Hindi, Japanese, and Korean. The
`Unicode <http://en.wikipedia.org/wiki/Unicode>`_ standard tackles the
complexities of what exactly a character is, and is generally accepted
as the definitive standard addressing this problem. Depending on your
needs, you can either ignore these complexities entirely and just
pretend that only ASCII characters exist, or you can write code that can
handle any of the characters or encodings that one may encounter when
handling non-ASCII text. Julia makes dealing with plain ASCII text
simple and efficient, and handling Unicode is as simple and efficient as
possible. In particular, you can write C-style string code to process
ASCII strings, and they will work as expected, both in terms of
performance and semantics. If such code encounters non-ASCII text, it
will gracefully fail with a clear error message, rather than silently
introducing corrupt results. When this happens, modifying the code to
handle non-ASCII data is straightforward.

There are a few noteworthy high-level features about Julia's strings:

-  ``String`` is an abstraction, not a concrete type — many different
   representations can implement the ``String`` interface, but they can
   easily be used together and interact transparently. Any string type
   can be used in any function expecting a ``String``.
-  Like C and Java, but unlike most dynamic languages, Julia has a
   first-class type representing a single character, called ``Char``.
   This is just a special kind of 32-bit integer whose numeric value
   represents a Unicode code point.
-  As in Java, strings are immutable: the value of a ``String`` object
   cannot be changed. To construct a different string value, you
   construct a new string from parts of other strings.
-  Conceptually, a string is a *partial function* from indices to
   characters — for some index values, no character value is returned,
   and instead an exception is thrown. This allows for efficient
   indexing into strings by the byte index of an encoded representation
   rather than by a character index, which cannot be implemented both
   efficiently and simply for variable-width encodings of Unicode
   strings.
-  Julia supports the full range of
   `Unicode <http://en.wikipedia.org/wiki/Unicode>`_ characters: literal
   strings are always `ASCII <http://en.wikipedia.org/wiki/ASCII>`_ or
   `UTF-8 <http://en.wikipedia.org/wiki/UTF-8>`_ but other encodings for
   strings from external sources can be supported.

.. _man-characters:

Characters
----------

A ``Char`` value represents a single character: it is just a 32-bit
integer with a special literal representation and appropriate arithmetic
behaviors, whose numeric value is interpreted as a `Unicode code
point <http://en.wikipedia.org/wiki/Code_point>`_. Here is how ``Char``
values are input and shown:

.. doctest::

    julia> 'x'
    'x'

    julia> typeof(ans)
    Char

You can convert a ``Char`` to its integer value, i.e. code point,
easily:

.. doctest::

    julia> int('x')
    120

    julia> typeof(ans)
    Int64

On 32-bit architectures, ``typeof(ans)`` will be ``Int32``. You can
convert an integer value back to a ``Char`` just as easily:

.. doctest::

    julia> char(120)
    'x'

Not all integer values are valid Unicode code points, but for
performance, the ``char`` conversion does not check that every character
value is valid. If you want to check that each converted value is a
valid code point, use the ``is_valid_char`` function:

.. doctest::

    julia> char(0x110000)
    '\U110000'

    julia> is_valid_char(0x110000)
    false

As of this writing, the valid Unicode code points are ``U+00`` through
``U+d7ff`` and ``U+e000`` through ``U+10ffff``. These have not all been
assigned intelligible meanings yet, nor are they necessarily
interpretable by applications, but all of these values are considered to
be valid Unicode characters.

You can input any Unicode character in single quotes using ``\u``
followed by up to four hexadecimal digits or ``\U`` followed by up to
eight hexadecimal digits (the longest valid value only requires six):

.. doctest::

    julia> '\u0'
    '\0'

    julia> '\u78'
    'x'

    julia> '\u2200'
    '∀'

    julia> '\U10ffff'
    '\U10ffff'

Julia uses your system's locale and language settings to determine which
characters can be printed as-is and which must be output using the
generic, escaped ``\u`` or ``\U`` input forms. In addition to these
Unicode escape forms, all of `C's traditional escaped input
forms <http://en.wikipedia.org/wiki/C_syntax#Backslash_escapes>`_ can
also be used:

.. doctest::

    julia> int('\0')
    0

    julia> int('\t')
    9

    julia> int('\n')
    10

    julia> int('\e')
    27

    julia> int('\x7f')
    127

    julia> int('\177')
    127

    julia> int('\xff')
    255

You can do comparisons and a limited amount of arithmetic with
``Char`` values:

.. doctest::

    julia> 'A' < 'a'
    true

    julia> 'A' <= 'a' <= 'Z'
    false

    julia> 'A' <= 'X' <= 'Z'
    true

    julia> 'x' - 'a'
    23

    julia> 'A' + 1
    'B'

String Basics
-------------

String literals are delimited by double quotes or triple double quotes:

.. doctest::

    julia> str = "Hello, world.\n"
    "Hello, world.\n"

    julia> """Contains "quote" characters"""
    "Contains \"quote\" characters"

If you want to extract a character from a string, you index into it:

.. doctest::

    julia> str[1]
    'H'

    julia> str[6]
    ','

    julia> str[end]
    '\n'

All indexing in Julia is 1-based: the first element of any
integer-indexed object is found at index 1, and the last
element is found at index ``n``, when the string has
a length of ``n``.

In any indexing expression, the keyword ``end`` can be used as a
shorthand for the last index (computed by ``endof(str)``).
You can perform arithmetic and other operations with ``end``, just like
a normal value:

.. doctest::

    julia> str[end-1]
    '.'

    julia> str[end/2]
    ' '

    julia> str[end/3]
    ERROR: InexactError()
     in getindex at string.jl:59

    julia> str[end/4]
    ERROR: InexactError()
     in getindex at string.jl:59

Using an index less than 1 or greater than ``end`` raises an error:

.. doctest::

    julia> str[0]
    ERROR: BoundsError()
     in getindex at /Users/sabae/src/julia/usr/lib/julia/sys.dylib (repeats 2 times)

    julia> str[end+1]
    ERROR: BoundsError()
     in getindex at /Users/sabae/src/julia/usr/lib/julia/sys.dylib (repeats 2 times)

You can also extract a substring using range indexing:

.. doctest::

    julia> str[4:9]
    "lo, wo"

Notice that the expressions ``str[k]`` and ``str[k:k]`` do not give the same result:

.. doctest::

    julia> str[6]
    ','

    julia> str[6:6]
    ","

The former is a single character value of type ``Char``, while the
latter is a string value that happens to contain only a single
character. In Julia these are very different things.

Unicode and UTF-8
-----------------

Julia fully supports Unicode characters and strings. As `discussed
above <#characters>`_, in character literals, Unicode code points can be
represented using Unicode ``\u`` and ``\U`` escape sequences, as well as
all the standard C escape sequences. These can likewise be used to write
string literals:

.. doctest::

    julia> s = "\u2200 x \u2203 y"
    "∀ x ∃ y"

Whether these Unicode characters are displayed as escapes or shown as
special characters depends on your terminal's locale settings and its
support for Unicode. Non-ASCII string literals are encoded using the
UTF-8 encoding. UTF-8 is a variable-width encoding, meaning that not all
characters are encoded in the same number of bytes. In UTF-8, ASCII
characters — i.e. those with code points less than 0x80 (128) — are
encoded as they are in ASCII, using a single byte, while code points
0x80 and above are encoded using multiple bytes — up to four per
character. This means that not every byte index into a UTF-8 string is
necessarily a valid index for a character. If you index into a string at
such an invalid byte index, an error is thrown:

.. doctest::

    julia> s[1]
    '∀'

    julia> s[2]
    ERROR: invalid UTF-8 character index
     in next at ./utf8.jl:68
     in getindex at string.jl:57

    julia> s[3]
    ERROR: invalid UTF-8 character index
     in next at ./utf8.jl:68
     in getindex at string.jl:57

    julia> s[4]
    ' '

In this case, the character ``∀`` is a three-byte character, so the
indices 2 and 3 are invalid and the next character's index is 4.

Because of variable-length encodings, the number of characters in a
string (given by ``length(s)``) is not always the same as the last index.
If you iterate through the indices 1 through ``endof(s)`` and index
into ``s``, the sequence of characters returned when errors aren't
thrown is the sequence of characters comprising the string ``s``.
Thus we have the identity that ``length(s) <= endof(s)``, since each
character in a string must have its own index. The following is an
inefficient and verbose way to iterate through the characters of ``s``:

.. doctest::

    julia> for i = 1:endof(s)
             try
               println(s[i])
             catch
               # ignore the index error
             end
           end
    ∀
    <BLANKLINE>
    x
    <BLANKLINE>
    ∃
    <BLANKLINE>
    y

The blank lines actually have spaces on them. Fortunately, the above
awkward idiom is unnecessary for iterating through the characters in a
string, since you can just use the string as an iterable object, no
exception handling required:

.. doctest::

    julia> for c in s
             println(c)
           end
    ∀
    <BLANKLINE>
    x
    <BLANKLINE>
    ∃
    <BLANKLINE>
    y

UTF-8 is not the only encoding that Julia supports, and adding support
for new encodings is quite easy.  In particular, Julia also provides
``UTF16String`` and ``UTF32String`` types, constructed by the
``utf16(s)`` and ``utf32(s)`` functions respectively, for UTF-16 and
UTF-32 encodings.  It also provides aliases ``WString`` and
``wstring(s)`` for either UTF-16 or UTF-32 strings, depending on the
size of ``Cwchar_t``. Additional discussion of other encodings and how to
implement support for them is beyond the scope of this document for
the time being. For further discussion of UTF-8 encoding issues, see
the section below on `byte array literals <#Byte+Array+Literals>`_,
which goes into some greater detail.

.. _man-string-interpolation:

Interpolation
-------------

One of the most common and useful string operations is concatenation:

.. doctest::

    julia> greet = "Hello"
    "Hello"

    julia> whom = "world"
    "world"

    julia> string(greet, ", ", whom, ".\n")
    "Hello, world.\n"

Constructing strings like this can become a bit cumbersome, however. To
reduce the need for these verbose calls to ``string``, Julia allows
interpolation into string literals using ``$``, as in Perl:

.. doctest::

    julia> "$greet, $whom.\n"
    "Hello, world.\n"

This is more readable and convenient and equivalent to the above string
concatenation — the system rewrites this apparent single string literal
into a concatenation of string literals with variables.

The shortest complete expression after the ``$`` is taken as the
expression whose value is to be interpolated into the string. Thus, you
can interpolate any expression into a string using parentheses:

.. doctest::

    julia> "1 + 2 = $(1 + 2)"
    "1 + 2 = 3"

Both concatenation and string interpolation call the generic ``string``
function to convert objects into ``String`` form. Most non-``String``
objects are converted to strings as they are shown in interactive
sessions:

.. doctest::

    julia> v = [1,2,3]
    3-element Array{Int64,1}:
     1
     2
     3

    julia> "v: $v"
    "v: [1,2,3]"

The ``string`` function is the identity for ``String`` and ``Char``
values, so these are interpolated into strings as themselves, unquoted
and unescaped:

.. doctest::

    julia> c = 'x'
    'x'

    julia> "hi, $c"
    "hi, x"

To include a literal ``$`` in a string literal, escape it with a
backslash:

.. doctest::

    julia> print("I have \$100 in my account.\n")
    I have $100 in my account.

Common Operations
-----------------

You can lexicographically compare strings using the standard comparison
operators:

.. doctest::

    julia> "abracadabra" < "xylophone"
    true

    julia> "abracadabra" == "xylophone"
    false

    julia> "Hello, world." != "Goodbye, world."
    true

    julia> "1 + 2 = 3" == "1 + 2 = $(1 + 2)"
    true

You can search for the index of a particular character using the
``search`` function:

.. doctest::

    julia> search("xylophone", 'x')
    1

    julia> search("xylophone", 'p')
    5

    julia> search("xylophone", 'z')
    0

You can start the search for a character at a given offset by providing
a third argument:

.. doctest::

    julia> search("xylophone", 'o')
    4

    julia> search("xylophone", 'o', 5)
    7

    julia> search("xylophone", 'o', 8)
    0

Another handy string function is ``repeat``:

.. doctest::

    julia> repeat(".:Z:.", 10)
    ".:Z:..:Z:..:Z:..:Z:..:Z:..:Z:..:Z:..:Z:..:Z:..:Z:."

Some other useful functions include:

-  ``endof(str)`` gives the maximal (byte) index that can be used to
   index into ``str``.
-  ``length(str)`` the number of characters in ``str``.
-  ``i = start(str)`` gives the first valid index at which a character
   can be found in ``str`` (typically 1).
-  ``c, j = next(str,i)`` returns next character at or after the index
   ``i`` and the next valid character index following that. With
   ``start`` and ``endof``, can be used to iterate through the
   characters in ``str``.
-  ``ind2chr(str,i)`` gives the number of characters in ``str`` up to
   and including any at index ``i``.
-  ``chr2ind(str,j)`` gives the index at which the ``j``\ th character
   in ``str`` occurs.

.. _man-non-standard-string-literals:

Non-Standard String Literals
----------------------------

There are situations when you want to construct a string or use string
semantics, but the behavior of the standard string construct is not
quite what is needed. For these kinds of situations, Julia provides
:ref:`non-standard string literals <man-non-standard-string-literals2>`.
A non-standard string literal looks like
a regular double-quoted string literal, but is immediately prefixed by
an identifier, and doesn't behave quite like a normal string literal. Regular
expressions, byte array literals and version number literals, as described
below, are some examples of non-standard string literals. Other examples are
given in the :ref:`metaprogramming <man-non-standard-string-literals2>`
section.

Regular Expressions
-------------------

Julia has Perl-compatible regular expressions (regexes), as provided by
the `PCRE <http://www.pcre.org/>`_ library. Regular expressions are
related to strings in two ways: the obvious connection is that regular
expressions are used to find regular patterns in strings; the other
connection is that regular expressions are themselves input as strings,
which are parsed into a state machine that can be used to efficiently
search for patterns in strings. In Julia, regular expressions are input
using non-standard string literals prefixed with various identifiers
beginning with ``r``. The most basic regular expression literal without
any options turned on just uses ``r"..."``:

.. doctest::

    julia> r"^\s*(?:#|$)"
    r"^\s*(?:#|$)"

    julia> typeof(ans)
    Regex (constructor with 3 methods)

To check if a regex matches a string, use the ``ismatch`` function:

.. doctest::

    julia> ismatch(r"^\s*(?:#|$)", "not a comment")
    false

    julia> ismatch(r"^\s*(?:#|$)", "# a comment")
    true

As one can see here, ``ismatch`` simply returns true or false,
indicating whether the given regex matches the string or not. Commonly,
however, one wants to know not just whether a string matched, but also
*how* it matched. To capture this information about a match, use the
``match`` function instead:

.. doctest::

    julia> match(r"^\s*(?:#|$)", "not a comment")

    julia> match(r"^\s*(?:#|$)", "# a comment")
    RegexMatch("#")

If the regular expression does not match the given string, ``match``
returns ``nothing`` — a special value that does not print anything at
the interactive prompt. Other than not printing, it is a completely
normal value and you can test for it programmatically::

    m = match(r"^\s*(?:#|$)", line)
    if m == nothing
      println("not a comment")
    else
      println("blank or comment")
    end

If a regular expression does match, the value returned by ``match`` is a
``RegexMatch`` object. These objects record how the expression matches,
including the substring that the pattern matches and any captured
substrings, if there are any. This example only captures the portion of
the substring that matches, but perhaps we want to capture any non-blank
text after the comment character. We could do the following:

.. doctest::

    julia> m = match(r"^\s*(?:#\s*(.*?)\s*$|$)", "# a comment ")
    RegexMatch("# a comment ", 1="a comment")

When calling ``match``, you have the option to specify an index at
which to start the search. For example:

.. doctest::

   julia> m = match(r"[0-9]","aaaa1aaaa2aaaa3",1)
   RegexMatch("1")

   julia> m = match(r"[0-9]","aaaa1aaaa2aaaa3",6)
   RegexMatch("2")

   julia> m = match(r"[0-9]","aaaa1aaaa2aaaa3",11)
   RegexMatch("3")

You can extract the following info from a ``RegexMatch`` object:

-  the entire substring matched: ``m.match``
-  the captured substrings as a tuple of strings: ``m.captures``
-  the offset at which the whole match begins: ``m.offset``
-  the offsets of the captured substrings as a vector: ``m.offsets``

For when a capture doesn't match, instead of a substring, ``m.captures``
contains ``nothing`` in that position, and ``m.offsets`` has a zero
offset (recall that indices in Julia are 1-based, so a zero offset into
a string is invalid). Here's is a pair of somewhat contrived examples::

    julia> m = match(r"(a|b)(c)?(d)", "acd")
    RegexMatch("acd", 1="a", 2="c", 3="d")

    julia> m.match
    "acd"

    julia> m.captures
    3-element Array{Union(SubString{UTF8String},Nothing),1}:
     "a"
     "c"
     "d"

    julia> m.offset
    1

    julia> m.offsets
    3-element Array{Int64,1}:
     1
     2
     3

    julia> m = match(r"(a|b)(c)?(d)", "ad")
    RegexMatch("ad", 1="a", 2=nothing, 3="d")

    julia> m.match
    "ad"

    julia> m.captures
    3-element Array{Union(SubString{UTF8String},Nothing),1}:
     "a"
     nothing
     "d"

    julia> m.offset
    1

    julia> m.offsets
    3-element Array{Int64,1}:
     1
     0
     2

It is convenient to have captures returned as a tuple so that one can
use tuple destructuring syntax to bind them to local variables::

    julia> first, second, third = m.captures; first
    "a"

You can modify the behavior of regular expressions by some combination
of the flags ``i``, ``m``, ``s``, and ``x`` after the closing double
quote mark. These flags have the same meaning as they do in Perl, as
explained in this excerpt from the `perlre
manpage <http://perldoc.perl.org/perlre.html#Modifiers>`_::

    i   Do case-insensitive pattern matching.

        If locale matching rules are in effect, the case map is taken
        from the current locale for code points less than 255, and
        from Unicode rules for larger code points. However, matches
        that would cross the Unicode rules/non-Unicode rules boundary
        (ords 255/256) will not succeed.

    m   Treat string as multiple lines.  That is, change "^" and "$"
        from matching the start or end of the string to matching the
        start or end of any line anywhere within the string.

    s   Treat string as single line.  That is, change "." to match any
        character whatsoever, even a newline, which normally it would
        not match.

        Used together, as r""ms, they let the "." match any character
        whatsoever, while still allowing "^" and "$" to match,
        respectively, just after and just before newlines within the
        string.

    x   Tells the regular expression parser to ignore most whitespace
        that is neither backslashed nor within a character class. You
        can use this to break up your regular expression into
        (slightly) more readable parts. The '#' character is also
        treated as a metacharacter introducing a comment, just as in
        ordinary code.

For example, the following regex has all three flags turned on:

.. doctest::

    julia> r"a+.*b+.*?d$"ism
    r"a+.*b+.*?d$"ims

    julia> match(r"a+.*b+.*?d$"ism, "Goodbye,\nOh, angry,\nBad world\n")
    RegexMatch("angry,\nBad world")

Triple-quoted regex strings, of the form ``r"""..."""``, are also
supported (and may be convenient for regular expressions containing
quotation marks or newlines).

Byte Array Literals
-------------------

Another useful non-standard string literal is the byte-array string
literal: ``b"..."``. This form lets you use string notation to express
literal byte arrays — i.e. arrays of ``Uint8`` values. The convention is
that non-standard literals with uppercase prefixes produce actual string
objects, while those with lowercase prefixes produce non-string objects
like byte arrays or compiled regular expressions. The rules for byte
array literals are the following:

-  ASCII characters and ASCII escapes produce a single byte.
-  ``\x`` and octal escape sequences produce the *byte* corresponding to
   the escape value.
-  Unicode escape sequences produce a sequence of bytes encoding that
   code point in UTF-8.

There is some overlap between these rules since the behavior of ``\x``
and octal escapes less than 0x80 (128) are covered by both of the first
two rules, but here these rules agree. Together, these rules allow one
to easily use ASCII characters, arbitrary byte values, and UTF-8
sequences to produce arrays of bytes. Here is an example using all
three:

.. doctest::

    julia> b"DATA\xff\u2200"
    8-element Array{Uint8,1}:
     0x44
     0x41
     0x54
     0x41
     0xff
     0xe2
     0x88
     0x80

The ASCII string "DATA" corresponds to the bytes 68, 65, 84, 65.
``\xff`` produces the single byte 255. The Unicode escape ``\u2200`` is
encoded in UTF-8 as the three bytes 226, 136, 128. Note that the
resulting byte array does not correspond to a valid UTF-8 string — if
you try to use this as a regular string literal, you will get a syntax
error:

.. doctest::

    julia> "DATA\xff\u2200"
    ERROR: syntax: invalid UTF-8 sequence

Also observe the significant distinction between ``\xff`` and ``\uff``:
the former escape sequence encodes the *byte 255*, whereas the latter
escape sequence represents the *code point 255*, which is encoded as two
bytes in UTF-8:

.. doctest::

    julia> b"\xff"
    1-element Array{Uint8,1}:
     0xff

    julia> b"\uff"
    2-element Array{Uint8,1}:
     0xc3
     0xbf

In character literals, this distinction is glossed over and ``\xff`` is
allowed to represent the code point 255, because characters *always*
represent code points. In strings, however, ``\x`` escapes always
represent bytes, not code points, whereas ``\u`` and ``\U`` escapes
always represent code points, which are encoded in one or more bytes.
For code points less than ``\u80``, it happens that the UTF-8
encoding of each code point is just the single byte produced by the
corresponding ``\x`` escape, so the distinction can safely be ignored.
For the escapes ``\x80`` through ``\xff`` as compared to ``\u80``
through ``\uff``, however, there is a major difference: the former
escapes all encode single bytes, which — unless followed by very
specific continuation bytes — do not form valid UTF-8 data, whereas the
latter escapes all represent Unicode code points with two-byte
encodings.

If this is all extremely confusing, try reading `"The Absolute Minimum
Every Software Developer Absolutely, Positively Must Know About Unicode
and Character
Sets" <http://www.joelonsoftware.com/articles/Unicode.html>`_. It's an
excellent introduction to Unicode and UTF-8, and may help alleviate some
confusion regarding the matter.

.. _man-version-number-literals:

Version Number Literals
-----------------------

Version numbers can easily be expressed with non-standard string literals of
the form ``v"..."``. Version number literals create ``VersionNumber`` objects
which follow the specifications of `semantic versioning <http://semver.org>`_,
and therefore are composed of major, minor and patch numeric values, followed
by pre-release and build alpha-numeric annotations. For example,
``v"0.2.1-rc1+win64"`` is broken into major version ``0``, minor version ``2``,
patch version ``1``, pre-release ``rc1`` and build ``win64``. When entering a
version literal, everything except the major version number is optional,
therefore e.g.  ``v"0.2"`` is equivalent to ``v"0.2.0"`` (with empty
pre-release/build annotations), ``v"2"`` is equivalent to ``v"2.0.0"``, and so
on.

``VersionNumber`` objects are mostly useful to easily and correctly compare two
(or more) versions. For example, the constant ``VERSION`` holds Julia version
number as a ``VersionNumber`` object, and therefore one can define some
version-specific behaviour using simple statements as::

    if v"0.2" <= VERSION < v"0.3-"
        # do something specific to 0.2 release series
    end

Note that in the above example the non-standard version number ``v"0.3-"`` is
used, with a trailing ``-``: this notation is a Julia extension of the
standard, and it's used to indicate a version which is lower than any ``0.3``
release, including all of its pre-releases. So in the above example the code
would only run with stable ``0.2`` versions, and exclude such versions as
``v"0.3.0-rc1"``. In order to also allow for unstable (i.e. pre-release)
``0.2`` versions, the lower bound check should be modified like this: ``v"0.2-"
<= VERSION``.

Another non-standard version specification extension allows to use a trailing
``+`` to express an upper limit on build versions, e.g.  ``VERSION >
"v"0.2-rc1+"`` can be used to mean any version above ``0.2-rc1`` and any of its
builds: it will return ``false`` for version ``v"0.2-rc1+win64"`` and ``true``
for ``v"0.2-rc2"``.

It is good practice to use such special versions in comparisons (particularly,
the trailing ``-`` should always be used on upper bounds unless there's a good
reason not to), but they must not be used as the actual version number of
anything, as they are illegal in the semantic versioning scheme.

Besides being used for the ``VERSION`` constant, ``VersionNumber`` objects are
widely used in the ``Pkg`` module, to specify packages versions and their
dependencies.


text:
<?php declare(strict_types=1);

namespace Altair\Sanitation\Filter;

class AlphaNumFilter extends AbstractFilter
{
    public function parse($value)
    {
        return preg_replace('/[^\p{L}\p{Nd}]/u', '', $value);
    }
}


text:
import type { StackHeaderLeftButtonProps } from '../../types';
// tslint:disable-next-line strict-export-declare-modifiers
declare type Props = StackHeaderLeftButtonProps;
// tslint:disable-next-line max-line-length
export default function HeaderBackButton({ disabled, allowFontScaling, backImage, label, labelStyle, labelVisible, onLabelLayout, onPress, pressColorAndroid: customPressColorAndroid, screenLayout, tintColor: customTintColor, titleLayout, truncatedLabel, accessibilityLabel, style, }: Props): JSX.Element;
export {};


text:
#ifndef CDSLIB_DETAILS_IS_ALIGNED_H
#define CDSLIB_DETAILS_IS_ALIGNED_H

#include <cds/details/defs.h>

namespace cds { namespace details {

    /// Checks if the pointer \p p has \p ALIGN byte alignment
    /**
        \p ALIGN must be power of 2.

        The function is mostly intended for run-time assertion
    */
    template <int ALIGN, typename T>
    static inline bool is_aligned(T const * p)
    {
        return (((uintptr_t)p) & uintptr_t(ALIGN - 1)) == 0;
    }

    /// Checks if the pointer \p p has \p nAlign byte alignment
    /**
        \p nAlign must be power of 2.

        The function is mostly intended for run-time assertion
    */
    template <typename T>
    static inline bool is_aligned(T const * p, size_t nAlign)
    {
        return (((uintptr_t)p) & uintptr_t(nAlign - 1)) == 0;
    }

}} // namespace cds::details

#endif // #ifndef CDSLIB_DETAILS_IS_ALIGNED_H


text:
"""This module contains functions for using git."""

import re
import shutil
import subprocess
import tempfile

import utils

class GitLocalConfig(object):
  """Class to manage local git configs."""
  def __init__(self, config_dict):
    self._config_dict = config_dict
    self._previous_values = {}

  def __enter__(self):
    for k, v in self._config_dict.iteritems():
      try:
        prev = subprocess.check_output(['git', 'config', '--local', k]).rstrip()
        if prev:
          self._previous_values[k] = prev
      except subprocess.CalledProcessError:
        # We are probably here because the key did not exist in the config.
        pass
      subprocess.check_call(['git', 'config', '--local', k, v])

  def __exit__(self, exc_type, _value, _traceback):
    for k in self._config_dict:
      if self._previous_values.get(k):
        subprocess.check_call(
            ['git', 'config', '--local', k, self._previous_values[k]])
      else:
        subprocess.check_call(['git', 'config', '--local', '--unset', k])

class GitBranch(object):
  """Class to manage git branches.

  This class allows one to create a new branch in a repository to make changes,
  then it commits the changes, switches to master branch, and deletes the
  created temporary branch upon exit.
  """
  def __init__(self, branch_name, commit_msg, upload=True, commit_queue=False,
               delete_when_finished=True, cc_list=None):
    self._branch_name = branch_name
    self._commit_msg = commit_msg
    self._upload = upload
    self._commit_queue = commit_queue
    self._patch_set = 0
    self._delete_when_finished = delete_when_finished
    self._cc_list = cc_list

  def __enter__(self):
    subprocess.check_call(['git', 'reset', '--hard', 'HEAD'])
    subprocess.check_call(['git', 'checkout', 'master'])
    if self._branch_name in subprocess.check_output(['git', 'branch']).split():
      subprocess.check_call(['git', 'branch', '-D', self._branch_name])
    subprocess.check_call(['git', 'checkout', '-b', self._branch_name,
                           '-t', 'origin/master'])
    return self

  def commit_and_upload(self, use_commit_queue=False):
    """Commit all changes and upload a CL, returning the issue URL."""
    subprocess.check_call(['git', 'commit', '-a', '-m', self._commit_msg])
    upload_cmd = ['git', 'cl', 'upload', '-f', '--bypass-hooks',
                  '--bypass-watchlists']
    self._patch_set += 1
    if self._patch_set > 1:
      upload_cmd.extend(['-t', 'Patch set %d' % self._patch_set])
    if use_commit_queue:
      upload_cmd.append('--use-commit-queue')
      # Need the --send-mail flag to publish the CL and remove WIP bit.
      upload_cmd.append('--send-mail')
    if self._cc_list:
      upload_cmd.extend(['--cc=%s' % ','.join(self._cc_list)])
    subprocess.check_call(upload_cmd)
    output = subprocess.check_output(['git', 'cl', 'issue']).rstrip()
    return re.match('^Issue number: (?P<issue>\d+) \((?P<issue_url>.+)\)$',
                    output).group('issue_url')

  def __exit__(self, exc_type, _value, _traceback):
    if self._upload:
      # Only upload if no error occurred.
      try:
        if exc_type is None:
          self.commit_and_upload(use_commit_queue=self._commit_queue)
      finally:
        subprocess.check_call(['git', 'checkout', 'master'])
        if self._delete_when_finished:
          subprocess.check_call(['git', 'branch', '-D', self._branch_name])

class NewGitCheckout(utils.tmp_dir):
  """Creates a new local checkout of a Git repository."""

  def __init__(self, repository, local=None):
    """Set parameters for this local copy of a Git repository.

    Because this is a new checkout, rather than a reference to an existing
    checkout on disk, it is safe to assume that the calling thread is the
    only thread manipulating the checkout.

    You must use the 'with' statement to create this object:

    with NewGitCheckout(*args) as checkout:
      # use checkout instance
    # the checkout is automatically cleaned up here

    Args:
      repository: URL of the remote repository (e.g.,
          'https://skia.googlesource.com/common') or path to a local repository
          (e.g., '/path/to/repo/.git') to check out a copy of
      local: optional path to an existing copy of the remote repo on local disk.
          If provided, the initial clone is performed with the local copy as the
          upstream, then the upstream is switched to the remote repo and the
          new copy is updated from there.
    """
    super(NewGitCheckout, self).__init__()
    self._repository = repository
    self._local = local

  @property
  def root(self):
    """Returns the root directory containing the checked-out files."""
    return self.name

  def __enter__(self):
    """Check out a new local copy of the repository.

    Uses the parameters that were passed into the constructor.
    """
    super(NewGitCheckout, self).__enter__()
    remote = self._repository
    if self._local:
      remote = self._local
    subprocess.check_output(args=['git', 'clone', remote, self.root])
    if self._local:
      subprocess.check_call([
          'git', 'remote', 'set-url', 'origin', self._repository])
      subprocess.check_call(['git', 'remote', 'update'])
      subprocess.check_call(['git', 'checkout', 'master'])
      subprocess.check_call(['git', 'reset', '--hard', 'origin/master'])
    return self


text:
'use strict';

var { Try } = require( 'already' );

var exitFunctions = [ ];
function onExit( fn )
{
	exitFunctions.push( fn );
}

async function exitHandler( )
{
	process.removeListener( 'SIGINT', exitHandler );
	process.removeListener( 'SIGTERM', exitHandler );

	await Promise.all(
		exitFunctions.map( fn => Try( fn ).catch( ( ) => { } ) )
	)

	console.log( "Done." );
	process.exit( );
}

process.addListener( 'SIGINT', exitHandler );
process.addListener( 'SIGTERM', exitHandler );

module.exports = onExit;


text:
package com.joaofnunes.service;

public class NegocioException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	public NegocioException(String msg) {
		super(msg);

	}

}


text: package loader


text:
from django.contrib import admin
from symposion.conference.models import Section

from symposion.proposals.models import ProposalBase
from symposion.schedule.models import Schedule, Day, Room, SlotKind, Slot, \
    SlotRoom, Presentation

admin.site.register(Schedule, list_display=("section", "published"))
admin.site.register(Day, list_display=("date", "schedule",))
admin.site.register(Room, list_display=("name", "schedule"))
admin.site.register(SlotKind, list_display=("label", "schedule"))
admin.site.register(SlotRoom, list_display=("slot", "room"))

class SlotAdmin(admin.ModelAdmin):
    list_display = ['day_schedule', 'day_date', 'start', 'end', 'kind', 'rooms']
    list_filter = ['kind', 'day__schedule']
    list_select_related = True
    ordering = ['day__date', 'start', 'end', 'slotroom__room__name']

    def rooms(self, obj):
        return ', '.join(obj.slotroom_set.values_list('room__name', flat=True))
    rooms.admin_order_field = 'slotroom__room__name'

    def day_date(self, obj):
        return obj.day.date
    day_date.admin_order_field = 'day__date'

    def day_schedule(self, obj):
        return obj.day.schedule.section.name
    day_schedule.admin_order_field = 'day__schedule__section__name'

admin.site.register(Slot, SlotAdmin)

class PresentationAdmin(admin.ModelAdmin):
    filter_horizontal = ['additional_speakers']
    list_display = (
        'number',
        'title',
        'speaker',
        'cancelled',
        'proposal_base',
        'kind',
        'section',
        'tutorial_attendees',
        'tutorial_max',
        'video_url',
        'slides_url',
        'assets_url'
    )
    list_filter = (
        'section',
        'proposal_base__kind',
        'cancelled',
    )
    search_fields = (
        'title',
        'speaker__name',
        'additional_speakers__name',
        'proposal_base__title',
        'proposal_base__kind__name',
        'description',
        'abstract',
        'section__name',
        'video_url',
        'assets_url',
        'slides_url',
    )

    def get_queryset(self, request):
        qs = super(PresentationAdmin, self).get_queryset(request)
        return qs.select_related('speaker', 'speaker__user')

    def formfield_for_foreignkey(self, db_field, request, **kwargs):
        if db_field.name == 'proposal_base':
            kwargs['queryset'] = ProposalBase.objects.order_by('title')
        if db_field.name == 'slot':
            kwargs['queryset'] = Slot.objects.order_by('day__date', 'start', 'end')
        if db_field.name == 'section':
            if 'queryset' not in kwargs:
                kwargs['queryset'] = Section.objects.all()
            kwargs['queryset'] = kwargs['queryset'].select_related('conference')
        return super(PresentationAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)

    def number(self, presentation):
        return presentation.proposal_base.number
    number.admin_order_field = 'proposal_base__pk'

    def kind(self, presentation):
        return presentation.proposal_base.kind

    def tutorial_attendees(self, presentation):
        if hasattr(presentation.proposal, 'registration_count'):
            return presentation.proposal.registration_count
        else:
            return 'N/A'
    tutorial_attendees.short_description = 'Attendees'

    def tutorial_max(self, presentation):
        return getattr(presentation.proposal, 'max_attendees', 'N/A')
    tutorial_max.short_description = 'Attendees Max'

admin.site.register(Presentation, PresentationAdmin)