text:
<?php

namespace Tale\Crud\Type;

class ByteType extends IntType
{

    const MIN = -128;
    const MAX = 127;
    const UNSIGNED_MIN = 0;
    const UNSIGNED_MAX = 255;
}


text:
multi-(macro)-task is a library for cooperative multitasking using macros.

mmtask is written in pure C language, and it only uses a few simple macros. It should be possible to compile a program using `mmtask` for every platform or micro-controller.

# Credits
It is based on the code from [this thread](http://cboard.cprogramming.com/cplusplus-programming/140384-counting-macro.html), and it is evolving into something similar to the simplest implementation of ASG (Asynchronous State Graphs), by [Marc Lobelle, from UCLouvain](https://www.researchgate.net/profile/Marc-Lobelle).

redpajama_set_name: RedPajamaGithub


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

namespace CertiPay.Common.Notifications.Extensions
{
    public static class SmtpExtensions
    {
        /// <summary>
        /// Extension method to have SmtpClient's SendMailAsync respond to a CancellationToken
        /// https://gist.github.com/mattbenic/400e3c039ab8ea3e33aa
        /// https://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.sendasynccancel(v=vs.110).aspx
        /// </summary>
        public static async Task SendMailAsync(
            this SmtpClient client,
            MailMessage message,
            CancellationToken token)
        {
            Action cancelSend = () =>
            {
                client.SendAsyncCancel();
            };

            if (!token.IsCancellationRequested)
                using (var reg = token.Register(cancelSend))
                {
                    await client.SendMailAsync(message);
                }
        }
    }
}


text:
chown www-data:www-data /app -R

if [ "$ALLOW_OVERRIDE" = "**False**" ]; then
    unset ALLOW_OVERRIDE
else
    sed -i "s/AllowOverride None/AllowOverride All/g" /etc/apache2/apache2.conf
    a2enmod rewrite
fi

a2enmod ssl

source /etc/apache2/envvars

tail -F /var/log/apache2/* &
exec apache2 -D FOREGROUND


text:
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('thread-list', 'Integration | Component | thread list', {
  integration: true
});

test('it renders', function(assert) {

  // Set any properties with this.set('myProperty', 'value');
  // Handle any actions with this.on('myAction', function(val) { ... });" + EOL + EOL +

  this.render(hbs`{{thread-list}}`);

  assert.equal(this.$().text().trim(), '');

  // Template block usage:" + EOL +
  this.render(hbs`
    {{#thread-list}}
      template block text
    {{/thread-list}}
  `);

  assert.equal(this.$().text().trim(), 'template block text');
});


text:
import os.path as op

import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal

from mne.datasets import testing
from mne.io import read_raw_fif
from mne.preprocessing import (regress_artifact, create_eog_epochs,
                               EOGRegression, read_eog_regression)
from mne.utils import requires_version

data_path = testing.data_path(download=False)
raw_fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_trunc_raw.fif')

@testing.requires_testing_data
def test_regress_artifact():
    """Test regressing artifact data."""
    raw = read_raw_fif(raw_fname).pick_types(meg=False, eeg=True, eog=True)
    raw.load_data()
    epochs = create_eog_epochs(raw)
    epochs.apply_baseline((None, None))
    orig_data = epochs.get_data('eeg')
    orig_norm = np.linalg.norm(orig_data)
    epochs_clean, betas = regress_artifact(epochs)
    regress_artifact(epochs, betas=betas, copy=False)  # inplace, and w/betas
    assert_allclose(epochs_clean.get_data(), epochs.get_data())
    clean_data = epochs_clean.get_data('eeg')
    clean_norm = np.linalg.norm(clean_data)
    assert orig_norm / 2 > clean_norm > orig_norm / 10
    with pytest.raises(ValueError, match=r'Invalid value.*betas\.shape.*'):
        regress_artifact(epochs, betas=betas[:-1])
    # Regressing channels onto themselves should work
    epochs, betas = regress_artifact(epochs, picks='eog', picks_artifact='eog')
    assert np.ptp(epochs.get_data('eog')) < 1E-15  # constant value
    assert_allclose(betas, 1)

@testing.requires_testing_data
def test_eog_regression():
    """Test regressing artifact data using the EOGRegression class."""
    raw_meg_eeg = read_raw_fif(raw_fname)
    raw = raw_meg_eeg.copy().pick(['eeg', 'eog', 'stim'])

    # Test various errors
    with pytest.raises(RuntimeError, match='Projections need to be applied'):
        model = EOGRegression(proj=False).fit(raw)
    with pytest.raises(RuntimeError, match='requires raw data to be loaded'):
        model = EOGRegression().fit(raw)
    raw.load_data()

    # Test regression on raw data
    model = EOGRegression()
    assert str(model) == '<EOGRegression | not fitted>'
    model.fit(raw)
    assert str(model) == '<EOGRegression | fitted to 1 artifact channel>'
    assert model.coef_.shape == (59, 1)  # 59 EEG channels, 1 EOG channel
    raw_clean = model.apply(raw)
    # Some signal must have been removed
    assert np.ptp(raw_clean.get_data('eeg')) < np.ptp(raw.get_data('eeg'))

    # Test regression on epochs
    epochs = create_eog_epochs(raw)
    model = EOGRegression().fit(epochs)
    epochs = model.apply(epochs)
    # Since these were blinks, they should be mostly gone
    assert np.ptp(epochs.get_data('eeg')) < 1E-4

    # Test regression on evoked
    evoked = epochs.average('all')
    model = EOGRegression().fit(evoked)
    evoked = model.apply(evoked)
    assert model.coef_.shape == (59, 1)
    # Since this was a blink evoked, signal should be mostly gone
    assert np.ptp(evoked.get_data('eeg')) < 1E-4

    # Test regression on evoked and applying to raw, with different ordering of
    # channels. This should not work.
    raw_ = raw.copy().drop_channels(['EEG 001'])
    raw_ = raw_.add_channels([raw.copy().pick(['EEG 001'])])
    model = EOGRegression().fit(evoked)
    with pytest.raises(ValueError, match='data channels are not compatible'):
        model.apply(raw_)

    # Test in-place operation
    raw_ = model.apply(raw, copy=False)
    assert raw_ is raw
    assert raw_._data is raw._data
    raw_ = model.apply(raw, copy=True)
    assert raw_ is not raw
    assert raw_._data is not raw._data

    # Test plotting with one channel type
    fig = model.plot()
    assert len(fig.axes) == 2  # (one topomap and one colorbar)
    assert fig.axes[0].title.get_text() == 'eeg/EOG 061'

    # Test plotting with multiple channel types
    raw_meg_eeg.load_data()
    fig = EOGRegression().fit(raw_meg_eeg).plot()
    assert len(fig.axes) == 6  # (3 topomaps and 3 colorbars)
    assert fig.axes[0].title.get_text() == 'grad/EOG 061'
    assert fig.axes[1].title.get_text() == 'mag/EOG 061'
    assert fig.axes[2].title.get_text() == 'eeg/EOG 061'

    # Test plotting with multiple channel types, multiple regressors)
    m = EOGRegression(picks_artifact=['EEG 001', 'EOG 061']).fit(raw_meg_eeg)
    assert str(m) == '<EOGRegression | fitted to 2 artifact channels>'
    fig = m.plot()
    assert len(fig.axes) == 12  # (6 topomaps and 3 colorbars)
    assert fig.axes[0].title.get_text() == 'grad/EEG 001'
    assert fig.axes[1].title.get_text() == 'mag/EEG 001'
    assert fig.axes[4].title.get_text() == 'mag/EOG 061'
    assert fig.axes[5].title.get_text() == 'eeg/EOG 061'

@requires_version('h5io')
@testing.requires_testing_data
def test_read_eog_regression(tmp_path):
    """Test saving and loading an EOGRegression object."""
    raw = read_raw_fif(raw_fname).pick(['eeg', 'eog'])
    raw.load_data()
    model = EOGRegression().fit(raw)

    model.save(tmp_path / 'weights.h5', overwrite=True)
    model2 = read_eog_regression(tmp_path / 'weights.h5')
    assert_array_equal(model.picks, model2.picks)
    assert_array_equal(model.picks_artifact, model2.picks_artifact)
    assert_array_equal(model.exclude, model2.exclude)
    assert_array_equal(model.coef_, model2.coef_)
    assert model.proj == model2.proj
    assert model.info_.keys() == model2.info_.keys()


text:
#ifndef SHADEROBJ_H
#define SHADEROBJ_H

#include "main/compiler.h"
#include "main/glheader.h"
#include "main/mtypes.h"
#include "program/ir_to_mesa.h"

#ifdef __cplusplus
extern "C" {
#endif
/**
 * Internal functions
 */

extern void
_mesa_init_shader_state(struct gl_context * ctx);

extern void
_mesa_free_shader_state(struct gl_context *ctx);

extern void
_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
                       struct gl_shader *sh);

extern struct gl_shader *
_mesa_lookup_shader(struct gl_context *ctx, GLuint name);

extern struct gl_shader *
_mesa_lookup_shader_err(struct gl_context *ctx, GLuint name, const char *caller);

extern void
_mesa_reference_shader_program(struct gl_context *ctx,
                               struct gl_shader_program **ptr,
                               struct gl_shader_program *shProg);
extern void
_mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader);

extern struct gl_shader *
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);

extern void
_mesa_init_shader_program(struct gl_context *ctx, struct gl_shader_program *prog);

extern struct gl_shader_program *
_mesa_lookup_shader_program(struct gl_context *ctx, GLuint name);

extern struct gl_shader_program *
_mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name,
                                const char *caller);

extern void
_mesa_clear_shader_program_data(struct gl_context *ctx,
                                struct gl_shader_program *shProg);

extern void
_mesa_free_shader_program_data(struct gl_context *ctx,
                               struct gl_shader_program *shProg);

extern void
_mesa_init_shader_object_functions(struct dd_function_table *driver);

extern void
_mesa_init_shader_state(struct gl_context *ctx);

extern void
_mesa_free_shader_state(struct gl_context *ctx);

static INLINE gl_shader_type
_mesa_shader_type_to_index(GLenum v)
{
   switch (v) {
   case GL_VERTEX_SHADER:
      return MESA_SHADER_VERTEX;
   case GL_FRAGMENT_SHADER:
      return MESA_SHADER_FRAGMENT;
   case GL_GEOMETRY_SHADER:
      return MESA_SHADER_GEOMETRY;
   default:
      ASSERT(0 && "bad value in _mesa_shader_type_to_index()");
      return MESA_SHADER_TYPES;
   }
}

