text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <ImageView
            android:id="@+id/help_id1"
            style="?android:attr/textAppearanceLarge"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:background="@drawable/bg_help_text"
            android:contentDescription="@string/help_showpictureactivity_description_draw"
            android:gravity="center"
            android:padding="5dp"
            android:scaleType="fitXY"
            android:src="@drawable/tut_drawing_figure" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@+id/help_id1"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="5dp"
            android:background="@drawable/bg_help_text"
            android:gravity="center"
            android:padding="5dp"
            android:text="@string/help_showpictureactivity_draw"
            android:textSize="20sp"
            android:textStyle="bold" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <ImageView
            android:id="@+id/help_id2"
            style="?android:attr/textAppearanceLarge"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:background="@drawable/bg_help_text"
            android:contentDescription="@string/help_showpictureactivity_description_delete"
            android:gravity="center"
            android:padding="5dp"
            android:scaleType="fitXY"
            android:src="@drawable/tut_delete_point" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@+id/help_id2"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="5dp"
            android:background="@drawable/bg_help_text"
            android:gravity="center"
            android:padding="5dp"
            android:text="@string/help_showpictureactivity_deletepoint"
            android:textSize="20sp"
            android:textStyle="bold" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <ImageView
            android:id="@+id/help_id3"
            style="?android:attr/textAppearanceLarge"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:background="@drawable/bg_help_text"
            android:contentDescription="@string/help_showpictureactivity_description_move"
            android:gravity="center"
            android:padding="5dp"
            android:scaleType="fitXY"
            android:src="@drawable/tut_move_point" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@+id/help_id3"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="5dp"
            android:background="@drawable/bg_help_text"
            android:gravity="center"
            android:padding="5dp"
            android:text="@string/help_showpictureactivity_movepoint"
            android:textSize="20sp"
            android:textStyle="bold" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true" >

            <ImageView
                android:id="@+id/help_1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_point" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignTop="@+id/help_1"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="5dp"
                android:layout_toRightOf="@+id/help_2"
                android:background="@drawable/bg_help_text"
                android:padding="5dp"
                android:text="@string/help_showpictureactivity_point"
                android:textSize="20sp"
                android:textStyle="bold" />

            <ImageView
                android:id="@+id/help_2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/help_1"
                android:layout_marginTop="5dp"
                android:src="@drawable/ic_way" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignTop="@+id/help_2"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="5dp"
                android:layout_toRightOf="@+id/help_1"
                android:background="@drawable/bg_help_text"
                android:padding="5dp"
                android:text="@string/help_showpictureactivity_way"
                android:textSize="20sp"
                android:textStyle="bold" />

            <ImageView
                android:id="@+id/help_3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/help_2"
                android:layout_marginTop="5dp"
                android:src="@drawable/ic_area" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignTop="@+id/help_3"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="5dp"
                android:layout_toRightOf="@+id/help_3"
                android:background="@drawable/bg_help_text"
                android:padding="5dp"
                android:text="@string/help_showpictureactivity_area"
                android:textSize="20sp"
                android:textStyle="bold" />

            <ImageView
                android:id="@+id/help_4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/help_3"
                android:layout_marginTop="5dp"
                android:src="@drawable/ic_house" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignTop="@+id/help_4"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="5dp"
                android:layout_toRightOf="@+id/help_4"
                android:background="@drawable/bg_help_text"
                android:padding="5dp"
                android:text="@string/help_showpictureactivity_house"
                android:textSize="20sp"
                android:textStyle="bold" />
        </RelativeLayout>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="60dp"
            android:background="@drawable/bg_help_text"
            android:padding="5dp"
            android:text="@string/help_showpictureactivity_choosetool"
            android:textSize="20sp"
            android:textStyle="bold" />
    </RelativeLayout>

</RelativeLayout>


text:
<?php
//
// Headers for Philips SmartTV.
//
header('Content-Type: application/ce-html+xml; charset=UTF-8');
readfile(__DIR__ . '/index.html');

redpajama_set_name: RedPajamaGithub


text:
<?php
/*
 * Plugin contextual help
 */

/**
 * Returns contextual help.
 *
 * @param type $page
 * @param type $contextual_help
 */
function wpcf_admin_help($page, $contextual_help) {
    $help = '';
    switch ($page) {
        // Custom Fields (list)
        case 'custom_fields':
            $help .= ''
                    . ''
                    . __("Custom Fields (also known as post-meta) are information attached to WordPress posts. This data can then be queried and filtered in your database. With Types you can create Custom Field Groups which are then attached to any post type (including Posts, Pages and Custom Post Types) or taxonomy.",
                            'wpcf')
                    . '

'
                    . sprintf(__('You can read more about Custom Fields in this tutorial: %s.',
                            'wpcf'),
                              'http://wp-types.com/user-guides/using-custom-fields/ »')
                    . '

'
                    . __("On this page you can see your current custom field groups, as well as information about which post types and taxonomies they are attached to, and whether they are active or not.",
                            'wpcf')
                    . '

'
                    . __('You have the following options:', 'wpcf')
                    . '

'
                    . __('Add a Custom Fields Group: Use this to add a new custom fields group which can be attached to a post type',
                            'wpcf')
                    . '

'
                    . __('Edit: Click to edit the custom field group',
                            'wpcf')
                    . '

'
                    . __('Deactivate: Click to deactivate a custom field group (this can be re-activated at a later date)',
                            'wpcf')
                    . '

'
                    . __('Delete Permanently: Click to delete a custom field group. Warning: This cannot be undone.',
                            'wpcf')
                    . '

';
            break;

        // Custom Types and Taxonomies (list)
        case 'custom_types_and_taxonomies':
            $help .= __('Custom Post Types are user-defined content types. Custom Taxonomies are used to categorize your content.',
                            'wpcf')
                    . ' ' . sprintf(__('You can read more about Custom Post Types and Taxonomies in this tutorial. %s',
                            'wpcf'), 'http://wp-types.com/learn/custom-post-types/ »')
                    . '

'
                    . __('This is the main admin page for your Custom Post Types and Taxonomies. It provides you with an overview of your data.',
                            'wpcf')
                    . '
'
                    . __('On this page you have the following options:', 'wpcf')
                    . '

'
                    . __('Add Custom Post Type: Use to create a new Custom Post Type',
                            'wpcf')
                    . '

'
                    . __('Add Custom Taxonomy: Use to create a new Custom Taxonomy',
                            'wpcf')
                    . '

'
                    . __('Edit: Click to edit the settings of a Custom Post Type or Taxonomy',
                            'wpcf')
                    . '

'
                    . __('Deactivate: Click to deactivate a Custom Post Type or Taxonomy (this can be reactivated at a later date)',
                            'wpcf')
                    . '

'
                    . __('Delete: Click to delete a Custom Post Type or Taxonomy.  Warning: This cannot be undone ',
                            'wpcf')
                    . '

';
            break;

        // Import/Export page
        case 'import_export':
            $help .= __('Use this page to import and export custom post types, taxonomies and custom fields to and from Types.',
                            'wpcf')
                    . '

'
                    . __('This is the main admin page for your Custom Post Types and Taxonomies. It provides you with an overview of your data.',
                            'wpcf')
                    . '
'
                    . __('On this page you have the following options:', 'wpcf')
                    . '
' . __('Import', 'wpcf') . '
'
                    . '

'
                    . __('Step 1: Upload an XML file or paste XML content directly into the text area.',
                            'wpcf')
                    . '

'
                    . __('Step 2: Select which custom post types, taxonomies and custom fields should be imported.',
                            'wpcf')
                    . '

'
                    . '
' . __('Export', 'wpcf') . '
'
                    . __('Click Export to export data from Types as an XML file.',
                            'wpcf');
            break;

        // Add/Edit group form page
        case 'edit_group':
            $help .= __('This is the edit page for your Custom Fields Groups.',
                            'wpcf')
                    . '
'
                    . sprintf(__('You can read more about creating a Custom Fields Group here: %s',
                            'wpcf'), 'http://wp-types.com/user-guides/using-custom-fields/ »')
                    . '

'
                    . __('On this page you can create and edit your groups. To create a group, do the following:',
                            'wpcf')
                    . '

'
                    . __('Add a Title', 'wpcf')
                    . '

'
                    . __('Choose where to display your group. You can attach this to both default WordPress post types and Custom Post Types. (nb: you can also associate taxonomy terms with Custom Field Groups)',
                            'wpcf')
                    . '

'
                    . __('To add a field click on the field you desire under "Available Fields" on the right hand side of your screen. This will be added to your Custom Field Group',
                            'wpcf')
                    . '

'
                    . __('Add information about your Custom Field', 'wpcf')
                    . '

'
                    . '
' . __('Tips', 'wpcf') . '
'
                    . '

'
                    . __('To ensure a user completes a field, check the box for validation required',
                            'wpcf')
                    . '

'
                    . __('Once you have created a field it will be saved for future use under "User created fields"',
                            'wpcf')
                    . '

'
                    . __('You can drag and drop the order of your custom fields using the blue icon',
                            'wpcf')
                    . '

';
            break;

        // Add/Edit custom type form page
        case 'edit_type':
            $help .= __('Use this page to create a WordPress post type. If you'd like to learn more about Custom Post Types you can read our detailed guide: http://wp-types.com/learn/custom-post-types/ or check out our tutorial on creating them with Types: http://wp-types.com/user-guides/create-a-custom-post-type/ »',
                            'wpcf')
                    . '

'
                    . '' . __('Name and Description', 'wpcf') . ''
                    . '
'
                    . __('Add a singular and plural name for your post type. You should also add a slug. This will be created from the post type name if none is added.',
                            'wpcf')
                    . '

'
                    . '' . __('Visibility', 'wpcf') . ''
                    . '

'
                    . __('Determine whether your post type will be visible on the admin menu to your users.',
                            'wpcf')
                    . '

'
                    . __('You can also adjust the menu position. The default position is 20, which means your post type will appear under "Pages". You can find more information about menu positioning in the WordPress Codex. http://codex.wordpress.org/Function_Reference/register_post_type#Parameters',
                            'wpcf')
                    . '

'
                    . __('The default post type icon is the pushpin icon that appears beside WordPress posts. You can change this by adding your own icon of 16px x 16px.',
                            'wpcf')
                    . '

'
                    . '' . __('Select Taxonomies', 'wpcf') . ''
                    . '

'
                    . __('Choose which taxonomies are to be associated with this post type.',
                            'wpcf')
                    . '

'
                    . '' . __('Labels', 'wpcf') . ''
                    . '

'
                    . __('Labels are the text that is attached to your custom post type name. Examples of them in use are "Add New Post" (where "Add New" is the label") and "Edit Post" (where "Edit" is the label). In normal circumstances the defaults will suffice.',
                            'wpcf')
                    . '

'
                    . '' . __('Display Sections', 'wpcf') . ''
                    . '

'
                    . __('Choose which sections to display on your "Add New" page.',
                            'wpcf')
                    . '

'
                    . '' . __('Advanced Settings', 'wpcf') . ''
                    . '

'
                    . __('Advanced settings give you even more control over your custom post type. You can read in detail what all of these settings do on our tutorial.',
                            'wpcf');
            break;

        // Add/Edit custom taxonomy form page
        case 'edit_tax':
            $help .= __('You can use Custom Taxonomies to categorize your content. Read more about what they are on our website: http://wp-types.com/learn/custom-post-types/ » or you can read our guide about how to set them up: http://wp-types.com/user-guides/create-custom-taxonomies/',
                            'wpcf')
                    . '

'
                    . '' . __('Name and Description', 'wpcf') . ''
                    . '

'
                    . __('Add a singular and plural name for your taxonomy. You should also add a slug. This will be created from the taxonomy name if none is added.',
                            'wpcf')
                    . '

'
                    . '' . __('Visibility', 'wpcf') . ''
                    . '

'
                    . __('Determine whether your post type will be visible on the admin menu to your users.',
                            'wpcf')
                    . '

'
                    . '' . __('Select Post Types', 'wpcf') . ''
                    . '

'
                    . __('Choose which post types this taxonomy should be associated with.',
                            'wpcf')
                    . '

'
                    . '' . __('Labels', 'wpcf') . ''
                    . '

'
                    . __('Labels are the text that is attached to your custom post type name. Examples of them in use are "Add New Post" (where "Add New" is the label") and "Edit Post" (where "Edit" is the label). In normal circumstances the defaults will suffice.',
                            'wpcf')
                    . '

'
                    . '' . __('Display Sections', 'wpcf') . ''
                    . '

'
                    . __('Choose which sections to display on your "Add New" page.',
                            'wpcf')
                    . '

'
                    . '' . __('Advanced Settings', 'wpcf') . ''
                    . '

'
                    . __('Advanced settings give you even more control over your custom post type. You can read in detail what all of these settings do on our tutorial.',
                            'wpcf')

            ;
            break;
    }
    return wpautop($help);
}


