text:
#include <asm/machdep.h>
#include <asm/pgtable.h>
#include <asm/mmu.h>
#include <asm/mmu_context.h>
#include <asm/abs_addr.h>
#include <linux/spinlock.h>

#include "call_hpt.h"

static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp =
	{ [0 ... 63] = SPIN_LOCK_UNLOCKED};

/*
 * Very primitive algorithm for picking up a lock
 */
static inline void iSeries_hlock(unsigned long slot)
{
	if (slot & 0x8)
		slot = ~slot;
	spin_lock(&iSeries_hlocks[(slot >> 4) & 0x3f]);
}

static inline void iSeries_hunlock(unsigned long slot)
{
	if (slot & 0x8)
		slot = ~slot;
	spin_unlock(&iSeries_hlocks[(slot >> 4) & 0x3f]);
}

long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
			 unsigned long pa, unsigned long rflags,
			 unsigned long vflags, int psize)
{
	long slot;
	hpte_t lhpte;
	int secondary = 0;

	BUG_ON(psize != MMU_PAGE_4K);

	/*
	 * The hypervisor tries both primary and secondary.
	 * If we are being called to insert in the secondary,
	 * it means we have already tried both primary and secondary,
	 * so we return failure immediately.
	 */
	if (vflags & HPTE_V_SECONDARY)
		return -1;

	iSeries_hlock(hpte_group);

	slot = HvCallHpt_findValid(&lhpte, va >> HW_PAGE_SHIFT);
	if (unlikely(lhpte.v & HPTE_V_VALID)) {
		if (vflags & HPTE_V_BOLTED) {
			HvCallHpt_setSwBits(slot, 0x10, 0);
			HvCallHpt_setPp(slot, PP_RWXX);
			iSeries_hunlock(hpte_group);
			if (slot < 0)
				return 0x8 | (slot & 7);
			else
				return slot & 7;
		}
		BUG();
	}

	if (slot == -1)	{ /* No available entry found in either group */
		iSeries_hunlock(hpte_group);
		return -1;
	}

	if (slot < 0) {		/* MSB set means secondary group */
		vflags |= HPTE_V_SECONDARY;
		secondary = 1;
		slot &= 0x7fffffffffffffff;
	}

 	lhpte.v = hpte_encode_v(va, MMU_PAGE_4K) | vflags | HPTE_V_VALID;
	lhpte.r = hpte_encode_r(phys_to_abs(pa), MMU_PAGE_4K) | rflags;

	/* Now fill in the actual HPTE */
	HvCallHpt_addValidate(slot, secondary, &lhpte);

	iSeries_hunlock(hpte_group);

	return (secondary << 3) | (slot & 7);
}

static unsigned long iSeries_hpte_getword0(unsigned long slot)
{
	hpte_t hpte;

	HvCallHpt_get(&hpte, slot);
	return hpte.v;
}

static long iSeries_hpte_remove(unsigned long hpte_group)
{
	unsigned long slot_offset;
	int i;
	unsigned long hpte_v;

	/* Pick a random slot to start at */
	slot_offset = mftb() & 0x7;

	iSeries_hlock(hpte_group);

	for (i = 0; i < HPTES_PER_GROUP; i++) {
		hpte_v = iSeries_hpte_getword0(hpte_group + slot_offset);

		if (! (hpte_v & HPTE_V_BOLTED)) {
			HvCallHpt_invalidateSetSwBitsGet(hpte_group +
							 slot_offset, 0, 0);
			iSeries_hunlock(hpte_group);
			return i;
		}

		slot_offset++;
		slot_offset &= 0x7;
	}

	iSeries_hunlock(hpte_group);

	return -1;
}

/*
 * The HyperVisor expects the "flags" argument in this form:
 *	bits  0..59 : reserved
 *	bit      60 : N
 *	bits 61..63 : PP2,PP1,PP0
 */
static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
				  unsigned long va, int psize, int local)
{
	hpte_t hpte;
	unsigned long want_v;

	iSeries_hlock(slot);

	HvCallHpt_get(&hpte, slot);
	want_v = hpte_encode_v(va, MMU_PAGE_4K);

	if (HPTE_V_COMPARE(hpte.v, want_v) && (hpte.v & HPTE_V_VALID)) {
		/*
		 * Hypervisor expects bits as NPPP, which is
		 * different from how they are mapped in our PP.
		 */
		HvCallHpt_setPp(slot, (newpp & 0x3) | ((newpp & 0x4) << 1));
		iSeries_hunlock(slot);
		return 0;
	}
	iSeries_hunlock(slot);

	return -1;
}

/*
 * Functions used to find the PTE for a particular virtual address.
 * Only used during boot when bolting pages.
 *
 * Input : vpn      : virtual page number
 * Output: PTE index within the page table of the entry
 *         -1 on failure
 */
static long iSeries_hpte_find(unsigned long vpn)
{
	hpte_t hpte;
	long slot;

	/*
	 * The HvCallHpt_findValid interface is as follows:
	 * 0xffffffffffffffff : No entry found.
	 * 0x00000000xxxxxxxx : Entry found in primary group, slot x
	 * 0x80000000xxxxxxxx : Entry found in secondary group, slot x
	 */
	slot = HvCallHpt_findValid(&hpte, vpn);
	if (hpte.v & HPTE_V_VALID) {
		if (slot < 0) {
			slot &= 0x7fffffffffffffff;
			slot = -slot;
		}
	} else
		slot = -1;
	return slot;
}

/*
 * Update the page protection bits. Intended to be used to create
 * guard pages for kernel data structures on pages which are bolted
 * in the HPT. Assumes pages being operated on will not be stolen.
 * Does not work on large pages.
 *
 * No need to lock here because we should be the only user.
 */
static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
					int psize)
{
	unsigned long vsid,va,vpn;
	long slot;

	BUG_ON(psize != MMU_PAGE_4K);

	vsid = get_kernel_vsid(ea);
	va = (vsid << 28) | (ea & 0x0fffffff);
	vpn = va >> HW_PAGE_SHIFT;
	slot = iSeries_hpte_find(vpn);
	if (slot == -1)
		panic("updateboltedpp: Could not find page to bolt\n");
	HvCallHpt_setPp(slot, newpp);
}

static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va,
				    int psize, int local)
{
	unsigned long hpte_v;
	unsigned long avpn = va >> 23;
	unsigned long flags;

	local_irq_save(flags);

	iSeries_hlock(slot);

	hpte_v = iSeries_hpte_getword0(slot);

	if ((HPTE_V_AVPN_VAL(hpte_v) == avpn) && (hpte_v & HPTE_V_VALID))
		HvCallHpt_invalidateSetSwBitsGet(slot, 0, 0);

	iSeries_hunlock(slot);

	local_irq_restore(flags);
}

void hpte_init_iSeries(void)
{
	ppc_md.hpte_invalidate	= iSeries_hpte_invalidate;
	ppc_md.hpte_updatepp	= iSeries_hpte_updatepp;
	ppc_md.hpte_updateboltedpp = iSeries_hpte_updateboltedpp;
	ppc_md.hpte_insert	= iSeries_hpte_insert;
	ppc_md.hpte_remove	= iSeries_hpte_remove;

	htab_finish_init();
}


text:
import { ApplicationStateAction } from "../../../../z_vendor/getto-application/action/action"

import { FindNextVersionMethod } from "../../find_next/method"

import { FindNextVersionEvent } from "../../find_next/event"

export type FindNextVersionCoreAction = ApplicationStateAction<FindNextVersionCoreState>

export type FindNextVersionMaterial = Readonly<{
    find: FindNextVersionMethod
}>

export type FindNextVersionCoreState =
    | Readonly<{ type: "initial-next-version" }>
    | FindNextVersionEvent

export const initialFindNextVersionCoreState: FindNextVersionCoreState = {
    type: "initial-next-version",
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef LayoutSVGInline_h
#define LayoutSVGInline_h

#include "core/layout/LayoutInline.h"

namespace blink {

class LayoutSVGInline : public LayoutInline {
public:
    explicit LayoutSVGInline(Element*);

    const char* name() const override { return "LayoutSVGInline"; }
    PaintLayerType layerTypeRequired() const final { return NoPaintLayer; }
    bool isOfType(LayoutObjectType type) const override { return type == LayoutObjectSVG || type == LayoutObjectSVGInline || LayoutInline::isOfType(type); }

    bool isChildAllowed(LayoutObject*, const ComputedStyle&) const override;

    // Chapter 10.4 of the SVG Specification say that we should use the
    // object bounding box of the parent text element.
    // We search for the root text element and take its bounding box.
    // It is also necessary to take the stroke and paint invalidation rect of
    // this element, since we need it for filters.
    FloatRect objectBoundingBox() const final;
    FloatRect strokeBoundingBox() const final;
    FloatRect paintInvalidationRectInLocalCoordinates() const final;

    LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* = nullptr) const final;
    void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidationContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr, const PaintInvalidationState* = nullptr) const final;
    const LayoutObject* pushMappingToContainer(const LayoutBoxModelObject* ancestorToStopAt, LayoutGeometryMap&) const final;
    void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const final;

private:
    InlineFlowBox* createInlineFlowBox() final;

    void invalidateTreeIfNeeded(PaintInvalidationState&) final;

    void willBeDestroyed() final;
    void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) final;

    void addChild(LayoutObject* child, LayoutObject* beforeChild = nullptr) final;
    void removeChild(LayoutObject*) final;
};

DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGInline, isSVGInline());

}

#endif // LayoutSVGInline_H


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/cloudtrace/v2/trace.proto

namespace Google\Cloud\Trace\V2;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * An event describing a message sent/received between Spans.
 *
 * Generated from protobuf message google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent
 */
