text:
Ext.Loader.setConfig({enabled: true});

Ext.Loader.setPath('Ext.ux', '../ux/');

Ext.require([
    'Ext.data.*',
    'Ext.tip.QuickTipManager',
    'Ext.form.*',
    'Ext.grid.Panel'
]);

Ext.onReady(function(){
    MultiLangDemo = (function() {
        // get the selected language code parameter from url (if exists)
        var params = Ext.urlDecode(window.location.search.substring(1));
        //Ext.form.Field.prototype.msgTarget = 'side';

        return {
            init: function() {
                Ext.tip.QuickTipManager.init();

                /* Language chooser combobox  */
                var store = Ext.create('Ext.data.ArrayStore', {
                    fields: ['code', 'language'],
                    data : Ext.exampledata.languages // from languages.js
                });

                var combo = Ext.create('Ext.form.field.ComboBox', {
                    renderTo: 'languages',
                    store: store,
                    displayField:'language',
                    queryMode: 'local',
                    emptyText: 'Select a language...',
                    hideLabel: true,
                    listeners: {
                        select: function(cb, record) {
                            var search = location.search,
                                index = search.indexOf('&'),
                                params = Ext.urlEncode({'lang': record.get('code')});

                            location.search = (index === -1) ? params : params + search.substr(index);
                        }
                    }
                });

                var record, url;

                if (params.lang) {
                    // check if there's really a language with that language code
                    record = store.findRecord('code', params.lang, null, null, null, true);
                    // if language was found in store assign it as current value in combobox
                    if (record) {
                        combo.setValue(record.data.language);
                    }

                    url = Ext.util.Format.format("../../packages/ext-locale/build/ext-locale-{0}.js", params.lang);

                    Ext.Loader.loadScript({
                            url: url,
                            onLoad: this.onSuccess,
                            onError: this.onFailure,
                            scope: this
                        }
                    );
                } else {
                    this.setupDemo();
                }
            },
            onSuccess: function() {
                var me = this;
                // Give the locale file onReady a chance to process
                setTimeout(function() {
                    me.setupDemo();
                }, 1);
            },
            onFailure: function() {
                Ext.Msg.alert('Failure', 'Failed to load locale file.');
                this.setupDemo();
            },
            setupDemo: function() {
                // Grid needs to be this wide to handle the largest language case for the toolbar.
                // In this case, it's Russian.

                var width = 720;
                /* Email field */
                Ext.create('Ext.FormPanel', {
                    renderTo: 'emailfield',
                    labelWidth: 100, // label settings here cascade unless overridden
                    frame: true,
                    title: 'Email Field',
                    bodyPadding: '5 5 0',
                    width: width,
                    defaults: {
                        msgTarget: 'side',
                        width: width - 40
                    },
                    defaultType: 'textfield',
                    items: [{
                        fieldLabel: 'Email',
                        name: 'email',
                        vtype: 'email'
                    }]
                });

                /* Datepicker */
                Ext.create('Ext.FormPanel', {
                    renderTo: 'datefield',
                    labelWidth: 100, // label settings here cascade unless overridden
                    frame: true,
                    title: 'Datepicker',
                    bodyPadding: '5 5 0',
                    width: width,
                    defaults: {
                        msgTarget: 'side',
                        width: width - 40
                    },
                    defaultType: 'datefield',
                    items: [{
                        fieldLabel: 'Date',
                        name: 'date'
                    }]
                });

                // shorthand alias
                var monthArray = Ext.Array.map(Ext.Date.monthNames, function (e) { return [e]; });
                var ds = Ext.create('Ext.data.Store', {
                    fields: ['month'],
                    remoteSort: true,
                    pageSize: 6,
                    proxy: {
                        type: 'memory',
                        enablePaging: true,
                        data: monthArray,
                        reader: {
                            type: 'array'
                        }
                    }
                });

                Ext.create('Ext.grid.Panel', {
                    renderTo: 'grid',
                    width: width,
                    height: 330,
                    title:'Month Browser',
                    columns:[{
                        text: 'Month of the year',
                        dataIndex: 'month',
                        width: 240
                    }],
                    store: ds,
                    bbar: Ext.create('Ext.toolbar.Paging', {
                        pageSize: 6,
                        store: ds,
                        displayInfo: true
                    })
                });

                // trigger the data store load
                ds.load();
            }
        };

    })();
    MultiLangDemo.init();
});


text:
#include <stdint.h>
#include <string.h>

#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"

static void onhdr(void *ud, grpc_mdelem *md) { GRPC_MDELEM_UNREF(md); }
static void dont_log(gpr_log_func_args *args) {}

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  grpc_test_only_set_metadata_hash_seed(0);
  gpr_set_log_function(dont_log);
  grpc_init();
  grpc_chttp2_hpack_parser parser;
  grpc_chttp2_hpack_parser_init(&parser);
  parser.on_header = onhdr;
  grpc_chttp2_hpack_parser_parse(&parser, data, data + size);
  grpc_chttp2_hpack_parser_destroy(&parser);
  grpc_shutdown();
  return 0;
}

redpajama_set_name: RedPajamaGithub