text:
"""Tests for ``xentica.core.variables`` module."""
import unittest

from xentica.core.variables import Variable, IntegerVariable
from xentica.core.exceptions import XenticaException
from xentica import core
from xentica import seeds

class InvertCA(core.CellularAutomaton):
    """CA that inverts each cell's value each step."""
    state = core.IntegerProperty(max_val=1)
    # vars should be declared at the class level,
    # in order to use them in direct assigns
    intvar = IntegerVariable()

    class Topology:
        """Most common topology."""
        dimensions = 2
        lattice = core.OrthogonalLattice()
        neighborhood = core.MooreNeighborhood()
        border = core.TorusBorder()

    def emit(self):
        """Do nothing at emit phase."""
        self.intvar = self.main.state
        self.buffers[0].state = self.intvar

    def absorb(self):
        """Invert cell's value."""
        self.intvar = self.buffers[0].state
        self.main.state = -self.intvar
        var_list = [
            IntegerVariable(name="self_var"),
            IntegerVariable(),
        ]
        var_list[1] += 1

    def color(self):
        """Do nothing, no color processing required."""

class InvertExperiment(core.Experiment):
    """Test experiment for ``InvertCA``."""

    word = "INSIDE OUT"
    size = (64, 36, )
    seed = seeds.patterns.PrimordialSoup(
        vals={
            "state": seeds.random.RandInt(0, 1),
        }
    )

class TestVariable(unittest.TestCase):
    """Tests for ``Variable`` class and its children."""

    def test_integer(self):
        """Test ``IntegerVariable`` initialization."""
        myvar1 = IntegerVariable()
        self.assertEqual(str(myvar1), "myvar1", "Wrong variable name.")
        self.assertEqual(myvar1.code, "myvar1", "Wrong variable name.")
        myvar2 = IntegerVariable(1)
        self.assertEqual(str(myvar2), "myvar2", "Wrong variable name.")
        var_list = [
            IntegerVariable(1, name="myvar3"),
            IntegerVariable(name="myvar4"),
            IntegerVariable(2),
            IntegerVariable(),
        ]
        self.assertEqual(var_list[0].var_name, "myvar3",
                         "Wrong variable name.")
        self.assertEqual(var_list[1].var_name, "myvar4",
                         "Wrong variable name.")
        self.assertEqual(var_list[2].var_name, "var",
                         "Wrong variable name.")
        self.assertEqual(var_list[3].var_name, "var",
                         "Wrong variable name.")

    def test_descriptor(self):
        """Test ``Variable`` acting as class descriptor."""

        model = InvertCA(InvertExperiment)
        correct_emit = """
unsigned char _cell_state;
_cell_state = (_cell) & 1;
unsigned int intvar = 0;
intvar = _cell_state;
unsigned char _bcell_state0;
_bcell_state0 = intvar;
unsigned char _bcell0;
_bcell0 = ((unsigned char) _bcell_state0 & 1);
fld[i + n * 8] = _bcell0;
"""
        correct_absorb = """
unsigned char _bcell_state0;
_bcell_state0 = (_bcell0) & 1;
unsigned int intvar = 0;
intvar = _bcell_state0;
unsigned char _cell_state;
_cell_state = (-(intvar));
unsigned char _cell = fld[i];
unsigned int var = 0;
var += 1;
_cell = ((unsigned char) _cell_state & 1);
fld[i] = _cell;
"""
        self.assertIn(correct_emit, model.cuda_source,
                      "Wrong code for emit().")
        self.assertIn(correct_absorb, model.cuda_source,
                      "Wrong code for absorb().")

    def test_illegal_assign(self):
        """Test illegal assign to ``DeferredExpression``."""

        with self.assertRaises(XenticaException):
            class BrokenCA(InvertCA):
                """Class for broken expressions testing."""

                def emit(self):
                    """Try to assign to DeferredExpression"""
                    deferred_exp = 1 + self.main.state
                    deferred_exp += 1

            BrokenCA(InvertExperiment)

    def test_no_init_val(self):
        """Test initialization without initial value."""
        with self.assertRaises(XenticaException):
            Variable()


text:
define(['./_baseToString', './_castSlice', './_charsEndIndex', './_stringToArray', './toString'], function(baseToString, castSlice, charsEndIndex, stringToArray, toString) {

  /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  var undefined;

  /** Used to match leading and trailing whitespace. */
  var reTrimEnd = /\s+$/;

  /**
   * Removes trailing whitespace or specified characters from `string`.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category String
   * @param {string} [string=''] The string to trim.
   * @param {string} [chars=whitespace] The characters to trim.
   * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
   * @returns {string} Returns the trimmed string.
   * @example
   *
   * _.trimEnd('  abc  ');
   * // => '  abc'
   *
   * _.trimEnd('-_-abc-_-', '_-');
   * // => '-_-abc'
   */
  function trimEnd(string, chars, guard) {
    string = toString(string);
    if (string && (guard || chars === undefined)) {
      return string.replace(reTrimEnd, '');
    }
    if (!string || !(chars = baseToString(chars))) {
      return string;
    }
    var strSymbols = stringToArray(string),
        end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;

    return castSlice(strSymbols, 0, end).join('');
  }

  return trimEnd;
});


text:
function NewPasswordException () {
  this.name = 'NewPasswordException'
  this.message = 'Setting new password failed!'
}

export default NewPasswordException