class Span_TimeEvent_MessageEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * Type of MessageEvent. Indicates whether the message was sent or
     * received.
     *
     * Generated from protobuf field .google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;
     */
    private $type = 0;
    /**
     * An identifier for the MessageEvent's message that can be used to match
     * SENT and RECEIVED MessageEvents. It is recommended to be unique within
     * a Span.
     *
     * Generated from protobuf field int64 id = 2;
     */
    private $id = 0;
    /**
     * The number of uncompressed bytes sent or received.
     *
     * Generated from protobuf field int64 uncompressed_size_bytes = 3;
     */
    private $uncompressed_size_bytes = 0;
    /**
     * The number of compressed bytes sent or received. If missing assumed to
     * be the same size as uncompressed.
     *
     * Generated from protobuf field int64 compressed_size_bytes = 4;
     */
    private $compressed_size_bytes = 0;

    public function __construct() {
        \GPBMetadata\Google\Devtools\Cloudtrace\V2\Trace::initOnce();
        parent::__construct();
    }

    /**
     * Type of MessageEvent. Indicates whether the message was sent or
     * received.
     *
     * Generated from protobuf field .google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Type of MessageEvent. Indicates whether the message was sent or
     * received.
     *
     * Generated from protobuf field .google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type type = 1;
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Trace\V2\Span_TimeEvent_MessageEvent_Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * An identifier for the MessageEvent's message that can be used to match
     * SENT and RECEIVED MessageEvents. It is recommended to be unique within
     * a Span.
     *
     * Generated from protobuf field int64 id = 2;
     * @return int|string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * An identifier for the MessageEvent's message that can be used to match
     * SENT and RECEIVED MessageEvents. It is recommended to be unique within
     * a Span.
     *
     * Generated from protobuf field int64 id = 2;
     * @param int|string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkInt64($var);
        $this->id = $var;

        return $this;
    }

    /**
     * The number of uncompressed bytes sent or received.
     *
     * Generated from protobuf field int64 uncompressed_size_bytes = 3;
     * @return int|string
     */
    public function getUncompressedSizeBytes()
    {
        return $this->uncompressed_size_bytes;
    }

    /**
     * The number of uncompressed bytes sent or received.
     *
     * Generated from protobuf field int64 uncompressed_size_bytes = 3;
     * @param int|string $var
     * @return $this
     */
    public function setUncompressedSizeBytes($var)
    {
        GPBUtil::checkInt64($var);
        $this->uncompressed_size_bytes = $var;

        return $this;
    }

    /**
     * The number of compressed bytes sent or received. If missing assumed to
     * be the same size as uncompressed.
     *
     * Generated from protobuf field int64 compressed_size_bytes = 4;
     * @return int|string
     */
    public function getCompressedSizeBytes()
    {
        return $this->compressed_size_bytes;
    }

    /**
     * The number of compressed bytes sent or received. If missing assumed to
     * be the same size as uncompressed.
     *
     * Generated from protobuf field int64 compressed_size_bytes = 4;
     * @param int|string $var
     * @return $this
     */
    public function setCompressedSizeBytes($var)
    {
        GPBUtil::checkInt64($var);
        $this->compressed_size_bytes = $var;

        return $this;
    }

}


text:
'use strict';

import Faction from '../datatypes/Faction.js';

let factionData = Object.create(null);

const vs = new Faction(1, 'VS', 'Vanu Sovereignty');
factionData['vs'] = vs;

const nc = new Faction(2, 'NC', 'New Conglomerate');
factionData['nc'] = nc;

const tr = new Faction(3, 'TR', 'Terran Republic');
factionData['tr'] = tr;

export default factionData;


text:
/**
 *
 */
package weibo4j.examples.statuses;

import java.util.List;

import weibo4j.Status;
import weibo4j.Weibo;

/**
 * @author haidong
 *
 */
public class RepostByMe {

