text:
package lejos.hardware.device;

import lejos.hardware.port.I2CPort;

/**
 * LDCMotor, Lattebox DC Motor, is a abstraction to model any DCMotor connected to
 * LSC, Lattebox Servo Controller.
 *
 * @author Juan Antonio Brenha Moral
 *
 */
public class LDCMotor extends LMotor{

	private int speed;
	private int forward_min_speed = 1020;
	private int forward_max_speed = 850;
	private int backward_min_speed = 1080;
	private int backward_max_speed = 1230;

	/**
	 * Constructor
	 *
	 * @param port
	 * @param location
	 * @param DCMotorName
	 * @param SPI_PORT
	 *
	 */
	public LDCMotor(I2CPort port, int location, String DCMotorName, byte SPI_PORT){
		super(port,location,DCMotorName,SPI_PORT);
	}

	public LDCMotor(I2CPort port, int location, String DCMotorName, byte SPI_PORT,int forwardMinSpeed,int forwardMaxSpeed,int backwardMinSpeed, int backwardMaxSpeed){
		super(port,location,DCMotorName,SPI_PORT);

		this.forward_min_speed = forwardMinSpeed;
		this.forward_max_speed = forwardMaxSpeed;
		this.backward_min_speed = backwardMinSpeed;
		this.backward_max_speed = backwardMaxSpeed;
	}

	/**
	 * Method to set the speed in a DC Motor
	 *
	 * @param speed the speed
	 *
	 */
	public void setSpeed(int speed){
		this.setPulse(speed);
	}

	/**
	 *
	 * Method to get speed from the DC Motor
	 *
	 * @return the speed
	 *
	 */
	public int getSpeed(){
		return this.getPulse();
	}

	public void setForwardMinSpeed(int min_speed){
		this.forward_min_speed = min_speed;
	}

	public void setForwardMaxSpeed(int max_speed){
		this.forward_max_speed = max_speed;
	}

	public void setBackwardMinSpeed(int min_speed){
		this.backward_min_speed = min_speed;
	}

	public void setBackwardMaxSpeed(int max_speed){
		this.backward_max_speed = max_speed;
	}
}


text:
// expect-compile-error DuplicateTypesInComponentError<int>|The installed component provides some types that are already provided

#include <fruit/fruit.h>
#include "test_macros.h"

using fruit::Component;
using fruit::Injector;
using fruit::createComponent;

Component<int> getParentComponent() {
  return createComponent()
    .registerConstructor<int()>();
}

Component<int> getComponent() {
  return createComponent()
    .install(getParentComponent())
    .install(getParentComponent());
}

redpajama_set_name: RedPajamaGithub


text:
require_relative '../../spec_helper'

module Barometer::Query
  RSpec.describe Format::NoaaStationId do
    describe '.is?' do
      it 'returns false' do
        expect( Format::NoaaStationId.is?('') ).to be false
      end
    end
  end
end


text:
// <copyright file="TextInputManager.cs" company="nXu.hu">
//     Copyright nXu. Licensed under the MIT License.
// </copyright>
// <author>nXu</author>

namespace BrainfuckInterpreter
{
    using System;
    using System.IO;

    /// <summary>
    /// A text input manager class.
    /// </summary>
    public class TextInputManager : InputManager, IDisposable
    {
        /// <summary>
        /// The string to read.
        /// </summary>
        private string stringToRead;

        /// <summary>
        /// The stream to read.
        /// </summary>
        private Stream streamToRead;

        /// <summary>
        /// Stream reader for the stream.
        /// </summary>
        private TextReader reader;