text:
namespace xls {

// This pass will act upon a Proc that contains a single CountedFor node. The
// goal is to move the state for the CountedFor node into the Proc state, and
// adjusting the data flow to allow the CountedFor loop (and hence the proc) to
// iterate the required number of times before placing any result on the output
// channel. The driving example is the proc_fir_filter found in xls/examples.

// In the FIR filter's case, the CountedFor is responsible for the convolution
// (multiply-accumulate). Left alone, the CountedFor would be unrolled by
// trip_count times. This translates into that many duplicate blocks of
// hardware. As multipliers are particularly large and expensive IPs, it is
// often good to minimize how many there are. By rolling the CountedFor into
// the proc state, we end up with only a single multiplier, which can be a
// nice area and power consumption optimization.
class RollIntoProcPass : public ProcPass {
 public:
  RollIntoProcPass(std::optional<int64_t> unroll_factor = absl::nullopt);
  ~RollIntoProcPass() override {}

 protected:
  absl::StatusOr<bool> RunOnProcInternal(
      Proc* proc, const PassOptions& options,
      PassResults* results) const override;

  // Unroll the CountedFor function body. This will make it easier to do this
  // kind of optimization in this pass.
  absl::StatusOr<CountedFor*> UnrollCountedForBody(Proc* proc,
                                                   CountedFor* countedfor,
                                                   int64_t unroll_factor) const;

  // Create the new proc initial state that will be used for the folded loop.
  absl::StatusOr<Value> CreateInitialState(Proc* proc, CountedFor* countedfor,
                                           Receive* recv) const;

  // We will need to clone the CountedFor loop body into the proc. This function
  // takes care of that for us.
  absl::StatusOr<Node*> CloneCountedFor(Proc* proc, CountedFor* countedfor,
                                        Node* loop_induction_variable,
                                        Node* loop_carry) const;

  // The Receive node needs to be replaced with a "ReceiveIf" node. Since this
  // required a few steps (including muxing with one of the proc state Tuple
  // elements), move this to a separate function.
  absl::StatusOr<Node*> ReplaceReceiveWithConditionalReceive(
      Proc* proc, Receive* original_receive, Node* receive_condition,
      Node* on_condition_false) const;

  // Build a set of muxes that all use the same selector input.
  absl::StatusOr<std::vector<Node*>> SelectBetween(
      Proc* proc, CountedFor* countedfor, Node* selector,
      absl::Span<Node* const> on_false, absl::Span<Node* const> on_true) const;

 private:
  std::optional<int64_t> unroll_factor_;
};

}  // namespace xls

#endif  // XLS_PASSES_PROC_LOOP_FOLDING_H_


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='entry',
            options={'verbose_name_plural': 'entries'},
        ),
        migrations.RemoveField(
            model_name='entry',
            name='full_name',
        ),
        migrations.RemoveField(
            model_name='entry',
            name='sort_name',
        ),
        migrations.AddField(
            model_name='entry',
            name='first_name',
            field=models.CharField(default='', max_length=255, blank=True),
        ),
        migrations.AddField(
            model_name='entry',
            name='last_name',
            field=models.CharField(default='', max_length=255, blank=True),
        ),
        migrations.AddField(
            model_name='entry',
            name='phone',
            field=models.CharField(default='', max_length=32, blank=True),
        ),
        migrations.AddField(
            model_name='entry',
            name='place',
            field=models.CharField(default='', max_length=64, blank=True),
        ),
        migrations.AddField(
            model_name='entry',
            name='shown_name',
            field=models.CharField(default='', max_length=255, blank=True),
        ),
    ]


text:
"""Performs requests to the Google Maps Static API."""

from googlemaps import convert

MAPS_IMAGE_FORMATS = {'png8', 'png', 'png32', 'gif', 'jpg', 'jpg-baseline'}

MAPS_MAP_TYPES = {'roadmap', 'satellite', 'terrain', 'hybrid'}

class StaticMapParam:
    """Base class to handle parameters for Maps Static API."""

    def __init__(self):
        self.params = []

    def __str__(self):
        """Converts a list of parameters to the format expected by
        the Google Maps server.

        :rtype: str

        """
        return convert.join_list('|', self.params)

class StaticMapMarker(StaticMapParam):
    """Handles marker parameters for Maps Static API."""

    def __init__(self, locations,
                 size=None, color=None, label=None):
        """
        :param locations: Specifies the locations of the markers on
            the map.
        :type locations: list

        :param size: Specifies the size of the marker.
        :type size: str

        :param color: Specifies a color of the marker.
        :type color: str

        :param label: Specifies a single uppercase alphanumeric
            character to be displaied on marker.
        :type label: str
        """

        super(StaticMapMarker, self).__init__()

        if size:
            self.params.append("size:%s" % size)

        if color:
            self.params.append("color:%s" % color)

        if label:
            if len(label) != 1 or (label.isalpha() and not label.isupper()) or not label.isalnum():
                raise ValueError("Marker label must be alphanumeric and uppercase.")
            self.params.append("label:%s" % label)

        self.params.append(convert.location_list(locations))

class StaticMapPath(StaticMapParam):
    """Handles path parameters for Maps Static API."""

    def __init__(self, points,
                 weight=None, color=None,
                 fillcolor=None, geodesic=None):
        """
        :param points: Specifies the point through which the path
            will be built.
        :type points: list

        :param weight: Specifies the thickness of the path in pixels.
        :type weight: int

        :param color: Specifies a color of the path.
        :type color: str

        :param fillcolor: Indicates both that the path marks off a
            polygonal area and specifies the fill color to use as an
            overlay within that area.
        :type fillcolor: str

        :param geodesic: Indicates that the requested path should be
            interpreted as a geodesic line that follows the curvature
            of the earth.
        :type geodesic: bool
        """

        super(StaticMapPath, self).__init__()

        if weight:
            self.params.append("weight:%s" % weight)

        if color:
            self.params.append("color:%s" % color)

        if fillcolor:
            self.params.append("fillcolor:%s" % fillcolor)

        if geodesic:
            self.params.append("geodesic:%s" % geodesic)

        self.params.append(convert.location_list(points))

def static_map(client, size,
               center=None, zoom=None, scale=None,
               format=None, maptype=None, language=None, region=None,
               markers=None, path=None, visible=None, style=None):
    """
    Downloads a map image from the Maps Static API.

    See https://developers.google.com/maps/documentation/maps-static/intro
    for more info, including more detail for each parameter below.

    :param size: Defines the rectangular dimensions of the map image.
    :type param: int or list

    :param center: Defines the center of the map, equidistant from all edges
        of the map.
    :type center: dict or list or string

    :param zoom: Defines the zoom level of the map, which determines the
        magnification level of the map.
    :type zoom: int

    :param scale: Affects the number of pixels that are returned.
    :type scale: int

    :param format: Defines the format of the resulting image.
    :type format: string

    :param maptype: defines the type of map to construct. There are several
        possible maptype values, including roadmap, satellite, hybrid,
        and terrain.
    :type maptype: string

    :param language: defines the language to use for display of labels on
        map tiles.
    :type language: string

    :param region: defines the appropriate borders to display, based on
        geo-political sensitivities.
    :type region: string

    :param markers: define one or more markers to attach to the image at
        specified locations.
    :type markers: StaticMapMarker

    :param path: defines a single path of two or more connected points to
        overlay on the image at specified locations.
    :type path: StaticMapPath

    :param visible: specifies one or more locations that should remain visible
        on the map, though no markers or other indicators will be displayed.
    :type visible: list of dict

    :param style: defines a custom style to alter the presentation of
        a specific feature (roads, parks, and other features) of the map.
    :type style: list of dict

    :rtype: iterator containing the raw image data, which typically can be
        used to save an image file locally. For example:

        ```
        f = open(local_filename, 'wb')
        for chunk in client.static_map(size=(400, 400),
                                       center=(52.520103, 13.404871),
                                       zoom=15):
            if chunk:
                f.write(chunk)
        f.close()
        ```
    """

    params = {"size": convert.size(size)}

    if not markers:
        if not (center or zoom is not None):
            raise ValueError(
                "both center and zoom are required"
                "when markers is not specifed"
            )

    if center:
        params["center"] = convert.latlng(center)

    if zoom is not None:
        params["zoom"] = zoom

    if scale is not None:
        params["scale"] = scale

    if format:
        if format not in MAPS_IMAGE_FORMATS:
             raise ValueError("Invalid image format")
        params['format'] = format

    if maptype:
        if maptype not in MAPS_MAP_TYPES:
            raise ValueError("Invalid maptype")
        params["maptype"] = maptype

    if language:
        params["language"] = language

    if region:
        params["region"] = region

    if markers:
        params["markers"] = markers

    if path:
        params["path"] = path

    if visible:
        params["visible"] = convert.location_list(visible)

    if style:
        params["style"] = convert.components(style)

    response = client._request(
        "/maps/api/staticmap",
        params,
        extract_body=lambda response: response,
        requests_kwargs={"stream": True},
    )
    return response.iter_content()


text:
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import {PageToolbarElement} from 'chrome://resources/ash/common/page_toolbar.js';
import {flushTasks} from 'chrome://webui-test/polymer_test_util.js';

import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js';
import {isVisible} from '../test_util.js';