	/**
	 * 获取用户最新转发的n条微博消息
	 * @param args
	 */
	public static void main(String[] args) {
		System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
    	System.setProperty("weibo4j.oauth.consumerSecret", Weibo.CONSUMER_SECRET);
        try {
        	Weibo weibo = new Weibo();
			weibo.setToken(args[0],args[1]);
        	List <Status> list =  weibo.getrepostbyme(args[2]);
        	for(Status status:list){
        	System.out.println(status.toString());
        	}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}


text:
import 'isomorphic-fetch'

const defaultOptions = {
    dataType: 'json'
}

const request = (url, data, method, options) => {
    options = Object.assign({}, defaultOptions, options)
    return fetch(url, {
            method,
            body: data
        })
        .then(resp => {
            if (resp.status >= 200 && resp.status < 300) {
                switch(options.dataType) {
                    case 'text': return resp.text()
                    case 'json': return resp.json()
                    default:
                        console.error('unknow datatype')
                        throw new Exception('出错了, 请稍后再重试 -_#')
                }
            } else {
                throw new Error('出错了, 请稍后再重试 -_#')
            }
        }).catch(err => {
            console.log('err', err);
        });
}

const GET = (url, data, options) => {
    return request(url, null, 'GET', options)
}

const POST = (url, data, options) => {
    return request(url, data, 'POST', options)
}

export default {
    GET
}


text:
export default class Lexer {
  constructor(rules) {
    this.rules = rules;
  }

  tokenize(...args) {
    return this.constructor.tokenize(this.rules, ...args);
  }

  static tokenize(rules, expression, {
                                        findLongest = true,
                                        lastOfLongest = false,
                                        passThroughUnrecognized = false
                                     } = {}) {
    let tokens = [];
    while (expression.trim().length > 0) {
      let longestResult = '', longestResultName, found = false;
      for (let {name, rule} of rules) {
        rule = new RegExp('^' + rule.source, rule.flags);
        let result = rule.exec(expression);
        if (!!result) {
          found = true;
          if (findLongest) {
            if (lastOfLongest && result[0].length >= longestResult.length) {
              longestResult = result[0];
              longestResultName = name;
            } else if (result[0].length > longestResult.length) {
              longestResult = result[0];
              longestResultName = name;
            }
          } else {
            tokens.push({type: name, value: result[0]});
            expression = expression.substr(result[0].length).trim();
            break;
          }
        }
      }
      if (findLongest && found) {
        tokens.push({type: longestResultName, value: longestResult});
        expression = expression.substr(longestResult.length).trim();
      }
      if (!found) {
        if (passThroughUnrecognized) {
          tokens.push({type: expression[0], value: expression[0]});
          expression = expression.substr(1).trim();
        } else {
          throw new Error('Could not recognize string');
        }
      }
    }
    return tokens;
  }
}


text:
export function decibelsToAmplitudeRatio(dbs) {
  return Math.pow(10, 0.05*dbs);
}

export function amplitudeRatioToDecibels(amp) {
  return 20*Math.log10(amp);
}


text:
<?php

class CartManager extends AJXP_Plugin
{
    public function switchAction ($actionName, $httpVars, $fileVars)
    {
        if ($actionName == "search-cart-download") {

            // Pipe SEARCH + DOWNLOAD actions.

            $indexer = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("index");
            if($indexer == false) return;
            $httpVars["return_selection"] = true;
            unset($httpVars["get_action"]);
            $res = AJXP_Controller::findActionAndApply("search", $httpVars, $fileVars);
            if (isSet($res) && is_array($res)) {
                $newHttpVars = array(
                    "selection_nodes"   => $res,
                    "dir"               => "__AJXP_ZIP_FLAT__/",
                    "archive_name"      => $httpVars["archive_name"]
                );
                AJXP_Controller::findActionAndApply("download", $newHttpVars, array());
            }

        }

    }

}


text:
using System;
using LinqToTwitter.Common;
using LitJson;
using System.Xml.Serialization;

namespace LinqToTwitter
{
    [XmlType(Namespace = "LinqToTwitter")]
    public class SearchMetaData
    {
        public SearchMetaData() { }
        public SearchMetaData(JsonData metaData)
        {
            CompletedIn = metaData.GetValue<decimal>("completed_in");
            MaxID = metaData.GetValue<string>("max_id_str").GetULong(0ul);
            NextResults = metaData.GetValue<string>("next_results");
            Query = metaData.GetValue<string>("query");
            RefreshUrl = metaData.GetValue<string>("refresh_url");
            Count = metaData.GetValue<int>("count");
            SinceID = metaData.GetValue<string>("since_id_str").GetULong(0ul);
        }

        /// <summary>
        /// Processing time for search
        /// </summary>
        public decimal CompletedIn { get; set; }

        /// <summary>
        /// Max ID returned in search
        /// </summary>
        public ulong MaxID { get; set; }

        /// <summary>
        /// Query string to get next page
        /// </summary>
        public string NextResults { get; set; }

        /// <summary>
        /// Original Query
        /// </summary>
        public string Query { get; set; }

        /// <summary>
        /// Query string to refresh this search
        /// </summary>
        public string RefreshUrl { get; set; }

        /// <summary>
        /// Number of results per page to return on next query
        /// </summary>
        public int Count { get; set; }

        /// <summary>
        /// Don't return tweets older than this ID
        /// </summary>
        public ulong SinceID { get; set; }
    }
}


text:
#pragma once

#ifndef NAZARA_NETWORK_CONFIG_HPP
#define NAZARA_NETWORK_CONFIG_HPP

/*!
* \defgroup network (NazaraNetwork) Network module
*  Network/System module including classes to handle networking elements...
*/

/// Each modification of a paramater of the module needs a recompilation of the unit

// Use the MemoryManager to manage dynamic allocations (can detect memory leak but allocations/frees are slower)
#define NAZARA_NETWORK_MANAGE_MEMORY 0

// Activate the security tests based on the code (Advised for development)
#define NAZARA_NETWORK_SAFE 1

/// Each modification of a parameter following implies a modification (often minor) of the code

/// Checking the values and types of certain constants
#include <Nazara/Network/ConfigCheck.hpp>

#if defined(NAZARA_STATIC)
	#define NAZARA_NETWORK_API
#else
	#ifdef NAZARA_NETWORK_BUILD
		#define NAZARA_NETWORK_API NAZARA_EXPORT
	#else
		#define NAZARA_NETWORK_API NAZARA_IMPORT
	#endif
#endif

#endif // NAZARA_NETWORK_CONFIG_HPP


text:
<?php
/**
 * Single Product tabs
 *
 * @author  WooThemes
 * @package WooCommerce/Templates
 * @version 2.4.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Filter tabs and allow third parties to add their own
 *
 * Each tab is an array containing title, callback and priority.
 * @see woocommerce_default_product_tabs()
 */
$tabs = apply_filters( 'woocommerce_product_tabs', array() );

if ( ! empty( $tabs ) ) : ?>

        <?php foreach ( $tabs as $key => $tab ) : ?>

            <h6 class="title-holder clearfix <?php echo esc_attr($key) ?>_tab">
                <?php echo apply_filters( 'woocommerce_product_' . $key . '_tab_title', esc_html( $tab['title'] ), $key ); ?>

                    <?php call_user_func( $tab['callback'], $key, $tab ) ?>

        <?php endforeach; ?>

<?php endif; ?>


text:
package com.n1analytics.paillier;

/**
 * Thrown when comparing two Paillier contexts and the contexts are not the same.
 */
public class PaillierContextMismatchException extends PaillierKeyMismatchException {

  private static final long serialVersionUID = -6169034734530199098L;

  /**
   * Constructs a new {@code PaillierContextMismatchException} without a specific message.
   */
  public PaillierContextMismatchException() {
    super();
  }

  /**
   * Constructs a new {@code PaillierContextMismatchException} with a specific message.
   * @param message the detail message.
   */
  public PaillierContextMismatchException(String message) {
    super(message);
  }

  /**
   * Constructs a new {@code PaillierContextMismatchException} with the exception cause.
   * @param cause the cause.
   */
  public PaillierContextMismatchException(Throwable cause) {
    super(cause);
  }

  /**
   * Constructs a new {@code PaillierContextMismatchException} with a specific message and the exception cause.
   * @param message the detail message,
   * @param cause the cause.
   */
  public PaillierContextMismatchException(String message, Throwable cause) {
    super(message, cause);
  }

  /**
   * Constructs a new {@code PaillierContextMismatchException} with a specific message and the exception cause.
   * @param message the detail message.
   * @param cause the cause.
   * @param enableSuppression whether suppression is enabled or disabled.
   * @param writableStackTrace whether the stack trace should be writable.
   */
  public PaillierContextMismatchException(String message, Throwable cause,
                                          boolean enableSuppression,
                                          boolean writableStackTrace) {
    super(message, cause, enableSuppression, writableStackTrace);
  }
}


text:
ref class Animate abstract
{
internal:
    Animate();

    virtual DirectX::XMFLOAT3 Evaluate (_In_ float dt) = 0;

    bool  IsActive(_In_ float t) { return ((t >= m_startTime) && (m_continuous || (t < (m_startTime + m_duration)))); };
    bool  IsFinished(_In_ float t) { return (!m_continuous && (t >= (m_startTime + m_duration))); }
    float Start();
    void  Start(_In_ float start);
    float Duration();
    void  Duration(_In_ float duration);
    bool  Continuous();
    void  Continuous(_In_ bool continuous);

protected private:
    bool  m_continuous;      // if true means at end cycle back to beginning
    float m_startTime;       // time at which animation begins
    float m_duration;        // for continuous this is the duration of 1 cycle through path
	float m_currentTime;	 //tracks time passed while game is updating, allowing for pause states, etc.
};

//----------------------------------------------------------------------

// AnimateLinePosition:
// This class is a specialization of Animate that defines an animation of a position vector
// along a straight line defined in world coordinates from startPosition to endPosition.

ref class AnimateLinePosition: public Animate
{
internal:
    AnimateLinePosition(
        _In_ DirectX::XMFLOAT3 startPosition,
        _In_ DirectX::XMFLOAT3 endPosition,
        _In_ float duration,
        _In_ bool continuous
        );
    virtual DirectX::XMFLOAT3 Evaluate(_In_ float dt) override;

private:
    DirectX::XMFLOAT3 m_startPosition;
    DirectX::XMFLOAT3 m_endPosition;
    float             m_length;
};

//----------------------------------------------------------------------

struct LineSegment
{
    DirectX::XMFLOAT3 position;
    float             length;
    float             uStart;
    float             uLength;
};

// AnimateLineListPosition:
// This class is a specialization of Animate that defines an animation of a position vector
// along a set of line segments defined by a set of points.  The animation along the path is
// such that the evaluation of the position along the path will be uniform independent of
// the length of each of the line segments.  A continuous loop can be achieved by having the
// first and last points of the list be the same.

ref class AnimateLineListPosition: public Animate
{
internal:
    AnimateLineListPosition(
        _In_ unsigned int count,
        _In_reads_(count) DirectX::XMFLOAT3 position[],
        _In_ float duration,
        _In_ bool continuous
        );
    virtual DirectX::XMFLOAT3 Evaluate(_In_ float dt) override;

private:
    unsigned int             m_count;
    float                    m_totalLength;
    std::vector<LineSegment> m_segment;
};

//----------------------------------------------------------------------

// AnimateCirclePosition:
// This class is a specialization of Animate that defines an animation of a position vector
// along a circular path centered at 'center' with a starting point of 'startPosition'.  The
// distance between 'center' and 'startPosition' defines the radius of the circle.  The plane
// of the circle will pass through 'center' and 'startPosition' and have a normal of 'planeNormal'.
// The direction of the animation can be either clockwise or counterclockwise based
// on the 'clockwise' parameter.

ref class AnimateCirclePosition: public Animate
{
internal:
    AnimateCirclePosition(
        _In_ DirectX::XMFLOAT3 center,
        _In_ DirectX::XMFLOAT3 startPosition,
        _In_ DirectX::XMFLOAT3 planeNormal,
        _In_ float duration,
        _In_ bool continuous,
        _In_ bool clockwise
        );
    virtual DirectX::XMFLOAT3 Evaluate(_In_ float dt) override;

private:
    DirectX::XMFLOAT4X4 m_rotationMatrix;
    DirectX::XMFLOAT3   m_center;
    DirectX::XMFLOAT3   m_planeNormal;
    DirectX::XMFLOAT3   m_startPosition;
    float               m_radius;
    bool                m_clockwise;
};

//----------------------------------------------------------------------


text:
where am i?

Previously, this site allowed Foursquare users to create and share a heat maps of their check-ins. It is no longer operational, but existing users can still log in with Google to see their old maps and delete their data.

  {% if user %}

  {% else %}

  {% endif %}

foursquare says:

"We're all about helping you find new ways to explore the city. We'll help you meet up with your friends and let you earn points and unlock badges for discovering new places, doing new things and meeting new people."

a heat map? huh?

A heat map is a way to visualize location data using color on a map. Denser concentrations of color indicate more Foursquare check-ins at a venue at that particular location.


text:
[![Build Status](https://travis-ci.org/arman000/marty.svg)](https://travis-ci.org/arman000/marty)
# Marty

Marty is a framework for viewing and reporting on versioned data.
Marty provides its own scripting environment.  Scripts can also be
verioned.  RESTful APIs are provided for accessing and executing
vesioned scripts.

Marty also provides user authentication and session support.
Currently, only LDAP-based authentication is supported.  There's also
support for role-based authorization.

# Rake tasks

The Marty framework provides several rake tasks to manage its database tables
and delorean scripts.

To create the correct migrations for a Marty-based application (see below for
getting the internal dummy application to work):

```bash
rake marty:install:migrations
```

The Marty database needs to be seeded with specific configuration
information. Before running your Marty application for the first time you will
need to run:

```bash
rake marty:seed
```

If you are using Delorean scripts in your application you can load them
with a rake task. By default these scripts will be picked up from
`app/delorean_scripts`. To load scripts:

```bash
rake marty:load_scripts
```

You can override the default directory by setting the `LOAD_DIR` environment
variable:

```bash
LOAD_DIR=<delorean script directory> marty:load_scripts
```

To delete scripts:

``` bash
rake marty:delete_scripts
```

# Scheduled Job

To use scheduled background jobs, add to `config/application.rb`:

```bash
config.active_job.queue_adapter = :delayed_job
```

## Using Monit to keep background jobs alive

To have monit keep track of background jobs run a bash script to configure
monit after deployment. An example script is provided in `.application-scripts`

## Marty SqlServers

Marty comes with support for using the ActiveRecord SQL Server adapter. To use
this functionality you will need:

- A `config/sql_servers.yml` file that specifies your endpoint configurations,
similar to `config/database.yml`
- Create an initializer that:
  - requires the needed files with `require 'marty/sql_servers'`
  - connects on startup with `Marty::SqlServers.generate_database_connections!`

*note* The ActiveRecord SQL Server adapter will escape queries and stored
procedure variables by default.

*note* The ActiveRecord SQL Server adapter enforces that all XML is sent
as UTF-16 Little Endian. You will want to remove the instructions on XML or
ensure that they are UTF-16 LE.

# Dummy Application & Testing

Make sure that extjs is installed (or symbolically linked) in the
dummy app at spec/dummy/public.

Docker doesn't support symlinks, so in order to run it in Docker you will have to copy extjs files.

```bash
cp -r PATH/TO/YOUR/EXTJS/FILES spec/dummy/public/extjs
```

You can run it with Docker:

```bash
make app-initialise-docker
make app-start
```

To run tests:

```bash
make app-bash
HEADLESS=true rspec
```

You can also use docker for running Postgres and Redis only:

```bash
cp spec/dummy/config/database.yml.db_in_docker.example spec/dummy/config/database.yml

make db-start
make db-stop
```

Postgres container would listen to 3030 port

To run without Docker:

Marty currently only runs with PostgreSQL. To be able to run the tests
you will first need to create a `database.yml` file in `spec/dummy/config`.
You can use the example file by doing:

```bash
cp spec/dummy/config/database.yml.example spec/dummy/config/database.yml
```

To initialize the dummy application for a demo run:

```bash
bundle install
bundle exec rake db:create db:migrate db:seed app:marty:load_scripts
cd spec/dummy
bundle exec rails s
```

Or, to run the application with the job workers running:

```bash
bundle install
bundle exec rake db:create db:migrate db:seed app:marty:load_scripts
cd spec/dummy
gem install foreman
foreman start
```

The Marty dummy app should now be accessible in your browser:
`localhost:3000`

You can log in using `marty` as both user and password.

To create the test database in prepartion to run your tests:

```bash
RAILS_ENV=test bundle exec rake db:create
```

Then to run the tests:

```bash
bundle exec rspec
```
## Test Isolation Support

To make it easier to run tests in CI pipelines, Marty comes with a functionality
that can make recordings of external calls which can be replayed during tests.

To use this `RequestRecording` functionality you will need to do the following:

- Include `gem 'vcr'` and `gem 'webmock'` in your gemfile
- Require the desired files in your RSpec configuration
  - `Marty::Gem.require_file!('spec/support/request_recording')` for HTTP requests
  - `Marty::Gem.require_file!('spec/support/request_recording/sql_server')` for SQL Server requests
- When running a test that connects to an external service, first run the test
  in an environment with connectivity and enable "Recording Mode" by setting
  the environment variable `MARTY_RSPEC_RECORD=true`
- Should you need to regenerate a test recording, the same environment variable
  can be used to update test recordings.

# History & Status

Marty was originally part of a much larger project internal to
PennyMac.  We have split Marty from its original home with the goal of
making it generally available as a platform for working with versioned
data and scripts. However, some rspec and cucumber tests are still in
the parent and have yet to be ported. Also, documentation is sorely
lacking. Hopefully, this will be rectified soon.

# WIP Documentation

## Reports in Delorean

Reports are the interface inside marty for users to submit data to processes
as well as export data. To create a report you will need to create a Delorean
script with the following conditions:

- The script name must end in _report, e.g. example_report.dl
- In a node inside the above script, define the following:
  - title: The display title for the report in the UI
  - form: A list of fields that will be mapped to any paramters in your node.
  - result: This is the value returned after running the report
  - optional
    - roles: provide a list of roles that have access to execute the report.
    - format: provide the format for the report result. This will default to json.

An exmaple node would be, which would belong in `example_report.dl`
```ruby
ExmapleExtract:
    title   = "My Example Report"
    roles   = ['admin', 'user_manager']
    raw     = # some logic to do things goes here
    result  = Marty::Helper.to_csv(raw)
    form    = []
    format  = "csv"
```


text:
.class public Landroid/support/v7/widget/CardView;
.super Landroid/widget/FrameLayout;
.source "CardView.java"

# interfaces
.implements Landroid/support/v7/widget/CardViewDelegate;

# static fields
.field private static final IMPL:Landroid/support/v7/widget/CardViewImpl;

# instance fields
.field private mCompatPadding:Z

.field private final mContentPadding:Landroid/graphics/Rect;

.field private mPreventCornerOverlap:Z

.field private final mShadowBounds:Landroid/graphics/Rect;

# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    .line 75
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x15

    if-lt v0, v1, :cond_0

    .line 76
    new-instance v0, Landroid/support/v7/widget/CardViewApi21;

    invoke-direct {v0}, Landroid/support/v7/widget/CardViewApi21;-><init>()V

    sput-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    .line 82
    :goto_0
    sget-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v0}, Landroid/support/v7/widget/CardViewImpl;->initStatic()V

    .line 83
    return-void

    .line 77
    :cond_0
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x11

    if-lt v0, v1, :cond_1

    .line 78
    new-instance v0, Landroid/support/v7/widget/CardViewJellybeanMr1;

    invoke-direct {v0}, Landroid/support/v7/widget/CardViewJellybeanMr1;-><init>()V

    sput-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    goto :goto_0

    .line 80
    :cond_1
    new-instance v0, Landroid/support/v7/widget/CardViewEclairMr1;

    invoke-direct {v0}, Landroid/support/v7/widget/CardViewEclairMr1;-><init>()V

    sput-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    goto :goto_0
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 2
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 95
    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 89
    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    iput-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    .line 91
    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    iput-object v0, p0, Landroid/support/v7/widget/CardView;->mShadowBounds:Landroid/graphics/Rect;

    .line 96
    const/4 v0, 0x0

    const/4 v1, 0x0

    invoke-direct {p0, p1, v0, v1}, Landroid/support/v7/widget/CardView;->initialize(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 97
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;

    .prologue
    .line 100
    invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 89
    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    iput-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    .line 91
    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    iput-object v0, p0, Landroid/support/v7/widget/CardView;->mShadowBounds:Landroid/graphics/Rect;

    .line 101
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Landroid/support/v7/widget/CardView;->initialize(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 102
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;
    .param p3, "defStyleAttr"    # I

    .prologue
    .line 105
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 89
    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    iput-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    .line 91
    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    iput-object v0, p0, Landroid/support/v7/widget/CardView;->mShadowBounds:Landroid/graphics/Rect;

    .line 106
    invoke-direct {p0, p1, p2, p3}, Landroid/support/v7/widget/CardView;->initialize(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 107
    return-void
.end method

.method private initialize(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 10
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;
    .param p3, "defStyleAttr"    # I

    .prologue
    const/4 v9, 0x0

    const/4 v2, 0x0

    .line 203
    sget-object v0, Landroid/support/v7/cardview/R$styleable;->CardView:[I

    sget v1, Landroid/support/v7/cardview/R$style;->CardView_Light:I

    invoke-virtual {p1, p2, v0, p3, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;

    move-result-object v7

    .line 205
    .local v7, "a":Landroid/content/res/TypedArray;
    sget v0, Landroid/support/v7/cardview/R$styleable;->CardView_cardBackgroundColor:I

    invoke-virtual {v7, v0, v9}, Landroid/content/res/TypedArray;->getColor(II)I

    move-result v3

    .line 206
    .local v3, "backgroundColor":I
    sget v0, Landroid/support/v7/cardview/R$styleable;->CardView_cardCornerRadius:I

    invoke-virtual {v7, v0, v2}, Landroid/content/res/TypedArray;->getDimension(IF)F

    move-result v4

    .line 207
    .local v4, "radius":F
    sget v0, Landroid/support/v7/cardview/R$styleable;->CardView_cardElevation:I

    invoke-virtual {v7, v0, v2}, Landroid/content/res/TypedArray;->getDimension(IF)F

    move-result v5

    .line 208
    .local v5, "elevation":F
    sget v0, Landroid/support/v7/cardview/R$styleable;->CardView_cardMaxElevation:I

    invoke-virtual {v7, v0, v2}, Landroid/content/res/TypedArray;->getDimension(IF)F

    move-result v6

    .line 209
    .local v6, "maxElevation":F
    sget v0, Landroid/support/v7/cardview/R$styleable;->CardView_cardUseCompatPadding:I

    invoke-virtual {v7, v0, v9}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v0

    iput-boolean v0, p0, Landroid/support/v7/widget/CardView;->mCompatPadding:Z

    .line 210
    sget v0, Landroid/support/v7/cardview/R$styleable;->CardView_cardPreventCornerOverlap:I

    const/4 v1, 0x1

    invoke-virtual {v7, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v0

    iput-boolean v0, p0, Landroid/support/v7/widget/CardView;->mPreventCornerOverlap:Z

    .line 211
    sget v0, Landroid/support/v7/cardview/R$styleable;->CardView_contentPadding:I

    invoke-virtual {v7, v0, v9}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v8

    .line 212
    .local v8, "defaultPadding":I
    iget-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    sget v1, Landroid/support/v7/cardview/R$styleable;->CardView_contentPaddingLeft:I

    invoke-virtual {v7, v1, v8}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v1

    iput v1, v0, Landroid/graphics/Rect;->left:I

    .line 214
    iget-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    sget v1, Landroid/support/v7/cardview/R$styleable;->CardView_contentPaddingTop:I

    invoke-virtual {v7, v1, v8}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v1

    iput v1, v0, Landroid/graphics/Rect;->top:I

    .line 216
    iget-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    sget v1, Landroid/support/v7/cardview/R$styleable;->CardView_contentPaddingRight:I

    invoke-virtual {v7, v1, v8}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v1

    iput v1, v0, Landroid/graphics/Rect;->right:I

    .line 218
    iget-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    sget v1, Landroid/support/v7/cardview/R$styleable;->CardView_contentPaddingBottom:I

    invoke-virtual {v7, v1, v8}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v1

    iput v1, v0, Landroid/graphics/Rect;->bottom:I

    .line 220
    cmpl-float v0, v5, v6

    if-lez v0, :cond_0

    .line 221
    move v6, v5

    .line 223
    :cond_0
    invoke-virtual {v7}, Landroid/content/res/TypedArray;->recycle()V

    .line 224
    sget-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    move-object v1, p0

    move-object v2, p1

    invoke-interface/range {v0 .. v6}, Landroid/support/v7/widget/CardViewImpl;->initialize(Landroid/support/v7/widget/CardViewDelegate;Landroid/content/Context;IFFF)V

    .line 225
    return-void
.end method

# virtual methods
.method public getCardElevation()F
    .locals 1

    .prologue
    .line 316
    sget-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v0, p0}, Landroid/support/v7/widget/CardViewImpl;->getElevation(Landroid/support/v7/widget/CardViewDelegate;)F

    move-result v0

    return v0
.end method

.method public getContentPaddingBottom()I
    .locals 1

    .prologue
    .line 260
    iget-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->bottom:I

    return v0
.end method

.method public getContentPaddingLeft()I
    .locals 1

    .prologue
    .line 233
    iget-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->left:I

    return v0
.end method

.method public getContentPaddingRight()I
    .locals 1

    .prologue
    .line 242
    iget-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->right:I

    return v0
.end method

.method public getContentPaddingTop()I
    .locals 1

    .prologue
    .line 251
    iget-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->top:I

    return v0
.end method

.method public getMaxCardElevation()F
    .locals 1

    .prologue
    .line 342
    sget-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v0, p0}, Landroid/support/v7/widget/CardViewImpl;->getMaxElevation(Landroid/support/v7/widget/CardViewDelegate;)F

    move-result v0

    return v0
.end method

.method public getPreventCornerOverlap()Z
    .locals 1

    .prologue
    .line 354
    iget-boolean v0, p0, Landroid/support/v7/widget/CardView;->mPreventCornerOverlap:Z

    return v0
.end method

.method public getRadius()F
    .locals 1

    .prologue
    .line 281
    sget-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v0, p0}, Landroid/support/v7/widget/CardViewImpl;->getRadius(Landroid/support/v7/widget/CardViewDelegate;)F

    move-result v0

    return v0
.end method

.method public getUseCompatPadding()Z
    .locals 1

    .prologue
    .line 126
    iget-boolean v0, p0, Landroid/support/v7/widget/CardView;->mCompatPadding:Z

    return v0
.end method

.method protected onMeasure(II)V
    .locals 6
    .param p1, "widthMeasureSpec"    # I
    .param p2, "heightMeasureSpec"    # I

    .prologue
    .line 176
    sget-object v4, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    instance-of v4, v4, Landroid/support/v7/widget/CardViewApi21;

    if-nez v4, :cond_0

    .line 177
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v3

    .line 178
    .local v3, "widthMode":I
    sparse-switch v3, :sswitch_data_0

    .line 187
    :goto_0
    invoke-static {p2}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v0

    .line 188
    .local v0, "heightMode":I
    sparse-switch v0, :sswitch_data_1

    .line 196
    :goto_1
    invoke-super {p0, p1, p2}, Landroid/widget/FrameLayout;->onMeasure(II)V

    .line 200
    .end local v0    # "heightMode":I
    .end local v3    # "widthMode":I
    :goto_2
    return-void

    .line 181
    .restart local v3    # "widthMode":I
    :sswitch_0
    sget-object v4, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v4, p0}, Landroid/support/v7/widget/CardViewImpl;->getMinWidth(Landroid/support/v7/widget/CardViewDelegate;)F

    move-result v4

    float-to-double v4, v4

    invoke-static {v4, v5}, Ljava/lang/Math;->ceil(D)D

    move-result-wide v4

    double-to-int v2, v4

    .line 182
    .local v2, "minWidth":I
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v4

    invoke-static {v2, v4}, Ljava/lang/Math;->max(II)I

    move-result v4

    invoke-static {v4, v3}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result p1

    goto :goto_0

    .line 191
    .end local v2    # "minWidth":I
    .restart local v0    # "heightMode":I
    :sswitch_1
    sget-object v4, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v4, p0}, Landroid/support/v7/widget/CardViewImpl;->getMinHeight(Landroid/support/v7/widget/CardViewDelegate;)F

    move-result v4

    float-to-double v4, v4

    invoke-static {v4, v5}, Ljava/lang/Math;->ceil(D)D

    move-result-wide v4

    double-to-int v1, v4

    .line 192
    .local v1, "minHeight":I
    invoke-static {p2}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v4

    invoke-static {v1, v4}, Ljava/lang/Math;->max(II)I

    move-result v4

    invoke-static {v4, v0}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result p2

    goto :goto_1

    .line 198
    .end local v0    # "heightMode":I
    .end local v1    # "minHeight":I
    .end local v3    # "widthMode":I
    :cond_0
    invoke-super {p0, p1, p2}, Landroid/widget/FrameLayout;->onMeasure(II)V

    goto :goto_2

    .line 178
    :sswitch_data_0
    .sparse-switch
        -0x80000000 -> :sswitch_0
        0x40000000 -> :sswitch_0
    .end sparse-switch

    .line 188
    :sswitch_data_1
    .sparse-switch
        -0x80000000 -> :sswitch_1
        0x40000000 -> :sswitch_1
    .end sparse-switch
.end method

.method public setCardElevation(F)V
    .locals 1
    .param p1, "radius"    # F

    .prologue
    .line 305
    sget-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v0, p0, p1}, Landroid/support/v7/widget/CardViewImpl;->setElevation(Landroid/support/v7/widget/CardViewDelegate;F)V

    .line 306
    return-void
.end method

.method public setContentPadding(IIII)V
    .locals 1
    .param p1, "left"    # I
    .param p2, "top"    # I
    .param p3, "right"    # I
    .param p4, "bottom"    # I

    .prologue
    .line 170
    iget-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    invoke-virtual {v0, p1, p2, p3, p4}, Landroid/graphics/Rect;->set(IIII)V

    .line 171
    sget-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v0, p0}, Landroid/support/v7/widget/CardViewImpl;->updatePadding(Landroid/support/v7/widget/CardViewDelegate;)V

    .line 172
    return-void
.end method

.method public setMaxCardElevation(F)V
    .locals 1
    .param p1, "radius"    # F

    .prologue
    .line 331
    sget-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v0, p0, p1}, Landroid/support/v7/widget/CardViewImpl;->setMaxElevation(Landroid/support/v7/widget/CardViewDelegate;F)V

    .line 332
    return-void
.end method

.method public setPadding(IIII)V
    .locals 0
    .param p1, "left"    # I
    .param p2, "top"    # I
    .param p3, "right"    # I
    .param p4, "bottom"    # I

    .prologue
    .line 112
    return-void
.end method

.method public setPaddingRelative(IIII)V
    .locals 0
    .param p1, "start"    # I
    .param p2, "top"    # I
    .param p3, "end"    # I
    .param p4, "bottom"    # I

    .prologue
    .line 116
    return-void
.end method

.method public setPreventCornerOverlap(Z)V
    .locals 1
    .param p1, "preventCornerOverlap"    # Z

    .prologue
    .line 371
    iget-boolean v0, p0, Landroid/support/v7/widget/CardView;->mPreventCornerOverlap:Z

    if-ne p1, v0, :cond_0

    .line 376
    :goto_0
    return-void

    .line 374
    :cond_0
    iput-boolean p1, p0, Landroid/support/v7/widget/CardView;->mPreventCornerOverlap:Z

    .line 375
    sget-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v0, p0}, Landroid/support/v7/widget/CardViewImpl;->onPreventCornerOverlapChanged(Landroid/support/v7/widget/CardViewDelegate;)V

