text:
ALTER TABLE romans_site.rubrics_article ADD preview TEXT NULL;

CREATE TABLE `callback` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` text COLLATE utf8_unicode_ci NOT NULL,
  `name` text COLLATE utf8_unicode_ci NOT NULL,
  `message` text COLLATE utf8_unicode_ci NOT NULL,
  `date_create` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE romans_site.rubrics_article ADD preview_photo TEXT NULL;

ALTER TABLE romans_site.rubrics_article ADD deleted DATETIME NULL;


text:
class GripperSimTestSetup : public ::testing::Test {
 protected:
  std::unique_ptr<actionlib::SimpleActionClient<::franka_gripper::HomingAction>> homing_client;
  std::unique_ptr<actionlib::SimpleActionClient<::franka_gripper::MoveAction>> move_client;
  std::unique_ptr<actionlib::SimpleActionClient<::franka_gripper::GraspAction>> grasp_client;
  ros::NodeHandle n;
  double finger_1_pos = 0.;
  double finger_2_pos = 0.;
  double finger_1_force = 0.;
  double finger_2_force = 0.;
  void SetUp() override;
  void updateFingerState();
  void resetStone();
  void setRealTimeUpdateRate(double rate);
};

redpajama_set_name: RedPajamaGithub


text:
use strict;
use warnings;

use Bio::EnsEMBL::Registry;

my $registry = 'Bio::EnsEMBL::Registry';

$registry->load_all('/hps/nobackup/production/ensembl/anja/release_96/vervet/ensembl.registry');

my $vfa = $registry->get_adaptor('vervet', 'variation', 'variationfeature');
my $sgta = $registry->get_adaptor('vervet', 'variation', 'samplegenotype');
my $sa = $registry->get_adaptor('vervet', 'core', 'slice');

$vfa->db->use_vcf(2);

my $slice = $sa->fetch_by_region('chromosome', 22, 1009570, 1019570);

my $vfs = $vfa->fetch_all_by_Slice($slice);
print STDERR 'VFS ', scalar @$vfs, "\n";

my $sgts = $sgta->fetch_all_by_Slice($slice);
print STDERR 'SGTS ', scalar @$sgts, "\n";


text:
using System;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Web.UI;

namespace System.Web.UI.WebControls {

    public class PagePropertiesChangingEventArgs : EventArgs {
        private int _startRowIndex;
        private int _maximumRows;

        public PagePropertiesChangingEventArgs(int startRowIndex, int maximumRows) {
            _startRowIndex = startRowIndex;
            _maximumRows = maximumRows;
        }

        public int MaximumRows {
            get {
                return _maximumRows;
            }
        }

        public int StartRowIndex {
            get {
                return _startRowIndex;
            }
        }
    }
}


text:
/* vim: set expandtab sw=4 ts=4 sts=4: */

/**
 * Unbind all event handlers before tearing down a page
 */
AJAX.registerTeardown('server_variables.js', function () {
    $(document).off('click', 'a.editLink');
    $('#serverVariables').find('.var-name').find('a img').remove();
});

AJAX.registerOnload('server_variables.js', function () {
    var $editLink = $('a.editLink');
    var $saveLink = $('a.saveLink');
    var $cancelLink = $('a.cancelLink');

    $('#serverVariables').find('.var-name').find('a').append(
        $('#docImage').clone().css('display', 'inline-block')
    );

    /* Launches the variable editor */
    $(document).on('click', 'a.editLink', function (event) {
        event.preventDefault();
        editVariable(this);
    });

    /* Allows the user to edit a server variable */
    function editVariable (link) {
        var $link = $(link);
        var $cell = $link.parent();
        var $valueCell = $link.parents('.var-row').find('.var-value');
        var varName = $link.data('variable');

        var $mySaveLink = $saveLink.clone().css('display', 'inline-block');
        var $myCancelLink = $cancelLink.clone().css('display', 'inline-block');
        var $msgbox = PMA_ajaxShowMessage();
        var $myEditLink = $cell.find('a.editLink');
        $cell.addClass('edit'); // variable is being edited
        $myEditLink.remove(); // remove edit link

        $mySaveLink.click(function () {
            var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
            $.post($(this).attr('href'), {
                ajax_request: true,
                type: 'setval',
                varName: varName,
                varValue: $valueCell.find('input').val()
            }, function (data) {
                if (data.success) {
                    $valueCell
                        .html(data.variable)
                        .data('content', data.variable);
                    PMA_ajaxRemoveMessage($msgbox);
                } else {
                    if (data.error === '') {
                        PMA_ajaxShowMessage(PMA_messages.strRequestFailed, false);
                    } else {
                        PMA_ajaxShowMessage(data.error, false);
                    }
                    $valueCell.html($valueCell.data('content'));
                }
                $cell.removeClass('edit').html($myEditLink);
            });
            return false;
        });

        $myCancelLink.click(function () {
            $valueCell.html($valueCell.data('content'));
            $cell.removeClass('edit').html($myEditLink);
            return false;
        });

        $.get($mySaveLink.attr('href'), {
            ajax_request: true,
            type: 'getval',
            varName: varName
        }, function (data) {
            if (typeof data !== 'undefined' && data.success === true) {
                var $links = $('<div />')
                    .append($myCancelLink)
                    .append('   ')
                    .append($mySaveLink);
                var $editor = $('<div />', { 'class': 'serverVariableEditor' })
                    .append(
                        $('<div/>').append(
                            $('<input />', { type: 'text' }).val(data.message)
                        )
                    );
                    // Save and replace content
                $cell
                    .html($links)
                    .children()
                    .css('display', 'flex');
                $valueCell
                    .data('content', $valueCell.html())
                    .html($editor)
                    .find('input')
                    .focus()
                    .keydown(function (event) { // Keyboard shortcuts
                        if (event.keyCode === 13) { // Enter key
                            $mySaveLink.trigger('click');
                        } else if (event.keyCode === 27) { // Escape key
                            $myCancelLink.trigger('click');
                        }
                    });
                PMA_ajaxRemoveMessage($msgbox);
            } else {
                $cell.removeClass('edit').html($myEditLink);
                PMA_ajaxShowMessage(data.error);
            }
        });
    }
});


text:
<?php
namespace Workshop\Plugins\Plugin\Catalog\Model;

class Category
{
    public function afterGetName(\Magento\Catalog\Model\Category $category, $name)
    {
        return $name . ' ('.__('ID:').$category->getId().')';
    }
}


text:
package io.apptik.multiview.adapters;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

import java.lang.reflect.InvocationTargetException;

public class WrapperAdapter<A extends RecyclerView.Adapter, VG extends ViewGroup> extends RecyclerView.Adapter<WrapperAdapter.ViewHolder> {

    A originalAdapter;
    Class<VG> vgClass;

    public WrapperAdapter(A originalAdapter, Class<VG> vgClass) {
        this.originalAdapter = originalAdapter;
        this.vgClass = vgClass;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

        VG viewGroup = null;
        try {
            viewGroup = vgClass.getConstructor(Context.class).newInstance(parent.getContext());
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
        if(viewGroup==null) {
            throw new IllegalStateException("viewGroup container was not initialized");
        }
        RecyclerView.LayoutParams lp = new RecyclerView.LayoutParams(RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.MATCH_PARENT);
        viewGroup.setLayoutParams(lp);
        ViewHolder vh = new ViewHolder(originalAdapter.onCreateViewHolder(parent, viewType), viewGroup);
        View childView = vh.originalVH.itemView;
        ViewGroup.LayoutParams lpCh = childView.getLayoutParams();
        lpCh.width = parent.getWidth();
        lpCh.height = parent.getHeight();
        viewGroup.addView(childView);
        return vh;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        originalAdapter.bindViewHolder(holder.originalVH, position);
    }

    @Override
    public int getItemCount() {
        return originalAdapter.getItemCount();
    }

    public class ViewHolder<VH extends RecyclerView.ViewHolder> extends RecyclerView.ViewHolder {

        public final VH originalVH;
        public final VG viewGroup;

        public ViewHolder(VH originViewHolder, VG viewGroup) {
            super(viewGroup);
            originalVH = originViewHolder;
            this.viewGroup = viewGroup;
        }
    }
}


text:
OUTPUT = "I don't think you {} today, I think you {} {} {}!".format

def alan_annoying_kid(phrase):
    words = phrase.split()
    action = ' '.join(words[2:]).rstrip('.')
    if "didn't" in phrase:
        return OUTPUT(action, 'did', words[3], 'it')
    return OUTPUT(action, "didn't", words[2][:-2], 'at all')


text:
Checkout

                    Home/Checkout

Billing Address

    <form action="" method="POST">

                    Country Name
                    <select id="countryName" class="form-control">
                        <option>Select Country....</option>
                        <option data-countryCode="DZ" value="213">Algeria (+213)</option>
				<option data-countryCode="AD" value="376">Andorra (+376)</option>
				<option data-countryCode="AO" value="244">Angola (+244)</option>
				<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
				<option data-countryCode="AG" value="1268">Antigua & Barbuda (+1268)</option>
				<option data-countryCode="AR" value="54">Argentina (+54)</option>
				<option data-countryCode="AM" value="374">Armenia (+374)</option>
				<option data-countryCode="AW" value="297">Aruba (+297)</option>
				<option data-countryCode="AU" value="61">Australia (+61)</option>
				<option data-countryCode="AT" value="43">Austria (+43)</option>
				<option data-countryCode="AZ" value="994">Azerbaijan (+994)</option>
				<option data-countryCode="BS" value="1242">Bahamas (+1242)</option>
				<option data-countryCode="BH" value="973">Bahrain (+973)</option>
				<option data-countryCode="BD" value="880">Bangladesh (+880)</option>
				<option data-countryCode="BB" value="1246">Barbados (+1246)</option>
				<option data-countryCode="BY" value="375">Belarus (+375)</option>
				<option data-countryCode="BE" value="32">Belgium (+32)</option>
				<option data-countryCode="BZ" value="501">Belize (+501)</option>
				<option data-countryCode="BJ" value="229">Benin (+229)</option>
				<option data-countryCode="BM" value="1441">Bermuda (+1441)</option>
				<option data-countryCode="BT" value="975">Bhutan (+975)</option>
				<option data-countryCode="BO" value="591">Bolivia (+591)</option>
				<option data-countryCode="BA" value="387">Bosnia Herzegovina (+387)</option>
				<option data-countryCode="BW" value="267">Botswana (+267)</option>
				<option data-countryCode="BR" value="55">Brazil (+55)</option>
				<option data-countryCode="BN" value="673">Brunei (+673)</option>
				<option data-countryCode="BG" value="359">Bulgaria (+359)</option>
				<option data-countryCode="BF" value="226">Burkina Faso (+226)</option>
				<option data-countryCode="BI" value="257">Burundi (+257)</option>
				<option data-countryCode="KH" value="855">Cambodia (+855)</option>
				<option data-countryCode="CM" value="237">Cameroon (+237)</option>
				<option data-countryCode="CA" value="1">Canada (+1)</option>
				<option data-countryCode="CV" value="238">Cape Verde Islands (+238)</option>
				<option data-countryCode="KY" value="1345">Cayman Islands (+1345)</option>
				<option data-countryCode="CF" value="236">Central African Republic (+236)</option>
				<option data-countryCode="CL" value="56">Chile (+56)</option>
				<option data-countryCode="CN" value="86">China (+86)</option>
				<option data-countryCode="CO" value="57">Colombia (+57)</option>
				<option data-countryCode="KM" value="269">Comoros (+269)</option>
				<option data-countryCode="CG" value="242">Congo (+242)</option>
				<option data-countryCode="CK" value="682">Cook Islands (+682)</option>
				<option data-countryCode="CR" value="506">Costa Rica (+506)</option>
				<option data-countryCode="HR" value="385">Croatia (+385)</option>
				<option data-countryCode="CU" value="53">Cuba (+53)</option>
				<option data-countryCode="CY" value="90392">Cyprus North (+90392)</option>
				<option data-countryCode="CY" value="357">Cyprus South (+357)</option>
				<option data-countryCode="CZ" value="42">Czech Republic (+42)</option>
				<option data-countryCode="DK" value="45">Denmark (+45)</option>
				<option data-countryCode="DJ" value="253">Djibouti (+253)</option>
				<option data-countryCode="DM" value="1809">Dominica (+1809)</option>
				<option data-countryCode="DO" value="1809">Dominican Republic (+1809)</option>
				<option data-countryCode="EC" value="593">Ecuador (+593)</option>
				<option data-countryCode="EG" value="20">Egypt (+20)</option>
				<option data-countryCode="SV" value="503">El Salvador (+503)</option>
				<option data-countryCode="GQ" value="240">Equatorial Guinea (+240)</option>
				<option data-countryCode="ER" value="291">Eritrea (+291)</option>
				<option data-countryCode="EE" value="372">Estonia (+372)</option>
				<option data-countryCode="ET" value="251">Ethiopia (+251)</option>
				<option data-countryCode="FK" value="500">Falkland Islands (+500)</option>
				<option data-countryCode="FO" value="298">Faroe Islands (+298)</option>
				<option data-countryCode="FJ" value="679">Fiji (+679)</option>
				<option data-countryCode="FI" value="358">Finland (+358)</option>
				<option data-countryCode="FR" value="33">France (+33)</option>
				<option data-countryCode="GF" value="594">French Guiana (+594)</option>
				<option data-countryCode="PF" value="689">French Polynesia (+689)</option>
				<option data-countryCode="GA" value="241">Gabon (+241)</option>
				<option data-countryCode="GM" value="220">Gambia (+220)</option>
				<option data-countryCode="GE" value="7880">Georgia (+7880)</option>
				<option data-countryCode="DE" value="49">Germany (+49)</option>
				<option data-countryCode="GH" value="233">Ghana (+233)</option>
				<option data-countryCode="GI" value="350">Gibraltar (+350)</option>
				<option data-countryCode="GR" value="30">Greece (+30)</option>
				<option data-countryCode="GL" value="299">Greenland (+299)</option>
				<option data-countryCode="GD" value="1473">Grenada (+1473)</option>
				<option data-countryCode="GP" value="590">Guadeloupe (+590)</option>
				<option data-countryCode="GU" value="671">Guam (+671)</option>
				<option data-countryCode="GT" value="502">Guatemala (+502)</option>
				<option data-countryCode="GN" value="224">Guinea (+224)</option>
				<option data-countryCode="GW" value="245">Guinea - Bissau (+245)</option>
				<option data-countryCode="GY" value="592">Guyana (+592)</option>
				<option data-countryCode="HT" value="509">Haiti (+509)</option>
				<option data-countryCode="HN" value="504">Honduras (+504)</option>
				<option data-countryCode="HK" value="852">Hong Kong (+852)</option>
				<option data-countryCode="HU" value="36">Hungary (+36)</option>
				<option data-countryCode="IS" value="354">Iceland (+354)</option>
				<option data-countryCode="IN" value="91">India (+91)</option>
				<option data-countryCode="ID" value="62">Indonesia (+62)</option>
				<option data-countryCode="IR" value="98">Iran (+98)</option>
				<option data-countryCode="IQ" value="964">Iraq (+964)</option>
				<option data-countryCode="IE" value="353">Ireland (+353)</option>
				<option data-countryCode="IL" value="972">Israel (+972)</option>
				<option data-countryCode="IT" value="39">Italy (+39)</option>
				<option data-countryCode="JM" value="1876">Jamaica (+1876)</option>
				<option data-countryCode="JP" value="81">Japan (+81)</option>
				<option data-countryCode="JO" value="962">Jordan (+962)</option>
				<option data-countryCode="KZ" value="7">Kazakhstan (+7)</option>
				<option data-countryCode="KE" value="254">Kenya (+254)</option>
				<option data-countryCode="KI" value="686">Kiribati (+686)</option>
				<option data-countryCode="KP" value="850">Korea North (+850)</option>
				<option data-countryCode="KR" value="82">Korea South (+82)</option>
				<option data-countryCode="KW" value="965">Kuwait (+965)</option>
				<option data-countryCode="KG" value="996">Kyrgyzstan (+996)</option>
				<option data-countryCode="LA" value="856">Laos (+856)</option>
				<option data-countryCode="LV" value="371">Latvia (+371)</option>
				<option data-countryCode="LB" value="961">Lebanon (+961)</option>
				<option data-countryCode="LS" value="266">Lesotho (+266)</option>
				<option data-countryCode="LR" value="231">Liberia (+231)</option>
				<option data-countryCode="LY" value="218">Libya (+218)</option>
				<option data-countryCode="LI" value="417">Liechtenstein (+417)</option>
				<option data-countryCode="LT" value="370">Lithuania (+370)</option>
				<option data-countryCode="LU" value="352">Luxembourg (+352)</option>
				<option data-countryCode="MO" value="853">Macao (+853)</option>
				<option data-countryCode="MK" value="389">Macedonia (+389)</option>
				<option data-countryCode="MG" value="261">Madagascar (+261)</option>
				<option data-countryCode="MW" value="265">Malawi (+265)</option>
				<option data-countryCode="MY" value="60">Malaysia (+60)</option>
				<option data-countryCode="MV" value="960">Maldives (+960)</option>
				<option data-countryCode="ML" value="223">Mali (+223)</option>
				<option data-countryCode="MT" value="356">Malta (+356)</option>
				<option data-countryCode="MH" value="692">Marshall Islands (+692)</option>
				<option data-countryCode="MQ" value="596">Martinique (+596)</option>
				<option data-countryCode="MR" value="222">Mauritania (+222)</option>
				<option data-countryCode="YT" value="269">Mayotte (+269)</option>
				<option data-countryCode="MX" value="52">Mexico (+52)</option>
				<option data-countryCode="FM" value="691">Micronesia (+691)</option>
				<option data-countryCode="MD" value="373">Moldova (+373)</option>
				<option data-countryCode="MC" value="377">Monaco (+377)</option>
				<option data-countryCode="MN" value="976">Mongolia (+976)</option>
				<option data-countryCode="MS" value="1664">Montserrat (+1664)</option>
				<option data-countryCode="MA" value="212">Morocco (+212)</option>
				<option data-countryCode="MZ" value="258">Mozambique (+258)</option>
				<option data-countryCode="MN" value="95">Myanmar (+95)</option>
				<option data-countryCode="NA" value="264">Namibia (+264)</option>
				<option data-countryCode="NR" value="674">Nauru (+674)</option>
				<option data-countryCode="NP" value="977">Nepal (+977)</option>
				<option data-countryCode="NL" value="31">Netherlands (+31)</option>
				<option data-countryCode="NC" value="687">New Caledonia (+687)</option>
				<option data-countryCode="NZ" value="64">New Zealand (+64)</option>
				<option data-countryCode="NI" value="505">Nicaragua (+505)</option>
				<option data-countryCode="NE" value="227">Niger (+227)</option>
				<option data-countryCode="NG" value="234">Nigeria (+234)</option>
				<option data-countryCode="NU" value="683">Niue (+683)</option>
				<option data-countryCode="NF" value="672">Norfolk Islands (+672)</option>
				<option data-countryCode="NP" value="670">Northern Marianas (+670)</option>
				<option data-countryCode="NO" value="47">Norway (+47)</option>
				<option data-countryCode="OM" value="968">Oman (+968)</option>
				<option data-countryCode="PW" value="680">Palau (+680)</option>
				<option data-countryCode="PA" value="507">Panama (+507)</option>
				<option data-countryCode="PG" value="675">Papua New Guinea (+675)</option>
				<option data-countryCode="PY" value="595">Paraguay (+595)</option>
				<option data-countryCode="PE" value="51">Peru (+51)</option>
				<option data-countryCode="PH" value="63">Philippines (+63)</option>
				<option data-countryCode="PL" value="48">Poland (+48)</option>
				<option data-countryCode="PT" value="351">Portugal (+351)</option>
				<option data-countryCode="PR" value="1787">Puerto Rico (+1787)</option>
				<option data-countryCode="QA" value="974">Qatar (+974)</option>
				<option data-countryCode="RE" value="262">Reunion (+262)</option>
				<option data-countryCode="RO" value="40">Romania (+40)</option>
				<option data-countryCode="RU" value="7">Russia (+7)</option>
				<option data-countryCode="RW" value="250">Rwanda (+250)</option>
				<option data-countryCode="SM" value="378">San Marino (+378)</option>
				<option data-countryCode="ST" value="239">Sao Tome & Principe (+239)</option>
				<option data-countryCode="SA" value="966">Saudi Arabia (+966)</option>
				<option data-countryCode="SN" value="221">Senegal (+221)</option>
				<option data-countryCode="CS" value="381">Serbia (+381)</option>
				<option data-countryCode="SC" value="248">Seychelles (+248)</option>
				<option data-countryCode="SL" value="232">Sierra Leone (+232)</option>
				<option data-countryCode="SG" value="65">Singapore (+65)</option>
				<option data-countryCode="SK" value="421">Slovak Republic (+421)</option>
				<option data-countryCode="SI" value="386">Slovenia (+386)</option>
				<option data-countryCode="SB" value="677">Solomon Islands (+677)</option>
				<option data-countryCode="SO" value="252">Somalia (+252)</option>
				<option data-countryCode="ZA" value="27">South Africa (+27)</option>
				<option data-countryCode="ES" value="34">Spain (+34)</option>
				<option data-countryCode="LK" value="94">Sri Lanka (+94)</option>
				<option data-countryCode="SH" value="290">St. Helena (+290)</option>
				<option data-countryCode="KN" value="1869">St. Kitts (+1869)</option>
				<option data-countryCode="SC" value="1758">St. Lucia (+1758)</option>
				<option data-countryCode="SD" value="249">Sudan (+249)</option>
				<option data-countryCode="SR" value="597">Suriname (+597)</option>
				<option data-countryCode="SZ" value="268">Swaziland (+268)</option>
				<option data-countryCode="SE" value="46">Sweden (+46)</option>
				<option data-countryCode="CH" value="41">Switzerland (+41)</option>
				<option data-countryCode="SI" value="963">Syria (+963)</option>
				<option data-countryCode="TW" value="886">Taiwan (+886)</option>
				<option data-countryCode="TJ" value="7">Tajikstan (+7)</option>
				<option data-countryCode="TH" value="66">Thailand (+66)</option>
				<option data-countryCode="TG" value="228">Togo (+228)</option>
				<option data-countryCode="TO" value="676">Tonga (+676)</option>
				<option data-countryCode="TT" value="1868">Trinidad & Tobago (+1868)</option>
				<option data-countryCode="TN" value="216">Tunisia (+216)</option>
				<option data-countryCode="TR" value="90">Turkey (+90)</option>
				<option data-countryCode="TM" value="7">Turkmenistan (+7)</option>
				<option data-countryCode="TM" value="993">Turkmenistan (+993)</option>
				<option data-countryCode="TC" value="1649">Turks & Caicos Islands (+1649)</option>
				<option data-countryCode="TV" value="688">Tuvalu (+688)</option>
				<option data-countryCode="UG" value="256">Uganda (+256)</option>
				<option data-countryCode="GB" value="44">UK (+44)</option>
				<option data-countryCode="UA" value="380">Ukraine (+380)</option>
				<option data-countryCode="AE" value="971">United Arab Emirates (+971)</option>
				<option data-countryCode="UY" value="598">Uruguay (+598)</option>
				<option data-countryCode="US" value="1">USA (+1)</option>
				<option data-countryCode="UZ" value="7">Uzbekistan (+7)</option>
				<option data-countryCode="VU" value="678">Vanuatu (+678)</option>
				<option data-countryCode="VA" value="379">Vatican City (+379)</option>
				<option data-countryCode="VE" value="58">Venezuela (+58)</option>
				<option data-countryCode="VN" value="84">Vietnam (+84)</option>
				<option data-countryCode="VG" value="84">Virgin Islands - British (+1284)</option>
				<option data-countryCode="VI" value="84">Virgin Islands - US (+1340)</option>
				<option data-countryCode="WF" value="681">Wallis & Futuna (+681)</option>
				<option data-countryCode="YE" value="969">Yemen (North)(+969)</option>
				<option data-countryCode="YE" value="967">Yemen (South)(+967)</option>
				<option data-countryCode="ZM" value="260">Zambia (+260)</option>
				<option data-countryCode="ZW" value="263">Zimbabwe (+263)</option>
                    </select>

                        First Name
                        <input type="text" name="first_name" placeholder="First Name" class="form-control">

                        Last Name
                        <input type="text" name="last_name" placeholder="Last Name" class="form-control">

                    Company Name
                    <input type="text" name="company_name" class="form-control" placeholder="Company Name">

                    Address
                    <input type="text" name="address" class="form-control" placeholder="Address">

                    <input type="text" name="optional_address" class="form-control" placeholder="Optional Address">

		                    State / City
		                    <input type="text" name="city_state" class="form-control" placeholder="State / City">

                            Zip Code
                            <input type="number" class="form-control" placeholder="Zip Code" name="zipe_code">

                            Email Address
                            <input type="email" class="form-control" placeholder="Email Address" name="email">

                            Phone Number
                            <input type="number" class="form-control" name="phone" placeholder="Phone Number">

                    Additional Information
                    <textarea name="additional_info" id="additional_info" cols="30" rows="5" class="form-control"></textarea>

                    Order Info

                                SL
                                Product Name
                                Quantity
                                Product Price
                                Total

                                1
                                Facebook Cover Design

                                        <input type="number" value="1" class="form-control order-details-quantity" size="4">

                                $300
                                $1500

                                1
                                Facebook Cover Design

                                        <input type="number" value="1" class="form-control order-details-quantity" size="4">

                                $300
                                $1500

                                1
                                Facebook Cover Design

                                        <input type="number" value="1" class="form-control order-details-quantity" size="4">

                                $300
                                $1500

                                10
                                Facebook Cover Design

                                        <input type="number" value="1" class="form-control order-details-quantity" size="4">

                                $300
                                $1500

                                Total

                                $2500

                            <input id="payment_method_paypal" type="radio" class="input-radio" name="payment_method" value="paypal" checked="checked" data-order_button_text="Proceed to PayPal">

                                PayPal
                                What is PayPal?

Pay via PayPal; you can pay with your credit card if you don't have a PayPal account.

                        Since your browser does not support JavaScript, or it is disabled, please ensure you click the <em>Update Totals</em> button before placing your order. You may be charged more than the amount stated above if you fail to do so.<br/><input type="submit" class="button alt" name="woocommerce_checkout_update_totals" value="Update totals" />

                        <input type="hidden" id="_wpnonce" name="_wpnonce" value="c4e14ce9c1">
                        <input type="hidden" name="_wp_http_referer" value="/wp-admin/admin-ajax.php">

                        <input type="submit" class="button btn btn-primary alt" name="woocommerce_checkout_place_order" id="place_order" value="Proceed to PayPal" data-value="Place order">

    </form>


text:
---
title: Array.prototype.shift
localeTitle: Array.prototype.shift
---
El método de matriz de JavaScript `.shift()` eliminará el primer elemento de una matriz y devolverá ese valor. Esto también cambiará la longitud de la matriz

**Sintaxis**

```javascript
  var array = [1, 2, 3, 4];
  array.shift();