export function pageToolbarTestSuite() {
  /** @type {?PageToolbarElement} */
  let pageToolbarElement = null;

  setup(() => {
    document.body.innerHTML = '';
  });

  teardown(() => {
    pageToolbarElement.remove();
    pageToolbarElement = null;
  });

  /**
   * @param {string} title
   * @return {!Promise}
   */
  function initializePageToolbar(title) {
    assertFalse(!!pageToolbarElement);

    pageToolbarElement =
        /** @type {!PageToolbarElement} */ (
            document.createElement('page-toolbar'));

    assertTrue(!!pageToolbarElement);
    pageToolbarElement.title = title;
    document.body.appendChild(pageToolbarElement);

    return flushTasks();
  }

  test('TitleInitialized', () => {
    return initializePageToolbar('title').then(() => {
      assertTrue(isVisible(/** @type {!HTMLElement} */ (
          pageToolbarElement.shadowRoot.querySelector('#title'))));
      const expectedTitle = 'title';
      const actualTitle =
          pageToolbarElement.shadowRoot.querySelector('#title').textContent;
      assertEquals(expectedTitle, actualTitle);
    });
  });
}


text:
module MiqAeMethodService
  class MiqAeServiceManageIQ_Providers_AutomationManager_ConfiguredSystem < MiqAeServiceConfiguredSystem
    expose :manager, :association => true
  end
end


text:
module Cryptoexchange::Exchanges
  module Finexbox
    module Services
      class Market < Cryptoexchange::Services::Market
        class << self
          def supports_individual_ticker_query?
            false
          end
        end

        def fetch
          output = super ticker_url
          adapt_all(output)
        end

        def ticker_url
          "#{Cryptoexchange::Exchanges::Finexbox::Market::API_URL}/market"
        end

        def adapt_all(output)
          markets = output['result']
          markets.map do |value|
            base, target = value['market'].split('_')
            market_pair = Cryptoexchange::Models::MarketPair.new(
              base: base,
              target: target,
              market: Finexbox::Market::NAME
            )
            adapt(value, market_pair)
          end
        end

        def adapt(output, market_pair)
          ticker = Cryptoexchange::Models::Ticker.new
          ticker.base      = market_pair.base
          ticker.target    = market_pair.target
          ticker.market    = Finexbox::Market::NAME
          ticker.last      = NumericHelper.to_d(output['price'])
          ticker.high      = NumericHelper.to_d(output['high'])
          ticker.low       = NumericHelper.to_d(output['low'])
          ticker.volume    = NumericHelper.to_d(output['volume'])
          ticker.change    = NumericHelper.to_d(output['percent'])
          ticker.timestamp = nil
          ticker.payload   = output
          ticker
        end
      end
    end
  end
end


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

namespace UMA
{
    public class ImportProcessor : AssetPostprocessor
    {
        // Start is called before the first frame update
        static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {
            string UMAVER = "UMA " + UmaAboutWindow.umaVersion;
            if (BuildPipeline.isBuildingPlayer || UnityEditorInternal.InternalEditorUtility.inBatchMode || Application.isPlaying)
                return;

            if (EditorPrefs.GetString("UMA_VERSION", "0") != UmaAboutWindow.umaVersion)
            {
                UMAAssetIndexer UAI = UMAAssetIndexer.Instance;
                if (UAI == null)
                    return;

                int chosen = EditorUtility.DisplayDialogComplex("UMA " + UmaAboutWindow.umaVersion, "New UMA version imported. The global index should be rebuilt or restored (if you made a backup). (If you don't know what this means, choose 'Rebuild Index')", "Rebuild Index", "Restore from backup", "Do nothing");

                switch (chosen)
                {
                    case 0:
                        UAI.Clear();
                        UAI.BuildStringTypes();
                        UAI.AddEverything(false);
                        Resources.UnloadUnusedAssets();
                        EditorUtility.DisplayDialog(UMAVER, "Index rebuild complete", "OK");
                        break;

                    case 1:
                        string filename = EditorUtility.OpenFilePanel("Restore", "", "bak");
                        if (!string.IsNullOrEmpty(filename))
                        {
                            try
                            {
                                string backup = System.IO.File.ReadAllText(filename);
                                EditorUtility.DisplayProgressBar(UMAVER, "Restoring index", 0);
                                if (!UAI.Restore(backup))
                                {
                                    EditorUtility.DisplayDialog(UMAVER, "Error: Unable to restore index. Please review the console for more information.", "OK");
                                }
                                else
                                {
                                    EditorUtility.DisplayDialog(UMAVER, "Restore successful.", "OK");
                                }
                                backup = "";
                            }
                            catch (Exception ex)
                            {
                                Debug.LogException(ex);
                                EditorUtility.DisplayDialog("Error", "Error reading backup: " + ex.Message, "OK");
                            }
                            EditorUtility.ClearProgressBar();
                        }
                        break;

                    default:
                        EditorUtility.DisplayDialog("UMA " + UmaAboutWindow.umaVersion, "You can rebuild or restore the library from the Global Library window accessable from the UMA menu above.", "OK");
                        break;
                }
                EditorPrefs.SetString("UMA_VERSION", UmaAboutWindow.umaVersion);
            }
        }
    }
}


text:
require "active_support/core_ext/hash/indifferent_access"