    goto :goto_0
.end method

.method public setRadius(F)V
    .locals 1
    .param p1, "radius"    # F

    .prologue
    .line 271
    sget-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v0, p0, p1}, Landroid/support/v7/widget/CardViewImpl;->setRadius(Landroid/support/v7/widget/CardViewDelegate;F)V

    .line 272
    return-void
.end method

.method public setShadowPadding(IIII)V
    .locals 4
    .param p1, "left"    # I
    .param p2, "top"    # I
    .param p3, "right"    # I
    .param p4, "bottom"    # I

    .prologue
    .line 291
    iget-object v0, p0, Landroid/support/v7/widget/CardView;->mShadowBounds:Landroid/graphics/Rect;

    invoke-virtual {v0, p1, p2, p3, p4}, Landroid/graphics/Rect;->set(IIII)V

    .line 292
    iget-object v0, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    iget v0, v0, Landroid/graphics/Rect;->left:I

    add-int/2addr v0, p1

    iget-object v1, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    iget v1, v1, Landroid/graphics/Rect;->top:I

    add-int/2addr v1, p2

    iget-object v2, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    iget v2, v2, Landroid/graphics/Rect;->right:I

    add-int/2addr v2, p3

    iget-object v3, p0, Landroid/support/v7/widget/CardView;->mContentPadding:Landroid/graphics/Rect;

    iget v3, v3, Landroid/graphics/Rect;->bottom:I

    add-int/2addr v3, p4

    invoke-super {p0, v0, v1, v2, v3}, Landroid/widget/FrameLayout;->setPadding(IIII)V

    .line 294
    return-void