text:
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Validation Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines contain the default error messages used by
    | the validator class. Some of these rules have multiple versions such
    | as the size rules. Feel free to tweak each of these messages here.
    |
    */

    'accepted'   => ':attribute doit être accepté.',
    'active_url' => ':attribute n\'est pas une URL valide.',
    'after'      => ':attribute doit être une date supérieure à :date.',
    'alpha'      => ':attribute ne doit contenir que des lettres.',
    'alpha_dash' => ':attribute doit contenir seulement des lettres, nombres et des tirets.',
    'alpha_num'  => ':attribute ne doit contenir que des lettres et des nombres.',
    'array'      => ':attribute doit être un tableau.',
    'before'     => ':attribute doit être une date inférieur à :date.',
    'between'    => [
        'numeric' => ':attribute doit être compris entre :min et :max.',
        'file'    => ':attribute doit être compris entre :min et :max kilo-octets.',
        'string'  => ':attribute doit être entre :min et :max caractères.',
        'array'   => 'attribute doit être entre :min et :max éléments.',
    ],
    'boolean'        => 'Le champ :attribute doit être vrai ou faux.',
    'confirmed'      => 'La confirmation de :attribute ne correspond pas.',
    'date'           => ':attribute n\'est pas une date valide.',
    'date_format'    => ':attribute ne correspond pas au format :format.',
    'different'      => ':attribute et :other doivent être différents.',
    'digits'         => ':attribute doit avoir :digits chiffres.',
    'digits_between' => ':attribute doit être entre :min et :max chiffres.',
    'email'          => ':attribute doit être une adresse courriel valide.',
    'exists'         => 'Le :attribute sélectionné est invalide.',
    'distinct'       => ':attribute possède une valeur en double.',
    'filled'         => 'Le champ :attribute est requis.',
    'image'          => ':attribute doit être une image.',
    'in'             => 'Le :attribute sélectionné est invalide.',
    'in_array'       => 'Le champ :attribute n\'existe pas dans :other.',
    'integer'        => ':attribute doit être un nombre entier.',
    'ip'             => ':attribute doit être une adresse IP valide.',
    'json'           => ':attribut doit être une chaîne JSON valide.',
    'max'            => [
        'numeric' => ':attribute ne doit pas dépasser :max.',
        'file'    => ':attribute ne peut être plus grand que :max kilo-octets.',
        'string'  => ':attribute ne doit pas dépasser :max caractères.',
        'array'   => ':attribute ne doit dépasser :max éléments.',
    ],
    'mimes' => ':attribute doit être un fichier de type: :values.',
    'min'   => [
        'numeric' => ':attribute doit être au moins de :min.',
        'file'    => ':attribute doit être au moins de :min kilo-octets.',
        'string'  => ':attribute doit comporter au minimum :min caractères.',
        'array'   => ':attribute doit contenir au moins :min éléments.',
    ],
    'not_in'               => 'Le :attribute sélectionné est invalide.',
    'numeric'              => ':attribute doit être un nombre.',
    'present'              => 'Le champs :attribute doit être rempli.',
    'regex'                => 'Le format de :attribute n\'est pas valide.',
    'required'             => 'Le champ :attribute est requis.',
    'required_if'          => 'Le champ :attribute est requis lorsque :other est :value.',
    'required_unless'      => 'Le champ :attribute est requis sauf si :other est dans :values.',
    'required_with'        => 'Le champ :attribute est requis lorsque :values est présent.',
    'required_with_all'    => 'Le champ :attribute est requis lorsque :values est présent.',
    'required_without'     => 'Le champ :attribute est nécessaire quand :values n\'est pas présent.',
    'required_without_all' => 'Le champ :attribute est requis lorsque aucune des :values sont présentes.',
    'same'                 => 'Le :attribute et :other doivent correspondre.',
    'size'                 => [
        'numeric' => ':attribute doit faire :size.',
        'file'    => 'attribute doit être de :size kilo-octets.',
        'string'  => 'L\'attribut ":attribute" doit faire :size caractères.',
        'array'   => ':attribute doit contenir :size éléments.',
    ],
    'string'   => ':attribut doit être une chaîne de caractères.',
    'timezone' => ':attribute doit être une zone valide.',
    'unique'   => ':attribute a déjà été pris.',
    'url'      => 'Le format de :attribute n\'est pas valide.',

    /*
    |--------------------------------------------------------------------------
    | Custom Validation Language Lines
    |--------------------------------------------------------------------------
    |
    | Here you may specify custom validation messages for attributes using the
    | convention "attribute.rule" to name the lines. This makes it quick to
    | specify a specific custom language line for a given attribute rule.
    |
    */

    'custom' => [
        'attribute-name' => [
            'rule-name' => 'Message personnalisé',
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Custom Validation Attributes
    |--------------------------------------------------------------------------
    |
    | The following language lines are used to swap attribute place-holders
    | with something more reader friendly such as E-Mail Address instead
    | of "email". This simply helps us make messages a little cleaner.
    |
    */

    'attributes' => [],

];


text:
function varargout = plotshapefile(varargin)
%PLOTSHAPEFILE Plots a shapefile
%
% plotshapefile(filename, Param1, Value1, ...)
% plotshapefile(shapeStruct, ...)
% handles = plotshapefile(...)
%
% Plots polygons, polylines, points, and multipoints from a shapefile.  By
% default, all objects are colored black, and polygons are unfilled.  These
% defaults can be modified by including color tables for each set (see
% below for format).
%
% Input Variables:
%
%   filename:           Shapefile name.  The extension of filename can be
%                       .shp, .dbf or .shx, or be omitted.
%
%   shapeStruct:        shapefile structure, produced by a shaperead
%                       command.
%
%   Parameters (passed as param-value pairs)
%
%   'Bounds':           [south north west east] boundary coordinates for
%                       map plot.  The default is the bounding box for the
%                       shapefile.
%
%   'PolyColorTable':   1 x 3 cell array {fieldname, choices, colors},
%                       where fieldname specifies an attribute field of the
%                       shapefile that will be used for color reference
%                       when filling polygons, choices is a 1 x n list of
%                       possible values for that attribute field, and
%                       colors is a n x 3 array of color values for each
%                       possible value.
%
%   'PointColorTable':  1 x 3 cell array, same format as 'PolyColorTable',
%                       used to color Point and MultiPoint objects
%
%   'LineColorTable':   1 x 3 cell array, same format as 'PolyColorTable',
%                       used to color PolyLine objects
%
% Output variables:
%
%   handles:            structure holding the handles of the figure, map
%                       plot, map axis, and colorbar
%
% Example:
%
%   plotshapefile('test.shp', 'PolyColorTable', {'CAT', [1 2 3], ...
%                 [1 0 0; 0 1 0; 0 0 1]);

% Copyright 2005 Kelly Kearney

%--------------------------
% Parse inputs
%--------------------------

% First input, shapefile

if isstruct(varargin{1})
    Shapefile = varargin{1};
    if ~all(isfield(Shapefile, {'Geometry', 'BoundingBox', 'Lat', 'Lon'}))
        error('First input must be a shapefile structure with geographic coordinates or a valid shapefile');
    end
elseif ischar(varargin{1})
    if ~exist(varargin{1}, 'file') && ~exist([varargin{1} '.shp'], 'file')
        error('Could not find shapefile');
    end
    Shapefile = shaperead(varargin{1}, 'UseGeoCoords', true);
else
    error('First input argument must be a shapefile geographic data structure or the name of a shapefile');
end

% Other inputs

inputVars = varargin(2:end);
if mod(numel(inputVars), 2)
    error('Additional inputs must be in parameter-value pairs');
end
inputVars = reshape(inputVars, 2, []);
if ~all(cellfun(@ischar, inputVars(1,:)))
    error('Additional inputs must be in parameter-value pairs');
end
params = lower(inputVars(1,:));
vals = inputVars(2,:);

Params = struct('bounds', [], 'polycolortable', [], 'pointcolortable', [], 'linecolortable', []);

for ipar = 1:length(params)
    if ~isfield(Params, params{ipar})
        error('Invalid parameter: %s', params{ipar});
    end
    Params.(params{ipar}) = vals{ipar};
end

if isempty(Params.bounds)
   bounds = cell2mat({Shapefile.BoundingBox}');
   Params.bounds = [min(bounds(:,2)) max(bounds(:,2)) min(bounds(:,1)) max(bounds(:,1))];
end

%--------------------------
% Create figure and map
% axis
%--------------------------

mInterval = (Params.bounds(4) - Params.bounds(3))/5;
pInterval = (Params.bounds(2) - Params.bounds(1))/5;

scrnsz = get(0, 'ScreenSize');
handles.figure = figure('Position', [(scrnsz(3)-800)/2 (scrnsz(4)-600)/2 800 600], ...
                        'Renderer', 'zbuffer', ...
                        'Color', 'w');

handles.mapPlot = subplot('Position', [.1 .1 .8 .8]);
handles.mapAxis = axesm('MapProjection', 'mercator', ...
                        'FLatLimit', Params.bounds(1:2), ...
                        'FLonLimit', Params.bounds(3:4), ...
                        'Grid', 'on', ...
                        'MLineLocation', mInterval, ...
                        'PLineLocation', pInterval, ...
                        'MeridianLabel', 'on', ...
                        'ParallelLabel', 'on', ...
                        'MLabelLocation', mInterval, ...
                        'PLabelLocation', pInterval, ...
                        'MLabelRound', -2, ...
                        'PLabelRound', -2);
axis tight;

%--------------------------
% Plot polygons
%--------------------------

Polygons = Shapefile(ismember({Shapefile.Geometry}, 'Polygon'));

if isempty(Params.polycolortable)
    fillPoly = false;
else
    fillPoly = true;
    [attribName, attribChoices, attribColors] = parsecolortable(Params.polycolortable, Polygons);
end

for ipoly = 1:length(Polygons)

    if fillPoly
        [tf, loc] = ismember(Polygons(ipoly).(attribName), attribChoices);
        if ~all(tf)
            error('The polygon color table attribute choices do not match those in the shapefile');
        end
        col = attribColors(loc,:);

        [f, v] = poly2fv(Polygons(ipoly).Lon, Polygons(ipoly).Lat);
        vlat = v(:,2);
        vlon = v(:,1);

        handles.polyPatch(ipoly) = patchm(vlat(f'), vlon(f'), ...
                                  'FaceColor', col, ...
                                  'EdgeColor', 'none');
    end
    handles.polyOutline(ipoly) = plotm(Polygons(ipoly).Lat, Polygons(ipoly).Lon, 'k');

end

%--------------------------
% Plot points and
% multipoints
%--------------------------

Points = Shapefile(ismember({Shapefile.Geometry}, {'Point', 'Multipoint'}));

if isempty(Params.pointcolortable)
    colorPoints = false;
else
    colorPoints = true;
    [attribName, attribChoices, attribColors] = parsecolortable(Params.pointcolortable, Points);
end

for ipoint = 1:length(Points)
    if colorPoints
        [tf, loc] = ismember(Points(ipoint).(attribName), attribChoices);
        if ~all(tf)
            error('The point color table attribute choices do not match those in the shapefile');
        end
        col = attribColors(loc,:);
    else
        col = 'k';
    end

    handles.points(ipoint) = plotm(Points(ipoint).Lat, Points(ipoint).Lon, 'Marker', 'o', 'Color', col, 'LineStyle', 'none');
end

%--------------------------
% Plot polylines
%--------------------------

Lines = Shapefile(ismember({Shapefile.Geometry}, 'PolyLine'));

if isempty(Params.linecolortable)
    colorLines = false;
else
    colorLines = true;
    [attribName, attribChoices, attribColors] = parsecolortable(Params.linecolortable, Lines);
end

for iline = 1:length(Lines)
    if colorLines
        [tf, loc] = ismember(Lines(iline).(attribName), attribChoices);
        if ~all(tf)
            error('The line color table attribute choices do not match those in the shapefile');
        end
        col = attribColors(loc,:);
    else
        col = 'k';
    end

    handles.lines(iline) = plotm(Lines(iline).Lat, Lines(iline).Lon, 'Marker', '.', 'Color', col);
end

%--------------------------
% Output
%--------------------------

if nargout == 1
    varargout{1} = handles;
end

%--------------------------
% Subfunction: Parse color
% table
%--------------------------

function [name, choices, colors] = parsecolortable(colortable, Struct)
if ~iscell(colortable) || length(colortable) ~= 3
    error('Color tables must be 1 x 3 cell arrays');
end
name = colortable{1};
choices = colortable{2};
colors = colortable{3};
if isempty(choices) && isempty(colors)
    attribClass = class(Struct(1).(name));
    switch attribClass
        case 'char'
            choices = unique({Struct.(name)});
        case {'logical', 'double'}
            choices = unique([Struct.(name)]);
        otherwise
            error('Attribute values must be character arrays or scalars');
    end
    colors  = jet(length(choices));
end


text:
namespace YAF.Types.Models
{
    #region Using

    using System;

    using ServiceStack.DataAnnotations;

    using YAF.Types.Interfaces.Data;

    #endregion

    /// <summary>
    ///     A class which represents the YAF_Registry table in the YAF Database.
    /// </summary>
    [Serializable]
    public partial class Registry : IEntity, IHaveID
    {
        // , IHaveBoardID
        #region Constructors and Destructors

        /// <summary>
        ///     Initializes a new instance of the <see cref="Registry" /> class.
        /// </summary>
        public Registry()
        {
            this.OnCreated();
        }

        #endregion

        #region Public Properties

        /// <summary>
        ///     Gets or sets the Registry ID.
        /// </summary>
        [AutoIncrement]
        [Alias("RegistryID")]
        public int ID { get; set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        [Required]
        [Index]
        [StringLength(255)]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        public string Value { get; set; }

        /// <summary>
        /// Gets or sets the board id.
        /// </summary>
        [References(typeof(Board))]
        [Index]
        public int? BoardID { get; set; }

        #endregion

        #region Methods

        /// <summary>
        ///     The on created.
        /// </summary>
        partial void OnCreated();

        #endregion
    }
}


text:
<?php

namespace Lit\Api;

/**
 * Sends request to API server using HTTP POST request and returns data (decoded from JSON)
 * @package Lito\Api
 * @author lostintime
 */
class HttpJsonTransport extends Transport
{

    /**
     * API server url
     * @var String
     */
    private $serverUrl;

    /**
     * JSONP callback "padding" name
     * @var String
     */
    private $callback;

    /**
     * Transport constructor
     * @param String|null $serverUrl
     * @param String|null $callback
     */
    public function __construct($serverUrl = null, $callback = null)
    {
        $this->setServerUrl($serverUrl);
        $this->setCallback($callback);
    }

    /**
     * setts API url
     * @param String $serverUrl
     */
    public function setServerUrl($serverUrl)
    {
        $this->serverUrl = $serverUrl;
    }

    /**
     * returns API server url
     * @return String
     */
    public function getServerUrl()
    {
        return $this->serverUrl;
    }

    /**
     * setts JSONP callback "padding" name
     * @param $callback
     */
    public function setCallback($callback)
    {
        $this->callback = $callback;
    }

    /**
     * returns JSON callback "padding" name
     * @return String
     */
    public function getCallback()
    {
        return $this->callback;
    }

    /**
     * initializes and returns Request
     * @return Request
     */
    public function getRequest()
    {
        $params = $_REQUEST;
        if (isset($params['m'])) {
            $pos = strrchr($params['m'], '.');
            $resource = substr($params['m'], 0, $pos);
            $method = substr($params['m'], $pos + 1);
            unset($params['m']);
        } else {
            $resource = null;
            $method = null;
        }

        $headers = array();
        foreach ($_SERVER as $k => $v) {
            if (0 === stripos($k, 'HTTP_')) {
                $headers[substr($k, 5)] = $v;
            }
        }

        return new Request($resource, $method, $params, $headers);
    }

    /**
     * sends request to server and returns response (or throws an exception)
     * @param Request $request
     * @throws Exception
     * @return mixed
     */
    public function sendRequest(Request $request)
    {
        // preparing headers
        $process = curl_init($this->getServerUrl());

        $headers = $request->getHeaders();

        if (!is_array($headers))
            $headers = array();

        foreach ($headers as $k => $v) {
            $headers[$k] = str_replace(' ', '-', ucwords(strtolower(str_replace(array('_', '-'), ' ', $k)))) . ': ' . $v;
        }

        $headers['ACCEPT'] = 'Accept: text/json, application/json;q=0.9,*/*;q=0.8';
        $headers['ACCEPT_CHARSET'] = 'Accept-Charset: UTF-8,utf-8;q=0.7,*;q=0.7';

        curl_setopt($process, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($process, CURLOPT_HEADER, 0);
        curl_setopt($process, CURLOPT_USERAGENT, 'HttpJsonTransport');
        curl_setopt($process, CURLOPT_TIMEOUT, 15);

        curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);

        $params = $request->getParams();
        $params['m'] = $request->getMethod();

        curl_setopt($process, CURLOPT_POST, 1);
        curl_setopt($process, CURLOPT_POSTFIELDS, \http_build_query($params));

        $content = curl_exec($process);
        curl_close($process);

        $data = \json_decode($content, true);

        if ($data['error']) {
            if (class_exists($data['error']['type']))
                throw new $data['error']['type']($data['error']['message'], $data['error']['code']);
            else
                throw new Exception($data['error']['message'], $data['error']['code']);
        } else {
            return $data['data'];
        }
    }

    /**
     * Sends API call response back to client (json encoded)
     * @param Response $response
     * @param Request $request
     */
    public function sendResponse(Response $response, Request $request = null)
    {
        // preparing headers
        $headers = $response->getHeaders();

        if (!is_array($headers))
            $headers = array();

        $headers['CONTENT_TYPE'] = 'text/json; charset=utf-8';

        foreach ($headers as $k => $v) {
            \header(str_replace(' ', '-', ucwords(str_replace(array('_', '-'), ' ', $k))) . ': ' . $v);
        }

        echo ($this->getCallback() ? $this->getCallback() . '(' : '')
            . \json_encode(array(
                'error' => $response->getError() ? array(
                    'type' => get_class($response->getError()),
                    'code' => $response->getError()->getCode(),
                    'message' => $response->getError()->getMessage(),
                ) : null,
                'data' => $response->getData(),
            ))
            . ($this->getCallback() ? ')' : '');
    }

}


text:
def int2X(num,base):

    ans="" #answer will be i string format

    if num is 0:
        print ("Answer is: ", num)

    elif num < 0:
        print ("Error: negative number!")

    else:
        while num > 0:
            ans=digits[num%base]+ans  #the maths...
            num=int(num/base)  #the maths...

    return ans

# from base-X (2-16) to Integer
def X2int(num,base):

    num=num.upper() #standardize string input

    pow=0
    ans=0

    for c in reversed(num):  #loop backwards through num
        j=0  #used in for loop
        for i in digits:  #loop through digits (i is not needed)
            if(digits[j]==c):
                c=str(j);
            j+=1
        ans+=(base**pow)*int(c) #the maths...
        pow+=1 #move up through powers as move through input

    return ans

#make digits global so both functions can use them from here
global digits
digits="0123456789ABCDEF"

#give user a menu
choose=int(input("Would you like to:\n1. Convert from INT to another base\
             \n2. Convert to any base number to INT\n0. Exit\n--> "))

#user wants to convert an integer to another base (2-16)
if(choose==1):
    num = int(input("Please insert INT to convert: "))
    base= int(input("input base to convert to (2-16): "))

    print("answer is: ",int2X(num,base)) #calls function and outputs answer

#user wants to convert a number of base 2-16 to an integer
elif(choose==2):
    base = int(input("input base to convert from (2-16): "))
    num = str(input("Please insert number to convert to INT: "))

    print("Answer is: ",X2int(num,base))

#user wants to quit early
elif(choose==0):
    print("Goodbye")

#user inputs incorrectly
else:
    print("Error: invalid input")

input("\n[Press ENTER to close]");


text:
// Copyright 2017 The Bazel Authors. All rights reserved.
//
// 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 com.google.devtools.build.lib.rules.objc;

import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.testutil.Scratch;
import java.io.IOException;
import java.util.Map;
import java.util.Set;

/**
 * Provides utilities to help test a certain rule type without requiring the calling code to know
 * exactly what kind of rule is being tested. Only one instance is needed per rule type (e.g. one
 * instance for {@code objc_library}).
 */
public abstract class RuleType {
  /**
   * What to pass as the value of some attribute to indicate an attribute should not be added to the
   * rule. This can either be to test an error condition, or to use an alternative attribute to
   * supply the value.
   */
  public static final String OMIT_REQUIRED_ATTR = "<OMIT_REQUIRED_ATTR>";

  private final String ruleTypeName;

  RuleType(String ruleTypeName) {
    this.ruleTypeName = ruleTypeName;
  }

  /**
   * The name of this type as it appears in {@code BUILD} files, such as {@code objc_library}.
   */
  final String getRuleTypeName() {
    return ruleTypeName;
  }

  /**
   * Returns whether this type exports companion library target in Xcode.
   */
  final boolean exportsXcodeCompanionTarget() {
    return ruleTypeName.equals("objc_binary");
  }

  /**
   * Returns the bundle extension for the bundles generated by the rule.
   */
   final String bundleExtension() {
     return ruleTypeName.equals("ios_test") ? "xctest" : "app";
   }

  /**
   * Returns names and values, and otherwise prepares, extra attributes required for this rule type
   * to be without error. For instance, if this rule type requires 'srcs' and 'infoplist'
   * attributes, this method may be implemented as follows:
   * <pre>
   * {@code
   * List<String> attributes = new ArrayList<>();
   * if (!alreadyAdded.contains("srcs")) {
   *   scratch.file("/workspace_root/" + packageDir + "/a.m");
   *   attributes.add("srcs = ['a.m']");
   * }
   * if (!alreadyAdded.contains(INFOPLIST_ATTR)) {
   *   scratch.file("/workspace_root/" + packageDir + "Info.plist");
   *   attributes.add("infoplist = ['Info.plist']");
   * }
   * return attributes;
   * </pre>
   * }
   *
   * @throws IOException for whatever reason the implementator feels like, but mostly just when
   *     a scratch file couldn't be created
   */
  abstract Iterable<String> requiredAttributes(
      Scratch scratch, String packageDir, Set<String> alreadyAdded) throws IOException;

  private ImmutableMap<String, String> map(String... attrs) {
    ImmutableMap.Builder<String, String> map = new ImmutableMap.Builder<>();
    Preconditions.checkArgument((attrs.length & 1) == 0,
        "attrs must have an even number of elements");
    for (int i = 0; i < attrs.length; i += 2) {
      map.put(attrs[i], attrs[i + 1]);
    }
    return map.build();
  }

  /**
   * Generates the String necessary to define a target of this rule type.
   *
   * @param packageDir the package in which to create the target
   * @param name the name of the target
   * @param checkSpecificAttrs alternating name/values of attributes to add to the rule that are
   *     required for the check being performed to be defined a certain way. Pass
   *     {@link #OMIT_REQUIRED_ATTR} for a value to prevent an attribute from being automatically
   *     defined.
   */
  final String target(
      Scratch scratch, String packageDir, String name, String... checkSpecificAttrs)
      throws IOException {
    ImmutableMap<String, String> checkSpecific = map(checkSpecificAttrs);
    StringBuilder target = new StringBuilder(ruleTypeName)
        .append("(name = '")
        .append(name)
        .append("',");
    for (Map.Entry<String, String> entry : checkSpecific.entrySet()) {
      if (entry.getValue().equals(OMIT_REQUIRED_ATTR)) {
        continue;
      }
      target.append(entry.getKey())
          .append("=")
          .append(entry.getValue())
          .append(",");
    }
    Joiner.on(",").appendTo(
        target,
        requiredAttributes(scratch, packageDir, checkSpecific.keySet()));
    target.append(')');
    return target.toString();

  }

  /**
   * Creates a target at //x:x which is the only target in the BUILD file. Returns the string that
   * is written to the scratch file as it is often useful for debugging purposes.
   */
  public final String scratchTarget(Scratch scratch, String... checkSpecificAttrs)
      throws IOException {
    return scratchTarget("x", "x", scratch, checkSpecificAttrs);
  }

  /**
   * Creates a target at a given package which is the only target in the BUILD file. Returns the
   * string that is written to the scratch file as it is often useful for debugging purposes.
   *
   * @param packageDir the package of the target, for example "foo" in //foo:bar
   * @param targetName the name of the target, for example "bar" in //foo:bar
   * @param scratch the scratch object to use to create the build file
   * @param checkSpecificAttrs alternating name/values of attributes to add to the rule that are
   *     required for the check being performed to be defined a certain way. Pass
   *     {@link #OMIT_REQUIRED_ATTR} for a value to prevent an attribute from being automatically
   *     defined.
   */
  public final String scratchTarget(String packageDir, String targetName,
      Scratch scratch, String... checkSpecificAttrs)
      throws IOException {
    String target = target(scratch, packageDir, targetName, checkSpecificAttrs);
    scratch.file(packageDir + "/BUILD", target);
    return target;
  }
}


text:
package android.net.http;

// Work around bug in robolectric https://github.com/robolectric/robolectric/issues/1862
public class AndroidHttpClient {
}


text:
const express = require("express");
const path = require("path");
const port = process.env.PORT || 8080;
const app = express();

app.use(express.static(__dirname));
app.get('*', (req,res) => {
    res.sendFile(path.resolve(__dirname,'index.html'))
});

app.listen(port);
console.log('server is on');


text:
require 'highline/import'

require_relative '../cli/terminal'
require_relative '../helpers/helpers'

module GoodData
  module Command
    class Auth
      class << self
        # Ask for credentials
        def ask_for_credentials
          puts 'Enter your GoodData credentials.'
          user = GoodData::CLI.terminal.ask('Email')
          password = GoodData::CLI.terminal.ask('Password') { |q| q.echo = 'x' }
          auth_token = GoodData::CLI.terminal.ask('Authorization Token')

          { :username => user, :password => password, :auth_token => auth_token }
        end

        # Ask for credentials and store them
        def store(credentials_file_path = Helpers::AuthHelper.credentials_file)
          credentials = ask_for_credentials

          ovewrite = if File.exist?(credentials_file_path)
                       GoodData::CLI.terminal.ask('Overwrite existing stored credentials (y/n)')
                     else
                       'y'
                     end

          if ovewrite == 'y'
            Helpers::AuthHelper.write_credentials(credentials, credentials_file_path)
          else
            puts 'Aborting...'
          end
        end

        # Delete stored credentials
        def unstore(credentials_file_path = Helpers::AuthHelper.credentials_file)
          Helpers::AuthHelper.remove_credentials_file(credentials_file_path)
        end
      end
    end
  end
end


text:
import json
import re
import requests

def reddit_conversations(link):
    api_url_prefix = "https://www.reddit.com/search.json?q="

    api_call_url = api_url_prefix + link

    r = requests.get(api_call_url, headers = {'User-agent': 'Arxie Bot'})
    body = json.loads(r.content)

    results = []
    for part in body:
        if 'permalink' not in part['data']:
            if 'children' not in part['data']: continue
            else:
                for child in part['data']['children']:
                    if 'permalink' not in child['data']: continue
                    else: results.append((child['data']['permalink'], child['data']['num_comments']))
        else:
            results.append((part['data']['permalink'], part['data']['num_comments']))

    results.sort(key = lambda x: x[1])

    subreddit = re.search('\/r\/[^/\/]+', results[0][0]).group(0)
    link = "https://www.reddit.com" + results[0][0]
    num_comments = results[0][1]
    return subreddit, link, num_comments

if __name__ == '__main__':
    link = "https://arxiv.org/abs/1706.00826"

    print(reddit_conversations(link))


text:
package org.wso2.carbon.apimgt.rest.api.publisher.v1.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;

import io.swagger.annotations.*;
import java.util.Objects;

import javax.xml.bind.annotation.*;
import org.wso2.carbon.apimgt.rest.api.common.annotations.Scope;
import com.fasterxml.jackson.annotation.JsonCreator;

import javax.validation.Valid;

public class APIBusinessInformationDTO   {

    private String businessOwner = null;
    private String businessOwnerEmail = null;
    private String technicalOwner = null;
    private String technicalOwnerEmail = null;

  /**
   **/
  public APIBusinessInformationDTO businessOwner(String businessOwner) {
    this.businessOwner = businessOwner;
    return this;
  }

  @ApiModelProperty(example = "businessowner", value = "")
  @JsonProperty("businessOwner")
 @Size(max=120)  public String getBusinessOwner() {
    return businessOwner;
  }
  public void setBusinessOwner(String businessOwner) {
    this.businessOwner = businessOwner;
  }

  /**
   **/
  public APIBusinessInformationDTO businessOwnerEmail(String businessOwnerEmail) {
    this.businessOwnerEmail = businessOwnerEmail;
    return this;
  }

  @ApiModelProperty(example = "businessowner@wso2.com", value = "")
  @JsonProperty("businessOwnerEmail")
  public String getBusinessOwnerEmail() {
    return businessOwnerEmail;
  }
  public void setBusinessOwnerEmail(String businessOwnerEmail) {
    this.businessOwnerEmail = businessOwnerEmail;
  }

  /**
   **/
  public APIBusinessInformationDTO technicalOwner(String technicalOwner) {
    this.technicalOwner = technicalOwner;
    return this;
  }

  @ApiModelProperty(example = "technicalowner", value = "")
  @JsonProperty("technicalOwner")
 @Size(max=120)  public String getTechnicalOwner() {
    return technicalOwner;
  }
  public void setTechnicalOwner(String technicalOwner) {
    this.technicalOwner = technicalOwner;
  }

  /**
   **/
  public APIBusinessInformationDTO technicalOwnerEmail(String technicalOwnerEmail) {
    this.technicalOwnerEmail = technicalOwnerEmail;
    return this;
  }

  @ApiModelProperty(example = "technicalowner@wso2.com", value = "")
  @JsonProperty("technicalOwnerEmail")
  public String getTechnicalOwnerEmail() {
    return technicalOwnerEmail;
  }
  public void setTechnicalOwnerEmail(String technicalOwnerEmail) {
    this.technicalOwnerEmail = technicalOwnerEmail;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    APIBusinessInformationDTO apIBusinessInformation = (APIBusinessInformationDTO) o;
    return Objects.equals(businessOwner, apIBusinessInformation.businessOwner) &&
        Objects.equals(businessOwnerEmail, apIBusinessInformation.businessOwnerEmail) &&
        Objects.equals(technicalOwner, apIBusinessInformation.technicalOwner) &&
        Objects.equals(technicalOwnerEmail, apIBusinessInformation.technicalOwnerEmail);
  }

  @Override
  public int hashCode() {
    return Objects.hash(businessOwner, businessOwnerEmail, technicalOwner, technicalOwnerEmail);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class APIBusinessInformationDTO {\n");

    sb.append("    businessOwner: ").append(toIndentedString(businessOwner)).append("\n");
    sb.append("    businessOwnerEmail: ").append(toIndentedString(businessOwnerEmail)).append("\n");
    sb.append("    technicalOwner: ").append(toIndentedString(technicalOwner)).append("\n");
    sb.append("    technicalOwnerEmail: ").append(toIndentedString(technicalOwnerEmail)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}


text:
module Syntax where

type Name = String

data Expr
  = Var Name
  | Lit Lit
  | App Expr Expr
  | Lam Name Expr
  deriving (Eq, Show)

data Lit
  = LInt Int
  | LBool Bool
  deriving (Show, Eq, Ord)


text:
* Test genomes

Simple minimal genomes for testing low level configuration and retrieval


text:
<!doctype html>

    <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css">


text:
#ifndef __LATENTSVM_H__
#define __LATENTSVM_H__

/*
 * This software is distributed under BSD 3-clause license (see LICENSE file).
 *
 * Authors: Viktor Gal
 */

#include <shogun/lib/config.h>
#include <shogun/lib/common.h>
#include <shogun/machine/LinearLatentMachine.h>

namespace shogun
{
	class LatentModel;

	/** @brief LatentSVM class
	 * Latent SVM implementation based on [1].
	 * For optimization this implementation uses SVMOcas.
	 *
	 * User must provide a her own LatentModel which implements the PSI(x_i,h_i)
	 * function for the given problem.
	 *
	 * [1] P. F. Felzenszwalb, R. B. Girshick, D. McAllester, and D. Ramanan,
	 *  "Object detection with discriminatively trained part-based models,"
	 *  Pattern Analysis and Machine Intelligence,
	 *  IEEE Transactions on, vol. 32, no. 9, pp. 1627-1645, 2010.
	 *
	 */
	class LatentSVM: public LinearLatentMachine
	{
		public:
			/** default contstructor */
			LatentSVM();

			/** constructor
			 *
			 * @param model the user defined LatentModel object.
			 * @param C regularization constant
			 */
			LatentSVM(std::shared_ptr<LatentModel> model, float64_t C);

			~LatentSVM() override;

			/** apply linear machine to all examples
			 *
			 * @return resulting labels
			 */
			std::shared_ptr<LatentLabels> apply_latent() override;

			using LinearLatentMachine::apply_latent;

			/** Returns the name of the SGSerializable instance.
			 *
			 * @return name of the SGSerializable
			 */
			const char* get_name() const override { return "LatentSVM"; }

		protected:
			/** inner loop of the latent machine
			 *
			 * The optimization part after finding the argmax_h for the
			 * positive examples in the outter loop. It uses SVMOcas for
			 * finding the cutting plane.
			 *
			 * @param cooling_eps epsilon
			 * @return primal objective value
			 */
			float64_t do_inner_loop(float64_t cooling_eps) override;
	};
}

#endif /* __LATENTSVM_H__ */


text:
/**
 * The Index Module for Reading List
 * @jsx m
 */

var index = {};

// This will set up a series of calls to build the index view.
index = require('./index.controller');

m.route.mode = 'hash';

//define a route
m.route(document.body, '/', {
    '/': index
});


text:
.filterable {
    margin-top: 15px;
}

.filterable .panel-heading .pull-right {
    margin-top: -20px;
}

.filterable .filters input[disabled] {
    background-color: transparent;
    border: none;
    cursor: auto;
    box-shadow: none;
    padding: 0;
    height: auto;
}

.filterable .filters input[disabled]::-webkit-input-placeholder {
    color: #333;
}

.filterable .filters input[disabled]::-moz-placeholder {
    color: #333;
}

.filterable .filters input[disabled]:-ms-input-placeholder {
    color: #333;
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Kernel Tuning Toolkit: Source/Api/StopCondition/ConfigurationFraction.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.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" />

Kernel Tuning Toolkit 2.1

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

ConfigurationFraction.h

Go to the documentation of this file.

    1

    4#pragma once

    5

    6#include <Api/StopCondition/StopCondition.h>

    7#include <KttPlatform.h>

    8

    9namespace ktt

   10{

   11

   15class KTT_API ConfigurationFraction : public StopCondition

   16{

   17public:

   23    explicit ConfigurationFraction(const double fraction);

   24

   25    bool IsFulfilled() const override;

   26    void Initialize(const uint64_t configurationsCount) override;

   27    void Update(const KernelResult& result) override;

   28    std::string GetStatusString() const override;

   29

   30private:

   31    uint64_t m_CurrentCount;

   32    uint64_t m_TotalCount;

   33    double m_TargetFraction;

   34

   35    double GetExploredFraction() const;

   36};

   37

   38} // namespace ktt

KttPlatform.h

StopCondition.h

ktt::ConfigurationFraction

Definition: ConfigurationFraction.h:16

ktt::ConfigurationFraction::IsFulfilled

bool IsFulfilled() const override

ktt::ConfigurationFraction::ConfigurationFraction

ConfigurationFraction(const double fraction)

ktt::ConfigurationFraction::GetStatusString

std::string GetStatusString() const override

ktt::ConfigurationFraction::Update

void Update(const KernelResult &result) override

ktt::ConfigurationFraction::Initialize

void Initialize(const uint64_t configurationsCount) override

ktt::KernelResult

Definition: KernelResult.h:21

ktt::StopCondition

Definition: StopCondition.h:19

ktt

Definition: KttPlatform.h:41

Source

Api

StopCondition

ConfigurationFraction.h

Generated by  1.9.3


text:
import React, { Fragment } from 'react'
import {
  registerFormField,
  connect,
  SchemaMarkupForm as SchemaForm,
  SchemaMarkupField as Field,
  registerFieldMiddleware
} from '../index'
import '@testing-library/jest-dom/extend-expect'
import { toArr } from '@formily/shared'
import { render, fireEvent, wait } from '@testing-library/react'

registerFieldMiddleware(Field => {
  return props => {
    const index = props.schema['x-props'] && props.schema['x-props'].index
    return (

        <Field {...props} />
        <div data-testid={`test-errors-${index}`}>{props.errors}

    )
  }
})

registerFormField(
  'string',
  connect()(props => (
    <input {...props} data-testid={props.testid} value={props.value || ''} />
  ))
)

registerFormField('array', props => {
  const { value, renderField } = props
  return (
    <Fragment>
      {toArr(value).map((item, index) => {
        return (

            {renderField(index)}

        )
      })}
    </Fragment>
  )
})

describe('test all apis', () => {
  //todo
  test('title', () => {
    //todo
  })

  test('type', () => {
    //todo
  })

  test('description', () => {
    //todo
  })

  test('default', () => {
    //todo
  })

  test('enum', () => {
    //todo
  })

  test('readyOnly', () => {
    //todo
  })

  test('writeOnly', () => {
    //todo
  })

  test('const', () => {
    //todo
  })

  test('multipleOf', () => {
    //todo
  })

  test('maximum', () => {
    //todo
  })

  test('minimum', () => {
    //todo
  })

  test('exclusiveMaximum', () => {
    //todo
  })

  test('exclusiveMinimum', () => {
    //todo
  })

  test('maxLength', () => {
    //todo
  })

  test('minLength', () => {
    //todo
  })

  test('pattern', () => {
    //todo
  })

  test('maxItems', () => {
    //todo
  })

  test('array minItems', async () => {
    const handleSubmit = jest.fn()
    const handleValidateFailed = jest.fn()
    const TestComponent = () => (
      <SchemaForm onSubmit={handleSubmit} onValidateFailed={handleValidateFailed}>
        <Fragment>
          <Field name="text" type="array" minItems={2}>
            <Field type="string"/>
          </Field>
          <button type="submit" data-testid="btn">
            Submit
          </button>
        </Fragment>
      </SchemaForm>
    )

    const { getByTestId, getByText } = render(<TestComponent />)

    fireEvent.click(getByTestId('btn'))
    await wait()
    fireEvent.click(getByTestId('btn'))
    await wait()
    expect(handleSubmit).toHaveBeenCalledTimes(0)
    expect(handleValidateFailed).toHaveBeenCalledTimes(2)
    expect(getByText('The length or number of entries must be at least 2')).toBeVisible()
  })

  test('uniqueItems', () => {
    //todo
  })

  test('maxProperties', () => {
    //todo
  })

  test('minProperties', () => {
    //todo
  })

  test('required', () => {
    //todo
  })

  test('format', () => {
    //todo
  })

  test('properties', () => {
    //todo
  })

  test('items', () => {
    //todo
  })

  test('additionalItems', () => {
    //todo
  })

  test('patternProperties', () => {
    //todo
  })

  test('additionalProperties', () => {})

  test('editable', () => {})

  test('x-props', () => {})

  test('x-component-props', () => {})

  describe('x-rules', () => {
    test('Increase lastValidateValue value processing during initialization', async () => {
      const inpueFieldValidate = jest.fn()
      const requriedFieldValidate = jest.fn()

      const TestComponent = () => (
        <SchemaForm initialValues={{ requriedField: 'defaultValue' }}>
          <Fragment>
            <Field
              required
              type="string"
              title="inpueField"
              name="inpueField"
              x-props={{ testid: 'inpueField' }}
              x-rules={() => {
                inpueFieldValidate()
                return ''
              }}
            />
            <Field
              required
              type="string"
              title="requriedField"
              name="requriedField"
              x-props={{ testid: 'requriedField' }}
              x-rules={() => {
                requriedFieldValidate()
                return ''
              }}
            />
          </Fragment>
        </SchemaForm>
      )

      const { getByTestId } = render(<TestComponent />)
      fireEvent.change(getByTestId('inpueField'), { target: { value: 1111 } })
      await wait()
      expect(inpueFieldValidate).toHaveBeenCalledTimes(1)
      expect(requriedFieldValidate).toHaveBeenCalledTimes(0)
      fireEvent.change(getByTestId('requriedField'), {
        target: { value: 2222 }
      })
      await wait()
      expect(inpueFieldValidate).toHaveBeenCalledTimes(1)
      expect(requriedFieldValidate).toHaveBeenCalledTimes(1)
    })
  })

  test('x-index', () => {})

  test('x-render', () => {})

  test('x-effect', () => {})
})

describe('major scenes', () => {
  //todo
  test('basic', () => {
    //todo
  })
})

describe('bugfix', () => {
  //todo
  test('basic', () => {
    //todo
  })
})


text: venv/bin/python setup.py py2app


text:
layout: page
title: Zamora Growth Enterprises Executive Retreat
date: 2016-05-24
author: Kathy Richard
tags: weekly links, java
status: published
summary: Duis massa massa, semper id odio.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 05/11/2019
  endDate: 05/12/2019
  ctyhocn: QROHTHX
  groupCode: ZGEER
published: true
---
Nam lacinia volutpat aliquam. Curabitur purus diam, tincidunt in tempus ut, pellentesque at dolor. Nullam eu aliquet sapien. Donec augue lectus, ornare eu libero non, varius pulvinar nisl. Aenean porta tempor lorem vitae iaculis. Quisque finibus at velit eget finibus. Nunc congue hendrerit laoreet. Aenean lacinia ligula sed dolor elementum, at sollicitudin leo rutrum. Cras placerat nibh et tellus feugiat laoreet. Etiam ornare tortor blandit quam dignissim congue. Donec ligula lacus, tincidunt facilisis purus sit amet, facilisis aliquam arcu. Fusce placerat eros metus, pharetra scelerisque nulla ullamcorper id. Vivamus sit amet pretium ipsum. Morbi at turpis turpis.

1 Ut sit amet augue sit amet eros maximus auctor porta vitae sapien
1 Nunc ultrices ipsum a condimentum auctor
1 Donec sit amet tortor feugiat, mollis purus ullamcorper, fringilla est
1 Quisque sed enim ornare, pellentesque tortor in, ultrices nisi
1 Vivamus ac sem commodo, pretium lectus lobortis, molestie ipsum.

Quisque accumsan non odio ac sagittis. Praesent lacus ex, consequat ut interdum sed, malesuada non ante. Maecenas eget ornare purus, non aliquam eros. Donec et dui vitae magna tempor ornare. Etiam elit leo, aliquet id facilisis sed, elementum vel odio. Nam cursus feugiat leo, ac iaculis metus auctor quis. Donec rutrum pellentesque semper. Etiam porta elit velit, porta vulputate orci finibus sit amet. Nunc et sodales ipsum. In a tellus aliquet, varius erat tincidunt, congue ligula. Curabitur nisi lacus, ultrices sed justo quis, faucibus molestie nulla. Suspendisse mattis neque at tempus tempor.
Nulla sed metus vel quam mattis pretium. Aenean ultricies cursus consequat. Aenean nec vehicula massa. Nullam faucibus dui dui, sed ultricies tortor cursus at. Duis id ornare diam. Vestibulum non diam vehicula, sodales quam non, finibus dui. Praesent mauris velit, interdum non urna et, dignissim consectetur eros.


text:
package com.navercorp.pinpoint.common.server.banner;

import com.navercorp.pinpoint.common.Version;
import com.navercorp.pinpoint.common.banner.PinpointBanner;
import com.navercorp.pinpoint.common.server.util.ServerBootLogger;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.env.Environment;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;

public class PinpointSpringBanner extends PinpointBanner implements ApplicationListener<ApplicationStartedEvent> {
    private ServerBootLogger logger = ServerBootLogger.getLogger(PinpointSpringBanner.class);

    private Environment environment;

    public PinpointSpringBanner() {
        this.pinpointBannerMode = Mode.CONSOLE;
    }

    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
        environment = event.getApplicationContext().getEnvironment();

        String bannerMode = environment.getProperty("pinpoint.banner.mode");
        String bannerConfigs = environment.getProperty("pinpoint.banner.configs");

        Mode mode;
        if (bannerMode == null) {
            mode = Mode.CONSOLE;
        } else {
            mode = PinpointBanner.Mode.valueOf(bannerMode.toUpperCase());
        }
        this.setPinpointBannerMode(mode);

        if (bannerConfigs == null) {
            this.keysToPrint = new ArrayList<>();
        } else {
            this.keysToPrint = Arrays.asList(bannerConfigs.split(","));
        }

        printBanner();
    }

    @Override
    public void printBanner() {
        if ( environment == null ) {
            logger.info("Environment not ready for banner.");
            return;
        }

        switch (this.pinpointBannerMode) {
            case OFF:
                return;
            case LOG:
                printBanner(logger);
                return;
            default:
                printBanner(System.out);
                return;
        }
    }

    private void printBanner(ServerBootLogger logger) {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(outputStream);
        printBanner(ps);
        logger.info(outputStream.toString());
    }

    private void printBanner(PrintStream out) {
        for (String line : BANNER) {
            out.println(line);
        }
        out.println(format("Pinpoint Version", Version.VERSION));

        for (String key: this.keysToPrint) {
            String value = environment.getProperty(key);
            if ( value != null ) {
                out.println(format(key, value));
            }
        }

        out.println();
    }

    @Override
    public void setPinpointBannerMode(Mode mode) {
        this.pinpointBannerMode = mode;
    }
}


text:
require './lib/word_calculator.rb'

def main_menu

puts "Welcome to the all-knowing word calculator!"
puts "I calculate the answers to your questions."
puts "(As long as they are about numbers.)"

  loop do
    puts "Please enter your question..."
    question = gets.chomp
    answer = calculate_sentences(question)

    if answer.class == Array
      puts "Here ya go..."
      answer.each do |solution|
        puts solution
      end
    elsif answer.class == Fixnum
      puts "The answer is ... "
      puts answer
    elsif answer.class == String
      puts answer
    else
      puts "I'm afraid there has been an error with your question. Try again? y/n"
      user_input = gets.chomp
      if user_input != "y"
        puts "Nevermind. Until next time."
        exit
      end
    end

    puts "Would you like to ask another question? y/n"
    user_input = gets.chomp
    if user_input != "y"
      puts "Alrighty. Until next time."
      exit
    end
  end
end
main_menu


text:
Django Banish Plus
====
**Django Banish Plus** is a Django *middleware* app to banish *user agents by IP address* or *User Agent Header*.
It also supports basic abuse prevention by automatically banning users if they **exceed a certain number of requests per minute**, which is likely some form of attack or attempted *denial of service*.

Django Banish Plus stores all ***banishments*** in memory to avoid database lookups on every request.
It requires memcached, especially for the IP abuse monitoring feature.

Django Banish Plus is based on [Django Banish](http://github.com/yourabi/django-banish) package by [Yousef Ourabi][1].

Features
----------

1. Banish requests, by **IP** or **user agent header** included blacklist.
2. Avoid banish request by whitelist.
3. Banish request from TOR network, using TOR IPS database.
4. The banish action is configurable, (403 response, redirect or custom template).

Installation
------------

### Requirements:

* Python 2.7
* Django 1.11
* **Memcache** or **Redis** cache system.
* Celery

### Python Packages.
- celery: 4.1.0
- redis: 2.10.6
- django-redis-cache: 1.7.1

### Clone with Git:
> $ git clone https://github.com/intelligenia/django-banish-plus

### Pip install
> pip install -e  git://github.com/intelligenia/django-banish-plus.git#egg=django-banish-plus

### Install and config cache system, to save all banish ips list.

- [Link to config **mencached cache system** in Django enviroment](https://djangosteps.wordpress.com/2013/07/03/setup-memcache-for-django-in-a-development-environment/)
- [Link to config **redis cache system** in Django enviroment](https://realpython.com/blog/python/caching-in-django-with-redis/)

### Install and config celery asynchronous task manager, to refresh tor ips list database.

- [Link to config **celery asynchronous task manager** in Django enviroment](http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html)

Setup
------
Install django-banish. Make sure it is on your PYTHONPATH or in your django project directory.

In your django project settings.py you must set the following options:

1. Add ``'banish.middleware.BanishMiddleware'`` to ``MIDDLEWARE_CLASSES``

2. Add ``'banish'`` to ``INSTALLED_APPS``

3. Run ``manage.py migrate`` to apply database changes and create new tables.

4. Add ``BANISH_ENABLED = True`` to enable Django-Banish (handy if you lock yourself out, you can just set this to False)

5. ``ADD BANISH_EMPTY_UA = True|False`` to specify wether requests without a USER_AGENT header will be banned.

6. Optionally set ``DEFAULT_BANISH_ABUSE_THRESHOLD`` (default is 100000) to the threshold of requests per minute

7. Optionally set ``BANISH_MESSAGE`` (default is "You are banned.") to change default message for banned user.

8. Optionally set ``BANISH_URL_REDIRECT`` to set url to redirect if request is banish.

9.  Optionally set ``BANISH_TEMPLATRE`` to render a custom template if request is banish.

10. Optionally set ``BANISH_RESTRICT_FILTER`` = True|False (default False), to specific url patch where banish is applied.

11. ``BANISH_ABUSE_THRESHOLD_TO_URL`` array whit dict "url path" and  "threshold"

12. Set ``BANISH_ONLY_WHITELIST = True|False``to allow only request from whitelist.

13. Set ``BANISH_TOR_IPS = True|False`` to banish TOR request.

14. Set ``TOR_IPS_DATABASE`` with tor ips database, (example, ``TOR_IPS_DATABASE = "http://torstatus.blutmagie.de/ip_list_exit.php/Tor_ip_list_EXIT.csv"``)

15. Set ``TOR_CACHE_KEY`` with cache key. (example ``TOR_CACHE_KEY = "tor-ip-exit-list"``)

Example
------

```

BANISH_ENABLED = False
BANISH_EMPTY_UA = True
BANISH_RESTRICT_FILTER = True

DEFAULT_BANISH_ABUSE_THRESHOLD = 10000
BANISH_ABUSE_THRESHOLD_TO_URL = [
	{u'url': u'/api/v1/', u'name':'v1', u'threshold': 100},
	{u'url': u'/api/v2/', u'name':'v2', u'threshold': 100},
	{u'url': u'/api/v3/', u'name':'v3', u'threshold': 10},
	{u'url': u'/api/v4/', u'name':'v4', u'threshold': 5}
]

BANISH_TOR_IPS = True
BANISH_ONLY_WHITELIST = False

TOR_IPS_DATABASE = u"http://torstatus.blutmagie.de/ip_list_exit.php/Tor_ip_list_EXIT.csv"
TOR_CACHE_KEY = u"tor-ip-exit-list"
BANISH_MESSAGE = u"{'msg': 'Banish Access'}"

```

License
------
Django Banish Plus is released under the [Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)

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](https://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.

Authors
-------
 * [José Miguel LP (intelligenia)][2]
 * [Yousef Ourabi][1]

[1]: http://github.com/yourabi
[2]: https://github.com/josemlp91/


text:
package com.amazonaws.services.costexplorer.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.costexplorer.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * CoverageMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class CoverageMarshaller {

    private static final MarshallingInfo<StructuredPojo> COVERAGEHOURS_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CoverageHours").build();
    private static final MarshallingInfo<StructuredPojo> COVERAGENORMALIZEDUNITS_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CoverageNormalizedUnits").build();
    private static final MarshallingInfo<StructuredPojo> COVERAGECOST_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CoverageCost").build();

    private static final CoverageMarshaller instance = new CoverageMarshaller();

    public static CoverageMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(Coverage coverage, ProtocolMarshaller protocolMarshaller) {

        if (coverage == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(coverage.getCoverageHours(), COVERAGEHOURS_BINDING);
            protocolMarshaller.marshall(coverage.getCoverageNormalizedUnits(), COVERAGENORMALIZEDUNITS_BINDING);
            protocolMarshaller.marshall(coverage.getCoverageCost(), COVERAGECOST_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
import logging
from typing import Iterable, List, Optional

from celery.utils.log import get_task_logger
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.utils import timezone

from ..attribute.models import Attribute
from ..celeryconf import app
from ..core.exceptions import PreorderAllocationError
from ..discount.models import Sale
from ..warehouse.management import deactivate_preorder_for_variant
from .models import Product, ProductType, ProductVariant
from .search import PRODUCTS_BATCH_SIZE, update_products_search_vector
from .utils.variant_prices import (
    update_product_discounted_price,
    update_products_discounted_prices,
    update_products_discounted_prices_of_catalogues,
    update_products_discounted_prices_of_discount,
)
from .utils.variants import generate_and_set_variant_name

logger = logging.getLogger(__name__)
task_logger = get_task_logger(__name__)

VARIANTS_UPDATE_BATCH = 500

def _update_variants_names(instance: ProductType, saved_attributes: Iterable):
    """Product variant names are created from names of assigned attributes.

    After change in attribute value name, for all product variants using this
    attributes we need to update the names.
    """
    initial_attributes = set(instance.variant_attributes.all())
    attributes_changed = initial_attributes.intersection(saved_attributes)
    if not attributes_changed:
        return

    variants = ProductVariant.objects.filter(
        product__in=instance.products.all(),
        product__product_type__variant_attributes__in=attributes_changed,
    )

    variants_to_update = []
    for variant in variants:
        variants_to_update.append(
            generate_and_set_variant_name(variant, variant.sku, save=False)
        )
        if len(variants_to_update) > VARIANTS_UPDATE_BATCH:
            ProductVariant.objects.bulk_update(
                variants_to_update, ["name", "updated_at"]
            )
            variants_to_update = []
    ProductVariant.objects.bulk_update(variants_to_update, ["name", "updated_at"])

@app.task
def update_variants_names(product_type_pk: int, saved_attributes_ids: List[int]):
    try:
        instance = ProductType.objects.get(pk=product_type_pk)
    except ObjectDoesNotExist:
        logging.warning(f"Cannot find product type with id: {product_type_pk}.")
        return
    saved_attributes = Attribute.objects.filter(pk__in=saved_attributes_ids)
    _update_variants_names(instance, saved_attributes)

@app.task
def update_product_discounted_price_task(product_pk: int):
    try:
        product = Product.objects.get(pk=product_pk)
    except ObjectDoesNotExist:
        logging.warning(f"Cannot find product with id: {product_pk}.")
        return
    update_product_discounted_price(product)

@app.task
def update_products_discounted_prices_of_catalogues_task(
    product_ids: Optional[List[int]] = None,
    category_ids: Optional[List[int]] = None,
    collection_ids: Optional[List[int]] = None,
    variant_ids: Optional[List[int]] = None,
):
    update_products_discounted_prices_of_catalogues(
        product_ids, category_ids, collection_ids, variant_ids
    )

@app.task
def update_products_discounted_prices_of_discount_task(discount_pk: int):
    try:
        discount = Sale.objects.get(pk=discount_pk)
    except ObjectDoesNotExist:
        logging.warning(f"Cannot find discount with id: {discount_pk}.")
        return
    update_products_discounted_prices_of_discount(discount)

@app.task
def update_products_discounted_prices_task(product_ids: List[int]):
    products = Product.objects.filter(pk__in=product_ids)
    update_products_discounted_prices(products)

@app.task
def deactivate_preorder_for_variants_task():
    variants_to_clean = _get_preorder_variants_to_clean()

    for variant in variants_to_clean:
        try:
            deactivate_preorder_for_variant(variant)
        except PreorderAllocationError as e:
            task_logger.warning(str(e))

def _get_preorder_variants_to_clean():
    return ProductVariant.objects.filter(
        is_preorder=True, preorder_end_date__lt=timezone.now()
    )

@app.task(queue=settings.UPDATE_SEARCH_VECTOR_INDEX_QUEUE_NAME, expires=20)
def update_products_search_vector_task():
    products = Product.objects.filter(search_index_dirty=True).order_by()[
        :PRODUCTS_BATCH_SIZE
    ]
    update_products_search_vector(products, use_batches=False)


text:
namespace MassTransit
{
    /// <summary>
    /// An Automatonymous state machine instance that is usable as a saga by MassTransit must implement this interface.
    /// It indicates to the framework the available features of the state as being a state machine instance.
    /// </summary>
    public interface SagaStateMachineInstance :
        ISaga
    {
    }
}


text: DISPENSA


text:
/* eslint-disable no-console, camelcase */
import processChangeFeedWithAutoReconnect from 'rethinkdb-changefeed-reconnect'

import {changefeedForProjectCreated} from 'src/server/services/dataService'
import {handleConnectionError} from './util'

export default function projectCreated(projectCreatedQueue) {
  processChangeFeedWithAutoReconnect(changefeedForProjectCreated, _getFeedProcessor(projectCreatedQueue), handleConnectionError, {
    changefeedName: 'project created',
  })
}

function _getFeedProcessor(projectCreatedQueue) {
  return ({new_val: project}) => {
    const jobOpts = {
      attempts: 3,
      backoff: {type: 'fixed', delay: 60000},
    }
    projectCreatedQueue.add(project, jobOpts)
  }
}


text:
package ru.spbau.tinydb.expressions.comparison;

import org.jetbrains.annotations.NotNull;
import ru.spbau.tinydb.common.DBException;
import ru.spbau.tinydb.expressions.Expression;
import ru.spbau.tinydb.queries.SecondLevelId;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * @author adkozlov
 */
public class JoinOnExpression implements Expression<Boolean> {

    @NotNull
    private final String tableName;
    @NotNull
    private final SecondLevelId firstId;
    @NotNull
    private final SecondLevelId secondId;

    public JoinOnExpression(@NotNull String tableName, @NotNull SecondLevelId firstId, @NotNull SecondLevelId secondId) {
        this.tableName = tableName;
        this.firstId = firstId;
        this.secondId = secondId;
    }

    @NotNull
    public String getTableName() {
        return tableName;
    }

    @NotNull
    public SecondLevelId getFirstId() {
        return firstId;
    }

    @NotNull
    public SecondLevelId getSecondId() {
        return secondId;
    }

    @NotNull
    @Override
    public Boolean execute(@NotNull Map<SecondLevelId, Object> values) {
        assertContainsId(values, firstId);
        assertContainsId(values, secondId);

        Object first = values.get(firstId);
        Object second = values.get(secondId);

        assertClassesAreEqual(first, second);

        return first.equals(second);
    }

    @NotNull
    @Override
    public List<SecondLevelId> getIds() {
        List<SecondLevelId> result = new LinkedList<>();
        result.add(firstId);
        result.add(secondId);

        return result;
    }

    @NotNull
    @Override
    public String toString() {
        return "INNER JOIN " + tableName + " ON " + firstId + " = " + secondId;
    }

    private static void assertContainsId(@NotNull Map<SecondLevelId, Object> values, @NotNull SecondLevelId id) {
        if (!values.containsKey(id)) {
            throw new DBException("no such attribute: " + id);
        }
    }

    private static void assertClassesAreEqual(@NotNull Object first, @NotNull Object second) {
        Class<?> firstClass = first.getClass();
        Class<?> secondClass = second.getClass();

        if (!first.getClass().equals(second.getClass())) {
            throw new DBException("incomparable types: " + firstClass + ", " + secondClass);
        }
    }
}


text:
import 'bootstrap-sass/assets/javascripts/bootstrap/popover';

$(() => {
  $('[data-toggle="popover"]').popover({
    animated: 'fade',
    placement: 'right',
  });
});


text:
"use strict";

function route(app) {
    app.get('/', function(req, res, next) {
        res.render('index', {
            oauthUser: req.session.oauthUser
        });
    });
}

module.exports = {
    route: route
};


text:
<resources>
<string name="create_notification">Crear Notificación</string>
<string name="view_notification">Ver Notificación</string>
<string name="edit_notification">Modificar Notificación</string>
<string name="about">Acerca de</string>
<string name="settings">Ajustes</string>

<string name="preference_notification_category">Preferencias de notificación</string>
<string name="checkbox_vibrate">Vibrar</string>
<string name="checkbox_sound">Sonar</string>
<string name="checkbox_LED">LED</string>
<string name="checkbox_ongoing">Persistente</string>
<string name="checkbox_dismiss">Eliminar al toque</string>
<string name="snooze">Silenciar</string>
<string name="snooze_detail">Añadir una acción de repetición a la notificación</string>
<string name="snooze_length">Repetir alarma después dé</string>
<string name="minute">minuto</string>
<string name="minutes">minutos</string>

<string name="action_settings">Ajustes</string>
<string name="action_delete">Borrar</string>
<string name="action_edit">Modificar</string>
<string name="action_about">Acerca de</string>

<string name="delete_confirmation">¿Estás seguro que quieres borrar esta notificación?</string>
<string name="yes">Sí</string>
<string name="no">No</string>
<string name="ok">OK</string>

<string name="title">Título</string>
<string name="save_menu">Guardar</string>
<string name="time_now">Ahora</string>
<string name="date_today">Hoy</string>
<string name="times_shown">Mostrado %1$d de %2$d vez/veces</string>
<string name="times_shown_edit">Mostrado %1$d de</string>
<string name="forever">Para siempre</string>
<string name="no_repeat">No se repita</string>
<string name="times"> vez/veces</string>
<string name="repeat_notification">Número de veces que se repite: </string>
<string name="content_hint">Añade contenido a la notificación</string>

<string name="select_icon">Seleccione un icono</string>
<string name="default_icon">Icono defecto</string>
<string name="custom_icon">Icono personalizado</string>

<string name="select_colour">Seleccione un color</string>
<string name="default_colour">Color defecto</string>
<string-array name="colour_names_array">
<item>Color defecto</item>
<item>Azul</item>
<item>Morado</item>
<item>Rojo</item>
<item>Verde</item>
<item>Naranja</item>
<item>Amarillo</item>
<item>Rosa</item>
</string-array>

<string name="specific_days">Días específicos de la semana</string>
<string name="repeats_on">Repite en:</string>
<string-array name="days_array">
<item>Lunes</item>
<item>Martes</item>
<item>Miércoles</item>
<item>Jueves</item>
<item>Viernes</item>
<item>Sábado</item>
<item>Domingo</item>
</string-array>

<string name="no_active">Ninguna notificación activa</string>
<string name="no_inactive">Ninguna notificación inactiva</string>

<string name="toast_past_date">No se puede elegir una fecha inicial en el pasado</string>
<string name="toast_higher_number">Número que debe repetirse tiene que ser mayor</string>
<string name="toast_title_empty">El título no puede estar vacío</string>

<string name="libraries">Bibliotecas</string>
<string name="rate_app">Calificar aplicación</string>
<string name="contact">Contactar</string>
<string name="version">Versión</string>

<string name="thanks_to">Gracias a</string>
<string name="translator">Traductor</string>

<string name="send_email">Enviar correo electrónico</string>

<string-array name="repeat_array">
<item>No se repita</item>
<item>Cada día</item>
<item>Cada semana</item>
<item>Cada mes</item>
<item>Cada año</item>
</string-array>
</resources>


text:
<?php

require_once 'class-tivwp-dm.php';
require_once 'class-tivwp-dm-notices.php';

/**
 * Class TIVWP_DM_Controller
 * @package TIVWP_DM
 * @author  tivnet
 */
class TIVWP_DM_Controller {

    /**
     * Constructor
     */
    public static function construct() {

        /**
         * The auto-switch should always work
         */
        self::_load_plugin_list();
        self::_setup_automatic_switch();

        /**
         * The rest relies on user privileges, and therefore must wait until necessary WP functions are loaded
         */
        if (!did_action('plugins_loaded')) {
            _doing_it_wrong(__METHOD__, __('Must call in of after the "plugins_loaded" action.'), '14.03.19');
            return;
        }

        /**
         * Low-level users won't see anything
         */
        if (!current_user_can(TIVWP_DM::MIN_CAPABILITY)) {
            return;
        }

        /**
         * The main actions happen in the admin area
         */
        if (is_admin()) {
            self::_setup_i18n();
            self::_setup_plugin_composer();
            self::_setup_admin_interface();
        }
    }

    /**
     * Initialize plugin list
     * @see TIVWP_DM::load_plugin_list
     */
    private static function _load_plugin_list() {
        add_action('init', array(
            'TIVWP_DM',
            'load_plugin_list'
                ), 0);
    }

    /**
     * Setup action call for internationalization
     * @see TIVWP_DM::action_init_load_plugin_textdomain
     */
    private static function _setup_i18n() {
        add_action('init', array(
            'TIVWP_DM',
            'action_init_load_plugin_textdomain'
        ));
    }

    /**
     * Prompt administrator to install and activate plugins
     */
    private static function _setup_plugin_composer() {

        if (!class_exists('TGM_Plugin_Activation')) {
            /**
             * @author    Thomas Griffin <thomas@thomasgriffinmedia.com>
             * @author    Gary Jones <gamajo@gamajo.com>
             * @link      https://github.com/thomasgriffin/TGM-Plugin-Activation
             */
            require_once dirname(__FILE__) . '/../vendor/class-tgm-plugin-activation.php';
        }

        /**
         * This happens on
         * @wp-hook init
         * @see     TGM_Plugin_Activation::init
         * @see     TIVWP_DM::action_tgmpa_register
         */
        add_action('tgmpa_register', array(
            'TIVWP_DM',
            'action_tgmpa_register'
        ));
    }

    /**
     * Setup admin area menus to bulk switch development plugins on/off
     * @see TIVWP_DM::turn_output_buffering
     * @see TIVWP_DM::action_admin_menu
     */
    private static function _setup_admin_interface() {

        add_action('admin_init', array(
            'TIVWP_DM',
            'turn_output_buffering'
        ));

        add_action('admin_menu', array(
            'TIVWP_DM',
            'action_admin_menu'
        ));
    }

    /**
     * Setup automatic plugins on/off switching depending on the defined TIVWP_DM_AUTO constant
     * @see TIVWP_DM::activate_all_development_plugins
     * @see TIVWP_DM::deactivate_all_development_plugins
     */
    private static function _setup_automatic_switch() {

        if (!defined('TIVWP_DM_AUTO')) {
            return;
        }

        $action = TIVWP_DM_AUTO;

        /**
         * If there is no callable method corresponding to the TIVWP_DM_AUTO set,
         * notify admin and set a fallback action
         */
        if (!is_callable(array(
                    'TIVWP_DM',
                    "{$action}_all_development_plugins"
                ))
        ) {

            TIVWP_DM_Notices::add(sprintf(__('Unknown action "%1$s" specified for %2$s', 'tivwp-dm'), $action, 'TIVWP_DM_AUTO'), TIVWP_DM_Notices::WITH_TRIGGER_ERROR
            );

            $action = TIVWP_DM::ACTION_DEACTIVATE;

            TIVWP_DM_Notices::add(sprintf(__('The unknown action has been replaced with "%s"', 'tivwp-dm'), $action), TIVWP_DM_Notices::WITH_TRIGGER_ERROR);
        }

        /**
         * Silently (de)activate all development plugins
         * @todo admin bar on front is shown before this, so it will be updated only on the next screen refresh
         */
        add_action('init', array(
            'TIVWP_DM',
            "{$action}_all_development_plugins"
                ), 20);

        /**
         * Enqueue admin notice about the action performed
         */
        TIVWP_DM_Notices::add(sprintf(__('Automatic action performed: "%s"', 'tivwp-dm'), $action, TIVWP_DM_Notices::WITHOUT_TRIGGER_ERROR));
    }

}

// class

# --- EOF


text:
namespace google {
namespace cloud {
namespace storage {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
namespace {
TEST(SignedUrlOptions, QueryParameters) {
  auto mp = [](char const* k, char const* v) {
    return std::pair<std::string, std::string>(k, v);
  };
  EXPECT_EQ("acl", WithAcl().value());
  EXPECT_EQ("billing", WithBilling().value());
  EXPECT_EQ("compose", WithCompose().value());
  EXPECT_EQ("cors", WithCors().value());
  EXPECT_EQ("encryption", WithEncryption().value());
  EXPECT_EQ("encryptionConfig", WithEncryptionConfig().value());
  EXPECT_EQ(mp("generation", "12345"), WithGeneration(12345U).value());
  EXPECT_EQ(mp("generation-marker", "23456"),
            WithGenerationMarker(23456U).value());
  EXPECT_EQ("lifecycle", WithLifecycle().value());
  EXPECT_EQ("location", WithLocation().value());
  EXPECT_EQ("logging", WithLogging().value());
  EXPECT_EQ(mp("marker", "abcd"), WithMarker("abcd").value());
  EXPECT_EQ(mp("response-content-disposition", "inline"),
            WithResponseContentDisposition("inline").value());
  EXPECT_EQ(mp("response-content-type", "text/plain"),
            WithResponseContentType("text/plain").value());
  EXPECT_EQ("storageClass", WithStorageClass().value());
  EXPECT_EQ("tagging", WithTagging().value());
  EXPECT_EQ(mp("userProject", "test-project"),
            WithUserProject("test-project").value());
}
}  // namespace
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace storage
}  // namespace cloud
}  // namespace google