module ActiveRecord
  # Store gives you a thin wrapper around serialize for the purpose of storing hashes in a single column.
  # It's like a simple key/value store baked into your record when you don't care about being able to
  # query that store outside the context of a single record.
  #
  # You can then declare accessors to this store that are then accessible just like any other attribute
  # of the model. This is very helpful for easily exposing store keys to a form or elsewhere that's
  # already built around just accessing attributes on the model.
  #
  # Every accessor comes with dirty tracking methods (+key_changed?+, +key_was+ and +key_change+) and
  # methods to access the changes made during the last save (+saved_change_to_key?+, +saved_change_to_key+ and
  # +key_before_last_save+).
  #
  # NOTE: There is no +key_will_change!+ method for accessors, use +store_will_change!+ instead.
  #
  # Make sure that you declare the database column used for the serialized store as a text, so there's
  # plenty of room.
  #
  # You can set custom coder to encode/decode your serialized attributes to/from different formats.
  # JSON, YAML, Marshal are supported out of the box. Generally it can be any wrapper that provides +load+ and +dump+.
  #
  # NOTE: If you are using structured database data types (eg. PostgreSQL +hstore+/+json+, or MySQL 5.7+
  # +json+) there is no need for the serialization provided by {.store}[rdoc-ref:rdoc-ref:ClassMethods#store].
  # Simply use {.store_accessor}[rdoc-ref:ClassMethods#store_accessor] instead to generate
  # the accessor methods. Be aware that these columns use a string keyed hash and do not allow access
  # using a symbol.
  #
  # NOTE: The default validations with the exception of +uniqueness+ will work.
  # For example, if you want to check for +uniqueness+ with +hstore+ you will
  # need to use a custom validation to handle it.
  #
  # Examples:
  #
  #   class User < ActiveRecord::Base
  #     store :settings, accessors: [ :color, :homepage ], coder: JSON
  #     store :parent, accessors: [ :name ], coder: JSON, prefix: true
  #     store :spouse, accessors: [ :name ], coder: JSON, prefix: :partner
  #     store :settings, accessors: [ :two_factor_auth ], suffix: true
  #     store :settings, accessors: [ :login_retry ], suffix: :config
  #   end
  #
  #   u = User.new(color: 'black', homepage: '37signals.com', parent_name: 'Mary', partner_name: 'Lily')
  #   u.color                          # Accessor stored attribute
  #   u.parent_name                    # Accessor stored attribute with prefix
  #   u.partner_name                   # Accessor stored attribute with custom prefix
  #   u.two_factor_auth_settings       # Accessor stored attribute with suffix
  #   u.login_retry_config             # Accessor stored attribute with custom suffix
  #   u.settings[:country] = 'Denmark' # Any attribute, even if not specified with an accessor
  #
  #   # There is no difference between strings and symbols for accessing custom attributes
  #   u.settings[:country]  # => 'Denmark'
  #   u.settings['country'] # => 'Denmark'
  #
  #   # Dirty tracking
  #   u.color = 'green'
  #   u.color_changed? # => true
  #   u.color_was # => 'black'
  #   u.color_change # => ['black', 'red']
  #
  #   # Add additional accessors to an existing store through store_accessor
  #   class SuperUser < User
  #     store_accessor :settings, :privileges, :servants
  #     store_accessor :parent, :birthday, prefix: true
  #     store_accessor :settings, :secret_question, suffix: :config
  #   end
  #
  # The stored attribute names can be retrieved using {.stored_attributes}[rdoc-ref:rdoc-ref:ClassMethods#stored_attributes].
  #
  #   User.stored_attributes[:settings] # [:color, :homepage, :two_factor_auth, :login_retry]
  #
  # == Overwriting default accessors
  #
  # All stored values are automatically available through accessors on the Active Record
  # object, but sometimes you want to specialize this behavior. This can be done by overwriting
  # the default accessors (using the same name as the attribute) and calling <tt>super</tt>
  # to actually change things.
  #
  #   class Song < ActiveRecord::Base
  #     # Uses a stored integer to hold the volume adjustment of the song
  #     store :settings, accessors: [:volume_adjustment]
  #
  #     def volume_adjustment=(decibels)
  #       super(decibels.to_i)
  #     end
  #
  #     def volume_adjustment
  #       super.to_i
  #     end
  #   end
  module Store
    extend ActiveSupport::Concern

    included do
      class << self
        attr_accessor :local_stored_attributes
      end
    end

    module ClassMethods
      def store(store_attribute, options = {})
        serialize store_attribute, IndifferentCoder.new(store_attribute, options[:coder])
        store_accessor(store_attribute, options[:accessors], options.slice(:prefix, :suffix)) if options.has_key? :accessors
      end

      def store_accessor(store_attribute, *keys, prefix: nil, suffix: nil)
        keys = keys.flatten

        accessor_prefix =
          case prefix
          when String, Symbol
            "#{prefix}_"
          when TrueClass
            "#{store_attribute}_"
          else
            ""
          end
        accessor_suffix =
          case suffix
          when String, Symbol
            "_#{suffix}"
          when TrueClass
            "_#{store_attribute}"
          else
            ""
          end

        _store_accessors_module.module_eval do
          keys.each do |key|
            accessor_key = "#{accessor_prefix}#{key}#{accessor_suffix}"

            define_method("#{accessor_key}=") do |value|
              write_store_attribute(store_attribute, key, value)
            end

            define_method(accessor_key) do
              read_store_attribute(store_attribute, key)
            end

            define_method("#{accessor_key}_changed?") do
              return false unless attribute_changed?(store_attribute)
              prev_store, new_store = changes[store_attribute]
              prev_store&.dig(key) != new_store&.dig(key)
            end

            define_method("#{accessor_key}_change") do
              return unless attribute_changed?(store_attribute)
              prev_store, new_store = changes[store_attribute]
              [prev_store&.dig(key), new_store&.dig(key)]
            end

            define_method("#{accessor_key}_was") do
              return unless attribute_changed?(store_attribute)
              prev_store, _new_store = changes[store_attribute]
              prev_store&.dig(key)
            end

            define_method("saved_change_to_#{accessor_key}?") do
              return false unless saved_change_to_attribute?(store_attribute)
              prev_store, new_store = saved_change_to_attribute(store_attribute)
              prev_store&.dig(key) != new_store&.dig(key)
            end

            define_method("saved_change_to_#{accessor_key}") do
              return unless saved_change_to_attribute?(store_attribute)
              prev_store, new_store = saved_change_to_attribute(store_attribute)
              [prev_store&.dig(key), new_store&.dig(key)]
            end

            define_method("#{accessor_key}_before_last_save") do
              return unless saved_change_to_attribute?(store_attribute)
              prev_store, _new_store = saved_change_to_attribute(store_attribute)
              prev_store&.dig(key)
            end
          end
        end

        # assign new store attribute and create new hash to ensure that each class in the hierarchy
        # has its own hash of stored attributes.
        self.local_stored_attributes ||= {}
        self.local_stored_attributes[store_attribute] ||= []
        self.local_stored_attributes[store_attribute] |= keys
      end

      def _store_accessors_module # :nodoc:
        @_store_accessors_module ||= begin
          mod = Module.new
          include mod
          mod
        end
      end

      def stored_attributes
        parent = superclass.respond_to?(:stored_attributes) ? superclass.stored_attributes : {}
        if local_stored_attributes
          parent.merge!(local_stored_attributes) { |k, a, b| a | b }
        end
        parent
      end
    end

    private
      def read_store_attribute(store_attribute, key) # :doc:
        accessor = store_accessor_for(store_attribute)
        accessor.read(self, store_attribute, key)
      end

      def write_store_attribute(store_attribute, key, value) # :doc:
        accessor = store_accessor_for(store_attribute)
        accessor.write(self, store_attribute, key, value)
      end

      def store_accessor_for(store_attribute)
        type_for_attribute(store_attribute).accessor
      end

      class HashAccessor # :nodoc:
        def self.read(object, attribute, key)
          prepare(object, attribute)
          object.public_send(attribute)[key]
        end

        def self.write(object, attribute, key, value)
          prepare(object, attribute)
          if value != read(object, attribute, key)
            object.public_send :"#{attribute}_will_change!"
            object.public_send(attribute)[key] = value
          end
        end

        def self.prepare(object, attribute)
          object.public_send :"#{attribute}=", {} unless object.send(attribute)
        end
      end

      class StringKeyedHashAccessor < HashAccessor # :nodoc:
        def self.read(object, attribute, key)
          super object, attribute, key.to_s
        end

        def self.write(object, attribute, key, value)
          super object, attribute, key.to_s, value
        end
      end

      class IndifferentHashAccessor < ActiveRecord::Store::HashAccessor # :nodoc:
        def self.prepare(object, store_attribute)
          attribute = object.send(store_attribute)
          unless attribute.is_a?(ActiveSupport::HashWithIndifferentAccess)
            attribute = IndifferentCoder.as_indifferent_hash(attribute)
            object.send :"#{store_attribute}=", attribute
          end
          attribute
        end
      end

      class IndifferentCoder # :nodoc:
        def initialize(attr_name, coder_or_class_name)
          @coder =
            if coder_or_class_name.respond_to?(:load) && coder_or_class_name.respond_to?(:dump)
              coder_or_class_name
            else
              ActiveRecord::Coders::YAMLColumn.new(attr_name, coder_or_class_name || Object)
            end
        end

        def dump(obj)
          @coder.dump self.class.as_indifferent_hash(obj)
        end

        def load(yaml)
          self.class.as_indifferent_hash(@coder.load(yaml || ""))
        end

        def self.as_indifferent_hash(obj)
          case obj
          when ActiveSupport::HashWithIndifferentAccess
            obj
          when Hash
            obj.with_indifferent_access
          else
            ActiveSupport::HashWithIndifferentAccess.new
          end
        end
      end
  end
end


text:
//
//  MHConstant.m
//  MHDevelopExample
//
//  Created by CoderMikeHe on 17/2/7.
//  Copyright © 2017年 CoderMikeHe. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

/**
 *  全局细线高度 .75f
 */
CGFloat const MHGlobalBottomLineHeight = .55f;

/**
 *  UIView 动画时长
 */
NSTimeInterval const MHAnimateDuration = .35f;

/**
 *  全局控制器顶部间距 10
 */
CGFloat const MHGlobalViewTopInset = 10.0f;

/**
 *  全局控制器左边间距 12
 */
CGFloat const MHGlobalViewLeftInset = 12.0f;

/**
 *  全局控制器中间间距 10
 */
CGFloat const MHGlobalViewInterInset = 10.0f;

/** 百思不得姐 -顶部标题的高度 */
CGFloat const MHTitilesViewH = 44;
/** 百思不得姐-顶部标题的Y */
CGFloat const MHTitilesViewY = 64;

/** 网易新闻-颜色 R、G、B、A*/
CGFloat const MHTopicLabelRed = .4f;
CGFloat const MHTopicLabelGreen = .6f;
CGFloat const MHTopicLabelBlue = .7f;
CGFloat const MHTopicLabelAlpha = 1.0f;

// 仿微信朋友圈评论和回复
// 段头+cell+表头
/**  话题头像宽高 */
CGFloat const MHTopicAvatarWH = 30.0f ;
/**  话题水平方向间隙 */
CGFloat const MHTopicHorizontalSpace = 10.0f;
/**  话题垂直方向间隙 */
CGFloat const MHTopicVerticalSpace = 10.0f ;
/**  话题更多按钮宽 */
CGFloat const MHTopicMoreButtonW = 24.0f ;

/**  评论水平方向间隙 */
CGFloat const MHCommentHorizontalSpace = 11.0f;
/**  评论垂直方向间隙 */
CGFloat const MHCommentVerticalSpace = 7.0f;

/** 文本行高 */
CGFloat const  MHCommentContentLineSpacing = 10.0f;

/** 评论假数据的id */
NSString * const MHAllCommentsId = @"MHAllCommentsId" ;

/** 评论用户的key */
NSString * const MHCommentUserKey = @"MHCommentUserKey";

/** 评论高度 */
CGFloat const MHCommentHeaderViewHeight = 100.0f;

/** 评论工具高度 */
CGFloat const MHCommentToolBarHeight  = 44.0f  ;

/** 最大字数 */
NSInteger const MHCommentMaxWords  = 300  ;

/** 每页数据 */
NSUInteger const MHCommentMaxCount = 30;

/** 弹出评论框View最小距离 */
CGFloat const MHTopicCommentToolBarMinHeight = 105;

/** 弹出评论框View的除了编辑框的高度 */
CGFloat const MHTopicCommentToolBarWithNoTextViewHeight = 75;

/** 视频评论成功的通知 */
NSString * const MHCommentSuccessNotification = @"MHCommentSuccessNotification";
/** 视频评论成功Key */
NSString * const MHCommentSuccessKey = @"MHCommentSuccessKey" ;

/** 视频点赞成功的通知 */
NSString * const MHThumbSuccessNotification = @"MHThumbSuccessNotification" ;