.end method

.method public setUseCompatPadding(Z)V
    .locals 1
    .param p1, "useCompatPadding"    # Z

    .prologue
    .line 146
    iget-boolean v0, p0, Landroid/support/v7/widget/CardView;->mCompatPadding:Z

    if-ne v0, p1, :cond_0

    .line 151
    :goto_0
    return-void

    .line 149
    :cond_0
    iput-boolean p1, p0, Landroid/support/v7/widget/CardView;->mCompatPadding:Z

    .line 150
    sget-object v0, Landroid/support/v7/widget/CardView;->IMPL:Landroid/support/v7/widget/CardViewImpl;

    invoke-interface {v0, p0}, Landroid/support/v7/widget/CardViewImpl;->onCompatPaddingChanged(Landroid/support/v7/widget/CardViewDelegate;)V

    goto :goto_0
.end method


text:
<?php
/** @noinspection ReturnTypeCanBeDeclaredInspection */
/** @noinspection AccessModifierPresentedInspection */

namespace Czim\CmsCore\Test\Http\Controllers;

use Czim\CmsCore\Http\Controllers\DefaultController;
use Czim\CmsCore\Support\Enums\Component;
use Czim\CmsCore\Test\CmsBootTestCase;
use Illuminate\Contracts\View\Factory;
use Mockery;
use Mockery\Mock;
use Mockery\MockInterface;

class DefaultControllerTest extends CmsBootTestCase
{

    /**
     * @test
     */
    function it_returns_a_default_blank_view()
    {
        $controller = new DefaultController($this->app[Component::CORE]);

        /** @var Factory|Mock|MockInterface $viewMock */
        $viewMock = Mockery::mock(Factory::class);

        $viewMock->shouldReceive('make')->with('cms::blank.index', [], [])->andReturn('testing');

        $this->app->instance(Factory::class, $viewMock);

        static::assertEquals('testing', $controller->index());
    }

}


text:
package org.apache.arrow.vector.ipc;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.SeekableByteChannel;
import java.util.Arrays;
import java.util.List;

import org.apache.arrow.flatbuf.Footer;
import org.apache.arrow.memory.BufferAllocator;
import org.apache.arrow.vector.ipc.message.ArrowBlock;
import org.apache.arrow.vector.ipc.message.ArrowDictionaryBatch;
import org.apache.arrow.vector.ipc.message.ArrowFooter;
import org.apache.arrow.vector.ipc.message.ArrowRecordBatch;
import org.apache.arrow.vector.ipc.message.MessageSerializer;
import org.apache.arrow.vector.types.pojo.Schema;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * An implementation of {@link ArrowReader} that reads the standard arrow binary
 * file format.
 */
public class ArrowFileReader extends ArrowReader {

  private static final Logger LOGGER = LoggerFactory.getLogger(ArrowFileReader.class);

  private SeekableReadChannel in;
  private ArrowFooter footer;
  private int currentDictionaryBatch = 0;
  private int currentRecordBatch = 0;

  public ArrowFileReader(SeekableReadChannel in, BufferAllocator allocator) {
    super(allocator);
    this.in = in;
  }

  public ArrowFileReader(SeekableByteChannel in, BufferAllocator allocator) {
    this(new SeekableReadChannel(in), allocator);
  }

  @Override
  public long bytesRead() {
    return in.bytesRead();
  }

  @Override
  protected void closeReadSource() throws IOException {
    in.close();
  }

  @Override
  protected Schema readSchema() throws IOException {
    if (footer == null) {
      if (in.size() <= (ArrowMagic.MAGIC_LENGTH * 2 + 4)) {
        throw new InvalidArrowFileException("file too small: " + in.size());
      }
      ByteBuffer buffer = ByteBuffer.allocate(4 + ArrowMagic.MAGIC_LENGTH);
      long footerLengthOffset = in.size() - buffer.remaining();
      in.setPosition(footerLengthOffset);
      in.readFully(buffer);
      buffer.flip();
      byte[] array = buffer.array();
      if (!ArrowMagic.validateMagic(Arrays.copyOfRange(array, 4, array.length))) {
        throw new InvalidArrowFileException("missing Magic number " + Arrays.toString(buffer.array()));
      }
      int footerLength = MessageSerializer.bytesToInt(array);
      if (footerLength <= 0 || footerLength + ArrowMagic.MAGIC_LENGTH * 2 + 4 > in.size()) {
        throw new InvalidArrowFileException("invalid footer length: " + footerLength);
      }
      long footerOffset = footerLengthOffset - footerLength;
      LOGGER.debug("Footer starts at {}, length: {}", footerOffset, footerLength);
      ByteBuffer footerBuffer = ByteBuffer.allocate(footerLength);
      in.setPosition(footerOffset);
      in.readFully(footerBuffer);
      footerBuffer.flip();
      Footer footerFB = Footer.getRootAsFooter(footerBuffer);
      this.footer = new ArrowFooter(footerFB);
    }
    return footer.getSchema();
  }

  @Override
  public ArrowDictionaryBatch readDictionary() throws IOException {
    if (currentDictionaryBatch >= footer.getDictionaries().size()) {
      throw new IOException("Requested more dictionaries than defined in footer: " + currentDictionaryBatch);
    }
    ArrowBlock block = footer.getDictionaries().get(currentDictionaryBatch++);
    return readDictionaryBatch(in, block, allocator);
  }

  /** Returns true if a batch was read, false if no more batches. */
  @Override
  public boolean loadNextBatch() throws IOException {
    prepareLoadNextBatch();

    if (currentRecordBatch < footer.getRecordBatches().size()) {
      ArrowBlock block = footer.getRecordBatches().get(currentRecordBatch++);
      ArrowRecordBatch batch = readRecordBatch(in, block, allocator);
      loadRecordBatch(batch);
      return true;
    } else {
      return false;
    }
  }

  public List<ArrowBlock> getDictionaryBlocks() throws IOException {
    ensureInitialized();
    return footer.getDictionaries();
  }

  /**
   * Returns the {@link ArrowBlock} metadata from the file.
   */
  public List<ArrowBlock> getRecordBlocks() throws IOException {
    ensureInitialized();
    return footer.getRecordBatches();
  }

  /**
   * Loads record batch for the given block.
   */
  public boolean loadRecordBatch(ArrowBlock block) throws IOException {
    ensureInitialized();
    int blockIndex = footer.getRecordBatches().indexOf(block);
    if (blockIndex == -1) {
      throw new IllegalArgumentException("Arrow block does not exist in record batches: " + block);
    }
    currentRecordBatch = blockIndex;
    return loadNextBatch();
  }

  private ArrowDictionaryBatch readDictionaryBatch(SeekableReadChannel in,
                                                   ArrowBlock block,
                                                   BufferAllocator allocator) throws IOException {
    LOGGER.debug("DictionaryRecordBatch at {}, metadata: {}, body: {}",
        block.getOffset(), block.getMetadataLength(), block.getBodyLength());
    in.setPosition(block.getOffset());
    ArrowDictionaryBatch batch = MessageSerializer.deserializeDictionaryBatch(in, block, allocator);
    if (batch == null) {
      throw new IOException("Invalid file. No batch at offset: " + block.getOffset());
    }
    return batch;
  }

  private ArrowRecordBatch readRecordBatch(SeekableReadChannel in,
                                           ArrowBlock block,
                                           BufferAllocator allocator) throws IOException {
    LOGGER.debug("RecordBatch at {}, metadata: {}, body: {}",
        block.getOffset(), block.getMetadataLength(),
        block.getBodyLength());
    in.setPosition(block.getOffset());
    ArrowRecordBatch batch = MessageSerializer.deserializeRecordBatch(in, block, allocator);
    if (batch == null) {
      throw new IOException("Invalid file. No batch at offset: " + block.getOffset());
    }
    return batch;
  }
}