static INLINE GLenum
_mesa_shader_index_to_type(GLuint i)
{
   static const GLenum enums[MESA_SHADER_TYPES] = {
      GL_VERTEX_SHADER,
      GL_FRAGMENT_SHADER,
      GL_GEOMETRY_SHADER ,
   };
   if (i >= MESA_SHADER_TYPES)
      return 0;
   else
      return enums[i];
}

#ifdef __cplusplus
}
#endif

#endif /* SHADEROBJ_H */


text:
package hipchat

import (
	"fmt"
	"net/http"
)

// EmoticonService gives access to the emoticon related part of the API.
type EmoticonService struct {
	client *Client
}

// Emoticons represents a list of hipchat emoticons.
type Emoticons struct {
	Items      []Emoticon `json:"items"`
	StartIndex int        `json:"startIndex"`
	MaxResults int        `json:"maxResults"`
	Links      PageLinks  `json:"links"`
}

// Emoticon represents a hipchat emoticon.
type Emoticon struct {
	ID       int    `json:"id"`
	Url      string `json:"url"`
	Links    Links  `json:"links"`
	Shortcut string `json:"shortcut"`
}

// List returns the list of all the emoticons
//
// HipChat api docs : https://www.hipchat.com/docs/apiv2/method/get_all_emoticons
func (e *EmoticonService) List(start, max int, type_ string) (*Emoticons, *http.Response, error) {
	req, err := e.client.NewRequest("GET",
		fmt.Sprintf("emoticon?start-index=%d&max-results=%d&type=%s", start, max, type_), nil)
	if err != nil {
		return nil, nil, err
	}

	emoticons := new(Emoticons)
	resp, err := e.client.Do(req, emoticons)
	if err != nil {
		return nil, resp, err
	}
	return emoticons, resp, nil
}


text:
import xml.etree.cElementTree as E

try:
    import urllib.request as urllib2
except:
    import urllib2

from authorize.apis.address_api import AddressAPI
from authorize.apis.credit_card_api import CreditCardAPI
from authorize.apis.customer_api import CustomerAPI
from authorize.apis.bank_account_api import BankAccountAPI
from authorize.apis.batch_api import BatchAPI
from authorize.apis.recurring_api import RecurringAPI
from authorize.apis.transaction_api import TransactionAPI
from authorize.exceptions import AuthorizeConnectionError
from authorize.exceptions import AuthorizeResponseError
from authorize.response_parser import parse_response
from authorize.xml_data import *

E.register_namespace('', 'AnetApi/xml/v1/schema/AnetApiSchema.xsd')

class AuthorizeAPI(object):

    def __init__(self, config):
        """Allow for multiple instances of the Authorize API."""
        self.config = config
        self.customer = CustomerAPI(self)
        self.credit_card = CreditCardAPI(self)
        self.bank_account = BankAccountAPI(self)
        self.address = AddressAPI(self)
        self.recurring = RecurringAPI(self)
        self.batch = BatchAPI(self)
        self.transaction = TransactionAPI(self)

    @property
    def client_auth(self):
        """Generate an XML element with client auth data populated."""
        if not hasattr(self, '_client_auth'):
            self._client_auth = E.Element('merchantAuthentication')
            E.SubElement(self._client_auth, 'name').text = self.config.login_id
            E.SubElement(self._client_auth, 'transactionKey').text = self.config.transaction_key
        return self._client_auth

    def _base_request(self, method):
        """Factory method for generating the base XML requests."""
        request = E.Element(method)
        request.set('xmlns', 'AnetApi/xml/v1/schema/AnetApiSchema.xsd')
        request.append(self.client_auth)
        return request

    def _make_call(self, call):
        """Make a call to the Authorize.net server with the XML."""
        try:
            request = urllib2.Request(self.config.environment, E.tostring(call))
            request.add_header('Content-Type', 'text/xml')
            response = urllib2.urlopen(request).read()
            response = E.fromstring(response)
            result = parse_response(response)
        except urllib2.HTTPError:
            raise AuthorizeConnectionError('Error processing XML request.')

        # Throw an exception for invalid calls. This makes error handling easier.
        if result.messages[0].result_code != 'Ok':
            error = result.messages[0].message
            e = AuthorizeResponseError('%s: %s' % (error.code, error.text))
            e.full_response = result
            raise e

        # Exception handling for transaction response errors.
        try:
            error = result.transaction_response.errors[0]
            e = AuthorizeResponseError('Response code %s: %s' % (error.error_code, error.error_text))
            e.full_response = result
            raise e
        except KeyError:
            pass

        return result


text:
#if USING_XR_MANAGEMENT && USING_XR_SDK_OCULUS
#define USING_XR_SDK
#endif

using System.Runtime.InteropServices;

// C# wrapper for Unity XR SDK Native APIs.

#if USING_XR_SDK
public static class OculusXRPlugin
{
	[DllImport("OculusXRPlugin")]
	public static extern void SetColorScale(float x, float y, float z, float w);

	[DllImport("OculusXRPlugin")]
	public static extern void SetColorOffset(float x, float y, float z, float w);
}
#endif


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="ExDoc v0.19.2">
    <title>TheFuzz.Similarity.Jaccard — TheFuzz v0.5.0</title>
    <link rel="stylesheet" href="dist/html-c1666276880c0f8e3769.css" />

<button class="sidebar-button sidebar-toggle">

  Toggle Sidebar
</button>
<button class="sidebar-button night-mode-toggle">

  Toggle Theme
</button>

TheFuzz

        v0.5.0

  <form class="sidebar-search" action="search.html">
    <button type="submit" class="search-button">

    </button>
    <input name="q" type="text" id="search-list" class="search-input" placeholder="Search" aria-label="Search" autocomplete="off" />
  </form>

Pages

Modules

        TheFuzz v0.5.0
TheFuzz.Similarity.Jaccard

            View Source

This module contains functions to calculate the Jaccard similarity
coefficient between two given
strings

              Link to this section

            Summary

      Functions

    compare(a, b)

Calculates the Jaccard similarity coefficient between two given strings with
a default ngram size of 2

    compare(a, b, n)

Calculates the Jaccard similarity coefficient between two given strings with
the specified ngram size

              Link to this section

Functions

      Link to this function

compare(a, b)

       View Source

Calculates the Jaccard similarity coefficient between two given strings with
a default ngram size of 2

  Examples

iex> TheFuzz.Similarity.Jaccard.compare("contact", "context")
0.3333333333333333
iex> TheFuzz.Similarity.Jaccard.compare("ht", "hththt")
0.2

      Link to this function

compare(a, b, n)

       View Source

Calculates the Jaccard similarity coefficient between two given strings with
the specified ngram size

  Examples

iex> TheFuzz.Similarity.Jaccard.compare("contact", "context", 3)
0.25
iex> TheFuzz.Similarity.Jaccard.compare("contact", "context", 1)
0.5555555555555556

            Built using
            ExDoc (v0.19.2),

            designed by
            Friedel Ziegelmayer.


text:
package exporter

import (
	"fmt"
	"net/url"
	"os"
	"time"
)

type fileStatsReader struct {
	filename string
}

func init() {
	StatsReaderCreators = append(StatsReaderCreators, newFileStatsReader)
}

func newFileStatsReader(u *url.URL, uri string, timeout time.Duration) StatsReader {
	if u.Scheme != "file" {
		return nil
	}

	return &fileStatsReader{
		filename: u.Path,
	}
}

func (reader *fileStatsReader) Read() (*UwsgiStats, error) {
	f, err := os.Open(reader.filename)
	if err != nil {
		return nil, fmt.Errorf("unable to open file: %w", err)
	}
	defer f.Close()

	uwsgiStats, err := parseUwsgiStatsFromIO(f)
	if err != nil {
		return nil, fmt.Errorf("unable to unmarshal JSON: %w", err)
	}

	return uwsgiStats, nil
}


text:
export default WMTSCapabilities;
/**
 * @classdesc
 * Format for reading WMTS capabilities data.
 *
 * @api
 */
declare class WMTSCapabilities extends XML {
    /**
     * @type {OWS}
     * @private
     */
    private owsParser_;
}
import XML from "./XML.js";
//# sourceMappingURL=WMTSCapabilities.d.ts.map


text:
<module>
	<title>
		CMS
	</title>
	<description>
		Preforming content management system.
	</description>
	<author>
		Z
	</author>
	<url>
		http://www.z.com/
	</url>
</module>


text:
<?php

namespace Concrete\Core\Package\ItemCategory;

use Concrete\Core\Entity\Package;

defined('C5_EXECUTE') or die('Access Denied.');

class TreeType extends AbstractCategory
{
    public function getItemCategoryDisplayName()
    {
        return t('Tree Types');
    }

    /**
     * @param $type \Concrete\Core\Tree\TreeType
     *
     * @return mixed
     */
    public function getItemName($type)
    {
        return $type->getTreeTypeHandle();
    }

    public function getPackageItems(Package $package)
    {
        return \Concrete\Core\Tree\TreeType::getListByPackage($package);
    }
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Flora, Jena 65: 297 (1882)

#### Original name
Usnea barbata var. asperrima Müll. Arg.

### Remarks
null


text:
package org.apache.hadoop.fs.gtfs;

/**
 * Created with IntelliJ IDEA.
 * User: kair
 * Date: 8/14/13
 * Time: 12:14 AM
 * To change this template use File | Settings | File Templates.
 */

import java.io.*;
import java.nio.ByteBuffer;

import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FSInputStream;
import org.apache.hadoop.fs.FSDataInputStream;

public class GTFSInputStream extends FSInputStream {

    private byte[] buf;
    private long buf_len;
    private long pos;
    private FSDataInputStream dfs_in;

    public GTFSInputStream(byte[] buf, long buf_len) {
        this.buf = buf;
        this.buf_len = buf_len;
        this.pos = 0;
        this.dfs_in = null;
    }

    public GTFSInputStream(FSDataInputStream dfs_in) {
        this.dfs_in = dfs_in;
        this.buf = null;
        this.pos = 0;
        this.buf_len = 0;
    }
    public long getPos() throws IOException {
        if (dfs_in != null) {
            return dfs_in.getPos();
        }
        return pos;
    }

    public synchronized void seek(long targetPos) throws IOException {
        if (dfs_in != null) {
            dfs_in.seek(pos);
        }
        pos = targetPos;
    }

    public synchronized boolean seekToNewSource(long targetPos) throws IOException {
        return false;
    }

    public int available() throws IOException {
        if (dfs_in != null) {
            return dfs_in.available();
        } else {
            if (buf_len > pos) {
                return (int) (buf_len - pos);
            } else {
                return 0;
            }
        }
    }