/** 视频评论回复成功的通知 */
NSString * const MHCommentReplySuccessNotification = @"MHCommentReplySuccessNotification" ;
/** 视频评论回复成功Key */
NSString * const MHCommentReplySuccessKey = @"MHCommentReplySuccessKey" ;

/** 视频评论获取成功的事件 */
NSString * const MHCommentRequestDataSuccessNotification = @"MHCommentRequestDataSuccessNotification" ;
/** 视频评论获取成功的事件 */
NSString * const MHCommentRequestDataSuccessKey = @"MHCommentRequestDataSuccessKey" ;

/** titleView高度 */
CGFloat const MHRecommendTitleViewHeight = 32.0f;
/** 选集view高度 */
CGFloat const MHRecommendAnthologyViewHeight = 44.0f;
/** 选集纯文本HeaderView高度 */
CGFloat const MHRecommendAnthologyHeaderViewHeight = 91.0f;
/** 评论高度 */
CGFloat const MHRecommendCommentHeaderViewHeight = 100.0f;


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

import io.trino.plugin.raptor.legacy.metadata.Distribution;
import io.trino.plugin.raptor.legacy.metadata.TableColumn;
import io.trino.spi.type.TypeManager;
import io.trino.spi.type.TypeOperators;
import io.trino.type.InternalTypeManager;
import org.jdbi.v3.core.Jdbi;
import org.jdbi.v3.sqlobject.SqlObjectPlugin;

import java.util.concurrent.ThreadLocalRandom;

import static io.trino.metadata.MetadataManager.createTestMetadataManager;

public final class DatabaseTesting
{
    private DatabaseTesting() {}

    public static Jdbi createTestingJdbi()
    {
        TypeManager typeManager = new InternalTypeManager(createTestMetadataManager(), new TypeOperators());
        return Jdbi.create("jdbc:h2:mem:test" + System.nanoTime() + ThreadLocalRandom.current().nextLong())
                .installPlugin(new SqlObjectPlugin())
                .registerRowMapper(new TableColumn.Mapper(typeManager))
                .registerRowMapper(new Distribution.Mapper(typeManager));
    }
}


text:
namespace llvm {
  class APInt;
  class AddOperator;
  class AssumptionCache;
  class DataLayout;
  class DominatorTree;
  class Instruction;
  class Loop;
  class LoopInfo;
  class MDNode;
  class StringRef;
  class TargetLibraryInfo;
  class Value;

  /// Determine which bits of V are known to be either zero or one and return
  /// them in the KnownZero/KnownOne bit sets.
  ///
  /// This function is defined on values with integer type, values with pointer
  /// type, and vectors of integers.  In the case
  /// where V is a vector, the known zero and known one values are the
  /// same width as the vector element, and the bit is set only if it is true
  /// for all of the elements in the vector.
  void computeKnownBits(Value *V, APInt &KnownZero, APInt &KnownOne,
                        const DataLayout &DL, unsigned Depth = 0,
                        AssumptionCache *AC = nullptr,
                        const Instruction *CxtI = nullptr,
                        const DominatorTree *DT = nullptr);
  /// Compute known bits from the range metadata.
  /// \p KnownZero the set of bits that are known to be zero
  /// \p KnownOne the set of bits that are known to be one
  void computeKnownBitsFromRangeMetadata(const MDNode &Ranges,
                                         APInt &KnownZero, APInt &KnownOne);
  /// Return true if LHS and RHS have no common bits set.
  bool haveNoCommonBitsSet(Value *LHS, Value *RHS, const DataLayout &DL,
                           AssumptionCache *AC = nullptr,
                           const Instruction *CxtI = nullptr,
                           const DominatorTree *DT = nullptr);

  /// ComputeSignBit - Determine whether the sign bit is known to be zero or
  /// one.  Convenience wrapper around computeKnownBits.
  void ComputeSignBit(Value *V, bool &KnownZero, bool &KnownOne,
                      const DataLayout &DL, unsigned Depth = 0,
                      AssumptionCache *AC = nullptr,
                      const Instruction *CxtI = nullptr,
                      const DominatorTree *DT = nullptr);

  /// isKnownToBeAPowerOfTwo - Return true if the given value is known to have
  /// exactly one bit set when defined. For vectors return true if every
  /// element is known to be a power of two when defined.  Supports values with
  /// integer or pointer type and vectors of integers.  If 'OrZero' is set then
  /// return true if the given value is either a power of two or zero.
  bool isKnownToBeAPowerOfTwo(Value *V, const DataLayout &DL,
                              bool OrZero = false, unsigned Depth = 0,
                              AssumptionCache *AC = nullptr,
                              const Instruction *CxtI = nullptr,
                              const DominatorTree *DT = nullptr);

  /// isKnownNonZero - Return true if the given value is known to be non-zero
  /// when defined.  For vectors return true if every element is known to be
  /// non-zero when defined.  Supports values with integer or pointer type and
  /// vectors of integers.
  bool isKnownNonZero(Value *V, const DataLayout &DL, unsigned Depth = 0,
                      AssumptionCache *AC = nullptr,
                      const Instruction *CxtI = nullptr,
                      const DominatorTree *DT = nullptr);

  /// Returns true if the give value is known to be non-negative.
  bool isKnownNonNegative(Value *V, const DataLayout &DL, unsigned Depth = 0,
                          AssumptionCache *AC = nullptr,
                          const Instruction *CxtI = nullptr,
                          const DominatorTree *DT = nullptr);

  /// isKnownNonEqual - Return true if the given values are known to be
  /// non-equal when defined. Supports scalar integer types only.
  bool isKnownNonEqual(Value *V1, Value *V2, const DataLayout &DL,
                      AssumptionCache *AC = nullptr,
                      const Instruction *CxtI = nullptr,
                      const DominatorTree *DT = nullptr);

  /// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero.  We use
  /// this predicate to simplify operations downstream.  Mask is known to be
  /// zero for bits that V cannot have.
  ///
  /// This function is defined on values with integer type, values with pointer
  /// type, and vectors of integers.  In the case
  /// where V is a vector, the mask, known zero, and known one values are the
  /// same width as the vector element, and the bit is set only if it is true
  /// for all of the elements in the vector.
  bool MaskedValueIsZero(Value *V, const APInt &Mask, const DataLayout &DL,
                         unsigned Depth = 0, AssumptionCache *AC = nullptr,
                         const Instruction *CxtI = nullptr,
                         const DominatorTree *DT = nullptr);

  /// ComputeNumSignBits - Return the number of times the sign bit of the
  /// register is replicated into the other bits.  We know that at least 1 bit
  /// is always equal to the sign bit (itself), but other cases can give us
  /// information.  For example, immediately after an "ashr X, 2", we know that
  /// the top 3 bits are all equal to each other, so we return 3.
  ///
  /// 'Op' must have a scalar integer type.
  ///
  unsigned ComputeNumSignBits(Value *Op, const DataLayout &DL,
                              unsigned Depth = 0, AssumptionCache *AC = nullptr,
                              const Instruction *CxtI = nullptr,
                              const DominatorTree *DT = nullptr);

  /// ComputeMultiple - This function computes the integer multiple of Base that
  /// equals V.  If successful, it returns true and returns the multiple in
  /// Multiple.  If unsuccessful, it returns false.  Also, if V can be
  /// simplified to an integer, then the simplified V is returned in Val.  Look
  /// through sext only if LookThroughSExt=true.
  bool ComputeMultiple(Value *V, unsigned Base, Value *&Multiple,
                       bool LookThroughSExt = false,
                       unsigned Depth = 0);

  /// CannotBeNegativeZero - Return true if we can prove that the specified FP
  /// value is never equal to -0.0.
  ///
  bool CannotBeNegativeZero(const Value *V, unsigned Depth = 0);

  /// CannotBeOrderedLessThanZero - Return true if we can prove that the
  /// specified FP value is either a NaN or never less than 0.0.
  ///
  bool CannotBeOrderedLessThanZero(const Value *V, unsigned Depth = 0);

  /// isBytewiseValue - If the specified value can be set by repeating the same
  /// byte in memory, return the i8 value that it is represented with.  This is
  /// true for all i8 values obviously, but is also true for i32 0, i32 -1,
  /// i16 0xF0F0, double 0.0 etc.  If the value can't be handled with a repeated
  /// byte store (e.g. i16 0x1234), return null.
  Value *isBytewiseValue(Value *V);

  /// FindInsertedValue - Given an aggregrate and an sequence of indices, see if
  /// the scalar value indexed is already around as a register, for example if
  /// it were inserted directly into the aggregrate.
  ///
  /// If InsertBefore is not null, this function will duplicate (modified)
  /// insertvalues when a part of a nested struct is extracted.
  Value *FindInsertedValue(Value *V,
                           ArrayRef<unsigned> idx_range,
                           Instruction *InsertBefore = nullptr);

  /// GetPointerBaseWithConstantOffset - Analyze the specified pointer to see if
  /// it can be expressed as a base pointer plus a constant offset.  Return the
  /// base and offset to the caller.
  Value *GetPointerBaseWithConstantOffset(Value *Ptr, int64_t &Offset,
                                          const DataLayout &DL);
  static inline const Value *
  GetPointerBaseWithConstantOffset(const Value *Ptr, int64_t &Offset,
                                   const DataLayout &DL) {
    return GetPointerBaseWithConstantOffset(const_cast<Value *>(Ptr), Offset,
                                            DL);
  }