text:
(function (app) {

    'use strict'

    app.factory('pathNameService', pathNameService);

    function pathNameService() {
        var service = {};

        if (window.location.pathname != '/')
            service = { pathName: window.location.pathname + '/' };
        else
            service = { pathName: window.location.pathname };

        return service;
    }

})(angular.module('common.core'))


text:
<?xml version="1.0" encoding="UTF-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/edtTxt1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@color/app_wid_number_bgcolor"
    android:drawablePadding="3dp"
    android:drawableRight="@android:drawable/presence_offline"
    android:padding="8dp"
    android:shadowColor="#FFFFFF"
    android:shadowDy="1"
    android:shadowRadius="0.01"
    android:textColor="#000000"
    android:textSize="18sp"
    android:textStyle="bold" />


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright 2013 Phil Brown

   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.

 -->
<resources>

    <!-- Defines an AbLE Layout to be placed at this location in the layout. -->
    <declare-styleable name="AbLE">
        <!-- The path to the annotated layout class containing the view. -->
        <attr name="AbLEclass" format="string" />
        <!-- The drawable or color to show as a placeholder in the layout preview. -->
        <attr name="AbLEpreview" format="color|reference" />
    </declare-styleable>
</resources>


text:
describe('my app', function() {
  it('should redirect `index.html` to `index.html#!/countries/countries', function() {
    browser.get('index.html');
    expect(browser.getLocationAbsUrl()).toBe('/home');
  });

  describe('home', function() {

    beforeEach(function() {
      browser.get('index.html');
    });

    it('should filter the country list as a user types into the search box', function() {
      var countryList = element.all(by.repeater('country in $ctrl.countries'));
      var query = element(by.model('$ctrl.query'));

      expect(countryList.count()).toBe(11);

      query.sendKeys('vietnam');
      expect(countryList.count()).toBe(1);

      query.clear();
      query.sendKeys('Brunei');
      expect(countryList.count()).toBe(1);
      query.clear();
      query.sendKeys('Indien');
      expect(countryList.count()).toBe(0);
    });
    it('should render country specific links', function() {
      var query = element(by.model('$ctrl.query'));
      query.sendKeys('Brunei');

      element.all(by.css('.thumbDescription a')).first().click();
      expect(browser.getLocationAbsUrl()).toBe('/countries/countries/BN');
    });

  });
  describe('View: Country details', function() {

  beforeEach(function() {
    browser.get('index.html#!/countries/countries/BN');
  });

  it('should display country with title `translations.de`', function() {
    expect(element(by.binding('$ctrl.country.translations.de')).getText()).toBe('Brunei');
  });

});

});


text:
package clarifai2.api.request.input;

import clarifai2.internal.grpc.api.InputOuterClass;
import clarifai2.api.BaseClarifaiClient;
import clarifai2.api.request.ClarifaiRequest;
import clarifai2.dto.input.ClarifaiInput;
import com.google.common.util.concurrent.ListenableFuture;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

public final class AddInputsRequest extends ClarifaiRequest.Builder<List<ClarifaiInput>> {

  private static final int MAX_NUM_INPUTS = 128;

  @NotNull private final List<ClarifaiInput> inputs = new ArrayList<>();

  private boolean allowDuplicateURLs = false;

  public AddInputsRequest(@NotNull final BaseClarifaiClient helper) {
    super(helper);
  }

  @NotNull @Override protected String method() {
    return "POST";
  }

  @NotNull @Override protected String subUrl() {
    return "v2/inputs";
  }

  @NotNull public AddInputsRequest plus(@NotNull ClarifaiInput... inputs) {
    return plus(Arrays.asList(inputs));
  }

  @NotNull public AddInputsRequest plus(@NotNull Collection<ClarifaiInput> inputs) {
    if (inputs.size() > MAX_NUM_INPUTS) {
      throw new IllegalArgumentException(String.format("Can't add more than %d inputs in one request", MAX_NUM_INPUTS));
    }
    this.inputs.addAll(inputs);
    return this;
  }

  /**
   * @param allowDuplicateURLs whether the API should allow uploading inputs with URLs that are already part of other
   *                           inputs in this app.
   * @return this request builder
   */
  @NotNull public AddInputsRequest allowDuplicateURLs(boolean allowDuplicateURLs) {
    this.allowDuplicateURLs = allowDuplicateURLs;
    return this;
  }

  @NotNull @Override protected DeserializedRequest<List<ClarifaiInput>> request() {
    return new DeserializedRequest<List<ClarifaiInput>>() {

      @NotNull @Override public ListenableFuture httpRequestGrpc() {
        List<InputOuterClass.Input> inputsGrpc = new ArrayList<>();
        for (ClarifaiInput input : inputs) {
          // Because allow duplicate URL is actually a property of an input, and not this outer request, we have to
          // pass it in to the serialization method.
          inputsGrpc.add(input.serialize(allowDuplicateURLs));
        }
        return stub().postInputs(InputOuterClass.PostInputsRequest.newBuilder().addAllInputs(inputsGrpc).build());
      }

      @NotNull @Override public List<ClarifaiInput> unmarshalerGrpc(Object returnedObject) {
        InputOuterClass.MultiInputResponse inputsResponse = (InputOuterClass.MultiInputResponse) returnedObject;

        List<ClarifaiInput> result = new ArrayList<>();
        for (InputOuterClass.Input input : inputsResponse.getInputsList()) {
          result.add(ClarifaiInput.deserialize(input));
        }
        return result;
      }
    };
  }
}


text:
import requests

url = "https://maps.googleapis.com/maps/api/place/textsearch/json?query=restaurants%20in%20Sydney&key=YOUR_API_KEY"

payload={}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

# [END maps_http_places_textsearch]


text:
<?php

namespace App\Model\Dao;

require '../../vendor/autoload.php';

use App\Database\Database;
use App\Model\Entity\User;

class UserDao
{
    private $database;

    public function __construct()
    {
        $this->database = Database::connection();
    }

    public function create(User $user)
    {
        $this->database->beginTransaction();

        try {
            $query = $this->database->prepare('INSERT INTO users (name, last_name, gender, phone, description, image, email, password)
                VALUES (:name, :last_name, :gender, :phone, :description, :image, :email, :password);');

            $password = password_hash($user->password, PASSWORD_DEFAULT);

            $query->execute([':name' =>	$user->name, ':last_name' => $user->last_name,
                ':gender' => $user->gender, ':phone' => $user->phone, ':description' => $user->description,
                ':image' => $user->image ,':email' => $user->email, ':password' => $password]);

            $this->database->commit();

        } catch (\Exception $erro) {
            echo $erro->getMessage();
            $this->database->rollback();
        }
    }

    public function getById($id)
    {
        $this->database->beginTransaction();

        try {
           $sql = $this->database->prepare('SELECT name, email, id FROM users WHERE id = :id;');
           $sql->execute([':id' => $id]);
           $this->database->commit();
           $data = $sql->fetchAll(\PDO::FETCH_ASSOC);

           if (sizeof($data) > 0) {
               return new User($data[0]);
           }
           return false;

        } catch (\Exception $erro) {
            echo $erro->getMessage();
            $this->database->rollback();
        }
    }

    public function getByEmail($email)
    {
        $this->database->beginTransaction();

        try {
           $sql = $this->database->prepare('SELECT * FROM users WHERE email = :email;');
           $sql->execute([':email' => $email]);
           $this->database->commit();
           $data = $sql->fetchAll(\PDO::FETCH_ASSOC);

           if (sizeof($data) > 0) {
               return new User($data[0]);
           }
           return false;

        } catch (\Exception $erro) {
            echo $erro->getMessage();exit();
            $this->database->rollback();
        }
    }

    public function update(User $user)
    {
        $this->database->beginTransaction();

        try {
            $query = $this->database->prepare('UPDATE users SET  name = :name, last_name = :last_name, gender = :gender,
                phone = :phone, description = :description, image = :image, email = :email, confirmation_account = :confirmation_account;');

            $query->execute([':name' =>	$user->name, ':last_name' => $user->last_name,
                ':gender' => $user->gender, ':phone' => $user->phone, ':description' => $user->description,
                ':image' => $user->image ,':email' => $user->email, ':confirmation_account' => $user->confirmation_account]);

            $this->database->commit();

        } catch (\Exception $erro) {
            echo $erro->getMessage();
            $this->database->rollback();
        }
    }
}


text:
galpy.potential.LcE
======================================

.. autofunction:: galpy.potential.LcE


text:
package fr.free.nrw.commons.ui.widget;

/*
 *Created by mikel on 07/08/2017.
 */

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.AppCompatDrawableManager;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;

import fr.free.nrw.commons.R;
import fr.free.nrw.commons.utils.UiUtils;

/**
 * a text view compatible with older versions of the platform
 */
public class CompatTextView extends AppCompatTextView {

    /**
     * Constructs a new instance of CompatTextView
     *
     * @param context the view context
     */
    public CompatTextView(Context context) {
        super(context);
        init(null);
    }

    /**
     * Constructs a new instance of CompatTextView
     *
     * @param context the view context
     * @param attrs   the set of attributes for the view
     */
    public CompatTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(attrs);
    }

    /**
     * Constructs a new instance of CompatTextView
     *
     * @param context
     * @param attrs
     * @param defStyleAttr
     */
    public CompatTextView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(attrs);
    }

    /**
     * initializes the view
     *
     * @param attrs the attribute set of the view, which can be null
     */
    private void init(@Nullable AttributeSet attrs) {
        if (attrs != null) {
            Context context = getContext();
            TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CompatTextView);

            // Obtain DrawableManager used to pull Drawables safely, and check if we're in RTL
            AppCompatDrawableManager dm = AppCompatDrawableManager.get();
            boolean rtl = ViewCompat.getLayoutDirection(this) == ViewCompat.LAYOUT_DIRECTION_RTL;

            // Grab the compat drawable padding from the XML
            float drawablePadding = a.getDimension(R.styleable.CompatTextView_drawablePadding, 0);

            // Grab the compat drawable resources from the XML
            int startDrawableRes = a.getResourceId(R.styleable.CompatTextView_drawableStart, 0);
            int topDrawableRes = a.getResourceId(R.styleable.CompatTextView_drawableTop, 0);
            int endDrawableRes = a.getResourceId(R.styleable.CompatTextView_drawableEnd, 0);
            int bottomDrawableRes = a.getResourceId(R.styleable.CompatTextView_drawableBottom, 0);

            // Load the used drawables, fall back to whatever was set in an "android:"
            Drawable[] currentDrawables = getCompoundDrawables();
            Drawable left = startDrawableRes != 0
                    ? dm.getDrawable(context, startDrawableRes) : currentDrawables[0];
            Drawable right = endDrawableRes != 0
                    ? dm.getDrawable(context, endDrawableRes) : currentDrawables[1];
            Drawable top = topDrawableRes != 0
                    ? dm.getDrawable(context, topDrawableRes) : currentDrawables[2];
            Drawable bottom = bottomDrawableRes != 0
                    ? dm.getDrawable(context, bottomDrawableRes) : currentDrawables[3];

            // Account for RTL and apply the compound Drawables
            Drawable start = rtl ? right : left;
            Drawable end = rtl ? left : right;
            setCompoundDrawablesWithIntrinsicBounds(start, top, end, bottom);
            setCompoundDrawablePadding((int) UiUtils.convertDpToPixel(drawablePadding, getContext()));

            a.recycle();
        }
    }
}