        /// <summary>
        /// Initializes a new instance of the <see cref="TextInputManager"/> class.
        /// </summary>
        /// <param name="source">String to read.</param>
        public TextInputManager(string source)
        {
            this.stringToRead = source;
            this.reader = new StringReader(this.stringToRead);

            this.streamToRead = null;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TextInputManager"/> class.
        /// </summary>
        /// <param name="source">Stream to read.</param>
        public TextInputManager(Stream source)
        {
            this.streamToRead = source;
            this.reader = new StreamReader(this.streamToRead);

            this.stringToRead = null;
        }

        /// <summary>
        /// Reads the next integer from the source.
        /// </summary>
        /// <returns>Next read integer, 0 if end of input.</returns>
        public override int Read()
        {
            char[] c = new char[1];

            if (this.reader.Read(c, 0, c.Length) > 0)
            {
                return (int)c[0];
            }
            else
            {
                return 0;
            }
        }

        /// <summary>
        /// Disposes managed resources.
        /// </summary>
        public void Dispose()
        {
            if (this.reader != null)
            {
                this.reader.Dispose();
            }

            if (this.streamToRead != null)
            {
                this.streamToRead.Dispose();
            }
        }
    }
}


text:
#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <arrow-glib/metadata-version.hpp>

/**
 * SECTION: metadata-version
 * @title: GArrowMetadataVersion
 * @short_description: Metadata version mapgging between Arrow and arrow-glib
 *
 * #GArrowMetadataVersion provides metadata versions corresponding
 * to `arrow::ipc::MetadataVersion` values.
 */

GArrowMetadataVersion
garrow_metadata_version_from_raw(arrow::ipc::MetadataVersion version)
{
  switch (version) {
  case arrow::ipc::MetadataVersion::V1:
    return GARROW_METADATA_VERSION_V1;
  case arrow::ipc::MetadataVersion::V2:
    return GARROW_METADATA_VERSION_V2;
  case arrow::ipc::MetadataVersion::V3:
    return GARROW_METADATA_VERSION_V3;
  default:
    return GARROW_METADATA_VERSION_V3;
  }
}

arrow::ipc::MetadataVersion
garrow_metadata_version_to_raw(GArrowMetadataVersion version)
{
  switch (version) {
  case GARROW_METADATA_VERSION_V1:
    return arrow::ipc::MetadataVersion::V1;
  case GARROW_METADATA_VERSION_V2:
    return arrow::ipc::MetadataVersion::V2;
  case GARROW_METADATA_VERSION_V3:
    return arrow::ipc::MetadataVersion::V3;
  default:
    return arrow::ipc::MetadataVersion::V3;
  }
}


text:
'use strict';

ceme.GetPageName = function () {
    var path = window.location.pathname;
    path = path.substr(1);
    if (path === '') {
        return 'home';
    }
    return path;
};

var queryObj = {};

var Router = function () {
    var currentMode,
        editor;

    function queryStringToJSON(queryString) {
        var result = {},
            pairs;
        if (queryString.indexOf('?') > -1) {
            queryString = queryString.split('?')[1];
        }
        pairs = queryString.split('&');
        pairs.forEach(function (pair) {
            pair = pair.split('=');
            result[pair[0]] = decodeURIComponent(pair[1] || '');
        });
        return result;
    }

    function xsrfToken() {
        return '&_xsrf=' + ceme.GetCookie('_xsrf');
    }

    function changeMode(mode) {
        currentMode = mode;
        $('.ceme-btn-page').removeClass('active');
        $('.ceme-btn-code').removeClass('active');
        $('.ceme-btn-both').removeClass('active');
        //editor.refresh();
        if (mode === 'view') {
            $('.ceme-btn-page').addClass('active');
            $('#ceme-code').hide();
            $('#ceme-output').fadeIn();
            $('#ceme-code').hide();
            $('#ceme-output').fadeIn();
        } else if (mode === 'edit') {
            $('.ceme-btn-code').addClass('active');
            $('#ceme-output').hide();
            $('#ceme-code').fadeIn();
        } else if (mode === 'both') {
            $('.ceme-btn-both').addClass('active');
            $('#ceme-output').fadeIn();
            $('#ceme-code').fadeIn();
        }
        editor.resize();
    }

    function makeEditor(elem) {
        /*
        var myCodeMirror = CodeMirror.fromTextArea(elem, {
            lineNumbers: true,
            mode: "text/html",
            tabSize: 4,
            indentUnit: 4,
            vimMode: false,
            extraKeys: {
                "Tab": "indentMore",
                "Shift-Tab": "indentLess",
                "Shift-Ctrl-Up": "swapLineUp",
                "Shift-Ctrl-Down": "swapLineDown"
            }
        });
        */
        //myCodeMirror.setSize(550, 700);
        return myCodeMirror;
    }

    function runCode() {
        var text,
            textareas,
            i,
            outputelem;
        text = editor.getValue();
        $('#alert').hide();
        outputelem = $('#ceme-output');
        outputelem.empty();

        cemeCompiler.asyncCompiler({
            filepath: '',
            callback: function (code, output) {
                outputelem.html(output).fadeIn(300);
                if (currentMode === 'edit') {
                    changeMode('view');
                }
            },
            code: text
        });

        textareas = document.getElementsByClassName("ceme-editor");
        for (i = 0; i < textareas.length; i += 1) {
            makeEditor(textareas[i]);
        }
    }

    $(document).on('submit', 'form', function (e) {
        $("#ceme-input").val(editor.getSession().getValue());

        var url = $(this).attr('action');
        if ($(this).attr('method') === 'post') {
            if (url.indexOf('/api') === 0) {
                e.preventDefault();
                $.ajax({
                    url: url,
                    type: 'POST',
                    data: $(this).serialize() + xsrfToken(),
                    error: function (jqXHR) {
                        if (jqXHR.status === 0) {
                            //TODO dont use cemeCompiler.
                            cemeCompiler.error('No internet connection');
                        } else if (jqXHR.status === 500) {
                            cemeCompiler.error('Internal server error');
                        } else if (jqXHR.status === 404) {
                            cemeCompiler.error(jqXHR.responseText);
                        } else if (jqXHR.status === 400) {
                            cemeCompiler.error(jqXHR.responseText);
                        } else {
                            cemeCompiler.error('Unexpected error status:' + jqXHR.status);
                        }
                    }
                }).done(function (response) {
                    $('#alert').hide().html(ceme.Alert(response, 'success')).fadeIn(200);
                });
            } else {
                var input = $("<input>")
                    .attr("type", "hidden")
                    .attr("name", "_xsrf").val(ceme.GetCookie('_xsrf'));
                $(this).append(input);
            }
        }
    });

    $(document).on('click', '#logout', function () {
        $('#logout-form').submit();
    });

    $(document).on('click', '.ceme-btn-page', function () {
        changeMode('view');
    });

    $(document).on('click', '.ceme-btn-code', function () {
        changeMode('edit');
    });

    $(document).on('click', '.ceme-btn-both', function () {
        changeMode('both');
    });

    $(document).on('click', '#ceme-run', runCode);

    $(document).on('click', '#ceme-history', function (e) {
        window.location = '/history?name=' + ceme.GetPageName();
        e.preventDefault();
    });

    $(document).on('click', 'a', function (e) {
        function external (url) {
            return /^(http|#)/.test(url);
        }
        var url = $(this).attr("href");
        if (url && !external(url)) {
            history.pushState(null, null, url);

            e.preventDefault();
            setTimeout(function () {
                Router.route(url);
            }, 0);
        }
    });

    function firstLoad() {
        cemeCompiler.setErrorCallback(function error(message) {
            if (ceme.Alert) {
                $('#alert').hide().html(ceme.Alert(message, 'danger')).fadeIn(200);
            }
        });

        cemeCompiler.asyncCompiler({
            filepath: '/assets/code/home.1.0.0.ceme',
            callback: function (code, output) {
                $('body').show();
                $('#page-container').hide().html(output).fadeIn(300);

                /*
                var mainarea = document.getElementById("ceme-input");
                editor = makeEditor(mainarea);
                */
                editor = ace.edit("ceme-ace-editor");

                $("#mobile-menu").mmenu({
                    "extensions": [
                    "border-none",
                    "effect-slide",
                    "padeshadow"
                    ],
                    onClick: {
                        close: true
                    }
                });

                Router.route(window.location.pathname + window.location.search);
            }
        });
    }

    function route(url) {
        var loc,
            pagename;
        if (url[0] === '/') {
            url = url.substr(1);
        }
        loc = url.split('?');
        if (loc[1]) {
            queryObj = queryStringToJSON(loc[1]);
        }
        pagename = loc[0];
        if (pagename === '') {
            pagename = 'home';
        }

        if (typeof ga !== 'undefined') {
            ga('send', 'pageview');
        }

        editor.getSession().setMode("ace/mode/ceme");
        editor.setOption('maxLines', Infinity);
        editor.setOption('minLines', 3);
        editor.setFontSize(18);
        editor.setTheme("ace/theme/github");
        editor.$blockScrolling = Infinity;

        $('#ceme-page-name').replaceWith('<input type="hidden" name="name" id="ceme-page-name" value="' + pagename + '">');

        cemeCompiler.asyncCompiler({
            filepath: '/code/' + pagename,
            callback: function (code, output) {

                editor.setValue(code);
                changeMode('view');

                runCode();

                hljs.configure({
                    languages: ['ceme']
                });
                $('pre code').each(function (i, block) {
                    hljs.highlightBlock(block);
                });

                if (document.cookie.indexOf('ofhbjpodsfasiohs') > 0) {
                    $('.login-logout').html('
Log Out
');
                } else {
                    $('.login-logout').html('
Login

Sign Up
');
                }

            }
        });

    }
    return {
        'route': route,
        'firstLoad': firstLoad,
        'runCode': runCode
    };
}();

window.onpopstate = function () {
    Router.route(window.location.pathname + window.location.search);
};


text:
local IntegratedWatchlistOrderRow = {}

function IntegratedWatchlistOrderRow:new(o)
 	o = o or {}   -- create object if user does not provide one
	setmetatable(o, self)
	self.__index = self

	o:Init()
	return o
end

function IntegratedWatchlistOrderRow:Init()
	local rowWindow = Apollo.LoadForm(self.supernova.xmlDoc , "IntegratedWatchlistOrderRow", self.watchlist:GetGrid(), self)
	rowWindow:FindChild("ItemName"):SetText(self.listing.name)
	rowWindow:FindChild("ItemCount"):SetText(self.listing.count)
	--rowWindow:FindChild("ItemExpiration"):SetText(self.listing.expirationTime)
	if (self.listing.isBuy) then
		--rowWindow:FindChild("ItemBuySell"):SetText("BUY")
		rowWindow:FindChild("SellPrice"):SetText(self.listing.pricePerUnit)
			rowWindow:FindChild("BuySell"):SetText("Buy Order")
		if self.commodity.sell1 == "--" then

		else
			if self.listing.pricePerUnit >= self.commodity.sell1 then
				rowWindow:FindChild("SellPrice"):SetTextColor("green")
			else
				rowWindow:FindChild("SellPrice"):SetTextColor("red")
			end
		end
	else
		if self.commodity.buy1 == "--" then

		else
			rowWindow:FindChild("BuyPrice"):SetText(self.listing.pricePerUnit)
			rowWindow:FindChild("BuySell"):SetText("Sell Order")
			if self.listing.pricePerUnit <= self.commodity.buy1 then
				rowWindow:FindChild("BuyPrice"):SetTextColor("green")
			else
				rowWindow:FindChild("BuyPrice"):SetTextColor("red")
			end
		end
	end
end

function IntegratedWatchlistOrderRow:OnLaunchTicket( wndHandler, wndControl, eMouseButton )
	self.supernova:LaunchTicket(self.commodity)
end

function IntegratedWatchlistOrderRow:OnCloseButtonClicked(wndHandler, wndControl, eMouseButton )
	self.watchlist:RemoveCommodity(self.commodity)
end

function IntegratedWatchlistOrderRow:OnCancel(wndHandler, wndControl, eMouseButton )
	self.listing.order:Cancel()
	MarketplaceLib.RequestOwnedCommodityOrders()
end

Apollo.RegisterPackage(IntegratedWatchlistOrderRow, "IntegratedWatchlistOrderRow", 1, {})


text:
import fn from '../../previousTuesday/index'
import convertToFP from '../_lib/convertToFP/index'

export default convertToFP(fn, 1)


text:
enyo.kind({
	name: "enyo.sample.FittableSample",
	kind: "FittableRows",
	classes: "fittable-sample-box enyo-fit",
	components: [
		{content: "Foo
Foo", allowHtml: true, classes: "fittable-sample-box fittable-sample-mtb"},
		{content: "Foo
Foo", allowHtml: true, classes: "fittable-sample-box fittable-sample-mtb"},
		{kind: "FittableColumns", fit: true, classes: "fittable-sample-box fittable-sample-mtb fittable-sample-o", components: [
			{content: "Foo", classes: "fittable-sample-box fittable-sample-mlr"},
			{content: "Foo", classes: "fittable-sample-box fittable-sample-mlr"},
			{content: "Fits!", fit: true, classes: "fittable-sample-box fittable-sample-mlr fittable-sample-o"},
			{content: "Foo", classes: "fittable-sample-box fittable-sample-mlr"}
		]},
		{kind: "FittableColumns", content: "Bat", classes: "fittable-sample-box fittable-sample-mtb enyo-center", components: [
			{content: "Centered", classes: "fittable-sample-box fittable-sample-mlr"},
			{content: "1", classes: "fittable-sample-box fittable-sample-mlr"},
			{content: "2", classes: "fittable-sample-box fittable-sample-mlr"},
			{content: "3", classes: "fittable-sample-box fittable-sample-mlr"},
			{content: "4", classes: "fittable-sample-box fittable-sample-mlr"}
		]}
	]
});


text:
#include <linux/cache.h>
#include <linux/delay.h>
#include <linux/uaccess.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/atomic.h>
#include <arch/chip.h>

/* This page is remapped on startup to be hash-for-home. */
int atomic_locks[PAGE_SIZE / sizeof(int)] __page_aligned_bss;

int *__atomic_hashed_lock(volatile void *v)
{
	/* NOTE: this code must match "sys_cmpxchg" in kernel/intvec_32.S */
	/*
	 * Use bits [3, 3 + ATOMIC_HASH_SHIFT) as the lock index.
	 * Using mm works here because atomic_locks is page aligned.
	 */
	unsigned long ptr = __insn_mm((unsigned long)v >> 1,
				      (unsigned long)atomic_locks,
				      2, (ATOMIC_HASH_SHIFT + 2) - 1);
	return (int *)ptr;
}

#ifdef CONFIG_SMP
/* Return whether the passed pointer is a valid atomic lock pointer. */
static int is_atomic_lock(int *p)
{
	return p >= &atomic_locks[0] && p < &atomic_locks[ATOMIC_HASH_SIZE];
}

void __atomic_fault_unlock(int *irqlock_word)
{
	BUG_ON(!is_atomic_lock(irqlock_word));
	BUG_ON(*irqlock_word != 1);
	*irqlock_word = 0;
}

#endif /* CONFIG_SMP */

static inline int *__atomic_setup(volatile void *v)
{
	/* Issue a load to the target to bring it into cache. */
	*(volatile int *)v;
	return __atomic_hashed_lock(v);
}

int _atomic_xchg(int *v, int n)
{
	return __atomic_xchg(v, __atomic_setup(v), n).val;
}
EXPORT_SYMBOL(_atomic_xchg);

int _atomic_xchg_add(int *v, int i)
{
	return __atomic_xchg_add(v, __atomic_setup(v), i).val;
}
EXPORT_SYMBOL(_atomic_xchg_add);

int _atomic_xchg_add_unless(int *v, int a, int u)
{
	/*
	 * Note: argument order is switched here since it is easier
	 * to use the first argument consistently as the "old value"
	 * in the assembly, as is done for _atomic_cmpxchg().
	 */
	return __atomic_xchg_add_unless(v, __atomic_setup(v), u, a).val;
}
EXPORT_SYMBOL(_atomic_xchg_add_unless);

int _atomic_cmpxchg(int *v, int o, int n)
{
	return __atomic_cmpxchg(v, __atomic_setup(v), o, n).val;
}
EXPORT_SYMBOL(_atomic_cmpxchg);

unsigned long _atomic_or(volatile unsigned long *p, unsigned long mask)
{
	return __atomic_or((int *)p, __atomic_setup(p), mask).val;
}
EXPORT_SYMBOL(_atomic_or);

unsigned long _atomic_andn(volatile unsigned long *p, unsigned long mask)
{
	return __atomic_andn((int *)p, __atomic_setup(p), mask).val;
}
EXPORT_SYMBOL(_atomic_andn);

unsigned long _atomic_xor(volatile unsigned long *p, unsigned long mask)
{
	return __atomic_xor((int *)p, __atomic_setup(p), mask).val;
}
EXPORT_SYMBOL(_atomic_xor);

long long _atomic64_xchg(long long *v, long long n)
{
	return __atomic64_xchg(v, __atomic_setup(v), n);
}
EXPORT_SYMBOL(_atomic64_xchg);

long long _atomic64_xchg_add(long long *v, long long i)
{
	return __atomic64_xchg_add(v, __atomic_setup(v), i);
}
EXPORT_SYMBOL(_atomic64_xchg_add);

long long _atomic64_xchg_add_unless(long long *v, long long a, long long u)
{
	/*
	 * Note: argument order is switched here since it is easier
	 * to use the first argument consistently as the "old value"
	 * in the assembly, as is done for _atomic_cmpxchg().
	 */
	return __atomic64_xchg_add_unless(v, __atomic_setup(v), u, a);
}
EXPORT_SYMBOL(_atomic64_xchg_add_unless);

long long _atomic64_cmpxchg(long long *v, long long o, long long n)
{
	return __atomic64_cmpxchg(v, __atomic_setup(v), o, n);
}
EXPORT_SYMBOL(_atomic64_cmpxchg);

/*
 * If any of the atomic or futex routines hit a bad address (not in
 * the page tables at kernel PL) this routine is called.  The futex
 * routines are never used on kernel space, and the normal atomics and
 * bitops are never used on user space.  So a fault on kernel space
 * must be fatal, but a fault on userspace is a futex fault and we
 * need to return -EFAULT.  Note that the context this routine is
 * invoked in is the context of the "_atomic_xxx()" routines called
 * by the functions in this file.
 */
struct __get_user __atomic_bad_address(int __user *addr)
{
	if (unlikely(!access_ok(VERIFY_WRITE, addr, sizeof(int))))
		panic("Bad address used for kernel atomic op: %p\n", addr);
	return (struct __get_user) { .err = -EFAULT };
}

void __init __init_atomic_per_cpu(void)
{
	/* Validate power-of-two and "bigger than cpus" assumption */
	BUILD_BUG_ON(ATOMIC_HASH_SIZE & (ATOMIC_HASH_SIZE-1));
	BUG_ON(ATOMIC_HASH_SIZE < nr_cpu_ids);

	/*
	 * On TILEPro we prefer to use a single hash-for-home
	 * page, since this means atomic operations are less
	 * likely to encounter a TLB fault and thus should
	 * in general perform faster.  You may wish to disable
	 * this in situations where few hash-for-home tiles
	 * are configured.
	 */
	BUG_ON((unsigned long)atomic_locks % PAGE_SIZE != 0);

	/* The locks must all fit on one page. */
	BUILD_BUG_ON(ATOMIC_HASH_SIZE * sizeof(int) > PAGE_SIZE);

	/*
	 * We use the page offset of the atomic value's address as
	 * an index into atomic_locks, excluding the low 3 bits.
	 * That should not produce more indices than ATOMIC_HASH_SIZE.
	 */
	BUILD_BUG_ON((PAGE_SIZE >> 3) > ATOMIC_HASH_SIZE);
}


text:
require 'optparse'

require_relative '../../../util'

def cancel_negotiation_for_proposals(marketplace, options)
  name = "buyers/#{options[:account_id]}/proposals/#{options[:proposal_id]}"

  body = Google::Apis::AuthorizedbuyersmarketplaceV1::CancelNegotiationRequest.new()

  puts "Canceling negotiation for proposal with name '#{name}':"

  proposal = marketplace.cancel_proposal_negotiation(name, body)
  ProposalPrinter.print(proposal)
end

if __FILE__ == $0
  begin
    # Retrieve the service used to make API requests.
    service = get_service()
  rescue ArgumentError => e
    raise 'Unable to create service, with error message: #{e.message}'
  rescue Signet::AuthorizationError => e
    raise 'Unable to create service, was the KEY_FILE in util.rb set? Error message: #{e.message}'
  end

  # Set options and default values for fields used in this example.
  options = [
    Option.new(
      'account_id',
      'The resource ID of the buyers resource under which the proposal exists. This will be used to construct the '\
      'name used as a path parameter for the proposals.cancelNegotation request.',
      type: Integer, short_alias: 'a', required: true, default_value: nil
    ),
    Option.new(
      'proposal_id',
      'The resource ID of the buyers.proposals resource that is being canceled. This will be used to construct the '\
      'name used as a path parameter for the proposals.cancelNegotiation request.',
      short_alias: 'c', required: true, default_value: nil
    ),
  ]

  # Parse options.
  parser = Parser.new(options)
  opts = parser.parse(ARGV)

  begin
    cancel_negotiation_for_proposals(service, opts)
  rescue Google::Apis::ServerError => e
    raise "The following server error occured:\n#{e.message}"
  rescue Google::Apis::ClientError => e
    raise "Invalid client request:\n#{e.message}"
  rescue Google::Apis::AuthorizationError => e
    raise "Authorization error occured:\n#{e.message}"
  end
end


text:
package com.dtolabs.rundeck.core.dispatcher;

import org.apache.commons.collections.Predicate;

import java.io.FilterReader;
import java.io.IOException;
import java.io.Reader;
import java.util.Arrays;
import java.util.Map;

/**
 * Reader that filters text to replace delimited tokens with values, the default delimiters are '@', and the default
 * allowed token characters are alphanumeric plus punctuation characters: "+-._:"
 */
public class ReplaceTokenReader extends FilterReader {
    public static final char DEFAULT_TOKEN_START = '@';
    public static final char DEFAULT_TOKEN_END = '@';
    private Map<String, String> tokens;
    boolean blankIfMissing;
    char tokenStart = DEFAULT_TOKEN_START;
    char tokenEnd = DEFAULT_TOKEN_END;
    private Predicate tokenCharPredicate;

    public ReplaceTokenReader(Reader reader, Map<String, String> tokens, boolean blankIfMissing) {
        this(reader, tokens, blankIfMissing, DEFAULT_TOKEN_START, DEFAULT_TOKEN_END);
    }

    public ReplaceTokenReader(Reader reader, Map<String, String> tokens, boolean blankIfMissing, char tokenStart,
            char tokenEnd) {
        super(reader);
        this.tokens = tokens;
        this.blankIfMissing = blankIfMissing;
        this.tokenStart = tokenStart;
        this.tokenEnd = tokenEnd;
        replaceBuffer = new StringBuilder();
        readBuffer = new StringBuilder();
        replaceBufferIndex = -1;
        readBufferIndex = -1;
        tokenCharPredicate = DEFAULT_ALLOWED_PREDICATE;
    }

    private static final char[] ALLOWED_CHARS = ".+-_:".toCharArray();
    static {
        Arrays.sort(ALLOWED_CHARS);
    }
    public static final Predicate DEFAULT_ALLOWED_PREDICATE = new Predicate() {
        @Override
        public boolean evaluate(Object o) {
            Character c = (Character) o;
            return Character.isLetterOrDigit((int)c) || Arrays.binarySearch(ALLOWED_CHARS, c) >= 0;
        }
    };

    private StringBuilder replaceBuffer;
    private int replaceBufferIndex;
    private int readBufferIndex;
    private StringBuilder readBuffer;

    @Override
    public int read(char[] chars, int offset, int len) throws IOException {
        int count=0;
        while (count < len && (count + offset) < chars.length) {
            int read = read();
            if (read != -1) {
                chars[count + offset] = (char) read;
                count++;
            } else if(count==0){
                return -1;
            }else{
                break;
            }
        }
        return count;
    }

    @Override
    public int read() throws IOException {
        //return replacement text
        if (replaceBufferIndex >= 0 && replaceBufferIndex < replaceBuffer.length()) {
            return replaceBuffer.charAt(replaceBufferIndex++);
        }
        //return buffered content that has no tokens
        if (readBufferIndex >= 0 && readBufferIndex < readBuffer.length()) {
            return readBuffer.charAt(readBufferIndex++);
        }
        int read = super.read();
        if (read == tokenStart) {
            readBuffer.append((char) read);
            if (readBufferIndex < 0) {
                readBufferIndex = 0;
            }
            do {
                read = super.read();
                if (read == tokenEnd) {
                    //end of replacement
                    String key = readBuffer.substring(1);
                    replaceBuffer.setLength(0);
                    readBuffer.setLength(0);
                    appendTokenSubstitute(key, replaceBuffer);
                    replaceBufferIndex = 0;
                    readBufferIndex = -1;
                    return read();
                } else if(read!=-1) {
                    readBuffer.append((char) read);
                    if(readBufferIndex<0){
                        readBufferIndex=0;
                    }
                    if (readBuffer.length() > 1 && !tokenCharPredicate.evaluate((char) read)) {
                        //not an allowed token character
                        //simply replace the content, and continue
                        replaceBuffer.setLength(0);
                        replaceBuffer.append(readBuffer);
                        replaceBufferIndex=0;
                        readBuffer.setLength(0);
                        readBufferIndex=-1;
                        return read();
                    }
                }
            } while (read != -1);

            //return buffered content that has no tokens
            if (readBufferIndex >= 0 && readBufferIndex < readBuffer.length()) {
                return readBuffer.charAt(readBufferIndex++);
            }
        }
        return read;
    }

    private void appendTokenSubstitute(String key, StringBuilder replaceBuffer) {
        if (null != tokens.get(key)) {
            replaceBuffer.append(tokens.get(key));
        } else if (blankIfMissing) {
            replaceBuffer.append("");
        } else {
            replaceBuffer.append(tokenStart).append(key).append(tokenEnd);
        }
    }

    public Predicate getTokenCharPredicate() {
        return tokenCharPredicate;
    }

    public void setTokenCharPredicate(Predicate tokenCharPredicate) {
        this.tokenCharPredicate = tokenCharPredicate;
    }
}


text:
#import <DADocSetAccess/DSAResultSource.h>

@class NSArray, NSMutableArray, NSSortDescriptor, NSString;

// Not exported
@interface DSAMultipleResultSource : DSAResultSource
{
    NSArray *_theSources;
    NSMutableArray *_remainingSources;
    NSMutableArray *_sourceCaches;
    unsigned long long *_unsignedMemory;
    NSString *_sortKey;
    NSSortDescriptor *_sortDescriptorForValue;
    unsigned long long _numberOfCompares;
}

@property unsigned long long numberOfCompares; // @synthesize numberOfCompares=_numberOfCompares;
- (void).cxx_destruct;
- (long long)compareObject:(id)arg1 toObject:(id)arg2;
- (struct _NSRange)rangeFromArray:(id)arg1 aboveValue:(id)arg2 includingExactMatches:(BOOL)arg3 startingIndex:(unsigned long long)arg4 nextFailedValue:(id *)arg5;
- (id)mergeForTime:(double)arg1;
- (id)_sortValueForObject:(id)arg1;
- (id)nextResultsInTime:(double)arg1;
- (id)remainingResults;
- (void)_sourceExpendedAtIndex:(unsigned long long)arg1;
- (BOOL)hasMoreResults;
- (void)cancel;
- (void)dealloc;
- (id)initWithSources:(id)arg1 withSortDescriptor:(id)arg2;

@end


text:
module Azure::Batch::Mgmt::V2019_08_01
  module Models
    #
    # Fixed scale settings for the pool.
    #
    #
    class FixedScaleSettings

      include MsRestAzure

      # @return [Duration] The timeout for allocation of compute nodes to the
      # pool. The default value is 15 minutes. Timeout values use ISO 8601
      # format. For example, use PT10M for 10 minutes. The minimum value is 5
      # minutes. If you specify a value less than 5 minutes, the Batch service
      # rejects the request with an error; if you are calling the REST API
      # directly, the HTTP status code is 400 (Bad Request).
      attr_accessor :resize_timeout

      # @return [Integer] The desired number of dedicated compute nodes in the
      # pool. At least one of targetDedicatedNodes, targetLowPriority nodes
      # must be set.
      attr_accessor :target_dedicated_nodes

      # @return [Integer] The desired number of low-priority compute nodes in
      # the pool. At least one of targetDedicatedNodes, targetLowPriority nodes
      # must be set.
      attr_accessor :target_low_priority_nodes

      # @return [ComputeNodeDeallocationOption] Determines what to do with a
      # node and its running task(s) if the pool size is decreasing. If
      # omitted, the default value is Requeue. Possible values include:
      # 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'
      attr_accessor :node_deallocation_option

      #
      # Mapper for FixedScaleSettings class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'FixedScaleSettings',
          type: {
            name: 'Composite',
            class_name: 'FixedScaleSettings',
            model_properties: {
              resize_timeout: {
                client_side_validation: true,
                required: false,
                serialized_name: 'resizeTimeout',
                type: {
                  name: 'TimeSpan'
                }
              },
              target_dedicated_nodes: {
                client_side_validation: true,
                required: false,
                serialized_name: 'targetDedicatedNodes',
                type: {
                  name: 'Number'
                }
              },
              target_low_priority_nodes: {
                client_side_validation: true,
                required: false,
                serialized_name: 'targetLowPriorityNodes',
                type: {
                  name: 'Number'
                }
              },
              node_deallocation_option: {
                client_side_validation: true,
                required: false,
                serialized_name: 'nodeDeallocationOption',
                type: {
                  name: 'Enum',
                  module: 'ComputeNodeDeallocationOption'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
$(document).ready(function() {

    $('#show-measurements').on('click', showMeasurements);
    $('#show-goals').on('click', showGoals);
    $('.wobtn').on('click', markComplete);
});

var showMeasurements = function(event){
  event.preventDefault();
  console.log("Meas");
  $('#mlist').toggle();
};

var showGoals = function(event){
  event.preventDefault();
  console.log("Goal");
  $('#glist').toggle();
};

var markComplete = function(event){
  event.preventDefault();
  console.log(this);
  var that = $(this);
  var userId = $(this).attr('name');
  var id = $(this).attr('id');
  var url = '/users/' + userId + '/workouts/' + id
  console.log(url);
  $.ajax({
    url: url,
    method: "PATCH",
    context: that
  }).success(function(data){
    console.log(data);
    $(this).hide()
    $(this).parent().css('class', 'list-group-item list-group-item-success')
  }).fail(function(data){
    console.log(data)
  });
};


text:
{% block label %}
  {% if get_value %}
    {% for option_value, option_label in choices %}
      {% if option_value == get_value %}
        {{ option_label }}
      {% endif %}
    {% endfor %}
  {% else %}
    {{ label }}
  {% endif %}
{% endblock %}

{% block char %}
  <input id="{{ id_for_label }}" class="form-control" name="{{ html_name }}"
          {{ widget_attrs }} type="text" {% if value %}value="{{ value }}"{% endif %}>
{% endblock %}

{% block hidden %}
  <input id="{{ id_for_label }}" name="{{ html_name }}" type="hidden" {% if value %}value="{{ value }}"{% endif %}>
{% endblock %}

{% block password %}
  <input id="{{ id_for_label }}" class="form-control" name="{{ html_name }}"
          {{ widget_attrs }} type="password" {% if value %}value="{{ value }}"{% endif %}>
{% endblock %}

{% block checkbox %}
  <input id="{{ id_for_label }}" name="{{ html_name }}" type="checkbox" class="form-control" {{ widget_attrs }}
         {% if value %}checked="checked"{% endif %}>
{% endblock %}

{% block radio %}
  {% for option_value, option_label in choices %}
    {% if option_value == get_value %}
      <input id="{{ id }}_{{ forloop.counter0 }}" name="{{ html_name }}" value="{{ option_value }}"
             type="radio" class="form-control" {{ widget_attrs }}
             {% if value == option_value %}checked="checked"{% endif %}>
    {% endif %}
  {% endfor %}
{% endblock %}

{% block select %}
  <select id="{{ id_for_label }}" name="{{ html_name }}" class="form-control" {{ widget_attrs }}>
    {% for option_value, option_label in choices %}
      <option value="{{ option_value }}" {% if value == option_value %}selected="selected"{% endif %}>
        {{ option_label }}
      </option>
    {% endfor %}
  </select>
{% endblock %}

{% block error %}

{% endblock %}

{% block extra %}
{% endblock %}


text:
<?php

use basicAuth\Repo\UserRepositoryInterface;
use basicAuth\formValidation\RegistrationForm;

class RegistrationController extends \BaseController {

	/**
	 * @var $user
	 */
	protected $user;

	/**
	 * @var RegistrationForm
	 */
	private $registrationForm;

	function __construct(UserRepositoryInterface $user, RegistrationForm $registrationForm)
	{
		$this->user = $user;
		$this->registrationForm = $registrationForm;
	}

	/**
	 * Show the form for creating a new resource.
	 *
	 * @return Response
	 */
	public function create()
	{

		$departments = DB::table('departments')->orderBy('name_department', 'asc')->lists('name_department', 'id');
		$cost_centers = DB::table('cost_centers')->orderBy('name', 'asc')->lists('name', 'id');
		$cellphones = DB::table('cellphones')->orderBy('number', 'asc')->lists('number', 'id');
		//return View::make('registration.create')->nest('cellphones', 'cellphones.create')->with('departments',$departments)->with('cost_centers',$cost_centers);
		return View::make('registration.create')->with('departments',$departments)->with('cost_centers',$cost_centers)->with('cellphones',$cellphones);

	}

	/**
	 * Store a newly created resource in storage.
	 *
	 * @return Response
	 */
	public function store()
	{
		//$input = Input::only('email', 'password', 'password_confirmation', 'first_name', 'last_name', 'employee_id', 'radio', 'department_id', 'cost_center_id', 'model', 'trade_mark', 'company', 'imei', 'plan_name', 'plan_description', 'plan_cost', 'plan_iva_cost');
		$input = Input::only('email', 'password', 'password_confirmation', 'first_name', 'last_name', 'employee_id', 'radio', 'department_id', 'cost_center_id', 'cellphone_id');

		$this->registrationForm->validate($input);

		//$input = Input::only('email', 'password', 'first_name', 'last_name', 'employee_id', 'radio', 'department_id', 'cost_center_id', 'model', 'trade_mark', 'company', 'imei', 'plan_name', 'plan_description', 'plan_cost', 'plan_iva_cost');
		$input = Input::only('email', 'password', 'first_name', 'last_name', 'employee_id', 'radio', 'department_id', 'cost_center_id', 'cellphone_id');

		$input = array_add($input, 'activated', true);

		$user = $this->user->create($input);

		// Find the group using the group name
    	$usersGroup = Sentry::findGroupByName('Usuario');

    	// Assign the group to the user
    	$user->addGroup($usersGroup);

		return Redirect::to('login')->withFlashMessage('¡Usuario creado exitosamente!');
	}

}


text:
package org.enoir.graphvizapi.exception;

/**
 * GraphvizApi Base Exception.
 * Created by frank on 2014/11/27.
 */
public class GraphvizApiException extends RuntimeException{
    public GraphvizApiException(String message){
        super(message);
    }
}