    public synchronized int read() throws IOException {
        if (dfs_in != null) {
            return dfs_in.read();
        }
        if (pos >= buf_len) {
            throw new IOException("End of File");
        }
        pos = pos + 1;
        return buf[(int)pos - 1];
    }

    public synchronized int read(byte b[], int off, int len) throws IOException {
        if (dfs_in != null) {
            return dfs_in.read(b, off, len);
        }
        if (pos >= buf_len) {
            return -1;
        }
        int res = Math.min(len, (int) (buf_len-pos));
        System.arraycopy(buf, (int) pos, b, off, res);
        pos += res;
        return res;
    }

    public synchronized void close() throws IOException {
        if (dfs_in != null) {
            dfs_in.close();
        } else {
            buf_len = 0;
            buf = null;
        }
    }

    public boolean markSupported() {
        return false;
    }

    public void mark(int readLimit) {
        // Do nothing
    }

    public void reset() throws IOException {
        throw new IOException("Mark not supported");
    }
}


text:
using Bridge;

namespace ReactReduxTodoApp.Actions
{
    public class ToggleTodoCompleted
    {
        public int Id;
    }
}


text:
CREATE TABLE IF NOT EXISTS `m_staff_assignment_history` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`centre_id` bigint(20) DEFAULT NULL,
`staff_id` bigint(20) NOT NULL,
`start_date` date NOT NULL,
`end_date` date DEFAULT NULL,
`createdby_id` bigint(20) DEFAULT NULL,
`created_date` datetime DEFAULT NULL,
`lastmodified_date` datetime DEFAULT NULL,
`lastmodifiedby_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK_m_staff_assignment_history_centre_id_m_group` (`centre_id`),
KEY `FK_m_staff_assignment_history_m_staff` (`staff_id`),
CONSTRAINT `FK_m_staff_assignment_history_centre_id_m_group` FOREIGN KEY (`centre_id`) REFERENCES `m_group` (`id`),
CONSTRAINT `FK_m_staff_assignment_history_m_staff` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`)
);
INSERT INTO stretchy_parameter ( parameter_name, parameter_variable, parameter_label, parameter_displayType, parameter_FormatType, parameter_default, special, selectOne, selectAll, parameter_sql, parent_id) VALUES ('selectCenterId', 'centerId', 'Enter Center Id', 'text', 'string', 'n/a', NULL, NULL, NULL, NULL, NULL);
INSERT INTO stretchy_report ( report_name, report_type, report_subtype, report_category, report_sql, description, core_report, use_report) VALUES ( 'Staff Assignment History', 'Pentaho', NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO stretchy_report_parameter ( report_id, parameter_id, report_parameter_name)
VALUES ((select sr.id from stretchy_report sr where sr.report_name='Staff Assignment History'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='selectCenterId'),
'centerId');


text:
<?php

namespace Omnipay\Verifone\Request;

use Omnipay\Verifone\RequestMessage\TransactionConfirmationRequestMessage;

/**
 * Responsible for wrapping a transaction confirmation request.
 *
 * @package    Verifone\Request
 * @copyright  Copyright (c) 2014 Adnams Plc (http://adnams.co.uk)
 */
class TransactionConfirmationRequest extends AbstractRequest
{
    /** @var TransactionConfirmationRequestMessage */
    private $transactionConfirmationRequestMessage;

    /**
     * Constructor.
     *
     * @param string $systemId
     * @param string $systemGuid
     * @param float $passcode
     * @param string $processingDb
     * @param TransactionConfirmationRequestMessage $transactionConfirmationRequestMessage
     */
    public function __construct($systemId, $systemGuid, $passcode, $processingDb, TransactionConfirmationRequestMessage $transactionConfirmationRequestMessage)
    {
        parent::__construct($systemId, $systemGuid, $passcode);

        $this->setProcessingDb($processingDb);
        $this->transactionConfirmationRequestMessage = $transactionConfirmationRequestMessage;
    }

    /**
     * Get the message type.
     *
     * @return string
     */
    protected function getMsgType()
    {
        return 'CNF';
    }

    /**
     * Get the message data.
     *
     * @return string
     */
    protected function getMsgData()
    {
        $transReq = $this->getDomDoc()->appendChild($this->getDomDoc()->createElement('confirmationrequest'));
        $this->getDomDoc()->createAttributeNS('TXN', 'Verifone'); // arg2 is not used but can't be empty.

        $this->createAndAppendElement($transReq, 'transactionid', $this->transactionConfirmationRequestMessage->getTransactionId());

        return $this->getDomDoc()->saveXML();
    }
}


text:
===================================================================
How To Build On ARM
===================================================================

Introduction
============

This document contains information about building/testing LLVM and
Clang on an ARM machine.

This document is *NOT* tailored to help you cross-compile LLVM/Clang
to ARM on another architecture, for example an x86_64 machine. To find
out more about cross-compiling, please check :doc:`HowToCrossCompileLLVM`.

Notes On Building LLVM/Clang on ARM
=====================================
Here are some notes on building/testing LLVM/Clang on ARM. Note that
ARM encompasses a wide variety of CPUs; this advice is primarily based
on the ARMv6 and ARMv7 architectures and may be inapplicable to older chips.

#. The most popular Linaro/Ubuntu OS's for ARM boards, e.g., the
   Pandaboard, have become hard-float platforms. There are a number of
   choices when using CMake. Autoconf usage is deprecated as of 3.8.

   Building LLVM/Clang in ``Release`` mode is preferred since it consumes
   a lot less memory. Otherwise, the building process will very likely
   fail due to insufficient memory. It's also a lot quicker to only build
   the relevant back-ends (ARM and AArch64), since it's very unlikely that
   you'll use an ARM board to cross-compile to other arches. If you're
   running Compiler-RT tests, also include the x86 back-end, or some tests
   will fail.

   .. code-block:: bash

     cmake $LLVM_SRC_DIR -DCMAKE_BUILD_TYPE=Release \
                         -DLLVM_TARGETS_TO_BUILD="ARM;X86;AArch64"

   Other options you can use are:

   .. code-block:: bash

     Use Ninja instead of Make: "-G Ninja"
     Build with assertions on: "-DLLVM_ENABLE_ASSERTIONS=True"
     Force Python2: "-DPYTHON_EXECUTABLE=/usr/bin/python2"
     Local (non-sudo) install path: "-DCMAKE_INSTALL_PREFIX=$HOME/llvm/install"
     CPU flags: "DCMAKE_C_FLAGS=-mcpu=cortex-a15" (same for CXX_FLAGS)

   After that, just typing ``make -jN`` or ``ninja`` will build everything.
   ``make -jN check-all`` or ``ninja check-all`` will run all compiler tests. For
   running the test suite, please refer to :doc:`TestingGuide`.

#. If you are building LLVM/Clang on an ARM board with 1G of memory or less,
   please use ``gold`` rather then GNU ``ld``. In any case it is probably a good
   idea to set up a swap partition, too.

   .. code-block:: bash

     $ sudo ln -sf /usr/bin/ld /usr/bin/ld.gold

#. ARM development boards can be unstable and you may experience that cores
   are disappearing, caches being flushed on every big.LITTLE switch, and
   other similar issues.  To help ease the effect of this, set the Linux
   scheduler to "performance" on **all** cores using this little script:

   .. code-block:: bash

      # The code below requires the package 'cpufrequtils' to be installed.
      for ((cpu=0; cpu<`grep -c proc /proc/cpuinfo`; cpu++)); do
          sudo cpufreq-set -c $cpu -g performance
      done

   Remember to turn that off after the build, or you may risk burning your
   CPU. Most modern kernels don't need that, so only use it if you have
   problems.

#. Running the build on SD cards is ok, but they are more prone to failures
   than good quality USB sticks, and those are more prone to failures than
   external hard-drives (those are also a lot faster). So, at least, you
   should consider to buy a fast USB stick.  On systems with a fast eMMC,
   that's a good option too.

#. Make sure you have a decent power supply (dozens of dollars worth) that can
   provide *at least* 4 amperes, this is especially important if you use USB
   devices with your board. Externally powered USB/SATA harddrives are even
   better than having a good power supply.


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

using UnityEngine;

namespace DaikonForge.Tween
{

	///
	/// Indicates the current state of a Tween
	///
	public enum TweenState
	{

		/// The tween is not currently running
		Stopped,

		/// The tween is currently paused
		Paused,

		/// The tween is currently running
		Playing,

		/// The tween was started, but is waiting for the StartDelay to expire
		Started

	}

	///
	/// Indicates the direction that a tween or animation will play
	///
	public enum TweenDirection
	{
		Forward = 0,
		Reverse
	}

	///
	/// Indicates the manner in which a Tween will loop
	///
	public enum TweenLoopType
	{

		///
		/// The tween will stop executing when it reaches the end value
		///
		None,

		///
		/// The tween will play back from the beginning when it reaches the end value
		///
		Loop,

		///
		/// The tween will play backwards and forwards
		///
		Pingpong

	}

	///
	/// Used by the TweenGroup class to determine whether to play the tweens
	/// sequentially or concurrently
	///
	public enum TweenGroupMode
	{

		///
		/// Each tween is played one after another in sequence, with each tween
		/// waiting until the previous tween is completed before continuing
		///
		Sequential,

		///
		/// All tweens are played at the same time
		///
		Concurrent

	}

	///
	/// The type of easing function (which specifies a the rate of change of a value over time) to use for animating.
	///
	public enum EasingType
	{

		///
		/// Easing equation function for a simple linear tweening, with no easing.
		///
		Linear,

		///
		/// Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out:
		/// decelerating from zero velocity.
		///
		Bounce,

		///
		/// Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in:
		/// accelerating from zero velocity.
		///
		BackEaseIn,
		///
		/// Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out:
		/// decelerating from zero velocity.
		///
		BackEaseOut,
		///
		/// Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in/out:
		/// acceleration until halfway, then deceleration.
		///
		BackEaseInOut,

		///
		/// Easing equation function for a circular (sqrt(1-t^2)) easing in:
		/// accelerating from zero velocity.
		///
		CircEaseIn,
		///
		/// Easing equation function for a circular (sqrt(1-t^2)) easing out:
		/// decelerating from zero velocity.
		///
		CircEaseOut,
		///
		/// Easing equation function for a circular (sqrt(1-t^2)) easing in/out:
		/// acceleration until halfway, then deceleration.
		///
		CircEaseInOut,

		///
		/// Easing equation function for a cubic (t^3) easing in:
		/// accelerating from zero velocity.
		///
		CubicEaseIn,
		///
		/// Easing equation function for a cubic (t^3) easing out:
		/// decelerating from zero velocity.
		///
		CubicEaseOut,
		///
		/// Easing equation function for a cubic (t^3) easing in/out:
		/// acceleration until halfway, then deceleration.
		///
		CubicEaseInOut,

		///
		/// Easing equation function for an exponential (2^t) easing in:
		/// accelerating from zero velocity.
		///
		ExpoEaseIn,
		///
		/// Easing equation function for an exponential (2^t) easing out:
		/// decelerating from zero velocity.
		///
		ExpoEaseOut,
		///
		/// Easing equation function for an exponential (2^t) easing in/out:
		/// acceleration until halfway, then deceleration.
		///
		ExpoEaseInOut,

		///
		/// Easing equation function for a quadratic (t^2) easing in:
		/// accelerating from zero velocity.
		///
		QuadEaseIn,
		///
		/// Easing equation function for a quadratic (t^2) easing out:
		/// decelerating from zero velocity.
		///
		QuadEaseOut,
		///
		/// Easing equation function for a quadratic (t^2) easing in/out:
		/// acceleration until halfway, then deceleration.
		///
		QuadEaseInOut,

		///
		/// Easing equation function for a quartic (t^4) easing in:
		/// accelerating from zero velocity.
		///
		QuartEaseIn,
		///
		/// Easing equation function for a quartic (t^4) easing out:
		/// decelerating from zero velocity.
		///
		QuartEaseOut,
		///
		/// Easing equation function for a quartic (t^4) easing in/out:
		/// acceleration until halfway, then deceleration.
		///
		QuartEaseInOut,

		///
		/// Easing equation function for a quintic (t^5) easing in:
		/// accelerating from zero velocity.
		///
		QuintEaseIn,
		///
		/// Easing equation function for a quintic (t^5) easing out:
		/// decelerating from zero velocity.
		///
		QuintEaseOut,
		///
		/// Easing equation function for a quintic (t^5) easing in/out:
		/// acceleration until halfway, then deceleration.
		///
		QuintEaseInOut,

		///
		/// Easing equation function for a sinusoidal (sin(t)) easing in:
		/// accelerating from zero velocity.
		///
		SineEaseIn,
		///
		/// Easing equation function for a sinusoidal (sin(t)) easing out:
		/// decelerating from zero velocity.
		///
		SineEaseOut,
		///
		/// Easing equation function for a sinusoidal (sin(t)) easing in/out:
		/// acceleration until halfway, then deceleration.
		///
		SineEaseInOut,

		Spring

	}

}


text:
1 Create a Serializer
=========================
    class PaginationSerializer < ActiveModel::ArraySerializer
      def initialize(object, options={})
        meta_key = options[:meta_key] || :meta
        options[meta_key] ||= {}
        options[meta_key][:pagination] = {
          pages: object.pages
        }
        super(object, options)
      end
    end

2 Create direcrive
=========================
    angular.module('ModuleName')
      .directive('paginate', [ '$location', function ($location) {
        return {
          restrict: 'E',
          scope: {
            pages: '='
          },
          replace: true,
          templateUrl: '..path/to/template/paginate.html',
          link: function(scope) {

            var baseUrl = $location.path()+'?page=';

            scope.current = $location.search().page || 1;

            scope.previous = function () {
              if (scope.current>1)
                return baseUrl + scope.current-1;
            };

            scope.next = function () {
              if ( scope.pages )
                if ( scope.current != scope.pages[scope.pages.length-1] )
                  return baseUrl + ( parseInt(scope.current)+1 );
            };

            scope.goTo = function (page) {
              return baseUrl + page;
            };

          }
        };
      }]);

3 Create template
=========================
    %nav
      %ul.pagination
        %li
          %a{:href => "{{previous()}}"} «

        %li{:'ng-repeat' => 'page in pages'}
          %a{:href => "{{goTo(page)}}"} {{page}}

        %li
          %a{:href => "{{next()}}"} »

4 update Angular controller
=========================

    angular.module('ModuleName')
      .controller('ControllerName',
        ['$scope',
        'Adds',
        '$location',
        function ($scope, Adds, $location) {
          // Privat scope
          var _addIndex = _addIndex || {};

          Adds.query({page: $location.search().page || 1 }, function (data) {
            $scope.adds  = data.adds;
            $scope.pages = data.meta.pagination.pages;
          });

        }]);

5 Add pagination on index page
=========================
    %paginate{pages: :pages}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     このコードはツールによって生成されました。
//     ランタイム バージョン:4.0.30319.237
//
//     このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
//     コードが再生成されるときに損失したりします。
// </auto-generated>
//------------------------------------------------------------------------------

namespace NLiblet.Properties {
    using System;

    /// <summary>
    ///   ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
    /// </summary>
    // このクラスは StronglyTypedResourceBuilder クラスが ResGen
    // または Visual Studio のようなツールを使用して自動生成されました。
    // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
    // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }

        /// <summary>
        ///   このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NLiblet.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、
        ///   現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Strings are different at index {1}.{0}Expected:'{2:e}'(\\u{2:U}, {2:c}, {2:b}){0}Actual  :'{3:e}'(\\u{3:U}, {3:c}, {3:b}){0}Expected string :{7}{4:e}{8}{0}Actual string   :{7}{5:e}{8}{0}                 {6}^ に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string StringDifference_DifferentAt {
            get {
                return ResourceManager.GetString("StringDifference_DifferentAt", resourceCulture);
            }
        }

        /// <summary>
        ///   Expected is not null, but actual is null. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string StringDifference_ExpectedIsNotNullButActualIsNull {
            get {
                return ResourceManager.GetString("StringDifference_ExpectedIsNotNullButActualIsNull", resourceCulture);
            }
        }

        /// <summary>
        ///   Expected is null, but actual is not null. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string StringDifference_ExpectedIsNullButActualIsNotNull {
            get {
                return ResourceManager.GetString("StringDifference_ExpectedIsNullButActualIsNotNull", resourceCulture);
            }
        }

        /// <summary>
        ///   Strings length are different.{0}Expected :{1:###,0}{0}Actual   :{2:###,0}{0}Expected string :{6}{3:e}{7}{0}Actual string   :{8}{4:e}{9}{0}                 {5}^ に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string StringDifference_LengthAreNotEqual {
            get {
                return ResourceManager.GetString("StringDifference_LengthAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Expected is <null> but actual is '{0}'({1}). に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_ActualIsNotNull {
            get {
                return ResourceManager.GetString("XmlAssert_ActualIsNotNull", resourceCulture);
            }
        }

        /// <summary>
        ///   Expected is '{0}'({1}) but actual is <null>. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_ActualIsNull {
            get {
                return ResourceManager.GetString("XmlAssert_ActualIsNull", resourceCulture);
            }
        }

        /// <summary>
        ///   Node #{1} are not equal.{0}XPath: {2}{0}Expected:<null>{0}Actual:{0}"{3}"({4}) に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_ActualNodeIsNotNull {
            get {
                return ResourceManager.GetString("XmlAssert_ActualNodeIsNotNull", resourceCulture);
            }
        }

        /// <summary>
        ///   Attribute '{1}' does not exist.{0}XPath: {2} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_AttributeDoesNotExist {
            get {
                return ResourceManager.GetString("XmlAssert_AttributeDoesNotExist", resourceCulture);
            }
        }

        /// <summary>
        ///   Attribute names are not equal. {1}{0}XPath: {2} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_AttributeNamesAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_AttributeNamesAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Attribute values are not equal. {1}{0}XPath: {2} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_AttributeValuesAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_AttributeValuesAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Node '{1}'({2}) at #{3} does not exist.{0}XPath: {4} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_ChildNodeDoesNotExist {
            get {
                return ResourceManager.GetString("XmlAssert_ChildNodeDoesNotExist", resourceCulture);
            }
        }

        /// <summary>
        ///   {1}{0}Node #{2} are not equal. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_ChildNodesAssertionTemplate {
            get {
                return ResourceManager.GetString("XmlAssert_ChildNodesAssertionTemplate", resourceCulture);
            }
        }

        /// <summary>
        ///   Comments are not equal. {0} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_CommentAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_CommentAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Data of instruction are not equal. Expected is '{0}' but actual is '{1}'. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_DataOfInstructionAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_DataOfInstructionAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Element names are not equal. {1}{0}XPath: {2} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_ElementNamesAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_ElementNamesAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Encoding of declaration are not equal. Expected is '{0}' but actual is '{1}'. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_EncodingOfDeclarationAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_EncodingOfDeclarationAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Node #{1} nodes are not equal.{0}XPath: {1}{0}Expected:"{3}"({4}){0}Actual:{0}<null> に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_ExpectedNodeIsNotNull {
            get {
                return ResourceManager.GetString("XmlAssert_ExpectedNodeIsNotNull", resourceCulture);
            }
        }

        /// <summary>
        ///   Internal subset of DTD are not equal. Expected is '{0}' but actual is '{1}'. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_InternalSubsetOfDtdAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_InternalSubsetOfDtdAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Name of DTD are not equal. Expected is '{0}' but actual is '{1}'. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_NameOfDtdAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_NameOfDtdAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Node #{1} are not equal.{0}XPath: {2}{0}Expected:"{3}"({4}){0}Actual:{0}"{5}"({6}) に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_NodesAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_NodesAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Public ID of DTD are not equal. Expected is '{0}' but actual is '{1}'. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_PublicIdOfDtdAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_PublicIdOfDtdAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Some extra attributes exist. {1}{0}XPath: {2} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_SomeExtraAttributesExist {
            get {
                return ResourceManager.GetString("XmlAssert_SomeExtraAttributesExist", resourceCulture);
            }
        }

        /// <summary>
        ///   Some extra nodes exist from #{2}  '{1}'{0}XPath: {3} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_SomeExtraChildNodesExist {
            get {
                return ResourceManager.GetString("XmlAssert_SomeExtraChildNodesExist", resourceCulture);
            }
        }

        /// <summary>
        ///   Standalone of declaration are not equal. Expected is '{0}' but actual is '{1}'. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_StandaloneOfDeclarationAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_StandaloneOfDeclarationAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   System ID of DTD are not equal. Expected is '{0}' but actual is '{1}'. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_SystemIdOfDtdAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_SystemIdOfDtdAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Target of instruction are not equal. Expected is '{0}' but actual is '{1}'. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_TargetOfInstructionAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_TargetOfInstructionAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Text are not equal. {0} に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_TextAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_TextAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   Version of declaration are not equal. Expected is '{0}' but actual is '{1}'. に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_VersionOfDeclarationAreNotEqual {
            get {
                return ResourceManager.GetString("XmlAssert_VersionOfDeclarationAreNotEqual", resourceCulture);
            }
        }

        /// <summary>
        ///   (CData) に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_XPathLabelCData {
            get {
                return ResourceManager.GetString("XmlAssert_XPathLabelCData", resourceCulture);
            }
        }

        /// <summary>
        ///   (Comment) に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_XPathLabelComment {
            get {
                return ResourceManager.GetString("XmlAssert_XPathLabelComment", resourceCulture);
            }
        }

        /// <summary>
        ///   (TextContent) に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_XPathLabelTextContent {
            get {
                return ResourceManager.GetString("XmlAssert_XPathLabelTextContent", resourceCulture);
            }
        }

        /// <summary>
        ///   (unknown) に類似しているローカライズされた文字列を検索します。
        /// </summary>
        internal static string XmlAssert_XPathLabelUnknown {
            get {
                return ResourceManager.GetString("XmlAssert_XPathLabelUnknown", resourceCulture);
            }
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Message</title>
<meta name="date" content="2017-02-09">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

experiment.effort.bargossip

Class Message

java.lang.Object

experiment.effort.bargossip.Message

public class Message
extends java.lang.Object

Define attributes and operations for menaging the message exchange in the BarGossip protocols.

Author:

Guido Lena Cota

Field Summary

Fields

Modifier and Type
Field and Description

static char
BAL

static char
BAL_RESP

static char
BRIEF

static char
DIVULGE

static char
KEY_RESP

static char
KEY_RQST

static char
PUSH

static char
PUSH_RESP

static char
STREAMING

Constructor Summary

Constructors

Constructor and Description

Message(char type,
       BarGossip sender,
       BarGossip recipient,
       java.util.TreeSet<Update> content1,
       java.util.TreeSet<Update> content2,
       int extraInfo)

Message(Message msg)

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

java.util.TreeSet<Update>
getContent1()

java.util.TreeSet<Update>
getContent2()

int
getExtraInfo()

BarGossip
getRecipient()

BarGossip
getSender()

char
getType()

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

BAL

public static final char BAL

See Also:

Constant Field Values

BAL_RESP

public static final char BAL_RESP

See Also:

Constant Field Values

PUSH

public static final char PUSH

See Also:

Constant Field Values

PUSH_RESP

public static final char PUSH_RESP

See Also:

Constant Field Values

DIVULGE

public static final char DIVULGE

See Also:

Constant Field Values

BRIEF

public static final char BRIEF

See Also:

Constant Field Values

KEY_RQST

public static final char KEY_RQST

See Also:

Constant Field Values

KEY_RESP

public static final char KEY_RESP

See Also:

Constant Field Values

STREAMING

public static final char STREAMING

See Also:

Constant Field Values

Constructor Detail

Message

public Message(char type,
               BarGossip sender,
               BarGossip recipient,
               java.util.TreeSet<Update> content1,
               java.util.TreeSet<Update> content2,
               int extraInfo)

Message

public Message(Message msg)

Method Detail

getType

public char getType()

getSender

public BarGossip getSender()

getRecipient

public BarGossip getRecipient()

getContent1

public java.util.TreeSet<Update> getContent1()

getContent2

public java.util.TreeSet<Update> getContent2()

getExtraInfo

public int getExtraInfo()

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
namespace Envoy {
namespace Extensions {
namespace ListenerFilters {
namespace ProxyProtocol {

struct WireHeader {
  WireHeader(size_t header_length, size_t header_addr_length, size_t addr_lengh,
             size_t extensions_length)
      : header_length_(header_length), header_addr_length_(header_addr_length),
        addr_lengh_(addr_lengh), extensions_length_(extensions_length),
        protocol_version_(Network::Address::IpVersion::v4), remote_address_(nullptr),
        local_address_(nullptr), local_command_(true) {}
  WireHeader(size_t header_length, size_t header_addr_length, size_t addr_lengh,
             size_t extensions_length, Network::Address::IpVersion protocol_version,
             Network::Address::InstanceConstSharedPtr remote_address,
             Network::Address::InstanceConstSharedPtr local_address)
      : header_length_(header_length), header_addr_length_(header_addr_length),
        addr_lengh_(addr_lengh), extensions_length_(extensions_length),
        protocol_version_(protocol_version), remote_address_(remote_address),
        local_address_(local_address), local_command_(false) {

    ASSERT(extensions_length_ <= 65535);
  }

  size_t wholeHeaderLength() { return header_length_ + header_addr_length_; }

  size_t headerLengthWithoutExtension() { return header_length_ + addr_lengh_; }

  // For v1, this is whole length of the header util the end `\r\n`.
  // For v2, this is PROXY_PROTO_V2_HEADER_LEN, without address and extensions;
  size_t header_length_;
  // For v1, this is zero. For v2, this is the length of address and extensions;
  size_t header_addr_length_;
  // For v1, this is zero. For v2, this is the length of address.
  size_t addr_lengh_;
  // For v1, this is zero, For v2, this is the length of extensions.
  size_t extensions_length_;
  const Network::Address::IpVersion protocol_version_;
  const Network::Address::InstanceConstSharedPtr remote_address_;
  const Network::Address::InstanceConstSharedPtr local_address_;
  const bool local_command_;
};

} // namespace ProxyProtocol
} // namespace ListenerFilters
} // namespace Extensions
} // namespace Envoy


text:
#ifndef YarrCanonicalizeUCS2_H
#define YarrCanonicalizeUCS2_H

#include <stdint.h>
#include <wtf/unicode/Unicode.h>

namespace JSC { namespace Yarr {

// This set of data (autogenerated using YarrCanonicalizeUCS2.js into YarrCanonicalizeUCS2.cpp)
// provides information for each UCS2 code point as to the set of code points that it should
// match under the ES5.1 case insensitive RegExp matching rules, specified in 15.10.2.8.
enum UCS2CanonicalizationType {
    CanonicalizeUnique,               // No canonically equal values, e.g. 0x0.
    CanonicalizeSet,                  // Value indicates a set in characterSetInfo.
    CanonicalizeRangeLo,              // Value is positive delta to pair, E.g. 0x41 has value 0x20, -> 0x61.
    CanonicalizeRangeHi,              // Value is positive delta to pair, E.g. 0x61 has value 0x20, -> 0x41.
    CanonicalizeAlternatingAligned,   // Aligned consequtive pair, e.g. 0x1f4,0x1f5.
    CanonicalizeAlternatingUnaligned, // Unaligned consequtive pair, e.g. 0x241,0x242.
};
struct UCS2CanonicalizationRange { uint16_t begin, end, value, type; };
extern const size_t UCS2_CANONICALIZATION_RANGES;
extern uint16_t* characterSetInfo[];
extern UCS2CanonicalizationRange rangeInfo[];

// This table is similar to the full rangeInfo table, however this maps from UCS2 codepoints to
// the set of Latin1 codepoints that could match.
enum LatinCanonicalizationType {
    CanonicalizeLatinSelf,     // This character is in the Latin1 range, but has no canonical equivalent in the range.
    CanonicalizeLatinMask0x20, // One of a pair of characters, under the mask 0x20.
    CanonicalizeLatinOther,    // This character is not in the Latin1 range, but canonicalizes to another that is.
    CanonicalizeLatinInvalid,  // Cannot match against Latin1 input.
};
struct LatinCanonicalizationRange { uint16_t begin, end, value, type; };
extern const size_t LATIN_CANONICALIZATION_RANGES;
extern LatinCanonicalizationRange latinRangeInfo[];

// This searches in log2 time over ~364 entries, so should typically result in 8 compares.
inline UCS2CanonicalizationRange* rangeInfoFor(UChar ch)
{
    UCS2CanonicalizationRange* info = rangeInfo;
    size_t entries = UCS2_CANONICALIZATION_RANGES;

    while (true) {
        size_t candidate = entries >> 1;
        UCS2CanonicalizationRange* candidateInfo = info + candidate;
        if (ch < candidateInfo->begin)
            entries = candidate;
        else if (ch <= candidateInfo->end)
            return candidateInfo;
        else {
            info = candidateInfo + 1;
            entries -= (candidate + 1);
        }
    }
}

// Should only be called for characters that have one canonically matching value.
inline UChar getCanonicalPair(UCS2CanonicalizationRange* info, UChar ch)
{
    ASSERT(ch >= info->begin && ch <= info->end);
    switch (info->type) {
    case CanonicalizeRangeLo:
        return ch + info->value;
    case CanonicalizeRangeHi:
        return ch - info->value;
    case CanonicalizeAlternatingAligned:
        return ch ^ 1;
    case CanonicalizeAlternatingUnaligned:
        return ((ch - 1) ^ 1) + 1;
    default:
        ASSERT_NOT_REACHED();
    }
    ASSERT_NOT_REACHED();
    return 0;
}

// Returns true if no other UCS2 codepoint can match this value.
inline bool isCanonicallyUnique(UChar ch)
{
    return rangeInfoFor(ch)->type == CanonicalizeUnique;
}

// Returns true if values are equal, under the canonicalization rules.
inline bool areCanonicallyEquivalent(UChar a, UChar b)
{
    UCS2CanonicalizationRange* info = rangeInfoFor(a);
    switch (info->type) {
    case CanonicalizeUnique:
        return a == b;
    case CanonicalizeSet: {
        for (uint16_t* set = characterSetInfo[info->value]; (a = *set); ++set) {
            if (a == b)
                return true;
        }
        return false;
    }
    case CanonicalizeRangeLo:
        return (a == b) || (a + info->value == b);
    case CanonicalizeRangeHi:
        return (a == b) || (a - info->value == b);
    case CanonicalizeAlternatingAligned:
        return (a | 1) == (b | 1);
    case CanonicalizeAlternatingUnaligned:
        return ((a - 1) | 1) == ((b - 1) | 1);
    }

    ASSERT_NOT_REACHED();
    return false;
}

} } // JSC::Yarr

#endif


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:background="@drawable/main_bg">

   <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="60dp"
    android:layout_marginTop="10dp"
    android:orientation="horizontal"
    android:gravity="center">

        <Button
	    android:id="@+id/btn_search"
	    android:layout_width="fill_parent"
	    android:layout_height="wrap_content"
	    android:layout_marginLeft="5dp"
	    android:layout_marginRight="5dp"
	    android:layout_weight="1"
	    android:text="Search"
	    android:textSize="18sp"
	    android:textColor="#dddddd"
	    android:background="@drawable/selector_btn" />

	    <Button
	    android:id="@+id/btn_reset"
	    android:layout_width="fill_parent"
	    android:layout_height="wrap_content"
	    android:layout_marginLeft="5dp"
	    android:layout_marginRight="5dp"
	    android:layout_weight="1"
	    android:text="reset"
	    android:textSize="18sp"
	    android:textColor="#dddddd"
	    android:background="@drawable/selector_btn"/>

	    <Button
	    android:id="@+id/btn_exit"
	    android:layout_width="fill_parent"
	    android:layout_height="wrap_content"
	    android:layout_marginLeft="5dp"
	    android:layout_marginRight="5dp"
	    android:layout_weight="1"
	    android:text="exit"
	    android:textSize="18sp"
	    android:textColor="#dddddd"
	    android:background="@drawable/selector_btn" />

    </LinearLayout>

	<View android:layout_marginTop="10dp" android:layout_width="fill_parent"   android:layout_height="2dp"   android:background="#000000"></View>

	<ListView android:id="@+id/device_list"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:layout_marginTop="20dp"
        android:fastScrollEnabled="true"
        android:cacheColorHint="#00000000"
        android:clickable="true"/>
</LinearLayout>


text:
<?php

namespace Awsp\Ship;

/**
 * A simple autoloader for the Awsp\Ship classes based on PSR-0
 *
 * @param string $class_name the class being loaded
 * @return void
 * @version updated 10/30/2015
 * @since 12/28/2012
 */
function awsp_ship_autoloader($class_name) {
	// remove any leading backslash
	$class_name = ltrim($class_name, '\\');
	// explode the class name into an array
	$class_name_array = explode('\\', $class_name);
	// extract the last element (file name) from the array
	$file_name = array_pop($class_name_array);
	// begin building the file path, replacing any backslashes with forward slashes for conformity
	$file_path = str_replace('\\', '/', CC_INCLUDES_DIR) . 'lib/Awsp/libs/';
	// append the namespace pieces to the file path
	$file_path .= implode('/', $class_name_array) . '/';
	// complete the file path
	$file = $file_path . $file_name . '.php';
	// see if the file exists and is readable in this directory
	if(is_readable($file)) {
		// require the file if it exists
		require($file);
	}
}

// register the autoloader
spl_autoload_register('\Awsp\Ship\awsp_ship_autoloader');


text:
module Graphics.Rendering.OpenGL.GL.Shaders.ShaderBinaries (
   ShaderBinaryFormat(..), shaderBinaryFormats,
   ShaderBinary(..), shaderBinary,
) where

import Foreign.Marshal.Array
import Graphics.Rendering.OpenGL.GL.ByteString
import Graphics.Rendering.OpenGL.GL.QueryUtils
import Graphics.Rendering.OpenGL.GL.Shaders.Shader
import Graphics.Rendering.OpenGL.GL.StateVar
import Graphics.Rendering.OpenGL.Raw

--------------------------------------------------------------------------------

newtype ShaderBinaryFormat = ShaderBinaryFormat GLenum
   deriving ( Eq, Ord, Show )

shaderBinaryFormats :: GettableStateVar [ShaderBinaryFormat]
shaderBinaryFormats =
   makeGettableStateVar $ do
      n <- getInteger1 fromIntegral GetNumShaderBinaryFormats
      getEnumN ShaderBinaryFormat GetShaderBinaryFormats n

data ShaderBinary = ShaderBinary ShaderBinaryFormat ByteString
   deriving ( Eq, Ord, Show )

shaderBinary :: [Shader] -> SettableStateVar ShaderBinary
shaderBinary shaders =
   makeSettableStateVar $ \(ShaderBinary (ShaderBinaryFormat format) bs) ->
      withArrayLen (map shaderID shaders) $ \numShaders shadersBuf ->
         withByteString bs $
            glShaderBinary (fromIntegral numShaders) shadersBuf format


text:
package com.frameworkset.spi.assemble;

import java.lang.reflect.InvocationTargetException;

public class BeanInstanceException extends RuntimeException
{

    public BeanInstanceException()
    {
        super();
        // TODO Auto-generated constructor stub
    }

    public BeanInstanceException(String message, Throwable cause)
    {
        super(message, handleThrowable(cause) );
        // TODO Auto-generated constructor stub
    }
    public static Throwable handleThrowable(Throwable retval)
	{
		if(retval == null)
			return null;
		if(retval instanceof InvocationTargetException)
		{
			Throwable ret = ((InvocationTargetException)retval).getTargetException();
			if(ret == null)
				return null;
			if(ret instanceof InvocationTargetException)
			{
				return handleThrowable(ret);
			}
			return ret;
		}

		return (Throwable)retval;

	}

    public BeanInstanceException(String message)
    {
        super(message);
        // TODO Auto-generated constructor stub
    }

    public BeanInstanceException(Throwable cause)
    {
        super(handleThrowable(cause));
        // TODO Auto-generated constructor stub
    }

}


text:
InheritanceTreeGenerator
========================

Generate a simple text tree of a class inheritance tree.

Usage: `java -jar InheritanceTreeGenerator.jar <JarFile> <ClassName>`

Note: classname needs to be in the internal name format. e.g. java.lang.Object should be java/lang/Object.


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

namespace Jcq.IcqProtocol.DataTypes
{
    public class TlvMemberSince : Tlv
    {
        public TlvMemberSince() : base(0x5)
        {
        }

        public DateTime MemberSince { get; set; }

        public override List<byte> Serialize()
        {
            var data = base.Serialize();

            data.AddRange(ByteConverter.GetBytesForUInt32Date(MemberSince));

            return data;
        }

        public override void Deserialize(List<byte> data)
        {
            base.Deserialize(data);

            int index = SizeFixPart;

            MemberSince = ByteConverter.ToDateTimeFromUInt32FileStamp(data.GetRange(index, 4));
        }

        public override int CalculateDataSize()
        {
            return 4;
        }
    }
}


text:
/**
 * @license Angular v4.3.1
 * (c) 2010-2017 Google, Inc. https://angular.io/
 * License: MIT
 */
 export * from './testing/index'


text:
from __future__ import unicode_literals
import unittest
from nose.tools import assert_equal  # PEP8 asserts
from subprocess import check_output

class Testmeter_read(unittest.TestCase):

    '''Unit tests for meter_read.'''

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_echo(self):
        '''An example test.'''
        result = run_cmd("echo hello world")
        assert_equal(result, "hello world\n")

def run_cmd(cmd):
    '''Run a shell command `cmd` and return its output.'''
    return check_output(cmd, shell=True).decode('utf-8')

if __name__ == '__main__':
    unittest.main()


text:
namespace content {

class ServiceWorkerRegistration;

// This class manages all in-flight registration or unregistration jobs.
class CONTENT_EXPORT ServiceWorkerJobCoordinator {
 public:
  explicit ServiceWorkerJobCoordinator(ServiceWorkerContextCore* context);

  ServiceWorkerJobCoordinator(const ServiceWorkerJobCoordinator&) = delete;
  ServiceWorkerJobCoordinator& operator=(const ServiceWorkerJobCoordinator&) =
      delete;

  ~ServiceWorkerJobCoordinator();

  void Register(const GURL& script_url,
                const blink::mojom::ServiceWorkerRegistrationOptions& options,
                const blink::StorageKey& key,
                blink::mojom::FetchClientSettingsObjectPtr
                    outside_fetch_client_settings_object,
                const GlobalRenderFrameHostId& requesting_frame_id,
                blink::mojom::AncestorFrameType ancestor_frame_type,
                ServiceWorkerRegisterJob::RegistrationCallback callback,
                const PolicyContainerPolicies& policy_container_policies);

  // If |is_immediate| is true, unregister clears the active worker from the
  // registration without waiting for the controlled clients to unload.
  void Unregister(const GURL& scope,
                  const blink::StorageKey& key,
                  bool is_immediate,
                  ServiceWorkerUnregisterJob::UnregistrationCallback callback);

  void Update(ServiceWorkerRegistration* registration, bool force_bypass_cache);

  void Update(ServiceWorkerRegistration* registration,
              bool force_bypass_cache,
              bool skip_script_comparison,
              blink::mojom::FetchClientSettingsObjectPtr
                  outside_fetch_client_settings_object,
              ServiceWorkerRegisterJob::RegistrationCallback callback);

  // Calls ServiceWorkerRegisterJobBase::Abort() on the specified jobs (all jobs
  // for a given scope, or all jobs entirely) and removes them.
  void Abort(const GURL& scope, const blink::StorageKey& key);
  void AbortAll();

  // Removes the job. A job that was not aborted must call FinishJob when it is
  // done.
  void FinishJob(const GURL& scope,
                 const blink::StorageKey& key,
                 ServiceWorkerRegisterJobBase* job);

 private:
  // A given service worker's registration is uniqely identified by the scope
  // url and the storage key.
  using UniqueRegistrationKey = std::pair<GURL, blink::StorageKey>;

  class JobQueue {
   public:
    JobQueue();
    JobQueue(JobQueue&&);

    JobQueue(const JobQueue&) = delete;
    JobQueue& operator=(const JobQueue&) = delete;

    ~JobQueue();

    // Adds a job to the queue. If an identical job is already at the end of the
    // queue, no new job is added. Returns the job in the queue, regardless of
    // whether it was newly added.
    ServiceWorkerRegisterJobBase* Push(
        std::unique_ptr<ServiceWorkerRegisterJobBase> job);

    // Starts the first job in the queue.
    void StartOneJob();

    // Removes a job from the queue.
    void Pop(ServiceWorkerRegisterJobBase* job);

    bool empty() { return jobs_.empty(); }

    // Aborts all jobs in the queue and removes them.
    void AbortAll();

   private:
    base::circular_deque<std::unique_ptr<ServiceWorkerRegisterJobBase>> jobs_;
  };

  // The ServiceWorkerContextCore object must outlive this.
  const raw_ptr<ServiceWorkerContextCore> context_;
  std::map<UniqueRegistrationKey, JobQueue> job_queues_;
};

}  // namespace content

#endif  // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_JOB_COORDINATOR_H_


text:
<?php

/**
 * Base class for all symfony generator tasks.
 *
 * @package    symfony
 * @subpackage task
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @version    SVN: $Id: sfGeneratorBaseTask.class.php 6931 2008-01-04 06:31:12Z fabien $
 */
abstract class sfGeneratorBaseTask extends sfBaseTask
{
}


text:
package edu.usu.sdl.describe.model;

import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

/**
 *
 * @author dshurtleff
 */
@Root(strict = false)
public class StructuredStatement
{
	@Element(name = "searchProvider", required = false)
	private SearchProvider searchProvider;

	@Element(name = "resource", required = false)
	private Resource resource;

	@Element(name="contentCollection", required = false)
	private ContentCollection contentCollection;

	public StructuredStatement()
	{
	}

	public SearchProvider getSearchProvider()
	{
		return searchProvider;
	}

	public void setSearchProvider(SearchProvider searchProvider)
	{
		this.searchProvider = searchProvider;
	}

	public Resource getResource()
	{
		return resource;
	}

	public void setResource(Resource resource)
	{
		this.resource = resource;
	}

	public ContentCollection getContentCollection()
	{
		return contentCollection;
	}

	public void setContentCollection(ContentCollection contentCollection)
	{
		this.contentCollection = contentCollection;
	}

}


text:
package decision

import (
	"sync"

	context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
	bstore "github.com/jbenet/go-ipfs/blocks/blockstore"
	bsmsg "github.com/jbenet/go-ipfs/exchange/bitswap/message"
	wl "github.com/jbenet/go-ipfs/exchange/bitswap/wantlist"
	peer "github.com/jbenet/go-ipfs/p2p/peer"
	eventlog "github.com/jbenet/go-ipfs/util/eventlog"
)

// TODO consider taking responsibility for other types of requests. For
// example, there could be a |cancelQueue| for all of the cancellation
// messages that need to go out. There could also be a |wantlistQueue| for
// the local peer's wantlists. Alternatively, these could all be bundled
// into a single, intelligent global queue that efficiently
// batches/combines and takes all of these into consideration.
//
// Right now, messages go onto the network for four reasons:
// 1. an initial `sendwantlist` message to a provider of the first key in a request
// 2. a periodic full sweep of `sendwantlist` messages to all providers
// 3. upon receipt of blocks, a `cancel` message to all peers
// 4. draining the priority queue of `blockrequests` from peers
//
// Presently, only `blockrequests` are handled by the decision engine.
// However, there is an opportunity to give it more responsibility! If the
// decision engine is given responsibility for all of the others, it can
// intelligently decide how to combine requests efficiently.
//
// Some examples of what would be possible:
//
// * when sending out the wantlists, include `cancel` requests
// * when handling `blockrequests`, include `sendwantlist` and `cancel` as appropriate
// * when handling `cancel`, if we recently received a wanted block from a
// 	 peer, include a partial wantlist that contains a few other high priority
//   blocks
//
// In a sense, if we treat the decision engine as a black box, it could do
// whatever it sees fit to produce desired outcomes (get wanted keys
// quickly, maintain good relationships with peers, etc).

var log = eventlog.Logger("engine")

const (
	sizeOutboxChan = 4
)

// Envelope contains a message for a Peer
type Envelope struct {
	// Peer is the intended recipient
	Peer peer.ID
	// Message is the payload
	Message bsmsg.BitSwapMessage
}

type Engine struct {
	// peerRequestQueue is a priority queue of requests received from peers.
	// Requests are popped from the queue, packaged up, and placed in the
	// outbox.
	peerRequestQueue *taskQueue

	// FIXME it's a bit odd for the client and the worker to both share memory
	// (both modify the peerRequestQueue) and also to communicate over the
	// workSignal channel. consider sending requests over the channel and
	// allowing the worker to have exclusive access to the peerRequestQueue. In
	// that case, no lock would be required.
	workSignal chan struct{}

	// outbox contains outgoing messages to peers
	outbox chan Envelope

	bs bstore.Blockstore

	lock sync.RWMutex // protects the fields immediatly below
	// ledgerMap lists Ledgers by their Partner key.
	ledgerMap map[peer.ID]*ledger
}

func NewEngine(ctx context.Context, bs bstore.Blockstore) *Engine {
	e := &Engine{
		ledgerMap:        make(map[peer.ID]*ledger),
		bs:               bs,
		peerRequestQueue: newTaskQueue(),
		outbox:           make(chan Envelope, sizeOutboxChan),
		workSignal:       make(chan struct{}),
	}
	go e.taskWorker(ctx)
	return e
}

func (e *Engine) taskWorker(ctx context.Context) {
	log := log.Prefix("bitswap.Engine.taskWorker")
	for {
		nextTask := e.peerRequestQueue.Pop()
		if nextTask == nil {
			// No tasks in the list?
			// Wait until there are!
			select {
			case <-ctx.Done():
				log.Debugf("exiting: %s", ctx.Err())
				return
			case <-e.workSignal:
				log.Debugf("woken up")
			}
			continue
		}
		log := log.Prefix("%s", nextTask)
		log.Debugf("processing")

		block, err := e.bs.Get(nextTask.Entry.Key)
		if err != nil {
			log.Warning("engine: task exists to send block, but block is not in blockstore")
			continue
		}
		// construct message here so we can make decisions about any additional
		// information we may want to include at this time.
		m := bsmsg.New()
		m.AddBlock(block)
		// TODO: maybe add keys from our wantlist?
		log.Debugf("sending...")
		select {
		case <-ctx.Done():
			return
		case e.outbox <- Envelope{Peer: nextTask.Target, Message: m}:
			log.Debugf("sent")
		}
	}
}

func (e *Engine) Outbox() <-chan Envelope {
	return e.outbox
}

// Returns a slice of Peers with whom the local node has active sessions
func (e *Engine) Peers() []peer.ID {
	e.lock.RLock()
	defer e.lock.RUnlock()

	response := make([]peer.ID, 0)
	for _, ledger := range e.ledgerMap {
		response = append(response, ledger.Partner)
	}
	return response
}

// MessageReceived performs book-keeping. Returns error if passed invalid
// arguments.
func (e *Engine) MessageReceived(p peer.ID, m bsmsg.BitSwapMessage) error {
	log := log.Prefix("bitswap.Engine.MessageReceived(%s)", p)
	log.Debugf("enter. %d entries %d blocks", len(m.Wantlist()), len(m.Blocks()))
	defer log.Debugf("exit")

	if len(m.Wantlist()) == 0 && len(m.Blocks()) == 0 {
		log.Info("superfluous message")
	}

	newWorkExists := false
	defer func() {
		if newWorkExists {
			e.signalNewWork()
		}
	}()

	e.lock.Lock()
	defer e.lock.Unlock()

	l := e.findOrCreate(p)
	if m.Full() {
		l.wantList = wl.New()
	}

	for _, entry := range m.Wantlist() {
		if entry.Cancel {
			log.Debug("cancel", entry.Key)
			l.CancelWant(entry.Key)
			e.peerRequestQueue.Remove(entry.Key, p)
		} else {
			log.Debug("wants", entry.Key, entry.Priority)
			l.Wants(entry.Key, entry.Priority)
			if exists, err := e.bs.Has(entry.Key); err == nil && exists {
				newWorkExists = true
				e.peerRequestQueue.Push(entry.Entry, p)
			}
		}
	}

	for _, block := range m.Blocks() {
		// FIXME extract blocks.NumBytes(block) or block.NumBytes() method
		log.Debug("got block %s %d bytes", block.Key(), len(block.Data))
		l.ReceivedBytes(len(block.Data))
		for _, l := range e.ledgerMap {
			if l.WantListContains(block.Key()) {
				newWorkExists = true
				e.peerRequestQueue.Push(wl.Entry{block.Key(), 1}, l.Partner)
			}
		}
	}
	return nil
}

// TODO add contents of m.WantList() to my local wantlist? NB: could introduce
// race conditions where I send a message, but MessageSent gets handled after
// MessageReceived. The information in the local wantlist could become
// inconsistent. Would need to ensure that Sends and acknowledgement of the
// send happen atomically

func (e *Engine) MessageSent(p peer.ID, m bsmsg.BitSwapMessage) error {
	e.lock.Lock()
	defer e.lock.Unlock()

	l := e.findOrCreate(p)
	for _, block := range m.Blocks() {
		l.SentBytes(len(block.Data))
		l.wantList.Remove(block.Key())
		e.peerRequestQueue.Remove(block.Key(), p)
	}

	return nil
}

func (e *Engine) numBytesSentTo(p peer.ID) uint64 {
	// NB not threadsafe
	return e.findOrCreate(p).Accounting.BytesSent
}

func (e *Engine) numBytesReceivedFrom(p peer.ID) uint64 {
	// NB not threadsafe
	return e.findOrCreate(p).Accounting.BytesRecv
}

// ledger lazily instantiates a ledger
func (e *Engine) findOrCreate(p peer.ID) *ledger {
	l, ok := e.ledgerMap[p]
	if !ok {
		l = newLedger(p)
		e.ledgerMap[p] = l
	}
	return l
}

func (e *Engine) signalNewWork() {
	// Signal task generation to restart (if stopped!)
	select {
	case e.workSignal <- struct{}{}:
	default:
	}
}


text:
#ifndef _ALTOVA_INCLUDED_AIMXML_ALTOVA__ALTOVA_CAimVersion
#define _ALTOVA_INCLUDED_AIMXML_ALTOVA__ALTOVA_CAimVersion

namespace AIMXML
{

class CAimVersion : public TypeBase
{
public:
	AIMXML_EXPORT CAimVersion(xercesc::DOMNode* const& init);
	AIMXML_EXPORT CAimVersion(CAimVersion const& init);
	void operator=(CAimVersion const& other) { m_node = other.m_node; }
	static altova::meta::SimpleType StaticInfo() { return altova::meta::SimpleType(types + _altova_ti_altova_CAimVersion); }

	enum EnumValues {
		Invalid = -1,
		k_AIMv1_0 = 0, // AIMv1_0
		k_AIMv2_0 = 1, // AIMv2_0
		k_AIMv3_0_1 = 2, // AIMv3_0_1
		k_AIMv3_0_2 = 3, // AIMv3_0_2
		k_AIMv4_0 = 4, // AIMv4_0
		EnumValueCount
	};
	void operator= (const string_type& value)
	{
		altova::XmlFormatter* Formatter = static_cast<altova::XmlFormatter*>(altova::AnySimpleTypeFormatter);
		XercesTreeOperations::SetValue(GetNode(), Formatter->Format(value));
	}

	operator string_type()
	{
		return CastAs<string_type >::Do(GetNode(), 0);
	}
};

}	// namespace AIMXML

#endif // _ALTOVA_INCLUDED_AIMXML_ALTOVA__ALTOVA_CAimVersion


text:
Application Recipes
===================

This section contains application recipes that consisted of two or more service recipes and define complete application stacks.


text:
import type { Router } from 'vue-router';
import type { RouteLocationDefinition } from '../../../../../utils/router';
import { Client } from '../../../../../_common/client/client.service';
import { commonStore } from '../../../../../_common/store/common-store';
import { $gettext } from '../../../../../_common/translate/translate.service';
import { AppStore } from '../../../../store';
import { UserTokenModal } from '../../../user/token-modal/token-modal.service';

export function createClientTrayMenuBuilder(router: Router, appStore: AppStore) {
	function go(location: RouteLocationDefinition) {
		router.push(location);
		Client.show();
	}

	function logout() {
		return appStore.logout();
	}

	return function clientTrayMenuBuilder(this: undefined, menu: nw.Menu) {
		menu.append(
			new nw.MenuItem({
				label: $gettext(`Home`),
				click: () =>
					go({
						name: 'home',
					}),
			})
		);

		menu.append(
			new nw.MenuItem({
				label: $gettext(`Discover`),
				click: () =>
					go({
						name: 'discover.home',
					}),
			})
		);

		menu.append(
			new nw.MenuItem({
				label: $gettext(`Store`),
				click: () =>
					go({
						name: 'discover.games.list._fetch',
						params: { section: null as any },
					}),
			})
		);

		menu.append(new nw.MenuItem({ type: 'separator' }));

		menu.append(
			new nw.MenuItem({
				label: $gettext(`Game Library`),
				click: () => go({ name: 'library.installed' }),
			})
		);

		menu.append(
			new nw.MenuItem({
				label: $gettext(`Edit Account`),
				click: () => go({ name: 'dash.account.edit' }),
			})
		);

		menu.append(
			new nw.MenuItem({
				label: $gettext(`Your Profile`),
				click: () =>
					go({
						name: 'profile.overview',
						params: { username: commonStore.user.value!.username },
					}),
			})
		);

		menu.append(
			new nw.MenuItem({
				label: $gettext(`Your Game Token`),
				click: () => {
					UserTokenModal.show();
					Client.show();
				},
			})
		);

		menu.append(
			new nw.MenuItem({
				label: $gettext(`Device Settings`),
				click: () => go({ name: 'dash.account.device-settings' }),
			})
		);

		menu.append(new nw.MenuItem({ type: 'separator' }));

		menu.append(
			new nw.MenuItem({
				label: $gettext(`Logout`),
				click: () => {
					logout();
					Client.show();
				},
			})
		);
	};
}


text:
2011-11-04 14:50

        Display:

            <input class='display' id='display_failure' type='checkbox' target='failure' checked>
            Failures
            <input class='display' id='display_incomplete' type='checkbox' target='incomplete' checked>
            Incomplete

            <input class='display' id='display_skipped' type='checkbox' target='skipped' checked>
            Skipped
            <input class='display' id='display_success' type='checkbox' target='success' checked>
            Success

        Sort by:
        <select id='sort_type'>
            <option value='Results (asc)'>Results (asc)</option>
            <option value='Results (desc)'>Results (desc)</option>
            <option value='Time (asc)'>Execution Time (asc)</option>
            <option value='Time (desc)'>Execution Time (desc)</option>
        </select>

DateTest

Executed in 0.003424882888794 seconds.

+

test_this

Executed in 0.0031058788299561 seconds.

+

test_this_too

Executed in 0.00031900405883789 seconds.

+

foo { breaks: this } bar

IncompleteTest

Executed in 0.0027110576629638 seconds.

+

test_something

Incomplete Test

Executed in 0.0023269653320312 seconds.

+

test_something_else

Executed in 0.00038409233093262 seconds.

+

some stuff

PUTest

Executed in 0.015663862228394 seconds.

-

test_this

test_this() failed!
Failed asserting that <string:value> is equal to <string:test>.

Executed in 0.002964973449707 seconds.

-

some stuff

test_this_too

test_this_too() failed!
Failed asserting that <string:value> is equal to <string:test>.

Executed in 0.012698888778687 seconds.

+

PUTest2

Executed in 0.0006251335144043 seconds.

+

test_this

Executed in 0.00034117698669434 seconds.

+

some stuff

test_this_too

Executed in 0.00028395652770996 seconds.

+

some stuff

SkippedTest

Executed in 0.0013320446014404 seconds.

+

test_something_else

Skipped Test

Executed in 0.0013320446014404 seconds.

+

Suite Statistics

                                            Failed: 1 (20%)

                                            Incomplete: 1 (20%)

                                            Skipped: 1 (20%)

                                            Succeeded: 2 (40%)

                                            Total: 5

Test Statistics

                                            Failed: 2 (22.2%)

                                            Incomplete: 1 (11.1%)

                                            Skipped: 1 (11.1%)

                                            Succeeded: 5 (55.6%)

                                            Total: 9

!

Notice: Use of undefined constant somestr - assumed 'somestr'

12

/srv/http/pu/tests/PUTest.php


text:
<!doctype html>

	<meta charset="utf-8">

	<title>White Label - a full featured Admin Skin</title>

	<meta name="description" content="">
	<meta name="author" content="revaxarts.com">

	<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:regular,bold">
	<link rel="stylesheet" href="css/style.css">

	<link rel="stylesheet" href="css/light/theme.css" id="themestyle">

	<meta name="apple-mobile-web-app-capable" content="no">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">

	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,maximum-scale=1">

Logout

Configuration

Settings

Place for some configs

Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores.

			Logo Here

Icons300+

Submenu4

Just

another

Dropdown

Menu

Login

WizardBonus

Errorpagenew

403

404

405

500

503

				<form id="searchform">
					<input type="search" name="query" id="search" placeholder="Search">
				</form>

Dashboard

Documentation

Alert Boxes

Breadcrumb

Calendar

Charts

Dialog

Editor

File

Fileexplorer

Form

Gallery

Inputfields

Slider

Store

Widget

Form

Charts

Gallery

Widgets

Breadcrumb

Fileexplorer

Calendar

Dialogs & Buttons

Table

Typo

Grid

File v 1.0

Converts an file upload field into a multi upload form

General Idea

The problem with file uploads is that they require different data types and the files can be large which causes a delay after submitting the form. Because of this reason the wl_File plugin transfers the files via an AJAX request:

User select file to upload via his file explorer (WIN) or finder (MAC)

The files get send to a script (script A) which saves the files temporarily

The user submit the form and only a list of uploaded files is sent to the server (to script B)

script B must handle the list and move the files from the temp folder to the desired destination

The disadvantage of this method is that files are allready on the server even without submitting the form

The advantage is the short delay when sending the actual form to the server

This plugin requires server side action (upload.php)

Options read more about inline data attributes

option	default	possible values	description	since	info

autoUpload	true	true | false
			The upload starts immediately after adding a file	1.0

paramName	'files'	'String'
			The name attribute used to send to the server	1.0	must be equal the param_name option in the upload.php

multiple	true	true | false
			Allowes multiple file upload. Can be set within the native input field	1.0	Currently not supported in Internet Explorer

allowedExtensions	false	false, Array
			define allowed file extensions. If set to false all fiels are allowed	1.0

maxNumberOfFiles	0	integer
			define maximum of allowed files for the upload field. Set to 0 to disable	1.0

maxFileSize	0	integer
			defines the maximum file size for a file	1.0	not available on Internet Explorer

minFileSize	0	integer
			defines the maximum file size for a file	1.0	not available on Internet Explorer

sequentialUploads	false	true | false
			Set this option to true to issue all file upload requests in a sequential order instead of simultaneous requests	1.0

dragAndDrop	true	true | false
			Enables drag & drop support in modern browser	1.0

formData	null	Array, Object, function
			additional data sent to the upload script	1.0

text	[texts]	object
			an object with all required texts	1.0

onAdd	function(e, data){}	function(event, data)
			callback for adding files to the list	1.0

onSend	function(e, data){}	function(event, data)
			callback on sending fiels to the server. Return false prevent sending data	1.0

onDone	function(e, data){}	function(event, data)
			callback if one file was succesfully uploaded	1.0

onFinish	function(e, data){}	function(event, data)
			callback if all files where succesfully uploaded	1.0

onFail	function(e, data){}	function(event, data)
			callback if an error occurs	1.0

onAlways	function(e, data){}	function(event, data)
			callback gets called in any case (always)	1.0

onProgress	function(e, data){}	function(event, data)
			callback during upload progress for one file	1.0	only available on modern browsers

onProgressAll	function(e, data){}	function(event, data)
			callback during upload progress for all files	1.0	only available on modern browsers

onStart	function(e){}	function(event)
			callback on start of the upload	1.0

onStop	function(e){}	function(event)
			callback if the upload is finished	1.0

onChange	function(e, data){}	function(event, data)
			callback if a file is added or removed to the list	1.0

onDrop	function(e, data){}	function(event, data)
			callback if a file is droped from the users file system	1.0

onDragOver	function(e){}	function(event)
			callback if the user drags a file from his file system over the dropzone	1.0

onFileError	function(error, fileobj){}	function(error, fileobj)
			callback if an error occures on file add.
error:

error.msg : maxNumberOfFiles|allowedExtensions|maxFileSize|minFileSize
error.code : 1|2|3|4
	1.0	file.size is not available on Internet Explorer

Check out jQuery-File-Upload plugin docs for all options

Methods

method name	default	arguments	description	since	info

set		key, value
			sets the the option 'key' with the value 'value'	1.0

Usage

$(selector).wl_File([options]);

Calling Methods

$(selector).wl_File('method' [,arg [,arg]]);

Markup

<form action="submit.php" method="post">
	<fieldset>
		<label>Fieldset Label</label>
		<section><label for="input">Label</label>
			<div><input type="file" id="file_upload" name="file_upload" multiple></div>
		</section>
		...
		<section>
			<div><button>Submit</button></div>
		</section>
	</fieldset>
</form>

Example

			<form action="submit.php" method="post" autocomplete="off" data-confirm-send="false">
				<fieldset>
				File Upload

File Upload

<input type="file" id="file_upload" name="file_upload">

Multi File Upload

<input type="file" id="file_upload_multiple" name="file_upload_multiple" multiple>

<button class="reset">Reset</button><button class="submit">Submit</button>

				</fieldset>
			</form>
			<form action="submit.php" method="post" autocomplete="off" data-confirm-send="false">
				<fieldset>
				Required File Upload

Required File Upload

<input type="file" id="file_upload_multiple" name="file_upload_multiple" multiple required>

<button class="reset">Reset</button><button class="submit">Submit</button>

				</fieldset>
			</form>

		Copyright by revaxarts.com 2011


text:
rem
rem Run the Java Customer Maintenance demo program.
rem
rem Note: Enable the MVSP.DEMO account in MVSP account MVSP.MENU prior to running this test.
rem
set CLASSPATH=classes;lib\mvapi.jar;lib\TableLayout.jar;src
"%JAVA_HOME%\bin\javac" -cp %CLASSPATH% -d classes src/CustMaint.java
copy product_icon.gif classes
rem
"%JAVA_HOME%\bin\java" -cp "%CLASSPATH%" CustMaint