text:
import Ember from 'ember';
import { moduleFor, test } from 'ember-qunit';

moduleFor('controller:multi-table', 'Unit | Controller | multi table', {
  // Specify the other units that are required for this test.
  // needs: ['service:local-storage']
});

test('Basic creation test', function(assert) {
  let controller = this.subject({
    send: Ember.K,
    beforeSort: {bind: Ember.K},
    initVisibleColumns: Ember.K,
    localStorage: Ember.Object.create(),
    getCounterColumns: function () {
      return [];
    }
  });

  assert.ok(controller);
  assert.ok(controller._visibleColumnsObserver);
  assert.ok(controller.sendCountersChanged);
});


text:
package org.bson.json;

import org.bson.BsonMinKey;

class ExtendedJsonMinKeyConverter implements Converter<BsonMinKey> {
    @Override
    public void convert(final BsonMinKey value, final StrictJsonWriter writer) {
        writer.writeStartObject();
        writer.writeNumber("$minKey", "1");
        writer.writeEndObject();
    }
}


text:
<?php

namespace FairCounts\UserBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use FairCounts\MainBundle\Entity\FolderOfExpense;
use FairCounts\MainBundle\Entity\Expense;

class DefaultController extends Controller
{
    public function indexAction($name)
    {
        return $this->render('FairCountsUserBundle:Default:index.html.twig', array('name' => $name));
    }

	public function testAction($name)
	{
		$userManager = $this->get('fos_user.user_manager');

		$user = $userManager->findUserByUsername($name);

		return $this->render('FairCountsUserBundle:Default:index.html.twig', array('name' => $user->getEmail()));
	}

	public function addUserAction($username, $password, $email){
		$userManager = $this->get('fos_user.user_manager');

		$user = $userManager->createUser();
		$user->setUsername($email);
		$user->setPlainPassword($password);
		$user->setEmail($email);
		$user->setEnabled(true);

		$userManager->updateUser($user);

		$this->getDoctrine()->getEntityManager()->flush();

		return $this->render('FairCountsUserBundle:Default:index.html.twig', array('name' => $username));
	}

	public function getUserFoldersAction(){

		$session = $this->getRequest()->getSession();
		$userManager = $this->get('fos_user.user_manager');

		$username = $session->get('userLogin');

		if($username != null){
			$user = $userManager->findUserByUsername($username);

			return $this->render('FairCountsUserBundle:Default:index.html.twig', array('name' => $user->getNumberOfFolders()));
		}

		// TODO: Rediriger vers page d'erreur
		return $this->render('FairCountsUserBundle:Default:index.html.twig', array('name' => "error"));
	}

	public function createFolderAction(){
		$user = $this->container->get('security.context')->getToken()->getUser();

		if($user != null){

			$label = $this->getRequest()->query->get('folderLabel'); // Récupération du label du formulaire
			$users = $this->getRequest()->query->get('memberUsers'); // Récupération des users du formulaire

			$folder = new FolderOfExpense(); // On créer un nouvel objet folder
			$folder->setLabel($label);

			foreach( $users as $user ) { // On ajoute tous les users membres
				$folder->addUser($user);
			}

			$em = $this->getDoctrine()->getManager();
			$em->persist($folder);
			$em->flush();
		}
	}

	public function createExpenseAction(){
		$user = $this->container->get('security.context')->getToken()->getUser();

		if($user != null){

			$amount = $this->getRequest()->query->get('folderLabel'); // Récupération du montant
			$folder = $this->getRequest()->query->get('folder'); // Récupération du folder

			// TODO: Verification à faire sur le folder
			// Etre sur que l'user courant est membre du folder

			$usersWhoPaid = $this->getRequest()->query->get('usersWhoPaid');
			$usersWhoOweMoney = $this->getRequest()->query->get('usersWhoOweMoney');

			$expense = new Expense(); // On créer un nouvel objet expense
			$expense->setAmount($amount);

			foreach( $usersWhoOweMoney as $user ) {
				$expense->addUserWhoOwesMoney($user);
			}

			foreach( $usersWhoPaid as $user ) {
				$expense->addUserWhoPaid($user);
			}

			$em = $this->getDoctrine()->getManager();
			$em->persist($expense);
			$em->flush();
		}
	}
}


text:
title: Home
suppresstitle: true
---

$partial("templates/pages.html")$

[... more posts (next page)](/page2.html), [or all posts (archive)](/archive.html).


text:
/**
 * @namespace Phaser.Physics.Impact.Components
 */

module.exports = {

    Acceleration: require('./Acceleration'),
    BodyScale: require('./BodyScale'),
    BodyType: require('./BodyType'),
    Bounce: require('./Bounce'),
    CheckAgainst: require('./CheckAgainst'),
    Collides: require('./Collides'),
    Debug: require('./Debug'),
    Friction: require('./Friction'),
    Gravity: require('./Gravity'),
    Offset: require('./Offset'),
    SetGameObject: require('./SetGameObject'),
    Velocity: require('./Velocity')

};


text:
require 'active_model'

# @private
class FakeModel
  include ActiveModel::Validations

  attr_accessor :field
  attr_accessor :other_field

  validates :field, presence: true
  validates :other_field, presence: true
end