  /// getConstantStringInfo - This function computes the length of a
  /// null-terminated C string pointed to by V.  If successful, it returns true
  /// and returns the string in Str.  If unsuccessful, it returns false.  This
  /// does not include the trailing nul character by default.  If TrimAtNul is
  /// set to false, then this returns any trailing nul characters as well as any
  /// other characters that come after it.
  bool getConstantStringInfo(const Value *V, StringRef &Str,
                             uint64_t Offset = 0, bool TrimAtNul = true);

  /// GetStringLength - If we can compute the length of the string pointed to by
  /// the specified pointer, return 'len+1'.  If we can't, return 0.
  uint64_t GetStringLength(Value *V);

  /// GetUnderlyingObject - This method strips off any GEP address adjustments
  /// and pointer casts from the specified value, returning the original object
  /// being addressed.  Note that the returned value has pointer type if the
  /// specified value does.  If the MaxLookup value is non-zero, it limits the
  /// number of instructions to be stripped off.
  Value *GetUnderlyingObject(Value *V, const DataLayout &DL,
                             unsigned MaxLookup = 6);
  static inline const Value *GetUnderlyingObject(const Value *V,
                                                 const DataLayout &DL,
                                                 unsigned MaxLookup = 6) {
    return GetUnderlyingObject(const_cast<Value *>(V), DL, MaxLookup);
  }

  /// \brief This method is similar to GetUnderlyingObject except that it can
  /// look through phi and select instructions and return multiple objects.
  ///
  /// If LoopInfo is passed, loop phis are further analyzed.  If a pointer
  /// accesses different objects in each iteration, we don't look through the
  /// phi node. E.g. consider this loop nest:
  ///
  ///   int **A;
  ///   for (i)
  ///     for (j) {
  ///        A[i][j] = A[i-1][j] * B[j]
  ///     }
  ///
  /// This is transformed by Load-PRE to stash away A[i] for the next iteration
  /// of the outer loop:
  ///
  ///   Curr = A[0];          // Prev_0
  ///   for (i: 1..N) {
  ///     Prev = Curr;        // Prev = PHI (Prev_0, Curr)
  ///     Curr = A[i];
  ///     for (j: 0..N) {
  ///        Curr[j] = Prev[j] * B[j]
  ///     }
  ///   }
  ///
  /// Since A[i] and A[i-1] are independent pointers, getUnderlyingObjects
  /// should not assume that Curr and Prev share the same underlying object thus
  /// it shouldn't look through the phi above.
  void GetUnderlyingObjects(Value *V, SmallVectorImpl<Value *> &Objects,
                            const DataLayout &DL, LoopInfo *LI = nullptr,
                            unsigned MaxLookup = 6);

  /// onlyUsedByLifetimeMarkers - Return true if the only users of this pointer
  /// are lifetime markers.
  bool onlyUsedByLifetimeMarkers(const Value *V);

  /// isDereferenceablePointer - Return true if this is always a dereferenceable
  /// pointer. If the context instruction is specified perform context-sensitive
  /// analysis and return true if the pointer is dereferenceable at the
  /// specified instruction.
  bool isDereferenceablePointer(const Value *V, const DataLayout &DL,
                                const Instruction *CtxI = nullptr,
                                const DominatorTree *DT = nullptr,
                                const TargetLibraryInfo *TLI = nullptr);

  /// Returns true if V is always a dereferenceable pointer with alignment
  /// greater or equal than requested. If the context instruction is specified
  /// performs context-sensitive analysis and returns true if the pointer is
  /// dereferenceable at the specified instruction.
  bool isDereferenceableAndAlignedPointer(const Value *V, unsigned Align,
                                          const DataLayout &DL,
                                          const Instruction *CtxI = nullptr,
                                          const DominatorTree *DT = nullptr,
                                          const TargetLibraryInfo *TLI = nullptr);

  /// isSafeToSpeculativelyExecute - Return true if the instruction does not
  /// have any effects besides calculating the result and does not have
  /// undefined behavior.
  ///
  /// This method never returns true for an instruction that returns true for
  /// mayHaveSideEffects; however, this method also does some other checks in
  /// addition. It checks for undefined behavior, like dividing by zero or
  /// loading from an invalid pointer (but not for undefined results, like a
  /// shift with a shift amount larger than the width of the result). It checks
  /// for malloc and alloca because speculatively executing them might cause a
  /// memory leak. It also returns false for instructions related to control
  /// flow, specifically terminators and PHI nodes.
  ///
  /// If the CtxI is specified this method performs context-sensitive analysis
  /// and returns true if it is safe to execute the instruction immediately
  /// before the CtxI.
  ///
  /// If the CtxI is NOT specified this method only looks at the instruction
  /// itself and its operands, so if this method returns true, it is safe to
  /// move the instruction as long as the correct dominance relationships for
  /// the operands and users hold.
  ///
  /// This method can return true for instructions that read memory;
  /// for such instructions, moving them may change the resulting value.
  bool isSafeToSpeculativelyExecute(const Value *V,
                                    const Instruction *CtxI = nullptr,
                                    const DominatorTree *DT = nullptr,
                                    const TargetLibraryInfo *TLI = nullptr);

  /// Returns true if the result or effects of the given instructions \p I
  /// depend on or influence global memory.
  /// Memory dependence arises for example if the instruction reads from
  /// memory or may produce effects or undefined behaviour. Memory dependent
  /// instructions generally cannot be reorderd with respect to other memory
  /// dependent instructions or moved into non-dominated basic blocks.
  /// Instructions which just compute a value based on the values of their
  /// operands are not memory dependent.
  bool mayBeMemoryDependent(const Instruction &I);

  /// isKnownNonNull - Return true if this pointer couldn't possibly be null by
  /// its definition.  This returns true for allocas, non-extern-weak globals
  /// and byval arguments.
  bool isKnownNonNull(const Value *V, const TargetLibraryInfo *TLI = nullptr);

  /// isKnownNonNullAt - Return true if this pointer couldn't possibly be null.
  /// If the context instruction is specified perform context-sensitive analysis
  /// and return true if the pointer couldn't possibly be null at the specified
  /// instruction.
  bool isKnownNonNullAt(const Value *V,
                        const Instruction *CtxI = nullptr,
                        const DominatorTree *DT  = nullptr,
                        const TargetLibraryInfo *TLI = nullptr);

  /// Return true if it is valid to use the assumptions provided by an
  /// assume intrinsic, I, at the point in the control-flow identified by the
  /// context instruction, CxtI.
  bool isValidAssumeForContext(const Instruction *I, const Instruction *CxtI,
                               const DominatorTree *DT = nullptr);

  enum class OverflowResult { AlwaysOverflows, MayOverflow, NeverOverflows };
  OverflowResult computeOverflowForUnsignedMul(Value *LHS, Value *RHS,
                                               const DataLayout &DL,
                                               AssumptionCache *AC,
                                               const Instruction *CxtI,
                                               const DominatorTree *DT);
  OverflowResult computeOverflowForUnsignedAdd(Value *LHS, Value *RHS,
                                               const DataLayout &DL,
                                               AssumptionCache *AC,
                                               const Instruction *CxtI,
                                               const DominatorTree *DT);
  OverflowResult computeOverflowForSignedAdd(Value *LHS, Value *RHS,
                                             const DataLayout &DL,
                                             AssumptionCache *AC = nullptr,
                                             const Instruction *CxtI = nullptr,
                                             const DominatorTree *DT = nullptr);
  /// This version also leverages the sign bit of Add if known.
  OverflowResult computeOverflowForSignedAdd(AddOperator *Add,
                                             const DataLayout &DL,
                                             AssumptionCache *AC = nullptr,
                                             const Instruction *CxtI = nullptr,
                                             const DominatorTree *DT = nullptr);

  /// Return true if this function can prove that the instruction I will
  /// always transfer execution to one of its successors (including the next
  /// instruction that follows within a basic block). E.g. this is not
  /// guaranteed for function calls that could loop infinitely.
  ///
  /// In other words, this function returns false for instructions that may
  /// transfer execution or fail to transfer execution in a way that is not
  /// captured in the CFG nor in the sequence of instructions within a basic
  /// block.
  ///
  /// Undefined behavior is assumed not to happen, so e.g. division is
  /// guaranteed to transfer execution to the following instruction even
  /// though division by zero might cause undefined behavior.
  bool isGuaranteedToTransferExecutionToSuccessor(const Instruction *I);

  /// Return true if this function can prove that the instruction I
  /// is executed for every iteration of the loop L.
  ///
  /// Note that this currently only considers the loop header.
  bool isGuaranteedToExecuteForEveryIteration(const Instruction *I,
                                              const Loop *L);

  /// Return true if this function can prove that I is guaranteed to yield
  /// full-poison (all bits poison) if at least one of its operands are
  /// full-poison (all bits poison).
  ///
  /// The exact rules for how poison propagates through instructions have
  /// not been settled as of 2015-07-10, so this function is conservative
  /// and only considers poison to be propagated in uncontroversial
  /// cases. There is no attempt to track values that may be only partially
  /// poison.
  bool propagatesFullPoison(const Instruction *I);