```

## Descripción

`.shift()` eliminará el elemento en el índice 0 de la matriz sobre la que se llama. A continuación, devuelve el valor eliminado y cambia todos los elementos restantes hacia abajo en 1 valor de índice.

`.shift()` devolverá `undefined` si la matriz a la que se llama no contiene elementos.

## Ejemplos

**Desplazando el primer valor de una matriz**

```javascript
  var array = [1, 2, 3, 4, 5];
  console.log(array);
  // Console will output 1, 2, 3, 4, 5

  array.shift();
  // If we console.log(array.shift()); the console would output 1.

  console.log(array);
  /* Console will output 2, 3, 4, 5 and
  the variable array now contains the set [2, 3, 4, 5] where
  each element has been moved down 1 index value. */
```

Fuente: [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)


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

namespace SmartSql.Utils
{
    /// <summary>
    /// 文件监控加载器
    /// </summary>
    public class FileWatcherLoader : IDisposable
    {
        private IList<FileSystemWatcher> _fileWatchers = new List<FileSystemWatcher>();

        public void Watch(FileInfo fileInfo, Action onFileChanged)
        {
            if (onFileChanged != null)
            {
                WatchFileChange(fileInfo, onFileChanged);
            }
        }
        private void WatchFileChange(FileInfo fileInfo, Action onFileChanged)
        {
            FileSystemWatcher fileWatcher = new FileSystemWatcher(fileInfo.DirectoryName)
            {
                Filter = fileInfo.Name,
                NotifyFilter = NotifyFilters.LastWrite
            };
            #region OnChanged
            DateTime lastChangedTime = DateTime.Now;
            int twoTimeInterval = 1000;
            fileWatcher.Changed += (sender, e) =>
            {
                var timerInterval = (DateTime.Now - lastChangedTime).TotalMilliseconds;
                if (timerInterval < twoTimeInterval) { return; }
                onFileChanged?.Invoke();
                lastChangedTime = DateTime.Now;
            };
            #endregion
            fileWatcher.EnableRaisingEvents = true;
            _fileWatchers.Add(fileWatcher);
        }

        public void Dispose()
        {
            for (int i = 0; i < _fileWatchers.Count; i++)
            {
                FileSystemWatcher fileWatcher = _fileWatchers[i];
                fileWatcher.EnableRaisingEvents = false;
                fileWatcher.Dispose();
            }
        }
    }
}


text:
<?php

if ( ! class_exists( 'smallermobs_Menus' ) ) {

	/**
	* The "Menus" module
	*/
	class smallermobs_Menus {

		function __construct() {
			global $ss_settings;

			add_filter( 'smallermobs_nav_class',        array( $this, 'nav_class' ) );
			add_action( 'smallermobs_inside_nav_begin', array( $this, 'navbar_pre_searchbox' ), 11 );
			add_filter( 'smallermobs_navbar_class',     array( $this, 'navbar_class' ) );
			add_action( 'wp_enqueue_scripts',         array( $this, 'navbar_css' ), 101 );
			add_filter( 'smallermobs_navbar_brand',     array( $this, 'navbar_brand' ) );
			add_filter( 'body_class',                 array( $this, 'navbar_body_class' ) );
			add_action( 'widgets_init',               array( $this, 'sl_widgets_init' ), 40 );
			add_action( 'smallermobs_post_main_nav',    array( $this, 'navbar_sidebar' ) );
			add_action( 'smallermobs_pre_wrap',         array( $this, 'secondary_navbar' ) );
			add_action( 'widgets_init',               array( $this, 'slidedown_widgets_init' ), 50 );
			add_action( 'wp_enqueue_scripts',         array( $this, 'megadrop_script' ), 200 );
			add_action( 'smallermobs_pre_wrap',         array( $this, 'content_wrapper_static_left_open' ) );
			add_action( 'smallermobs_after_footer',     array( $this, 'content_wrapper_static_left_close' ), 1 );

			if ( isset( $ss_settings['secondary_navbar_margin'] ) && $ss_settings['secondary_navbar_margin'] != 0 ) {
				add_action( 'wp_enqueue_scripts', array( $this, 'secondary_navbar_margin' ), 101 );
			}

			if ( isset( $ss_settings['navbar_toggle'] ) ) {

				if ( $ss_settings['navbar_toggle'] == 'left' ) {
					$hook_navbar_slidedown_toggle = 'smallermobs_pre_content';
				} else {
					$hook_navbar_slidedown_toggle = 'smallermobs_inside_nav_begin';
				}

			} else {

				$hook_navbar_slidedown_toggle = 'smallermobs_inside_nav_begin';

			}

			add_action( $hook_navbar_slidedown_toggle, array( $this, 'navbar_slidedown_toggle' ) );

			if ( isset( $ss_settings['navbar_toggle'] ) ) {

				if ( $ss_settings['navbar_toggle'] == 'left' ) {
					$hook_navbar_slidedown_content = 'smallermobs_pre_content';
				} else {
					$hook_navbar_slidedown_content = 'smallermobs_do_navbar';
				}

			} else {

				$hook_navbar_slidedown_content = 'smallermobs_do_navbar';

			}

			add_action( $hook_navbar_slidedown_content, array( $this, 'navbar_slidedown_content' ), 99 );
		}

		/**
		 * Modify the nav class.
		 */
		function nav_class() {
			global $ss_settings;

			if ( $ss_settings['navbar_nav_right'] == '1' ) {
				return 'navbar-nav nav pull-right';
			} else {
				return 'navbar-nav nav';
			}
		}

		/*
		 * The template for the primary navbar searchbox
		 */
		function navbar_pre_searchbox() {
			global $ss_settings;

			$show_searchbox = $ss_settings['navbar_search'];
			if ( $show_searchbox == '1' ) : ?>
				<form role="search" method="get" id="searchform" class="form-search pull-right navbar-form" action="<?php echo home_url('/'); ?>">
					<?php _e('Search for:', 'smallermobs'); ?>
					<input type="text" value="<?php if (is_search()) { echo get_search_query(); } ?>" name="s" id="s" class="form-control search-query" placeholder="<?php _e('Search', 'smallermobs'); ?> <?php bloginfo('name'); ?>">
				</form>
			<?php endif;
		}

		/**
		 * Modify the navbar class.
		 */
		public static function navbar_class( $navbar = 'main') {
			global $ss_settings;

			$fixed    = $ss_settings['navbar_fixed'];
			$fixedpos = $ss_settings['navbar_fixed_position'];
			$style    = $ss_settings['navbar_style'];
			$toggle   = $ss_settings['navbar_toggle'];
			$left     = ( $toggle == 'left' ) ? true : false;

			$bp = self::sl_breakpoint();

			$defaults = 'navbar navbar-default topnavbar';

			if ( $fixed != 1 ) {
				$class = ' navbar-static-top';
			} else {
				$class = ( $fixedpos == 1 ) ? ' navbar-fixed-bottom' : ' navbar-fixed-top';
			}

			$class = $defaults . $class;

			if ( $left ) {
				$extra_classes = 'navbar navbar-default static-left ' . $bp .  ' col-' . $bp . '-' . $ss_settings['layout_secondary_width'];
				$class = $extra_classes;
			}

			if ( $navbar != 'secondary' ) {
				return $class . ' ' . $style;
			} else {
				return 'navbar ' . $style;
			}
		}

		/**
		 * Modify the grid-float-breakpoint using Bootstrap classes.
		 */
		public static function sl_breakpoint() {
			global $ss_settings;

			$break    = $ss_settings['grid_float_breakpoint'];

			$bp = ( $break == 'min' || $break == 'screen_xs_min' ) ? 'xs' : 'xs';
			$bp = ( $break == 'screen_sm_min' )                    ? 'sm' : $bp;
			$bp = ( $break == 'screen_md_min' )                    ? 'md' : $bp;
			$bp = ( $break == 'screen_lg_min' || $break == 'max' ) ? 'lg' : $bp;

			return $bp;
		}

		/**
		 * Add some CSS for the navbar when needed.
		 */
		function navbar_css() {
			global $ss_settings;

			$navbar_bg_opacity = $ss_settings['navbar_bg_opacity'];
			$style = '';

			$opacity = ( $navbar_bg_opacity == '' ) ? '0' : ( intval( $navbar_bg_opacity ) ) / 100;

			if ( $opacity != 1 && $opacity != '' ) {
				$bg  = str_replace( '#', '', $ss_settings['navbar_bg'] );
				$rgb = smallermobs_Color::get_rgb( $bg, true );
				$opacityie = str_replace( '0.', '', $opacity );

				$style .= '.navbar, .navbar-default {';

				if ( $opacity != 1 && $opacity != '') {
					$style .= 'background: transparent; background: rgba(' . $rgb . ', ' . $opacity . '); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#' . $opacityie . $bg . ',endColorstr=#' . $opacityie . $bg . '); ;';
				} else {
					$style .= 'background: #' . $bg . ';';
				}

				$style .= '}';
			}

			if ( $ss_settings['navbar_margin'] != 1 ) {
				$style .= '.navbar-static-top { margin-top:'. $ss_settings['navbar_margin'] . 'px; margin-bottom:' . $ss_settings['navbar_margin'] . 'px; }';
			}

			wp_add_inline_style( 'smallermobs_css', $style );
		}

		/**
		 * get the navbar branding options (if the branding module exists)
		 * and then add the appropriate logo or sitename.
		 */
		function navbar_brand() {
			global $ss_settings, $ss_framework;

			$logo           = $ss_settings['logo'];
			$branding_class = ! empty( $logo['url'] ) ? 'logo' : 'text';

			if ( $ss_settings['navbar_brand'] != 0 ) {
				$branding  = '';
				$branding .= $ss_settings['navbar_logo'] == 1 ? $ss_framework->logo() : get_bloginfo( 'name' );
				$branding .= '';
			} else {
				$branding = '';
			}
			return $branding;
		}

		/**
		 * Add and remove body_class() classes
		 */
		function navbar_body_class( $classes ) {
			global $ss_settings;

			// Add 'top-navbar' or 'bottom-navabr' class if using Bootstrap's Navbar
			// Used to add styling to account for the WordPress admin bar
			if ( $ss_settings['navbar_fixed'] == 1 && $ss_settings['navbar_fixed_position'] != 1 && $ss_settings['navbar_toggle'] != 'left' ) {
				$classes[] = 'top-navbar';
			} elseif ( $ss_settings['navbar_fixed'] == 1 && $ss_settings['navbar_fixed_position'] == 1 ) {
				$classes[] = 'bottom-navbar';
			}

			return $classes;
		}

		/**
		 * Register sidebars and widgets
		 */
		function sl_widgets_init() {
			register_sidebar( array(
				'name'          => __( 'In-Navbar Widget Area', 'smallermobs' ),
				'id'            => 'navbar',
				'description'   => __( 'This widget area will show up in your NavBars. This is most useful when using a static-left navbar.', 'smallermobs' ),
				'before_widget' => '
',
				'after_widget'  => '
',
				'before_title'  => '
',
				'after_title'   => '
',
			) );
		}

		/**
		 * Add the sidebar to the navbar.
		 */
		function navbar_sidebar() {
			dynamic_sidebar( 'navbar' );
		}

		/**
		 * The contents of the secondary navbar
		 */
		function secondary_navbar() {
			global $ss_settings, $ss_framework;

			if ( has_nav_menu( 'secondary_navigation' ) ) :
				if ( $ss_settings['site_style'] == 'boxed' ) {
			        echo '
';
			    } else {
			        echo '
';
			    };
			?>
					<header class="secondary navbar navbar-default navbar-static-top <?php echo self::navbar_class( 'secondary' ); ?>" role="banner">
						<?php echo $ss_framework->open_container( 'div' ); ?>

						<button data-target=".nav-secondary" data-toggle="collapse" type="button" class="navbar-toggle">

						</button>

						<?php
						if ( $ss_settings['navbar_secondary_social'] != 0 ) {
							SS_Framework_Bootstrap::navbar_social_links();
						} ?>

							<?php wp_nav_menu( array( 'theme_location' => 'secondary_navigation', 'menu_class' => apply_filters( 'smallermobs_nav_class', 'navbar-nav nav' ) ) ); ?>

						<?php echo $ss_framework->close_container( 'div' ); ?>

			<?php 	echo "
";
					endif;
		}

		/**
		 * Add margin to the secondary nvbar if needed
		 */
		function secondary_navbar_margin() {
			global $ss_settings;

			$secondary_navbar_margin = $ss_settings['secondary_navbar_margin'];
			$style = '.secondary { margin-top:' . $secondary_navbar_margin . 'px !important; margin-bottom:'. $secondary_navbar_margin .'px !important; }';

			wp_add_inline_style( 'smallermobs_css', $style );
		}

		/**
		 * Register widget areas for the navbar dropdowns.
		 */
		function slidedown_widgets_init() {
			// Register widgetized areas
			register_sidebar( array(
				'name'          => __( 'Navbar Slide-Down Top', 'smallermobs' ),
				'id'            => 'navbar-slide-down-top',
				'before_widget' => '

',
				'after_widget'  => '

',
				'before_title'  => '
',
				'after_title'   => '
',
			) );

			register_sidebar( array(
				'name'          => __( 'Navbar Slide-Down 1', 'smallermobs' ),
				'id'            => 'navbar-slide-down-1',
				'before_widget' => '

',
				'after_widget'  => '

',
				'before_title'  => '
',
				'after_title'   => '
',
			) );

			register_sidebar( array(
				'name'          => __( 'Navbar Slide-Down 2', 'smallermobs' ),
				'id'            => 'navbar-slide-down-2',
				'before_widget' => '

',
				'after_widget'  => '

',
				'before_title'  => '
',
				'after_title'   => '
',
			) );

			register_sidebar( array(
				'name'          => __( 'Navbar Slide-Down 3', 'smallermobs' ),
				'id'            => 'navbar-slide-down-3',
				'before_widget' => '

',
				'after_widget'  => '

',
				'before_title'  => '
',
				'after_title'   => '
',
			) );

			register_sidebar( array(
				'name'          => __( 'Navbar Slide-Down 4', 'smallermobs' ),
				'id'            => 'navbar-slide-down-4',
				'before_widget' => '

',
				'after_widget'  => '

',
				'before_title'  => '
',
				'after_title'   => '
',
			) );
		}

		/*
		 * Calculates the class of the widget areas based on a 12-column bootstrap grid.
		 */
		public static function navbar_widget_area_class() {
			$str = 0;
			if ( is_active_sidebar( 'navbar-slide-down-1' ) ) { $str++; }
			if ( is_active_sidebar( 'navbar-slide-down-2' ) ) { $str++; }
			if ( is_active_sidebar( 'navbar-slide-down-3' ) ) { $str++; }
			if ( is_active_sidebar( 'navbar-slide-down-4' ) ) { $str++; }

			$colwidth = ( $str > 0 ) ? 12 / $str : 12;

			return $colwidth;
		}

		/*
		 * Prints the content of the slide-down widget areas.
		 */
		function navbar_slidedown_content() {
			global $ss_settings;

			if ( is_active_sidebar( 'navbar-slide-down-1' ) || is_active_sidebar( 'navbar-slide-down-2' ) || is_active_sidebar( 'navbar-slide-down-3' ) || is_active_sidebar( 'navbar-slide-down-4' ) || is_active_sidebar( 'navbar-slide-down-top' ) ) : ?>

					<?php $megadrop_class = ( $ss_settings['site_style'] != 'fluid' ) ? 'top-megamenu container' : 'top-megamenu'; ?>
					<div id="megaDrop" class="<?php echo $megadrop_class; ?>">
						<?php $widgetareaclass = 'col-sm-' . self::navbar_widget_area_class(); ?>

						<?php if ( is_active_sidebar( 'navbar-slide-down-top' ) ) : ?>
							<?php dynamic_sidebar( 'navbar-slide-down-top' ); ?>
						<?php endif; ?>

							<?php if ( is_active_sidebar( 'navbar-slide-down-1' ) ) : ?>
								<div class="<?php echo $widgetareaclass; ?>">
									<?php dynamic_sidebar( 'navbar-slide-down-1' ); ?>

							<?php endif; ?>

							<?php if ( is_active_sidebar( 'navbar-slide-down-2' ) ) : ?>
								<div class="<?php echo $widgetareaclass; ?>">
									<?php dynamic_sidebar( 'navbar-slide-down-2' ); ?>

							<?php endif; ?>

							<?php if ( is_active_sidebar( 'navbar-slide-down-3' ) ) : ?>
								<div class="<?php echo $widgetareaclass; ?>">
									<?php dynamic_sidebar( 'navbar-slide-down-3' ); ?>

							<?php endif; ?>

							<?php if ( is_active_sidebar( 'navbar-slide-down-4' ) ) : ?>
								<div class="<?php echo $widgetareaclass; ?>">
									<?php dynamic_sidebar( 'navbar-slide-down-4' ); ?>

							<?php endif; ?>

			<?php endif;
		}

		/**
		 * When static-left navbar is selected, we need to add a wrapper to the whole content
		 */
		function content_wrapper_static_left_open() {
			global $ss_settings, $ss_framework;

			$breakpoint = self::sl_breakpoint();

			if ( $breakpoint == 'xs' ) {
				$width = 'mobile';
			} elseif ( $breakpoint == 'sm' ) {
				$width = 'tablet';
			} elseif ( $breakpoint == 'md' ) {
				$width = 'medium';
			} elseif ( $breakpoint == 'lg' ) {
				$width = 'large';
			}

			if ( isset( $ss_settings['navbar_toggle'] ) && $ss_settings['navbar_toggle'] == 'left' ) {
				echo $ss_framework->open_col( 'div', array( $width => 12 - $ss_settings['layout_secondary_width'] ), 'content-wrapper-left', 'col-' . $breakpoint . '-offset-' . $ss_settings['layout_secondary_width'] );
			}
		}

		/**
		 * When static-left navbar is selected, we need to close the wrapper opened by the content_wrapper_static_left function.
		 */
		function content_wrapper_static_left_close() {
			global $ss_settings, $ss_framework;

			if ( isset( $ss_settings['navbar_toggle'] ) && $ss_settings['navbar_toggle'] == 'left' ) {
				echo $ss_framework->close_col( 'div' );
			}
		}

		/**
		 * The icon that helps us open/close the dropdown widgets.
		 */
		function navbar_slidedown_toggle() {
			global $ss_settings;

			$navbar_color = $ss_settings['navbar_bg'];
			$navbar_mode  = $ss_settings['navbar_toggle'];
			$trigger = (
				is_active_sidebar( 'navbar-slide-down-top' ) ||
				is_active_sidebar( 'navbar-slide-down-1' ) ||
				is_active_sidebar( 'navbar-slide-down-2' ) ||
				is_active_sidebar( 'navbar-slide-down-3' ) ||
				is_active_sidebar( 'navbar-slide-down-4' )
			) ? true : false;

			if ( $trigger ) {

				$class = ( $navbar_mode == 'left' ) ? ' static-left' : ' nav-toggle';
				$pre   = ( $navbar_mode != 'left' ) ? '

' : '';
				$post  = ( $navbar_mode != 'left' ) ? '

' : '';

				echo $pre . '' . $post;

			}
		}

		/**
		 * The script responsible for showing/hiding the dropdown widget areas from the navbar.
		 */
		function megadrop_script() {
			if ( is_active_sidebar( 'navbar-slide-down-top' ) || is_active_sidebar( 'navbar-slide-down-1' ) || is_active_sidebar( 'navbar-slide-down-2' ) || is_active_sidebar( 'navbar-slide-down-3' ) || is_active_sidebar( 'navbar-slide-down-4' ) ) {
				wp_register_script( 'smallermobs_megadrop', get_template_directory_uri() . '/assets/js/megadrop.js', false, null, false );
				wp_enqueue_script( 'smallermobs_megadrop' );
			}
		}
	}
}


text:
package org.apache.maven.model.interpolation;

import java.util.Properties;

import javax.inject.Named;
import javax.inject.Singleton;

import org.apache.maven.model.building.ModelBuildingRequest;

/**
 * Maven default implementation of the {@link ModelVersionProcessor} to support
 * CI Friendly Versions
 */
@Named
@Singleton
public class DefaultModelVersionProcessor
    implements ModelVersionProcessor
{

    private static final String SHA1_PROPERTY = "sha1";

    private static final String CHANGELIST_PROPERTY = "changelist";

    private static final String REVISION_PROPERTY = "revision";

    @Override
    public boolean isValidProperty( String property )
    {
        return REVISION_PROPERTY.equals( property ) || CHANGELIST_PROPERTY.equals( property )
            || SHA1_PROPERTY.equals( property );
    }

    @Override
    public void overwriteModelProperties( Properties modelProperties, ModelBuildingRequest request )
    {
        if ( request.getSystemProperties().containsKey( REVISION_PROPERTY ) )
        {
            modelProperties.put( REVISION_PROPERTY, request.getSystemProperties().get( REVISION_PROPERTY ) );
        }
        if ( request.getSystemProperties().containsKey( CHANGELIST_PROPERTY ) )
        {
            modelProperties.put( CHANGELIST_PROPERTY, request.getSystemProperties().get( CHANGELIST_PROPERTY ) );
        }
        if ( request.getSystemProperties().containsKey( SHA1_PROPERTY ) )
        {
            modelProperties.put( SHA1_PROPERTY, request.getSystemProperties().get( SHA1_PROPERTY ) );
        }

    }
}


text:
var uubench    = require('./uubench'),
    dust       = require('../lib/dust'),
    dustBench  = require('./suites/dust_suite').dustBench;

uubench.nextTick = process.nextTick;

var suite = new uubench.Suite({
  iterations: 10000,
  result: function(name, stats) {
    var opms = stats.iterations/stats.elapsed;
    console.log(pad(12, name + ": "), pad(5, Math.round(opms), true));
  }
});

function pad(amt, val, pre) {
  val = String(val);
  var len = amt - val.length, out = '';
  for (var i=0; i<len; i++) {
    out += ' ';
  }
  return pre ? out + val : val + out;
}

console.log("ops/ms");
console.log("------");

global.dust = dust;

for (var key in dustBench.benches) {
  dustBench(suite, key);
}

suite.run();


text:
#include "api/audio_codecs/opus/audio_decoder_opus.h"
#include "api/audio_codecs/opus/audio_encoder_opus.h"
#include "common_audio/include/audio_util.h"
#include "common_audio/window_generator.h"
#include "modules/audio_coding/codecs/opus/test/lapped_transform.h"
#include "modules/audio_coding/neteq/tools/audio_loop.h"
#include "test/field_trial.h"
#include "test/gtest.h"
#include "test/testsupport/file_utils.h"

namespace webrtc {
namespace {

constexpr size_t kNumChannels = 1u;
constexpr int kSampleRateHz = 48000;
constexpr size_t kMaxLoopLengthSamples = kSampleRateHz * 50;  // 50 seconds.
constexpr size_t kInputBlockSizeSamples = 10 * kSampleRateHz / 1000;   // 10 ms
constexpr size_t kOutputBlockSizeSamples = 20 * kSampleRateHz / 1000;  // 20 ms
constexpr size_t kFftSize = 1024;
constexpr size_t kNarrowbandSize = 4000 * kFftSize / kSampleRateHz;
constexpr float kKbdAlpha = 1.5f;

class PowerRatioEstimator : public LappedTransform::Callback {
 public:
  PowerRatioEstimator() : low_pow_(0.f), high_pow_(0.f) {
    WindowGenerator::KaiserBesselDerived(kKbdAlpha, kFftSize, window_);
    transform_.reset(new LappedTransform(kNumChannels, 0u,
                                         kInputBlockSizeSamples, window_,
                                         kFftSize, kFftSize / 2, this));
  }

  void ProcessBlock(float* data) { transform_->ProcessChunk(&data, nullptr); }

  float PowerRatio() { return high_pow_ / low_pow_; }

 protected:
  void ProcessAudioBlock(const std::complex<float>* const* input,
                         size_t num_input_channels,
                         size_t num_freq_bins,
                         size_t num_output_channels,
                         std::complex<float>* const* output) override {
    float low_pow = 0.f;
    float high_pow = 0.f;
    for (size_t i = 0u; i < num_input_channels; ++i) {
      for (size_t j = 0u; j < kNarrowbandSize; ++j) {
        float low_mag = std::abs(input[i][j]);
        low_pow += low_mag * low_mag;
        float high_mag = std::abs(input[i][j + kNarrowbandSize]);
        high_pow += high_mag * high_mag;
      }
    }
    low_pow_ += low_pow / (num_input_channels * kFftSize);
    high_pow_ += high_pow / (num_input_channels * kFftSize);
  }

 private:
  std::unique_ptr<LappedTransform> transform_;
  float window_[kFftSize];
  float low_pow_;
  float high_pow_;
};

float EncodedPowerRatio(AudioEncoder* encoder,
                        AudioDecoder* decoder,
                        test::AudioLoop* audio_loop) {
  // Encode and decode.
  uint32_t rtp_timestamp = 0u;
  constexpr size_t kBufferSize = 500;
  rtc::Buffer encoded(kBufferSize);
  std::vector<int16_t> decoded(kOutputBlockSizeSamples);
  std::vector<float> decoded_float(kOutputBlockSizeSamples);
  AudioDecoder::SpeechType speech_type = AudioDecoder::kSpeech;
  PowerRatioEstimator power_ratio_estimator;
  for (size_t i = 0; i < 1000; ++i) {
    encoded.Clear();
    AudioEncoder::EncodedInfo encoder_info =
        encoder->Encode(rtp_timestamp, audio_loop->GetNextBlock(), &encoded);
    rtp_timestamp += kInputBlockSizeSamples;
    if (encoded.size() > 0) {
      int decoder_info = decoder->Decode(
          encoded.data(), encoded.size(), kSampleRateHz,
          decoded.size() * sizeof(decoded[0]), decoded.data(), &speech_type);
      if (decoder_info > 0) {
        S16ToFloat(decoded.data(), decoded.size(), decoded_float.data());
        power_ratio_estimator.ProcessBlock(decoded_float.data());
      }
    }
  }
  return power_ratio_estimator.PowerRatio();
}

}  // namespace

// TODO(ivoc): Remove this test, WebRTC-AdjustOpusBandwidth is obsolete.
TEST(BandwidthAdaptationTest, BandwidthAdaptationTest) {
  test::ScopedFieldTrials override_field_trials(
      "WebRTC-AdjustOpusBandwidth/Enabled/");

  constexpr float kMaxNarrowbandRatio = 0.0035f;
  constexpr float kMinWidebandRatio = 0.01f;

  // Create encoder.
  AudioEncoderOpusConfig enc_config;
  enc_config.bitrate_bps = absl::optional<int>(7999);
  enc_config.num_channels = kNumChannels;
  constexpr int payload_type = 17;
  auto encoder = AudioEncoderOpus::MakeAudioEncoder(enc_config, payload_type);

  // Create decoder.
  AudioDecoderOpus::Config dec_config;
  dec_config.num_channels = kNumChannels;
  auto decoder = AudioDecoderOpus::MakeAudioDecoder(dec_config);

  // Open speech file.
  const std::string kInputFileName =
      webrtc::test::ResourcePath("audio_coding/speech_mono_32_48kHz", "pcm");
  test::AudioLoop audio_loop;
  EXPECT_EQ(kSampleRateHz, encoder->SampleRateHz());
  ASSERT_TRUE(audio_loop.Init(kInputFileName, kMaxLoopLengthSamples,
                              kInputBlockSizeSamples));

  EXPECT_LT(EncodedPowerRatio(encoder.get(), decoder.get(), &audio_loop),
            kMaxNarrowbandRatio);

  encoder->OnReceivedTargetAudioBitrate(9000);
  EXPECT_LT(EncodedPowerRatio(encoder.get(), decoder.get(), &audio_loop),
            kMaxNarrowbandRatio);

  encoder->OnReceivedTargetAudioBitrate(9001);
  EXPECT_GT(EncodedPowerRatio(encoder.get(), decoder.get(), &audio_loop),
            kMinWidebandRatio);

  encoder->OnReceivedTargetAudioBitrate(8000);
  EXPECT_GT(EncodedPowerRatio(encoder.get(), decoder.get(), &audio_loop),
            kMinWidebandRatio);

  encoder->OnReceivedTargetAudioBitrate(12001);
  EXPECT_GT(EncodedPowerRatio(encoder.get(), decoder.get(), &audio_loop),
            kMinWidebandRatio);
}

}  // namespace webrtc


text:
package org.apache.carbondata.sdk.file;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import org.apache.carbondata.common.annotations.InterfaceAudience;
import org.apache.carbondata.common.annotations.InterfaceStability;
import org.apache.carbondata.core.datamap.DataMapStoreManager;
import org.apache.carbondata.core.datastore.impl.FileFactory;
import org.apache.carbondata.core.metadata.schema.table.CarbonTable;
import org.apache.carbondata.core.scan.expression.Expression;
import org.apache.carbondata.core.util.CarbonSessionInfo;
import org.apache.carbondata.core.util.ThreadLocalSessionInfo;
import org.apache.carbondata.hadoop.api.CarbonFileInputFormat;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.JobID;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.TaskAttemptID;
import org.apache.hadoop.mapreduce.task.JobContextImpl;
import org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl;

@InterfaceAudience.User
@InterfaceStability.Evolving
public class CarbonReaderBuilder {

  private String tablePath;
  private String[] projectionColumns;
  private Expression filterExpression;
  private String tableName;
  private Configuration hadoopConf;

  /**
   * Construct a CarbonReaderBuilder with table path and table name
   *
   * @param tablePath table path
   * @param tableName table name
   */
  CarbonReaderBuilder(String tablePath, String tableName) {
    this.tablePath = tablePath;
    this.tableName = tableName;
    ThreadLocalSessionInfo.setCarbonSessionInfo(new CarbonSessionInfo());
  }

  /**
   * Configure the projection column names of carbon reader
   *
   * @param projectionColumnNames projection column names
   * @return CarbonReaderBuilder object
   */
  public CarbonReaderBuilder projection(String[] projectionColumnNames) {
    Objects.requireNonNull(projectionColumnNames);
    this.projectionColumns = projectionColumnNames;
    return this;
  }

  /**
   * Configure the filter expression for carbon reader
   *
   * @param filterExpression filter expression
   * @return CarbonReaderBuilder object
   */
  public CarbonReaderBuilder filter(Expression filterExpression) {
    Objects.requireNonNull(filterExpression);
    this.filterExpression = filterExpression;
    return this;
  }

  /**
   * To support hadoop configuration
   *
   * @param conf hadoop configuration support, can set s3a AK,SK,end point and other conf with this
   * @return updated CarbonReaderBuilder
   */
  public CarbonReaderBuilder withHadoopConf(Configuration conf) {
    if (conf != null) {
      this.hadoopConf = conf;
    }
    return this;
  }

  /**
   * Build CarbonReader
   *
   * @param <T>
   * @return CarbonReader
   * @throws IOException
   * @throws InterruptedException
   */
  public <T> CarbonReader<T> build()
      throws IOException, InterruptedException {
    if (hadoopConf == null) {
      hadoopConf = FileFactory.getConfiguration();
    }
    CarbonTable table;
    if (filterExpression != null) {
      table = CarbonTable.buildTable(tablePath, tableName, hadoopConf);
    } else {
      table = CarbonTable.buildDummyTable(tablePath);
    }
    final CarbonFileInputFormat format = new CarbonFileInputFormat();
    final Job job = new Job(hadoopConf);
    format.setTableInfo(job.getConfiguration(), table.getTableInfo());
    format.setTablePath(job.getConfiguration(), table.getTablePath());
    format.setTableName(job.getConfiguration(), table.getTableName());
    format.setDatabaseName(job.getConfiguration(), table.getDatabaseName());
    if (filterExpression != null) {
      format.setFilterPredicates(job.getConfiguration(), filterExpression);
    }

    if (projectionColumns != null) {
      // set the user projection
      int len = projectionColumns.length;
      //      TODO : Handle projection of complex child columns
      for (int i = 0; i < len; i++) {
        if (projectionColumns[i].contains(".")) {
          throw new UnsupportedOperationException(
              "Complex child columns projection NOT supported through CarbonReader");
        }
      }
      format.setColumnProjection(job.getConfiguration(), projectionColumns);
    }

    try {
      final List<InputSplit> splits =
          format.getSplits(new JobContextImpl(job.getConfiguration(), new JobID()));

      List<RecordReader<Void, T>> readers = new ArrayList<>(splits.size());
      for (InputSplit split : splits) {
        TaskAttemptContextImpl attempt =
            new TaskAttemptContextImpl(job.getConfiguration(), new TaskAttemptID());
        RecordReader reader = format.createRecordReader(split, attempt);
        try {
          reader.initialize(split, attempt);
          readers.add(reader);
        } catch (Exception e) {
          reader.close();
          throw e;
        }
      }
      return new CarbonReader<>(readers);
    } catch (Exception ex) {
      // Clear the datamap cache as it can get added in getSplits() method
      DataMapStoreManager.getInstance()
          .clearDataMaps(table.getAbsoluteTableIdentifier());
      throw ex;
    }
  }

}


text:
wget  --post-file=register.json --header="Content-Type:application/json" http://localhost:5003/discovery/register --no-proxy

wget -X GET --header="Content-Type:application/json" http://localhost:5002/discovery/discover/Eke0BrUx --no-proxy


text:
<?php

// No direct access
defined('_HZEXEC_') or die();

$canDo = \Components\Publications\Helpers\Permissions::getActions('type');

Toolbar::title(Lang::txt('COM_PUBLICATIONS_PUBLICATIONS') . ': ' . Lang::txt('COM_PUBLICATIONS_MASTER_TYPES'), 'publications');
if ($canDo->get('core.create'))
{
	Toolbar::addNew();
}
if ($canDo->get('core.edit'))
{
	Toolbar::editList();
}
if ($canDo->get('core.delete'))
{
	Toolbar::spacer();
	Toolbar::deleteList();
}
Toolbar::divider();
Toolbar::help('types');
?>
<form action="<?php echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller); ?>" method="post" name="adminForm" id="adminForm">

				<input type="checkbox" name="toggle" value="" class="checkbox-toggle toggle-all" />
				<?php echo Html::grid('sort', Lang::txt('COM_PUBLICATIONS_FIELD_ID'), 'id', @$this->filters['sort_Dir'], @$this->filters['sort'] ); ?>
				<?php echo Html::grid('sort', Lang::txt('COM_PUBLICATIONS_FIELD_NAME'), 'type', @$this->filters['sort_Dir'], @$this->filters['sort'] ); ?>
				<?php echo Lang::txt('COM_PUBLICATIONS_FIELD_ALIAS'); ?>
				<?php echo Html::grid('sort', Lang::txt('COM_PUBLICATIONS_FIELD_CONTRIBUTABLE'), 'contributable', @$this->filters['sort_Dir'], @$this->filters['sort'] ); ?>
				<?php echo Html::grid('sort', Lang::txt('COM_PUBLICATIONS_FIELD_ORDER'), 'ordering', @$this->filters['sort_Dir'], @$this->filters['sort'] ); ?>

				<?php
				$pageNav = $this->pagination(
					$this->total,
					$this->filters['start'],
					$this->filters['limit']
				);
				echo $pageNav->render();
				?>

		<?php
		$k = 0;
		for ($i=0, $n=count($this->rows); $i < $n; $i++)
		{
			$row = &$this->rows[$i];
			$sClass = $row->supporting == 1 ? 'on' : 'off';
			$cClass = $row->contributable == 1 ? 'on' : 'off';

			// Determine whether master type is supported in current version of hub code
			$aClass = 'off';
			$active = 'off';

			// If we got a plugin - type is supported
			if (Plugin::isEnabled('projects', $row->alias))
			{
				$aClass = 'on';
				$active = 'on';
			}
			?>
			<tr class="<?php echo "row$k"; ?>">

					<input type="checkbox" name="id[]" id="cb<?php echo $i; ?>" value="<?php echo $row->id; ?>" class="checkbox-toggle" />

					<?php echo $row->id; ?>

					<a href="<?php echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&task=edit&id=' . $row->id); ?>">
						<?php echo $this->escape($row->type); ?>

					<?php echo $this->escape($row->alias); ?>

					<span class="state <?php echo $cClass; ?>">
						<?php echo Lang::txt($cClass); ?>

						<?php echo $pageNav->orderUpIcon($i, (isset($this->rows[$i-1]->ordering))); ?>

						<?php echo $pageNav->orderDownIcon($i, $n, (isset($this->rows[$i+1]->ordering))); ?>

					<input type="hidden" name="order[]" value="<?php echo $row->ordering; ?>" />

			<?php
			$k = 1 - $k;
		}
		?>

	<input type="hidden" name="option" value="<?php echo $this->option; ?>" />
	<input type="hidden" name="controller" value="<?php echo $this->controller; ?>" />
	<input type="hidden" name="task" value="" autocomplete="off" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="filter_order" value="<?php echo $this->escape($this->filters['sort']); ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->escape($this->filters['sort_Dir']); ?>" />
	<?php echo Html::input('token'); ?>
</form>


text:
package org.apache.carbondata.presto.impl;

import java.io.IOException;
import java.util.List;

import org.apache.carbondata.core.indexstore.BlockletDetailInfo;
import org.apache.carbondata.core.metadata.ColumnarFormatVersion;
import org.apache.carbondata.hadoop.CarbonInputSplit;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.Gson;

import org.apache.hadoop.fs.Path;

/**
 * CarbonLocalInputSplit represents a block, it contains a set of blocklet.
 */
public class CarbonLocalInputSplit {

  private static final long serialVersionUID = 3520344046772190207L;
  private String segmentId;
  private String path;
  private long start; // the start offset of the block in a carbondata file.
  private long length; // the length of the block.
  private List<String> locations;// locations are the locations for different replicas.
  private short version;
  private String[] deleteDeltaFiles;
  private String blockletId;

  private String detailInfo;

  /**
   * Number of BlockLets in a block
   */
  private int numberOfBlocklets = 0;

  @JsonProperty public short getVersion() {
    return version;
  }

  @JsonProperty public List<String> getLocations() {
    return locations;
  }

  @JsonProperty public long getLength() {
    return length;
  }

  @JsonProperty public long getStart() {
    return start;
  }

  @JsonProperty public String getPath() {
    return path;
  }

  @JsonProperty public String getSegmentId() {
    return segmentId;
  }

  @JsonProperty public int getNumberOfBlocklets() {
    return numberOfBlocklets;
  }

  @JsonProperty public String[] getDeleteDeltaFiles() {
    return deleteDeltaFiles;
  }

  @JsonProperty public String getDetailInfo() {
    return detailInfo;
  }

  @JsonProperty public String getBlockletId() {
    return blockletId;
  }

  public void setDetailInfo(BlockletDetailInfo blockletDetailInfo) {
    Gson gson = new Gson();
    detailInfo = gson.toJson(blockletDetailInfo);

  }

  @JsonCreator public CarbonLocalInputSplit(@JsonProperty("segmentId") String segmentId,
      @JsonProperty("path") String path, @JsonProperty("start") long start,
      @JsonProperty("length") long length, @JsonProperty("locations") List<String> locations,
      @JsonProperty("numberOfBlocklets") int numberOfBlocklets/*,
                                 @JsonProperty("tableBlockInfo") TableBlockInfo tableBlockInfo*/,
      @JsonProperty("version") short version,
      @JsonProperty("deleteDeltaFiles") String[] deleteDeltaFiles,
      @JsonProperty("blockletId") String blockletId,
      @JsonProperty("detailInfo") String detailInfo
  ) {
    this.path = path;
    this.start = start;
    this.length = length;
    this.segmentId = segmentId;
    this.locations = locations;
    this.numberOfBlocklets = numberOfBlocklets;
    //this.tableBlockInfo = tableBlockInfo;
    this.version = version;
    this.deleteDeltaFiles = deleteDeltaFiles;
    this.blockletId = blockletId;
    this.detailInfo = detailInfo;

  }

  public static CarbonInputSplit convertSplit(CarbonLocalInputSplit carbonLocalInputSplit) {
    CarbonInputSplit inputSplit = new CarbonInputSplit(carbonLocalInputSplit.getSegmentId(),
        carbonLocalInputSplit.getBlockletId(), new Path(carbonLocalInputSplit.getPath()),
        carbonLocalInputSplit.getStart(), carbonLocalInputSplit.getLength(),
        carbonLocalInputSplit.getLocations()
            .toArray(new String[carbonLocalInputSplit.getLocations().size()]),
        carbonLocalInputSplit.getNumberOfBlocklets(),
        ColumnarFormatVersion.valueOf(carbonLocalInputSplit.getVersion()),
        carbonLocalInputSplit.getDeleteDeltaFiles());
    Gson gson = new Gson();
    BlockletDetailInfo blockletDetailInfo =
        gson.fromJson(carbonLocalInputSplit.detailInfo, BlockletDetailInfo.class);
    if (null == blockletDetailInfo) {
      throw new RuntimeException("Could not read blocklet details");
    }
    try {
      blockletDetailInfo.readColumnSchema(blockletDetailInfo.getColumnSchemaBinary());
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    inputSplit.setDetailInfo(blockletDetailInfo);
    return inputSplit;
  }

}


text:
/*****************************************************************************/
/* EmployeeSelectedEntry: Event Handlers */
/*****************************************************************************/
Template.EmployeeSelectedEntry.events({
  'click #employee-edit-personaldata': function(e, tmpl) {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    if(selectedEmployee) {
      Modal.show('EmployeePersonalDataModal');
    }
  },
  'click #employee-edit-nextofkin-data': function(e, tmpl) {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    if(selectedEmployee) {
      Modal.show('EmployeeNextOfKinDataModal');
    }
  },
  'click #employee-edit-emergencycontact-data': function(e, tmpl) {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    if(selectedEmployee) {
      Modal.show('EmployeeEmergencyContactDataModal');
    }
  },
  'click #employee-edit-paymentdetails-data': function(e, tmpl) {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    if(selectedEmployee) {
      Modal.show('EmployeePaymentDetailsDataModal');
    }
  },
  'click #employment-payroll-link': function(e, tmpl) {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    if(selectedEmployee) {
      Modal.show("EmployeeEditEmploymentPayrollModal");
    }
  },
  'click #employee-edit-roles-data': function(e, tmpl) {
    Template.instance().setEmployeePermissons();
  },
  'click #userLeaveEntitlementSave': function(e, tmpl) {
    let allUserLeaveEntitlements = $("[name=allUserLeaveEntitlements]").val();

    if(allUserLeaveEntitlements && allUserLeaveEntitlements.length > 0) {
      let year = moment().year()
      let yearAsNumber = parseInt(year)

      let businessId = Session.get('context')
      let selectedEmployee = Session.get('employeesList_selectedEmployee');

      Meteor.call('LeaveEntitlement/setForOneEmployee', businessId, selectedEmployee._id, allUserLeaveEntitlements, yearAsNumber, (err, res) => {
          if (res){
              swal({
                  title: "Success",
                  text: `Leave entitlement saved!`,
                  confirmButtonClass: "btn-success",
                  type: "success",
                  confirmButtonText: "OK"
              });
          } else {
            swal('Save error!', err.reason, 'error')
          }
      });
    } else {
      swal('Save error!', 'You did not select a leave entitlement', 'error')
    }
  }
});

/*****************************************************************************/
/* EmployeeSelectedEntry: Helpers */
/*****************************************************************************/
Template.EmployeeSelectedEntry.helpers({
  "selectedEmployee": () => {
      let selectedEmployee = Session.get('employeesList_selectedEmployee');
      if(selectedEmployee) {
        if(selectedEmployee.roles) {
          if(!selectedEmployee.roles[Roles.GLOBAL_GROUP]) {
            selectedEmployee.roles[Roles.GLOBAL_GROUP] = [];
          }
        } else {
          selectedEmployee.roles = {};
          selectedEmployee.roles[Roles.GLOBAL_GROUP] = [];
        }
        return [selectedEmployee];
      } else
        return null;
  },
  "images": (id) => {
      return UserImages.findOne({_id: id});
  },
  positionName: (id)=> {
      if(id) {
        let entity = EntityObjects.findOne({_id: id})
        if(entity) {
            return entity.name;
        }
      } else {
        return "";
      }
  },
  isEqual: (a, b) => {
    return a === b;
  },
  selectedUserLeaveEntitlements: function() {
      return Template.instance().selectedUserLeaveEntitlements.get()
  },
  selectedUserLeaveEntitlementId: function() {
      let selectedLeaveEntitlement = Template.instance().selectedUserLeaveEntitlements.get()

      if(selectedLeaveEntitlement) {
        return selectedLeaveEntitlement.leaveEntitlementId
      }
  },
  allUserLeaveEntitlements: function() {
      return Template.instance().allLeaveEntitlements.get()
  },
  hasRoleManageAccess: () => {
    let canManageRoles = Core.hasRoleManageAccess(Meteor.userId())
    return canManageRoles;
  },
  doesEmployeeHasRoleManageAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');

    return Core.hasRoleManageAccess(selectedEmployee._id);
  },
  hasEmployeeAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');

    let canManageEmployeeData = Core.hasEmployeeAccess(selectedEmployee._id)
    return canManageEmployeeData;
  },
  hasTimeApprovalAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');

    let canApproveTime = Core.hasTimeApprovalAccess(selectedEmployee._id)
    console.log("canApproveTime: " + canApproveTime);
    return canApproveTime;
  },
  hasTimeManageAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');

    let canManageTime = Core.hasTimeManageAccess(selectedEmployee._id)
    return canManageTime;
  },
  hasLeaveApprovalAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');

    let canApproveLeave = Core.hasLeaveApprovalAccess(selectedEmployee._id);
    return canApproveLeave;
  },
  hasLeaveManageAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');

    let canManageLeave = Core.hasLeaveManageAccess(selectedEmployee._id);
    return canManageLeave;
  },
  hasEmployeeSelfServiceAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');

    let canDoSelfService = Core.hasSelfServiceAccess(selectedEmployee._id);
    return canDoSelfService;
  },
  hasPayRulesManageAccess: function () {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');

    let hasPayrulesManageAccess = Core.hasPayRulesManageAccess(selectedEmployee._id);
    return hasPayrulesManageAccess;
  },
  hasPayrollAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let canManagePayroll = Core.hasPayrollAccess(selectedEmployee._id);
    return canManagePayroll;
  },
  hasRunPayrollManageAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let canManagePayroll = Core.hasRunPayrollManageAccess(selectedEmployee._id);
    return canManagePayroll;
  },
  hasPayrollAdditionalPaymentsManageAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let canManagePayroll = Core.hasPayrollAdditionalPaymentsManageAccess(selectedEmployee._id);
    return canManagePayroll;
  },
  hasPayrollResultsViewAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let canManagePayroll = Core.hasPayrollResultsViewAccess(selectedEmployee._id);
    return canManagePayroll;
  },
  hasPayrollApprovalConfigAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let canManagePayroll = Core.hasPayrollApprovalConfigAccess(selectedEmployee._id);
    return canManagePayroll;
  },
  hasPayrollApprovalManageAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let canManagePayroll = Core.hasPayrollApprovalManageAccess(selectedEmployee._id);
    return canManagePayroll;
  },

  canSetLeaveEntitlement: () => {
    let userId = Meteor.userId()

    return Core.hasEmployeeAccess(userId) || Core.hasLeaveManageAccess(userId)
  },
  hasProcurementRequisitionApproveAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let canApproveProcurement = Core.hasProcurementRequisitionApproveAccess(selectedEmployee._id);

    return canApproveProcurement;
  },
  isProcurementRequisitionActive: () => {
    let businessUnitCustomConfig = Template.instance().businessUnitCustomConfig.get()
    if(businessUnitCustomConfig) {
        return businessUnitCustomConfig.isActive && businessUnitCustomConfig.isProcurementRequisitionActive
    } else {
        return true
    }
  },
  isSuccessfactorsEnabled: () => {
    let businessUnitCustomConfig = Template.instance().businessUnitCustomConfig.get()
    if(businessUnitCustomConfig) {
        return businessUnitCustomConfig.isActive && businessUnitCustomConfig.isSuccessFactorsIntegrationEnabled
    } else {
        return true
    }
  },
  hasTravelRequisitionApproveAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let canApproveTrip = Core.hasTravelRequisitionApproveAccess(selectedEmployee._id);

    return canApproveTrip;
  },
  isTravelRequisitionActive: () => {
    let businessUnitCustomConfig = Template.instance().businessUnitCustomConfig.get()
    if(businessUnitCustomConfig) {
        return businessUnitCustomConfig.isActive && businessUnitCustomConfig.isTravelRequisitionActive
    } else {
        return true
    }
  },
  hasPayrollReportsViewAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let hasPayrollReportsViewAccess = Core.hasPayrollReportsViewAccess(selectedEmployee._id);

    return hasPayrollReportsViewAccess;
  },
  hasTravelReportsViewAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let hasTravelReportsViewAccess = Core.hasTravelReportsViewAccess(selectedEmployee._id);

    return hasTravelReportsViewAccess;
  },
  hasAuditReportsViewAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let hasAuditReportsViewAccess = Core.hasAuditReportsViewAccess(selectedEmployee._id);

    return hasAuditReportsViewAccess;
  },
  hasProcurementReportsViewAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let hasProcurementReportsViewAccess = Core.hasProcurementReportsViewAccess(selectedEmployee._id);

    return hasProcurementReportsViewAccess;
  },
  hasProcurementTreatAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let hasProcurementTreatAccess = Core.hasProcurementTreatAccess(selectedEmployee._id);

    return hasProcurementTreatAccess;
  },
  hasTravelRequestTreatAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    let hasTravelRequestTreatAccess = Core.hasTravelRequestTreatAccess(selectedEmployee._id);

    return hasTravelRequestTreatAccess;
  },
  hasSuccessfactorsManageAccess: () => {
    let selectedEmployee = Session.get('employeesList_selectedEmployee');
    return Core.hasSuccessfactorManagesAccess(selectedEmployee._id);
  },
  isLeaveRequestEnabled: () => {
    let businessUnitCustomConfig = Template.instance().businessUnitCustomConfig.get()
    if(businessUnitCustomConfig) {
        return businessUnitCustomConfig.isActive && businessUnitCustomConfig.isLeaveRequestActive
    } else {
        return true
    }
  },
  isTimeWritingEnabled: () => {
    let businessUnitCustomConfig = Template.instance().businessUnitCustomConfig.get()
    if(businessUnitCustomConfig) {
        return businessUnitCustomConfig.isActive && businessUnitCustomConfig.isTimeWritingActive
    } else {
        return true
    }
  },
});

/*****************************************************************************/
/* EmployeeSelectedEntry: Lifecycle Hooks */
/*****************************************************************************/
Template.EmployeeSelectedEntry.onCreated(function () {
    let self = this;
    Session.set('employeesList_selectedEmployee', undefined);

    let businessId = Session.get('context')

    self.allLeaveEntitlements = new ReactiveVar()
    self.selectedUserLeaveEntitlements = new ReactiveVar()

    self.businessUnitCustomConfig = new ReactiveVar()

    self.setEmployeePermissons = function() {
      let selectedEmployee = Session.get('employeesList_selectedEmployee');
      if(selectedEmployee) {
        let shouldManageEmployeeData = $("[name=employeeManage]").val();
        let shouldApproveLeave = $("[name=leaveApprove]").val();
        let shouldManageLeave = $("[name=leaveManage]").val();
        let shouldApproveTime = $("[name=timeApprove]").val();
        let shouldManageTime = $("[name=timeManage]").val();
        let shouldHaveEmployeeSelfService = $("[name=employeeSelfService]").val();

        let shouldManagePayRules = $("[name=payRulesManage]").val();
        let shouldManagePayroll = $("[name=payrollManage]").val();

        let shouldManagePayrollRun = $("[name=runPayrollManage]").val();
        let shouldManagePayrollAdditionalPayments = $("[name=payrollAdditionalPaymentsManage]").val();
        let shouldViewPayrollResults = $("[name=payrollResultsManage]").val();
        let shouldManagePayrollApprovalConfig = $("[name=payrollApprovalConfigManage]").val();
        let shouldManagePayrollApproval = $("[name=payrollApprovalManage]").val();

        let shouldApproveProcurementRequisition = $("[name=procurementRequisitionApprove]").val();
        let shouldTravelRequestApprove = $("[name=travelRequestApprove]").val();

        let shouldProcurementRequisitionTreat = $("[name=procurementRequisitionTreat]").val();
        let shouldTravelRequestTreat = $("[name=travelRequestTreat]").val();

        let payrollReportsView = $("[name=payrollReportsView]").val();

        let travelReportsView = $("[name=travelReportsView]").val();
        let auditReportsView = $("[name=auditReportsView]").val();
        let procurementReportsView = $("[name=procurementReportsView]").val();
        let successfactorsManage = $("[name=successfactorsManage]").val();

        let arrayOfRoles = [];
        if(shouldManageEmployeeData === "true") {
          arrayOfRoles.push(Core.Permissions.EMPLOYEE_MANAGE)
        }
        if(shouldApproveLeave === "true") {
          arrayOfRoles.push(Core.Permissions.LEAVE_APPROVE)
        }
        if(shouldManageLeave === "true") {
          arrayOfRoles.push(Core.Permissions.LEAVE_MANAGE)
        }
        if(shouldApproveTime === "true") {
          arrayOfRoles.push(Core.Permissions.TIME_APPROVE)
        }
        if(shouldManageTime === "true") {
          arrayOfRoles.push(Core.Permissions.TIME_MANAGE)
        }
        if(shouldHaveEmployeeSelfService === "true") {
          arrayOfRoles.push(Core.Permissions.EMPLOYEE_SS)
        }
        if(shouldManagePayRules === "true") {
          arrayOfRoles.push(Core.Permissions.PAYRULES_MANAGE)
        }
        if(shouldManagePayroll === "true") {
          arrayOfRoles.push(Core.Permissions.PAYROLL_MANAGE)
        }

        if(shouldManagePayrollRun === "true") {
          arrayOfRoles.push(Core.Permissions.RUN_PAYROLL_MANAGE)
        }
        if(shouldManagePayrollAdditionalPayments === "true") {
          arrayOfRoles.push(Core.Permissions.PAYROLL_ADDITIONAL_PAYMENTS_MANAGE)
        }
        if(shouldViewPayrollResults === "true") {
          arrayOfRoles.push(Core.Permissions.PAYROLL_RESULTS_VIEW)
        }
        if(shouldManagePayrollApprovalConfig === "true") {
          arrayOfRoles.push(Core.Permissions.PAYROLL_APPROVAL_CONFIG_MANAGE)
        }
        if(shouldManagePayrollApproval === "true") {
          arrayOfRoles.push(Core.Permissions.PAYROLL_APPROVAL_MANAGE)
        }

        if(shouldApproveProcurementRequisition === "true") {
            arrayOfRoles.push(Core.Permissions.PROCUREMENT_REQUISITION_APPROVE)
        }
        if(shouldTravelRequestApprove === "true") {
            arrayOfRoles.push(Core.Permissions.TRAVEL_REQUISITION_APPROVE)
        }

        if(shouldProcurementRequisitionTreat === "true") {
          arrayOfRoles.push(Core.Permissions.PROCUREMENT_REQUISITION_TREAT)
        }
        if(shouldTravelRequestTreat === "true") {
          arrayOfRoles.push(Core.Permissions.TRAVEL_REQUISITION_TREAT)
        }

        if(payrollReportsView === "true") {
            arrayOfRoles.push(Core.Permissions.PAYROLL_REPORTS_VIEW)
        }
        if(travelReportsView === "true") {
            arrayOfRoles.push(Core.Permissions.TRAVEL_REPORTS_VIEW)
        }
        if(auditReportsView === "true") {
            arrayOfRoles.push(Core.Permissions.AUDIT_REPORTS_VIEW)
        }
        if(procurementReportsView === "true") {
            arrayOfRoles.push(Core.Permissions.PROCUREMENT_REPORTS_VIEW)
        }
        if(successfactorsManage === "true") {
            arrayOfRoles.push(Core.Permissions.SUCCESSFACTORS_MANAGE)
        }

        if(Core.hasRoleManageAccess(Meteor.userId())) {
          let shouldHaveRoleManageAccess = $("[name=roleManage]").val();
          if(shouldHaveRoleManageAccess === "true") {
            arrayOfRoles.push(Core.Permissions.ROLE_MANAGE);
          }
        }

        Meteor.call('role/setRolesForUser', selectedEmployee._id, arrayOfRoles, (err, res) => {
            if (res){
                swal({
                    title: "Success",
                    text: `Employee roles updated`,
                    confirmButtonClass: "btn-success",
                    type: "success",
                    confirmButtonText: "OK"
                });
            } else {
                console.log(err);
            }
        });
      }
    };

    self.autorun(function() {
        let selectedEmployee = Session.get('employeesList_selectedEmployee');
        if(selectedEmployee) {
            let userEntitlementSubs = self.subscribe('UserLeaveEntitlement', businessId, selectedEmployee._id)
            let allLeaveEntitlements = self.subscribe('LeaveEntitlements', businessId)
            let customConfigSub = self.subscribe("BusinessUnitCustomConfig", businessId, Core.getTenantId());

            if(userEntitlementSubs.ready() && allLeaveEntitlements.ready() && customConfigSub.ready()){
                let selectedUserLeaveEntitlements = UserLeaveEntitlements.findOne({
                    businessId: businessId, userId: selectedEmployee._id
                })
                self.selectedUserLeaveEntitlements.set(selectedUserLeaveEntitlements)

                let allLeaveEntitlements = LeaveEntitlements.find({
                    businessId: businessId
                }).fetch()
                self.allLeaveEntitlements.set(allLeaveEntitlements)
                //--
                self.businessUnitCustomConfig.set(BusinessUnitCustomConfigs.findOne({businessId: businessId}))
            }
        }
    })
});

Template.EmployeeSelectedEntry.onRendered(function () {
});

Template.EmployeeSelectedEntry.onDestroyed(function () {
  Session.set('employeesList_selectedEmployee', undefined);
});


text:
get '/rounds' do
  "hi there"
end

get '/rounds/new' do
  new_round = Round.create(user_id: session[:user_id])
  session[:round_id] = new_round.id
  @deck = Deck.find(session[:deck_id])
  redirect "/cards/#{@deck.cards.sample.id}"
end

get '/rounds/:round_id' do |round_id|
  @round = Round.find(round_id)
  @deck = Deck.find(session[:deck_id])
  erb :'round/show'
end


text:
import { Recycle } from "../../";

export = Recycle;


text:
define(function(require) {
    'use strict';

    var JqueryWidgetComponent;
    var _ = require('underscore');
    var $ = require('jquery');
    var tools = require('oroui/js/tools');
    var BaseComponent = require('oroui/js/app/components/base/component');

    /**
     * Initializes jquery widget on _sourceElement
     */
    JqueryWidgetComponent = BaseComponent.extend({
        $el: null,

        widgetName: null,

        /**
         * @inheritDoc
         */
        initialize: function(options) {
            this.$el = options._sourceElement;
            var subPromises = _.values(options._subPromises);
            var widgetOptions = _.omit(options, ['_sourceElement', '_subPromises', 'widgetModule', 'widgetName']);
            var initializeJqueryWidget = _.bind(function(widgetName) {
                widgetName = _.isString(widgetName) ? widgetName : '';
                this.widgetName = widgetName || options.widgetName;
                this.$el[this.widgetName](widgetOptions);
                this._resolveDeferredInit();
            }, this);

            this._deferredInit();
            if (subPromises.length) {
                // ensure that all nested components are already initialized
                $.when.apply($, subPromises).then(function() {
                    tools.loadModules(options.widgetModule, initializeJqueryWidget);
                });
            } else {
                tools.loadModules(options.widgetModule, initializeJqueryWidget);
            }
        },

        /**
         * @inheritDoc
         */
        dispose: function() {
            if (this.disposed) {
                return;
            }
            if (this.$el[this.widgetName]('instance')) {
                this.$el[this.widgetName]('destroy');
            }
            return JqueryWidgetComponent.__super__.dispose.apply(this, arguments);
        }
    });

    return JqueryWidgetComponent;
});


text:
function point = circle3dPoint(circle, pos)
%CIRCLE3DPOINT Coordinates of a point on a 3D circle from its position
%
%   output = circle3dPoint(input)
%
%   Example
%   % Draw some points on a 3D circle
%     figure; hold on;
%     % origin point
%     pos1 = 0;
%     drawPoint3d(circle3dPoint(circle, pos1), 'ro')
%     % few points regularly spaced
%     for i = 10:10:40
%         drawPoint3d(circle3dPoint(circle, i))
%     end
%     % Draw point opposite to origin
%     drawPoint3d(circle3dPoint(circle, 180), 'k*')

%
%   See also
%   circles3d, circle3dPosition
%
% ------
% Author: David Legland
% e-mail: david.legland@grignon.inra.fr
% Created: 2011-06-21,    using Matlab 7.9.0.529 (R2009b)
% Copyright 2011 INRA - Cepia Software Platform.

% extract circle coordinates
xc  = circle(1);
yc  = circle(2);
zc  = circle(3);
r   = circle(4);

theta   = circle(5);
phi     = circle(6);
psi     = circle(7);

% convert position to angle
t = pos * pi / 180;

% compute position on base circle
x   = r * cos(t);
y   = r * sin(t);
z   = 0;
pt0 = [x y z];

% compute transformation from local basis to world basis
trans   = localToGlobal3d(xc, yc, zc, theta, phi, psi);

% compute points of transformed circle
point   = transformPoint3d(pt0, trans);


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 org.camunda.bpm.engine.rest.impl.history;

import java.util.List;

import javax.ws.rs.core.UriInfo;

import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.engine.history.CleanableHistoricDecisionInstanceReport;
import org.camunda.bpm.engine.history.CleanableHistoricDecisionInstanceReportResult;
import org.camunda.bpm.engine.rest.dto.CountResultDto;
import org.camunda.bpm.engine.rest.dto.history.CleanableHistoricDecisionInstanceReportDto;
import org.camunda.bpm.engine.rest.dto.history.CleanableHistoricDecisionInstanceReportResultDto;
import org.camunda.bpm.engine.rest.history.HistoricDecisionDefinitionRestService;

import com.fasterxml.jackson.databind.ObjectMapper;

public class HistoricDecisionDefinitionRestServiceImpl implements HistoricDecisionDefinitionRestService {

  protected ObjectMapper objectMapper;
  protected ProcessEngine processEngine;

  public HistoricDecisionDefinitionRestServiceImpl(ObjectMapper objectMapper, ProcessEngine processEngine) {
    this.objectMapper = objectMapper;
    this.processEngine = processEngine;
  }

  @Override
  public List<CleanableHistoricDecisionInstanceReportResultDto> getCleanableHistoricDecisionInstanceReport(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
    CleanableHistoricDecisionInstanceReportDto queryDto = new CleanableHistoricDecisionInstanceReportDto(objectMapper, uriInfo.getQueryParameters());
    CleanableHistoricDecisionInstanceReport query = queryDto.toQuery(processEngine);

    List<CleanableHistoricDecisionInstanceReportResult> reportResult;
    if (firstResult != null || maxResults != null) {
      reportResult = executePaginatedQuery(query, firstResult, maxResults);
      } else {
      reportResult = query.list();
      }

    return CleanableHistoricDecisionInstanceReportResultDto.convert(reportResult);
  }

  private List<CleanableHistoricDecisionInstanceReportResult> executePaginatedQuery(CleanableHistoricDecisionInstanceReport query, Integer firstResult, Integer maxResults) {
    if (firstResult == null) {
      firstResult = 0;
    }
    if (maxResults == null) {
      maxResults = Integer.MAX_VALUE;
    }
    return query.listPage(firstResult, maxResults);
  }

  @Override
  public CountResultDto getCleanableHistoricDecisionInstanceReportCount(UriInfo uriInfo) {
    CleanableHistoricDecisionInstanceReportDto queryDto = new CleanableHistoricDecisionInstanceReportDto(objectMapper, uriInfo.getQueryParameters());
    queryDto.setObjectMapper(objectMapper);
    CleanableHistoricDecisionInstanceReport query = queryDto.toQuery(processEngine);

    long count = query.count();
    CountResultDto result = new CountResultDto();
    result.setCount(count);

    return result;
  }
}