describe 'be_valid_when' do
  # Declarations

  let(:model) { FakeModel.new }

  # General specs

  context 'matcher' do
    subject { be_valid_when :field }

    it 'is expected to be of proper type' do
      expect(subject).to be_an_instance_of RSpec::BeValidWhenMatcher::BeValidWhen
    end

    it { is_expected.to respond_to :matches? }
    it { is_expected.to respond_to :does_not_match? }
    it { is_expected.to respond_to :failure_message }
    it { is_expected.to respond_to :failure_message_when_negated }
    it { is_expected.to respond_to :description }
    it { is_expected.to respond_to :diffable? }
    it { is_expected.to respond_to :supports_block_expectations? }

    it 'does not support diffing' do
      expect(subject.diffable?).to eq false
    end

    it 'does not support block expectations' do
      expect(subject.supports_block_expectations?).to eq false
    end
  end

  # Matcher arguments specs

  context 'field name argument' do
    it 'is expected to be provided' do
      expect { be_valid_when }.to raise_error ArgumentError
    end

    it 'is expected to bo a symbol' do
      expect { be_valid_when 42 }.to raise_error ArgumentError
      expect { be_valid_when :field }.not_to raise_error
    end

    context 'when is the only argument provided' do
      subject { be_valid_when :field }

      it 'should fail on #matches?' do
        expect { subject.matches?(model) }.to raise_error ArgumentError
      end

      it 'should fail on #does_not_match?' do
        expect { subject.does_not_match?(model) }.to raise_error ArgumentError
      end

      it 'should fail on #failure_message' do
        expect { subject.failure_message }.to raise_error ArgumentError
      end

      it 'should fail on #failure_message_when_negated' do
        expect { subject.failure_message_when_negated }.to raise_error ArgumentError
      end

      it 'should fail on #description' do
        expect { subject.description }.to raise_error ArgumentError
      end
    end
  end

  context 'field value argument' do
    it 'can be specified when declating matcher' do
      expect { be_valid_when :field, 'value' }.not_to raise_error
    end

    context 'if provided' do
      subject { be_valid_when :field, 'value' }

      it 'should not fail on #matches?' do
        expect { subject.matches?(model) }.not_to raise_error
      end

      it 'should not fail on #does_not_match?' do
        expect { subject.does_not_match?(model) }.not_to raise_error
      end
    end
  end

  context 'custom message argument' do
    it 'can be specified when declating matcher' do
      expect { be_valid_when :field, 'value', 'some text' }.not_to raise_error
    end

    context 'if provided' do
      subject { be_valid_when :field, 'value', 'some text' }

      it 'should not fail on #matches?' do
        expect { subject.matches?(model) }.not_to raise_error
      end

      it 'should not fail on #does_not_match?' do
        expect { subject.does_not_match?(model) }.not_to raise_error
      end
    end
  end

  it 'should not accept more arguments than field symbol, field value and custom message' do
    expect { be_valid_when :field, 'value', 'some text', 'other arg' }.to raise_error ArgumentError
  end

  # General matching interface specs

  context 'if not provided with model to match' do
    subject { be_valid_when :field, 'value' }

    it 'should fail on #matches?' do
      expect { subject.matches? }.to raise_error ArgumentError
    end

    it 'should fail on #does_not_match?' do
      expect { subject.does_not_match? }.to raise_error ArgumentError
    end

    it 'should fail on #failure_message' do
      expect { subject.failure_message }.to raise_error ArgumentError
    end

    it 'should fail on #failure_message_when_negated' do
      expect { subject.failure_message_when_negated }.to raise_error ArgumentError
    end
  end

  context 'when asserting validity of model' do
    subject { be_valid_when :field }

    context 'using #matches?' do
      it 'is setting the proper field using the provided value' do
        model.field = nil
        subject.is('value').matches?(model)
        expect(model.field).to eq 'value'
      end

      it 'returns proper result' do
        expect(subject.is('value').matches?(model)).to eq true
        expect(subject.is(nil).matches?(model)).to eq false
      end
    end

    context 'using #does_not_match?' do
      it 'is setting the proper field using the provided value' do
        model.field = nil
        subject.is('value').does_not_match?(model)
        expect(model.field).to eq 'value'
      end

      it 'returns proper result' do
        expect(subject.is('value').does_not_match?(model)).to eq false
        expect(subject.is(nil).does_not_match?(model)).to eq true
      end
    end
  end

  # Message methods specs

  context 'failure message' do
    subject { be_valid_when :field, 'value' }

    let(:message_regex) do
      /^expected #<.*> to be valid when #field is "value"$/
    end

    it 'provides subject model, field name and field value' do
      subject.matches?(model)
      expect(subject.failure_message).to match message_regex
    end

    context 'when negated' do
      let(:negated_message_regex) do
        /^expected #<.*> not to be valid when #field is "value"$/
      end

      it 'provides subject model, field name and field value' do
        subject.does_not_match?(model)
        expect(subject.failure_message_when_negated).to match negated_message_regex
      end
    end
  end

  context 'description' do
    subject { be_valid_when :field, 'value' }

    let(:description_regex) { /^be valid when #field is "value"$/ }

    it 'provides field name and field value' do
      expect(subject.description).to match description_regex
    end
  end
end


text:
<?php

namespace League\JsonGuard\Constraints;

use League\JsonGuard;
use League\JsonGuard\ErrorCode;
use League\JsonGuard\SubSchemaValidatorFactory;
use League\JsonGuard\ValidationError;

class Dependencies implements ContainerInstanceConstraint
{
    /**
     * {@inheritdoc}
     */
    public static function validate($data, $parameter, SubSchemaValidatorFactory $validatorFactory, $pointer = null)
    {
        $errors = [];
        foreach ($parameter as $property => $dependencies) {
            if (!is_object($data) || !property_exists($data, $property)) {
                continue;
            }

            if (is_array($dependencies)) {
                $errors = array_merge($errors, self::validatePropertyDependency($data, $dependencies, $pointer));
            } elseif (is_object($dependencies)) {
                $errors = array_merge(
                    $errors,
                    self::validateSchemaDependency($data, $dependencies, $validatorFactory, $pointer)
                );
            }
        }

        return $errors;
    }

    /**
     * @param object $data
     * @param array  $dependencies
     * @param string $pointer
     *
     * @return array
     */
    protected static function validatePropertyDependency($data, $dependencies, $pointer)
    {
        $errors = [];
        foreach ($dependencies as $dependency) {
            if (!in_array($dependency, array_keys(get_object_vars($data)), true)) {
                $errors[] = new ValidationError(
                    sprintf('Unmet dependency "%s"', $dependency),
                    ErrorCode::UNMET_DEPENDENCY,
                    $data,
                    $pointer,
                    ['dependency' => $dependency]
                );
            }
        }

        return $errors;
    }

    /**
     * @param object                                      $data
     * @param object                                      $dependencies
     * @param \League\JsonGuard\SubSchemaValidatorFactory $validatorFactory
     * @param string                                      $pointer
     *
     * @return array
     */
    protected static function validateSchemaDependency(
        $data,
        $dependencies,
        SubSchemaValidatorFactory $validatorFactory,
        $pointer
    ) {
        $validator = $validatorFactory->makeSubSchemaValidator(
            $data,
            $dependencies,
            $pointer
        );

        return $validator->errors();
    }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Completion.Providers;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Shared.Utilities;

namespace Microsoft.CodeAnalysis.ExternalAccess.Pythia.Api
{
    internal abstract class PythiaCompletionProviderBase : CommonCompletionProvider
    {
        public static PerLanguageOption2<bool> HideAdvancedMembersOption => CompletionOptions.HideAdvancedMembers;

        public static CompletionItem CreateCommonCompletionItem(
            string displayText,
            string displayTextSuffix,
            CompletionItemRules rules,
            PythiaGlyph? glyph,
            ImmutableArray<SymbolDisplayPart> description,
            string sortText,
            string filterText,
            bool showsWarningIcon = false,
            ImmutableDictionary<string, string>? properties = null,
            ImmutableArray<string> tags = default,
            string? inlineDescription = null)
            => CommonCompletionItem.Create(displayText, displayTextSuffix, rules, (Glyph?)glyph, description, sortText, filterText, showsWarningIcon, properties, tags, inlineDescription);

        public static CompletionItem CreateSymbolCompletionItem(
            string displayText,
            IReadOnlyList<ISymbol> symbols,
            CompletionItemRules rules,
            int contextPosition,
            string? sortText = null,
            string? insertionText = null,
            string? filterText = null,
            SupportedPlatformData? supportedPlatforms = null,
            ImmutableDictionary<string, string>? properties = null,
            ImmutableArray<string> tags = default)
            => SymbolCompletionItem.CreateWithSymbolId(displayText, displayTextSuffix: null, symbols, rules, contextPosition, sortText, insertionText,
                filterText, displayTextPrefix: null, inlineDescription: null, glyph: null, supportedPlatforms, properties, tags);

        public static ImmutableArray<SymbolDisplayPart> CreateRecommendedKeywordDisplayParts(string keyword, string toolTip)
            => RecommendedKeyword.CreateDisplayParts(keyword, toolTip);

        public static Task<CompletionDescription> GetDescriptionAsync(CompletionItem item, Document document, CancellationToken cancellationToken)
            => SymbolCompletionItem.GetDescriptionAsync(item, document, cancellationToken);

        public static CompletionDescription GetDescription(CompletionItem item)
            => CommonCompletionItem.GetDescription(item);

        public override Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default)
            => base.GetChangeAsync(document, item, commitKey, cancellationToken);
    }
}


text:
package producer

import (
	"github.com/trivago/gollum/core"
	"github.com/trivago/tgo/tio"
	"github.com/trivago/tgo/tnet"
	"github.com/trivago/tgo/tstrings"
	"net"
	"strings"
	"sync"
	"time"
)

// Proxy producer plugin
// This producer is compatible to consumer.proxy.
// Responses to messages sent to the given address are sent back to the original
// consumer of it is a compatible message source. As with consumer.proxy the
// returned messages are partitioned by common message length algorithms.
// Configuration example
//
//  - "producer.Proxy":
//    Address: ":5880"
//    ConnectionBufferSizeKB: 1024
//    TimeoutSec: 1
//    Partitioner: "delimiter"
//    Delimiter: "\n"
//    Offset: 0
//    Size: 1
//
// Address stores the identifier to connect to.
// This can either be any ip address and port like "localhost:5880" or a file
// like "unix:///var/gollum.Proxy". By default this is set to ":5880".
//
// ConnectionBufferSizeKB sets the connection buffer size in KB.
// This also defines the size of the buffer used by the message parser.
// By default this is set to 1024, i.e. 1 MB buffer.
//
// TimeoutSec defines the maximum time in seconds a client is allowed to take
// for a response. By default this is set to 1.
//
// Partitioner defines the algorithm used to read messages from the stream.
// The messages will be sent as a whole, no cropping or removal will take place.
// By default this is set to "delimiter".
// * "delimiter" separates messages by looking for a delimiter string. The
//   delimiter is included into the left hand message.
// * "ascii" reads an ASCII encoded number at a given offset until a given
//   delimiter is found.
// * "binary" reads a binary number at a given offset and size
// * "binary_le" is an alias for "binary"
// * "binary_be" is the same as "binary" but uses big endian encoding
// * "fixed" assumes fixed size messages
//
// Delimiter defines the delimiter used by the text and delimiter partitioner.
// By default this is set to "\n".
//
// Offset defines the offset used by the binary and text partitioner.
// By default this is set to 0. This setting is ignored by the fixed partitioner.
//
// Size defines the size in bytes used by the binary or fixed partitioner.
// For binary this can be set to 1,2,4 or 8. By default 4 is chosen.
// For fixed this defines the size of a message. By default 1 is chosen.
type Proxy struct {
	core.BufferedProducer `gollumdoc:"embed_type"`
	connection            net.Conn
	protocol              string
	address               string
	bufferSizeKB          int
	reader                *tio.BufferedReader
	timeout               time.Duration
}

func init() {
	core.TypeRegistry.Register(Proxy{})
}

// Configure initializes this producer with values from a plugin config.
func (prod *Proxy) Configure(conf core.PluginConfigReader) error {
	prod.BufferedProducer.Configure(conf)
	prod.SetStopCallback(prod.close)

	prod.bufferSizeKB = conf.GetInt("ConnectionBufferSizeKB", 1<<10) // 1 MB
	prod.protocol, prod.address = tnet.ParseAddress(conf.GetString("Address", ":5880"), "tcp")
	if prod.protocol == "udp" {
		conf.Errors.Pushf("Proxy does not support UDP")
	}

	prod.timeout = time.Duration(conf.GetInt("TimeoutSec", 1)) * time.Second

	delimiter := tstrings.Unescape(conf.GetString("Delimiter", "\n"))
	offset := conf.GetInt("Offset", 0)
	flags := tio.BufferedReaderFlagEverything // pass all messages as-is

	partitioner := strings.ToLower(conf.GetString("Partitioner", "delimiter"))
	switch partitioner {
	case "binary_be":
		flags |= tio.BufferedReaderFlagBigEndian
		fallthrough

	case "binary", "binary_le":
		switch conf.GetInt("Size", 4) {
		case 1:
			flags |= tio.BufferedReaderFlagMLE8
		case 2:
			flags |= tio.BufferedReaderFlagMLE16
		case 4:
			flags |= tio.BufferedReaderFlagMLE32
		case 8:
			flags |= tio.BufferedReaderFlagMLE64
		default:
			conf.Errors.Pushf("Size only supports the value 1,2,4 and 8")
		}

	case "fixed":
		flags |= tio.BufferedReaderFlagMLEFixed
		offset = conf.GetInt("Size", 1)

	case "ascii":
		flags |= tio.BufferedReaderFlagMLE

	case "delimiter":
		// Nothing to add

	default:
		conf.Errors.Pushf("Unknown partitioner: %s", partitioner)
	}

	prod.reader = tio.NewBufferedReader(prod.bufferSizeKB, flags, offset, delimiter)
	return conf.Errors.OrNil()
}

func (prod *Proxy) sendMessage(msg *core.Message) {
	// If we have not yet connected or the connection sent to the fallback: connect.
	for prod.connection == nil {
		conn, err := net.DialTimeout(prod.protocol, prod.address, prod.timeout)

		if err != nil {
			prod.Log.Error.Print("Connection error - ", err)
			<-time.After(time.Second)
		} else {
			conn.(bufferedConn).SetWriteBuffer(prod.bufferSizeKB << 10)
			prod.connection = conn
		}
	}

	// Check if and how to work with the message source
	responder, processResponse := msg.GetSource().(core.AsyncMessageSource)
	if processResponse {
		if serialResponder, isSerial := msg.GetSource().(core.SerialMessageSource); isSerial {
			defer serialResponder.ResponseDone()
		}
	}

	// Write data
	prod.connection.SetWriteDeadline(time.Now().Add(prod.timeout))
	if _, err := prod.connection.Write(msg.GetPayload()); err != nil {
		prod.Log.Error.Print("Write error: ", err)
		prod.connection.Close()
		prod.connection = nil
		return // ### return, connection closed ###
	}

	// Prepare responder function
	enqueueResponse := tio.BufferReadCallback(nil)
	if processResponse {
		enqueueResponse = func(data []byte) {
			response := core.NewMessage(prod, data, msg.GetStreamID())
			responder.EnqueueResponse(response)
		}
	}

	// Read response
	prod.connection.SetReadDeadline(time.Now().Add(prod.timeout))
	if err := prod.reader.ReadAll(prod.connection, enqueueResponse); err != nil {
		prod.Log.Error.Print("Read error: ", err)
		prod.connection.Close()
		prod.connection = nil
		return // ### return, connection closed ###
	}
}

func (prod *Proxy) close() {
	defer prod.WorkerDone()
	prod.DefaultClose()

	if prod.connection != nil {
		prod.connection.Close()
	}
}

// Produce writes to a buffer that is sent to a given Proxy.
func (prod *Proxy) Produce(workers *sync.WaitGroup) {
	prod.AddMainWorker(workers)
	prod.MessageControlLoop(prod.sendMessage)
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.qualoperadora01.app" >

    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/android"
        android:label="qualOperadora"
        android:theme="@style/AppTheme" >
        <activity android:name="com.android.qualoperadora01.app.BaseOperadora" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service
            android:name="com.android.qualoperadora01.app.ServicoTelefones"
            android:exported="false" >
            <intent-filter>
                <action android:name="SERVICE_1" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </service>

        <activity
            android:name="com.android.qualoperadora01.app.MostraAgenda"
            android:label="@string/title_activity_mostra_agenda" >
        </activity>
    </application>

</manifest>