  /// Return either nullptr or an operand of I such that I will trigger
  /// undefined behavior if I is executed and that operand has a full-poison
  /// value (all bits poison).
  const Value *getGuaranteedNonFullPoisonOp(const Instruction *I);

  /// Return true if this function can prove that if PoisonI is executed
  /// and yields a full-poison value (all bits poison), then that will
  /// trigger undefined behavior.
  ///
  /// Note that this currently only considers the basic block that is
  /// the parent of I.
  bool isKnownNotFullPoison(const Instruction *PoisonI);

  /// \brief Specific patterns of select instructions we can match.
  enum SelectPatternFlavor {
    SPF_UNKNOWN = 0,
    SPF_SMIN,                   /// Signed minimum
    SPF_UMIN,                   /// Unsigned minimum
    SPF_SMAX,                   /// Signed maximum
    SPF_UMAX,                   /// Unsigned maximum
    SPF_FMINNUM,                /// Floating point minnum
    SPF_FMAXNUM,                /// Floating point maxnum
    SPF_ABS,                    /// Absolute value
    SPF_NABS                    /// Negated absolute value
  };
  /// \brief Behavior when a floating point min/max is given one NaN and one
  /// non-NaN as input.
  enum SelectPatternNaNBehavior {
    SPNB_NA = 0,                /// NaN behavior not applicable.
    SPNB_RETURNS_NAN,           /// Given one NaN input, returns the NaN.
    SPNB_RETURNS_OTHER,         /// Given one NaN input, returns the non-NaN.
    SPNB_RETURNS_ANY            /// Given one NaN input, can return either (or
                                /// it has been determined that no operands can
                                /// be NaN).
  };
  struct SelectPatternResult {
    SelectPatternFlavor Flavor;
    SelectPatternNaNBehavior NaNBehavior; /// Only applicable if Flavor is
                                          /// SPF_FMINNUM or SPF_FMAXNUM.
    bool Ordered;               /// When implementing this min/max pattern as
                                /// fcmp; select, does the fcmp have to be
                                /// ordered?

    /// \brief Return true if \p SPF is a min or a max pattern.
    static bool isMinOrMax(SelectPatternFlavor SPF) {
      return !(SPF == SPF_UNKNOWN || SPF == SPF_ABS || SPF == SPF_NABS);
    }
  };
  /// Pattern match integer [SU]MIN, [SU]MAX and ABS idioms, returning the kind
  /// and providing the out parameter results if we successfully match.
  ///
  /// If CastOp is not nullptr, also match MIN/MAX idioms where the type does
  /// not match that of the original select. If this is the case, the cast
  /// operation (one of Trunc,SExt,Zext) that must be done to transform the
  /// type of LHS and RHS into the type of V is returned in CastOp.
  ///
  /// For example:
  ///   %1 = icmp slt i32 %a, i32 4
  ///   %2 = sext i32 %a to i64
  ///   %3 = select i1 %1, i64 %2, i64 4
  ///
  /// -> LHS = %a, RHS = i32 4, *CastOp = Instruction::SExt
  ///
  SelectPatternResult matchSelectPattern(Value *V, Value *&LHS, Value *&RHS,
                                         Instruction::CastOps *CastOp = nullptr);

  /// Parse out a conservative ConstantRange from !range metadata.
  ///
  /// E.g. if RangeMD is !{i32 0, i32 10, i32 15, i32 20} then return [0, 20).
  ConstantRange getConstantRangeFromMetadata(MDNode &RangeMD);

  /// Return true if RHS is known to be implied by LHS.  A & B must be i1
  /// (boolean) values or a vector of such values. Note that the truth table for
  /// implication is the same as <=u on i1 values (but not <=s!).  The truth
  /// table for both is:
  ///    | T | F (B)
  ///  T | T | F
  ///  F | T | T
  /// (A)
  bool isImpliedCondition(Value *LHS, Value *RHS, const DataLayout &DL,
                          unsigned Depth = 0, AssumptionCache *AC = nullptr,
                          const Instruction *CxtI = nullptr,
                          const DominatorTree *DT = nullptr);
} // end namespace llvm

#endif


text:
<?php
namespace Ushios\Component\Tumblr\Reblog\Strategy;

/**
 * Reblog all post.
 * @author shugo
 *
 */
class AllReblogStrategy extends AbstractReblogStrategy
{
    /**
     * {@inheritdoc}
     */
    public function canReblog(array $post)
    {
        return true;
    }
}


text:
/**
 *
 */
package com.waeno.mvc;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author Chen, Xiaoqian
 * 2017年3月31日 下午4:38:02
 */
@Controller
@RequestMapping("/sayHelloTo")
public class HelloWorldController {

	@RequestMapping(path = "/{who}", method = RequestMethod.GET)
	public ModelAndView helloWorld(@PathVariable String who) {
		ModelAndView mav=new ModelAndView("hello");
		mav.getModelMap().addAttribute("hello", "Hello,"+who+"!");
		return mav;
	}

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Swift: swift::Response Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

Swift
    0.1

Swift is a C++ framework for building a RESTful API

Main Page

Related Pages

Namespaces

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

 All Classes Namespaces Functions Pages

swift

Response

Public Member Functions |
List of all members

swift::Response Class Reference

Public Member Functions

 	Response ()

void 	addHeader (Header *header)

void 	addHeader (std::string name, std::string value)

bool 	hasHeader (std::string name)

int 	getHeaderCount ()

void 	setContent (char *content, int length)

char * 	getContent ()

int 	getContentLen ()

std::string 	getCharset ()

void 	setCharset (std::string charset)

size_t 	getContentByteSize ()

std::string 	getContentByteSizeStr ()

void 	setBinaryMode (bool binary)

bool 	isBinary ()

std::queue< Header * > 	getHeaderQueue ()

Constructor & Destructor Documentation

          swift::Response::Response
          (
          	)

Constructs a blank Response object

Member Function Documentation

          void swift::Response::addHeader
          (
          Header *
          header	)

Adds a new header object to the response

Parameters

header	object

          void swift::Response::addHeader
          (
          std::string
          name,

          std::string
          value

          )

Creates a new header and adds it to the response

Parameters

header	name

header	value

          std::string swift::Response::getCharset
          (
          	)

Returns the charset for this response (used for text content)

Returns

string

          char * swift::Response::getContent
          (
          	)

Returns the response's content

Returns

char*

          size_t swift::Response::getContentByteSize
          (
          	)

Returns the byte size of the content

Returns

size_t

          std::string swift::Response::getContentByteSizeStr
          (
          	)

Returns the byte size of the content as a string

Returns

string

          int swift::Response::getContentLen
          (
          	)

Returns the lenght of the content

Returns

size_t

          int swift::Response::getHeaderCount
          (
          	)

Returns the number of headers

Returns

integer

          std::queue< Header * > swift::Response::getHeaderQueue
          (
          	)

Returns the queue of headers, in order

Returns

header queue

          bool swift::Response::hasHeader
          (
          std::string
          name	)

Indicates whether the response already has a header with given name

Parameters

header	name

Returns

boolean

          bool swift::Response::isBinary
          (
          	)

Indicates whether this response operates in binary mode

Returns

boolean

          void swift::Response::setBinaryMode
          (
          bool
          binary	)

Makes this Response a binary one or not

Parameters

boolean

          void swift::Response::setCharset
          (
          std::string
          charset	)

Sets the charset for this response (used for text content)

Parameters

charset	string

          void swift::Response::setContent
          (
          char *
          content,

          int
          length

          )

Sets the content of the response object

Parameters

content	string

The documentation for this class was generated from the following files:

swift.h

swift.cpp

<address class="footer">
Generated on Thu Jun 5 2014 12:17:00 for Swift by

 1.8.6
</address>


text:
FROM ubuntu:16.04
MAINTAINER info@openvidu.io

ARG CHROME_VERSION

# Install Chrome
RUN apt-get update && apt-get -y upgrade && apt-get install -y wget sudo \
  # Language Fonts
  ttf-ancient-fonts fonts-beng fonts-wqy-zenhei fonts-indic

RUN wget http://dl.google.com/linux/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb \
  && apt install -y ./google-chrome-stable_${CHROME_VERSION}_amd64.deb \
  && rm google-chrome-stable_${CHROME_VERSION}_amd64.deb \
  && google-chrome --version

# Install media packages
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:jonathonf/ffmpeg-4
RUN apt-get update
RUN apt-get install -y ffmpeg pulseaudio xvfb

# Install jq for managing JSON
RUN apt-get install -y jq

# Add root user to pulseaudio group
RUN adduser root pulse-access

# Clean
RUN apt-get autoclean

COPY entrypoint.sh scripts/composed.sh scripts/composed_quick_start.sh ./
COPY utils/xvfb-run-safe /usr/local/bin

# Prepare scripts and folders
RUN chmod +x /entrypoint.sh /composed.sh /composed_quick_start.sh \
  && chmod +x /usr/local/bin/xvfb-run-safe \
  && mkdir /recordings \
  && chmod 777 /recordings

ENTRYPOINT /entrypoint.sh