text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="org.liballeg.example"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="10"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
    <application android:label="@string/app_name" android:debuggable="true">
        <activity android:name="org.liballeg.example.ExampleActivity"
                  android:label="@string/app_name"
                  android:launchMode="singleTask"
                  android:screenOrientation="unspecified"
                  android:configChanges="screenLayout|uiMode|orientation">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>


text:
@interface INTUWeakForwarder ()

/// Save the "real" delegates Class to return the proper signature for it when the reference is nil.
@property (nonatomic, strong) Class realDelegateClass;

/// Contains the weak reference to the delegate which is what will nil out when the delegate is dealloc'ed
@property (nonatomic, weak) id	realDelegate;

@end

@implementation INTUWeakForwarder

+(id)forwardTo:(id)theRealDelegate associatedWith:(id)object
{
	NSAssert(theRealDelegate, @"Trying to forward to a nil object");
	NSAssert(object, @"Trying associate forwarder to a nil object");

	// Create the NSProxy subclass to do the forwarding
	INTUWeakForwarder* forwarder = [INTUWeakForwarder alloc];
	forwarder.realDelegate = theRealDelegate;
	forwarder.realDelegateClass = [theRealDelegate class];

	// We need to keep this proxy object around for the lifetime of the associated object.
	// To do this we associate the proxy with the object using the address of the created proxy
	// object as the unique key here. When object goes away so will the forwarder.
	objc_setAssociatedObject(object, (__bridge const void *)(forwarder), forwarder, OBJC_ASSOCIATION_RETAIN_NONATOMIC);

	return forwarder;
}

- (void)forwardInvocation:(NSInvocation *)anInvocation
{
	// If we still have the real delegate around then forward it on, otherwise drop it.
	if ( self.realDelegate ) {
		[anInvocation setTarget:self.realDelegate];
		[anInvocation invoke];
	}
}

-(NSMethodSignature*)methodSignatureForSelector:(SEL)sel
{
	if ( self.realDelegate ) {
		// We still have the delegate so have it return the selector signature
		return [self.realDelegate methodSignatureForSelector:sel];
	}
	else {
		// Delegate has been dealloc'ed. Return the signature using the class so we don't throw an exception
		return [self.realDelegateClass instanceMethodSignatureForSelector:sel];
	}
}

@end

redpajama_set_name: RedPajamaGithub


text:
package com.allforfunmc.chocolatestuff;

public class ClientProxy extends CommonProxy {
    @Override
    public void registerRenderers() {

    }

}


text:
<!DOCTYPE html>

        <title>CSS Test: left float, circle + shape-margin in % units</title>
        <link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com">
        <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#funcdef-circle">
        <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property">
        <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-margin-property">
        <link rel="match" href="reference/shape-outside-circle-013-ref.html">
        <meta name="flags" content="ahem" />
        <meta name="assert" content="The test verifies that text wraps around a
                                     left float with a shape-outside defined as
                                     a circle with a shape-margin in percentage units.">

The test passes if there is a green square to the right of the blue line. There should be no red.

            X


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

namespace ProjectStart.Controls
{
    public class ListBoxEx : ListBox
    {
        ListBoxItemRenderer renderer;
        public ListBoxItemRenderer Renderer
        {
            get { return renderer; }
            set { renderer = value; }
        }

        public ListBoxEx()
            : base()
        {
            this.ItemHeight = 30;
        }

        protected override void OnDrawItem(DrawItemEventArgs e)
        {
            if (renderer == null)
                throw new Exception("A renderer must be set to draw listbox items.");
            if (this.Items.Count <= 0)
                return;

            e.DrawBackground();
            e.DrawFocusRectangle();

            object item = this.Items[e.Index];

            renderer.DrawItem(e.Graphics, e.Bounds, item);

            base.OnDrawItem(e);
        }
    }
}


text:
layout: post
date:	2010-07-27 17:35:00
title:  Kabini...the mammals
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
The mammals....my goodness, what a great variety of mammals we saw, given the fact that we went one day and came back the next!

One of the most beautiful sightings was that of the

BARKING DEER :

<lj-cut text="many mammals here....">

 here

is a Barking Deer fawn....

The

CHITAL

or Spotted Deer, though common and plentiful, are yet so beautiful. Here's a magnificiently antlered stag:

and a...er...doe-eyed doe:

this one seems to want to hide in the Parthenium!

If there is any sweeter sight in Nature than a mother nursing her baby, I've yet to see it! This time, too, I was rewarded by the sight of many a mother-and-child.

Here they are, mother and child...mother nuzzling and nursing her baby...

 SAMBHAR

are another deer species which we sighted in plenty. Their neck secretions can be clearly seen:

<lj-embed id="425"/>

Here's a stag:

<lj-embed id="426"/>

Another mother-and-child picture:

We saw quite a few of the

LANGUR

population, and here's one I "captured":

WILD BOAR

too, were plentiful, and here is a scene of them grazing along with the Chital:

this one's hiding her face as she hadn't put her makeup on!

the

MALABAR GIANT SQUIRREL

in the pouring rain, was still eating, the greedy thing!

In this video, you can hear the steady rain:

<lj-embed id="427"/>

There were a lot of

GAUR

also about:

<lj-embed id="428"/>

ELEPHANTS...

the majestic (to me) kings and queens of the jungle.Here's a tusker:

Since the females are generally found in groups, here's one sight of a Ladies' Club:

Another shot....

</lj-cut>

The moral of this photo? If you want to maintain that figure...be a vegetarian!

...and emphatically, do NOT keep off th grass...or mud!

<lj-embed id="429"/>


text:
class certificateauthority_encodedatearray_1 {
    constructor() {
    }

    // void Decode (string)
    Decode(string) {

    }

    // void DecodeBlob (string, EncodingType)
    DecodeBlob(string, EncodingType) {

    }

    // string Encode ()
    Encode() {

    }

    // string EncodeBlob (EncodingType)
    EncodeBlob(EncodingType) {

    }

    // int GetCount ()
    GetCount() {

    }

    // Date GetValue (int)
    GetValue(int) {

    }

    // void Reset (int)
    Reset(int) {

    }

    // void SetValue (int, Date)
    SetValue(int, Date) {

    }

}

module.exports = certificateauthority_encodedatearray_1;


text:
using std::vector;
using ReferencePoint = S2Shape::ReferencePoint;

namespace s2shapeutil {

// This is a helper function for GetReferencePoint() below.
//
// If the given vertex "vtest" is unbalanced (see definition below), sets
// "result" to a ReferencePoint indicating whther "vtest" is contained and
// returns true.  Otherwise returns false.
static bool GetReferencePointAtVertex(
    const S2Shape& shape, const S2Point& vtest, ReferencePoint* result) {
  // Let P be an unbalanced vertex.  Vertex P is defined to be inside the
  // region if the region contains a particular direction vector starting from
  // P, namely the direction S2::Ortho(P).  This can be calculated using
  // S2ContainsVertexQuery.
  S2ContainsVertexQuery contains_query(vtest);
  int n = shape.num_edges();
  for (int e = 0; e < n; ++e) {
    auto edge = shape.edge(e);
    if (edge.v0 == vtest) contains_query.AddEdge(edge.v1, 1);
    if (edge.v1 == vtest) contains_query.AddEdge(edge.v0, -1);
  }
  int contains_sign = contains_query.ContainsSign();
  if (contains_sign == 0) {
    return false;  // There are no unmatched edges incident to this vertex.
  }
  result->point = vtest;
  result->contained = contains_sign > 0;
  return true;
}

// See documentation in header file.
S2Shape::ReferencePoint GetReferencePoint(const S2Shape& shape) {
  S2_DCHECK_EQ(shape.dimension(), 2);
  if (shape.num_edges() == 0) {
    // A shape with no edges is defined to be full if and only if it
    // contains at least one chain.
    return ReferencePoint::Contained(shape.num_chains() > 0);
  }
  // Define a "matched" edge as one that can be paired with a corresponding
  // reversed edge.  Define a vertex as "balanced" if all of its edges are
  // matched. In order to determine containment, we must find an unbalanced
  // vertex.  Often every vertex is unbalanced, so we start by trying an
  // arbitrary vertex.
  auto edge = shape.edge(0);
  ReferencePoint result;
  if (GetReferencePointAtVertex(shape, edge.v0, &result)) {
    return result;
  }
  // That didn't work, so now we do some extra work to find an unbalanced
  // vertex (if any).  Essentially we gather a list of edges and a list of
  // reversed edges, and then sort them.  The first edge that appears in one
  // list but not the other is guaranteed to be unmatched.
  int n = shape.num_edges();
  vector<S2Shape::Edge> edges(n), rev_edges(n);
  for (int i = 0; i < n; ++i) {
    auto edge = shape.edge(i);
    edges[i] = edge;
    rev_edges[i] = S2Shape::Edge(edge.v1, edge.v0);
  }
  std::sort(edges.begin(), edges.end());
  std::sort(rev_edges.begin(), rev_edges.end());
  for (int i = 0; i < n; ++i) {
    if (edges[i] < rev_edges[i]) {  // edges[i] is unmatched
      S2_CHECK(GetReferencePointAtVertex(shape, edges[i].v0, &result));
      return result;
    }
    if (rev_edges[i] < edges[i]) {  // rev_edges[i] is unmatched
      S2_CHECK(GetReferencePointAtVertex(shape, rev_edges[i].v0, &result));
      return result;
    }
  }
  // All vertices are balanced, so this polygon is either empty or full except
  // for degeneracies.  By convention it is defined to be full if it contains
  // any chain with no edges.
  for (int i = 0; i < shape.num_chains(); ++i) {
    if (shape.chain(i).length == 0) return ReferencePoint::Contained(true);
  }
  return ReferencePoint::Contained(false);
}

}  // namespace s2shapeutil


text:
/*global module:false*/
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    qunit: {
      files: ['test/test.html']
    }
  });

  grunt.loadNpmTasks('grunt-contrib-qunit');

  // Default task.
  grunt.registerTask('test', ['qunit']);

};


text:
#include "core/os.h"
#include "core/stringutils.h"

// https://stackoverflow.com/questions/612097/how-can-i-get-the-list-of-files-in-a-directory-using-c-or-c
// look into using https://github.com/cxong/tinydir instead of current platform
// hack...?

#include <iostream>

////////////////////////////////////////////////////////////////////////////////
// copied from https://stackoverflow.com/a/145309/180307

#include <cstdio> /* defines FILENAME_MAX */
#include <utility>
#ifdef _MSC_VER
#include "windows.h"
#include <direct.h>
#define GET_CURRENT_DIR _getcwd

#ifdef GetCurrentDirectory
#undef GetCurrentDirectory
#endif
#else
#include <dirent.h>
#include <unistd.h>

#define GET_CURRENT_DIR getcwd
#endif

namespace euphoria::core
{
    std::string
    get_current_directory()
    {
        char current_directory[FILENAME_MAX];

        if(!GET_CURRENT_DIR(
                   static_cast<char*>(current_directory),
                   sizeof(current_directory)))
        {
            return "";
        }

        current_directory[sizeof(current_directory) - 1] = 0;

        const std::string ret = static_cast<char*>(current_directory);
        return ret;
    }

    ////////////////////////////////////////////////////////////////////////////////

#ifdef _MSC_VER

    DirectoryListing
    list_directory(const std::string& path)
    {
        const std::string search_path = StringBuilder() << path << "*.*";
        WIN32_FIND_DATA fd;
        HANDLE hFind = ::FindFirstFile(search_path.c_str(), &fd);

        if(hFind != INVALID_HANDLE_VALUE)
        {
            DirectoryListing ret;
            ret.valid = true;

            do
            {
                // read all (real) files in current folder, delete '!' read other 2
                // default folder . and ..
                if(!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
                {
                    ret.files.push_back(fd.cFileName);
                }
                else // Put folders into vector
                {
                    ret.directories.push_back(fd.cFileName);
                }
            } while(::FindNextFile(hFind, &fd));
            ::FindClose(hFind);

            return ret;
        }
        else
        {
            DirectoryListing ret;
            ret.valid = false;
            return ret;
        }
    }
#else
    DirectoryListing
    list_directory(const std::string& path)
    {
        struct dirent* ent = nullptr;

        DIR* dir = opendir(path.c_str());
        if(dir != nullptr)
        {
            DirectoryListing ret;
            ret.valid = true;

            /* print all the files and directories within directory */
            while((ent = readdir(dir)) != nullptr)
            {
                const std::string name = ent->d_name;
                if(ent->d_type == DT_REG)
                {
                    ret.files.emplace_back(name);
                }
                else if(ent->d_type == DT_DIR)
                {
                    if(name == "." || name == "..")
                    {
                    }
                    else
                    {
                        ret.directories.emplace_back(name);
                    }
                }
            }

            closedir(dir);
            return ret;
        }
        else
        {
            DirectoryListing ret;
            ret.valid = false;
            return ret;
        }
    }
#endif

    // todo(Gustav): move to stringutils
    bool
    ends_with(const std::string& str, char c)
    {
        const auto l = str.length();

        if(l == 0)
        {
            return false;
        }

        return str[l - 1] == c;
    }

    std::string
    join_path(const std::string& left, const std::string& right)
    {
        if(ends_with(left, path_separator))
        {
            return left + right;
        }
        else
        {
            return left + path_separator + right;
        }
    }

    std::string
    get_extension(const std::string& path)
    {
        return last_strings(path, '.').second;
    }

    std::string
    get_file_name_including_extension(const std::string& path)
    {
        const auto r = last_strings(path, path_separator).second;
        if(r.empty())
        {
            return r;
        }
        else
        {
            // skip leading path_separator
            return r.substr(1);
        }
    }

    std::string
    get_file_name_without_extension(const std::string& path)
    {
        return last_strings(get_file_name_including_extension(path), '.').first;
    }

}


text:
int PCI1761::entityCount = 0;
bool PCI1761::hasOpened = false;
InstantDiCtrl * PCI1761::instantDiCtrl = NULL;//Create a 'InstantDiCtrl' for DI function.
InstantDoCtrl * PCI1761::instantDoCtrl = NULL;//Create a instantDoCtrl for DO function.

byte PCI1761::lastSignalIDI_RisingEdge = 0;
byte PCI1761::lastSignalIDI_TrailingEdge = 0;

byte PCI1761::bufferForR = 0;


text:
import { CheckoutOptions } from './checkout-options';
import { AnnotatedCommit } from './annotated-commit';
import { Repository } from './repository';
import { Signature } from './signature';
import { Oid } from './oid';
import { RebaseOperation } from './rebase-operation';
import { Index } from './index';

export interface RebaseOptions {
    version: number;
    quiet: number;
    rewriteNotesRef: string;
    checkoutOptions: CheckoutOptions;
}

export class Rebase {
    static init(repo: Repository, branch: AnnotatedCommit, upstream: AnnotatedCommit, onto: AnnotatedCommit, opts?: RebaseOptions): Promise<Rebase>;
    static initOptions(opts: RebaseOptions, version: number): number;
    static open(repo: Repository, opts?: RebaseOptions): Promise<Rebase>;

    abort(): number;
    commit(author: Signature, committer: Signature, messageEncoding: string, message: string): Oid;
    finish(signature: Signature): number;
    inmemoryIndex(index: Index): number;
    next(): Promise<RebaseOperation>;
    operationByIndex(idx: number): RebaseOperation;
    operationCurrent(): number;
    operationEntrycount(): number;
}


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterField(
            model_name='takenposition',
            name='position',
            field=models.ForeignKey(related_name='taken_positions', to='candidator.Position', null=True),
        ),
    ]


text:
from dynamic_scraper.spiders.django_checker import DjangoChecker
from open_insurance.models import Insurance

class InsuranceChecker(DjangoChecker):

    name = 'insurance_checker'

    def __init__(self, *args, **kwargs):
        self._set_ref_object(Insurance, **kwargs)
        self.scraper = self.ref_object.insurance_website.scraper
        self.scrape_url = self.ref_object.url
        self.scheduler_runtime = self.ref_object.checker_runtime
        super(InsuranceChecker, self).__init__(self, *args, **kwargs)


text:
package org.qcri.rheem.core.plan.rheemplan;

import org.apache.commons.lang3.Validate;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Stream;

/**
 * Utilities to deal with {@link OperatorContainer}s.
 */
public class OperatorContainers {

    /**
     * Check whether the combination of {@link InputSlot}s and {@link OutputSlot}s describe more than one {@link Operator}.
     *
     * @param inputs  said {@link InputSlot}s
     * @param outputs said {@link OutputSlot}s
     * @return whether it is worth wrapping
     */
    public static boolean canWrap(List<InputSlot<?>> inputs, List<OutputSlot<?>> outputs) {
        // Play safe: we only propose not to wrap if we cover all Slots of an Operator.
        Operator operator = null;
        for (InputSlot<?> input : inputs) {
            if (operator == null) operator = input.getOwner();
            else if (operator != input.getOwner()) return false;
        }
        for (OutputSlot<?> output : outputs) {
            if (operator == null) operator = output.getOwner();
            else if (operator != output.getOwner()) return false;
        }
        return inputs.size() == operator.getNumInputs() && outputs.size() == operator.getNumOutputs();
    }

    /**
     * Wraps an {@link Operator} in an {@link OperatorContainer}.
     *
     * @see #wrap(List, List, OperatorContainer)
     */
    public static void wrap(Operator wrappee, OperatorContainer wrapper) {
        wrap(Arrays.asList(wrappee.getAllInputs()), Arrays.asList(wrappee.getAllOutputs()), wrapper);
    }

    /**
     * Wraps the {@link Operator}s between the given {@link InputSlot}s and {@link OutputSlot}s in the given
     * {@link OperatorContainer}.
     *
In detail, the corresponding {@link CompositeOperator}'s {@link Slot}s are created and intercept
     * the given {@link Slot}s occupants/"occupees". The wrapped {@link Operator}s are assigned the given
     * {@link OperatorContainer} as container.

     *
     * @param inputs    mentioned {@link InputSlot}s, aligned with the {@link CompositeOperator}'s {@link InputSlot}s
     * @param outputs   mentioned {@link OutputSlot}s, aligned with the {@link CompositeOperator}'s {@link OutputSlot}s
     * @param container that should wrap the subplan
     */
    public static void wrap(List<InputSlot<?>> inputs, List<OutputSlot<?>> outputs, OperatorContainer container) {
        final SlotMapping slotMapping = container.getSlotMapping();
        final Operator containerOperator = container.toOperator();

        // Copy and steal the inputSlots.
        for (int inputIndex = 0; inputIndex < inputs.size(); inputIndex++) {
            InputSlot<?> innerInput = inputs.get(inputIndex);
            final InputSlot<?> outerInput = containerOperator.getInput(inputIndex);
            outerInput.unchecked().stealOccupant(innerInput.unchecked());
            slotMapping.mapUpstream(innerInput, outerInput);
        }

        // Copy and steal the outputSlots.
        for (int outputIndex = 0; outputIndex < outputs.size(); outputIndex++) {
            OutputSlot<?> innerOutput = outputs.get(outputIndex);
            final OutputSlot<?> outerOutput = containerOperator.getOutput(outputIndex);
            outerOutput.unchecked().stealOccupiedSlots(innerOutput.unchecked());
            slotMapping.mapUpstream(outerOutput, innerOutput);
        }

        // Mark all contained Operators and detect sources and sinks.
        final Set<InputSlot<?>> inputSet = new HashSet<>(inputs);
        final Set<OutputSlot<?>> outputSet = new HashSet<>(outputs);
        PlanTraversal.fanOut()
                .followingInputsIf(input -> !inputSet.contains(input))
                .followingOutputsIf(output -> !outputSet.contains(output))
                .withCallback(operator -> {
                    operator.setContainer(container);
                    if (operator.isSink()) {
                        Validate.isTrue(containerOperator.isSink(), "Detected sink %s in non-sink %s.", operator, containerOperator);
                        Validate.isTrue(container.getSink() == null, "At least two sinks %s and %s in %s.", operator, container.getSink(), containerOperator);
                        container.setSink(operator);
                    }
                    if (operator.isSource()) {
                        Validate.isTrue(containerOperator.isSource(), "Detected source %s in non-source %s.", operator, containerOperator);
                        Validate.isTrue(container.getSource() == null, "At least two sources %s and %s in %s.", operator, container.getSource(), containerOperator);
                        container.setSource(operator);
                    }
                })
                .traverse(Stream.concat(inputSet.stream(), outputSet.stream()).map(Slot::getOwner));

        // Sanity checks.
        Validate.isTrue((container.getSource() == null) ^ containerOperator.isSource());
        Validate.isTrue((container.getSink() == null) ^ containerOperator.isSink());
    }

    /**
     * Moves the contained {@link Operator}s from a {@code source} to a {@code target} {@link OperatorContainer}.
     *
     * @param source {@link OperatorContainer} whose {@link CompositeOperator} has identical {@link Slot}s as that of the {@code target}
     * @param target {@link OperatorContainer} whose {@link CompositeOperator} has identical {@link Slot}s as that of the {@code source}
     */
    public static void move(OperatorContainer source, OperatorContainer target) {
        final CompositeOperator sourceOperator = source.toOperator();
        final CompositeOperator targetOperator = target.toOperator();
        Operators.assertEqualInputs(sourceOperator, targetOperator);
        Operators.assertEqualOutputs(sourceOperator, targetOperator);

        for (int inputIndex = 0; inputIndex < sourceOperator.getNumInputs(); inputIndex++) {
            InputSlot<Object> sourceInput = sourceOperator.getInput(inputIndex).unchecked();
            InputSlot<Object> targetInput = targetOperator.getInput(inputIndex).unchecked();
            for (InputSlot<Object> innerInput : source.followInput(sourceInput)) {
                target.getSlotMapping().mapUpstream(innerInput, targetInput);
            }
        }
        for (int outputIndex = 0; outputIndex < sourceOperator.getNumOutputs(); outputIndex++) {
            OutputSlot<Object> sourceOutput = sourceOperator.getOutput(outputIndex).unchecked();
            OutputSlot<Object> targetOutput = targetOperator.getOutput(outputIndex).unchecked();
            OutputSlot<Object> innerOutput = source.traceOutput(sourceOutput);
            target.getSlotMapping().mapUpstream(targetOutput, innerOutput);
        }

        source.getContainedOperators().forEach(o -> o.setContainer(target));
    }
}


text:
package de.jungblut.datastructure;

/**
 * Simple binary heap for integers.
 *
 * @author thomas.jungblut
 *
 */
public final class BinaryHeap {

  private static final int INITIAL_ITEMS = 10;

  static enum HeapType {
    MIN, MAX
  }

  private final boolean minHeap;

  private int[] heap;
  private int size = 0;

  /**
   * Constructs a max heap with 10 elements.
   */
  public BinaryHeap() {
    heap = new int[INITIAL_ITEMS];
    minHeap = false;
  }

  /**
   * Constructs a heap with 10 elements.
   */
  public BinaryHeap(HeapType heapType) {
    heap = new int[INITIAL_ITEMS];
    this.minHeap = HeapType.MIN == heapType;
  }

  /**
   * Constructs a heap with the given number of elements.
   */
  public BinaryHeap(int initialSize, HeapType heapType) {
    heap = new int[initialSize];
    this.minHeap = HeapType.MIN == heapType;
  }

  /**
   * Constructs a max heap with the given number of elements.
   */
  public BinaryHeap(int initialSize) {
    heap = new int[initialSize];
    minHeap = false;
  }

  /**
   * Adds an integer to the heap.
   */
  public void add(int a) {
    ensureSize(size + 1);
    heap[size] = a;
    upHeap(size);
    size++;
  }

  /**
   * Get's the head of the heap and removes it. If empty it will return
   * {@link Integer#MAX_VALUE} in case of a min heap or
   * {@link Integer#MIN_VALUE} in a max heap. So check the size before removing.
   */
  public int pop() {
    int head = heap[0];
    remove(0);

    return head;
  }

  /**
   * @return the current size of the heap
   */
  public int size() {
    return size;
  }

  // remove the index by setting it to max/min of the integer and down the heap.
  private void remove(int index) {
    heap[index] = minHeap ? Integer.MAX_VALUE : Integer.MIN_VALUE;
    downHeap();
    size--;
  }

  // check if we exceeded our size yet
  private void ensureSize(int size) {
    if (size > heap.length) {
      grow();
    }
  }

  /**
   * Ups the heap index after an inserts.
   */
  private void upHeap(int pIndex) {
    int index = pIndex;
    boolean finished = false;
    while (!finished) {
      final int parentIndex = getIndexOfParent(index);
      final boolean greater = minHeap ? heap[index] < heap[parentIndex]
          : heap[index] > heap[parentIndex];
      if (greater) {
        ArrayUtils.swap(heap, index, parentIndex);
        index = parentIndex;
      } else {
        finished = true;
      }
      if (parentIndex == 0) {
        finished = true;
      }
    }
  }

  private int swapLowestWithRootAndRemove() {
    int root = heap[0];
    ArrayUtils.swap(heap, 0, size - 1);
    heap[size - 1] = minHeap ? Integer.MAX_VALUE : Integer.MIN_VALUE;
    size--;
    downHeap();
    return root;
  }

  private void grow() {
    // we are growing with factor 2
    int[] temp = new int[heap.length * 2];
    System.arraycopy(heap, 0, temp, 0, heap.length);
    heap = temp;
  }

  private void downHeap() {
    int index = 0;
    boolean finished = false;
    while (!finished) {
      int children = getIndexOfLeftChild(index);
      if (children > heap.length)
        break;

      if (minHeap ? heap[children] > heap[children + 1]
          : heap[children] < heap[children + 1]) {
        children++;
      }

      if (minHeap ? heap[index] > heap[children] : heap[index] < heap[children]) {
        ArrayUtils.swap(heap, index, children);
        index = children;
      } else {
        finished = true;
      }

      if (children == size) {
        finished = true;
      }
    }
  }

  private static int getIndexOfParent(int i) {
    return (int) Math.floor((i - 1) / 2);
  }

  private static int getIndexOfLeftChild(int i) {
    return 2 * i + 1;
  }

  @SuppressWarnings("unused")
  private static int getIndexOfRightChild(int i) {
    return getIndexOfLeftChild(i) + 1;
  }

  public final static class HeapSort {

    public static int[] sort(int[] arr) {
      int[] temp = new int[arr.length];
      BinaryHeap heap = new BinaryHeap();
      for (int i : arr) {
        heap.add(i);
      }

      for (int i = 0; i < arr.length; i++) {
        temp[arr.length - i - 1] = heap.swapLowestWithRootAndRemove();
      }

      return temp;
    }

  }

}


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

angular.module('flowableModeler')
  .controller('ProcessesCtrl', ['$rootScope', '$scope', '$translate', '$http', '$timeout','$location', '$modal', function ($rootScope, $scope, $translate, $http, $timeout, $location, $modal) {

      // Main page (needed for visual indicator of current page)
      $rootScope.setMainPageById('processes');
      $rootScope.formItems = undefined;

      // get latest thumbnails
      $scope.imageVersion = Date.now();

	  $scope.model = {
        filters: [
            {id: 'processes', labelKey: 'PROCESSES'}
		],

		sorts: [
		        {id: 'modifiedDesc', labelKey: 'MODIFIED-DESC'},
		        {id: 'modifiedAsc', labelKey: 'MODIFIED-ASC'},
		        {id: 'nameAsc', labelKey: 'NAME-ASC'},
		        {id: 'nameDesc', labelKey: 'NAME-DESC'}
		]
	  };

	  if ($rootScope.modelFilter) {
		  $scope.model.activeFilter = $rootScope.modelFilter.filter;
		  $scope.model.activeSort = $rootScope.modelFilter.sort;
		  $scope.model.filterText = $rootScope.modelFilter.filterText;

	  } else {
		  // By default, show first filter and use first sort
	      $scope.model.activeFilter = $scope.model.filters[0];
	      $scope.model.activeSort = $scope.model.sorts[0];
	      $rootScope.modelFilter = {
	        filter: $scope.model.activeFilter,
	        sort: $scope.model.activeSort,
	        filterText: ''
	      };
	  }

	  $scope.activateFilter = function(filter) {
		  $scope.model.activeFilter = filter;
		  $rootScope.modelFilter.filter = filter;
		  $scope.loadProcesses();
	  };

	  $scope.activateSort = function(sort) {
		  $scope.model.activeSort = sort;
		  $rootScope.modelFilter.sort = sort;
		  $scope.loadProcesses();
	  };

	  $scope.loadProcesses = function() {
		  $scope.model.loading = true;

		  var params = {
		      filter: $scope.model.activeFilter.id,
		      sort: $scope.model.activeSort.id,
		      modelType: 0
		  };

		  if ($scope.model.filterText && $scope.model.filterText != '') {
		    params.filterText = $scope.model.filterText;
		  }

		  $http({method: 'GET', url: FLOWABLE.CONFIG.contextRoot + '/app/rest/models', params: params}).
		  	success(function(data, status, headers, config) {
	    		$scope.model.processes = data;
	    		$scope.model.loading = false;
	        }).
	        error(function(data, status, headers, config) {
	           console.log('Something went wrong: ' + data);
	           $scope.model.loading = false;
	        });
	  };

	  var timeoutFilter = function() {
	      $scope.model.isFilterDelayed = true;
	      $timeout(function() {
	          $scope.model.isFilterDelayed = false;
	          if ($scope.model.isFilterUpdated) {
	              $scope.model.isFilterUpdated = false;
	              timeoutFilter();
	          } else {
	              $scope.model.filterText = $scope.model.pendingFilterText;
	              $rootScope.modelFilter.filterText = $scope.model.filterText;
	              $scope.loadProcesses();
	          }
	      }, 500);
	  };

	  $scope.filterDelayed = function() {
	      if ($scope.model.isFilterDelayed) {
	          $scope.model.isFilterUpdated = true;
	      } else {
	          timeoutFilter();
	      }
	  };

	  $scope.createProcess = function(mode) {
	    var modalInstance = _internalCreateModal({
	        template: 'views/popup/process-create.html?version=' + Date.now()
	    }, $modal, $scope);
	  };

	  $scope.importProcess = function () {
          _internalCreateModal({
              template: 'views/popup/process-import.html?version=' + Date.now()
          }, $modal, $scope);
	  };

	  $scope.showProcessDetails = function(process) {
	      if (process) {
	          $rootScope.editorHistory = [];
	          $location.path("/processes/" + process.id);
	      }
	  };

	  $scope.editProcessDetails = function(process) {
		  if (process) {
		      $rootScope.editorHistory = [];
              $location.path("/editor/" + process.id);
		  }
	  };

	  // Finally, load initial processes
	  $scope.loadProcesses();
  }]);

angular.module('flowableModeler')
.controller('CreateNewProcessModelCtrl', ['$rootScope', '$scope', '$modal', '$http', '$location',
                                          function ($rootScope, $scope, $modal, $http, $location) {

    $scope.model = {
       loading: false,
       process: {
            name: '',
            key: '',
            description: '',
           	modelType: 0
       }
    };

    if ($scope.initialModelType !== undefined) {
        $scope.model.process.modelType = $scope.initialModelType;
    }

    $scope.ok = function () {

        if (!$scope.model.process.name || $scope.model.process.name.length == 0 ||
        	!$scope.model.process.key || $scope.model.process.key.length == 0) {

            return;
        }

        $scope.model.loading = true;

        $http({method: 'POST', url: FLOWABLE.CONFIG.contextRoot + '/app/rest/models', data: $scope.model.process}).
            success(function(data) {
                $scope.$hide();

                $scope.model.loading = false;
                $rootScope.editorHistory = [];
                $location.path("/editor/" + data.id);
            }).
            error(function(data, status, headers, config) {
                $scope.model.loading = false;
                $scope.model.errorMessage = data.message;
            });
    };

    $scope.cancel = function () {
        if(!$scope.model.loading) {
            $scope.$hide();
        }
    };
}]);

angular.module('flowableModeler')
.controller('DuplicateProcessModelCtrl', ['$rootScope', '$scope', '$modal', '$http', '$location',
                                          function ($rootScope, $scope, $modal, $http, $location) {

    $scope.model = {
       loading: false,
       process: {
            name: '',
            key: '',
            description: ''
       }
    };

    if ($scope.originalModel) {
        //clone the model
        $scope.model.process.name = $scope.originalModel.process.name;
        $scope.model.process.key = $scope.originalModel.process.key;
        $scope.model.process.description = $scope.originalModel.process.description;
        $scope.model.process.id = $scope.originalModel.process.id;
    }

    $scope.ok = function () {

        if (!$scope.model.process.name || $scope.model.process.name.length == 0 ||
        	!$scope.model.process.key || $scope.model.process.key.length == 0) {

            return;
        }

        $scope.model.loading = true;

        $http({method: 'POST', url: FLOWABLE.CONFIG.contextRoot + '/app/rest/models/'+$scope.model.process.id+'/clone', data: $scope.model.process}).
            success(function(data) {
                $scope.$hide();

                $scope.model.loading = false;
                $rootScope.editorHistory = [];
                $location.path("/editor/" + data.id);
            }).
            error(function() {
                $scope.model.loading = false;
                $modal.$hide();
            });
    };

    $scope.cancel = function () {
        if(!$scope.model.loading) {
            $scope.$hide();
        }
    };
}]);

angular.module('flowableModeler')
.controller('ImportProcessModelCtrl', ['$rootScope', '$scope', '$http', 'Upload', '$location', function ($rootScope, $scope, $http, Upload, $location) {

  $scope.model = {
       loading: false
  };

  $scope.onFileSelect = function($files, isIE) {

      $scope.model.loading = true;

      for (var i = 0; i < $files.length; i++) {
          var file = $files[i];

          var url;
          if (isIE) {
              url = FLOWABLE.CONFIG.contextRoot + '/app/rest/import-process-model/text';
          } else {
              url = FLOWABLE.CONFIG.contextRoot + '/app/rest/import-process-model';
          }

          Upload.upload({
              url: url,
              method: 'POST',
              file: file
          }).progress(function(evt) {
              $scope.model.uploadProgress = parseInt(100.0 * evt.loaded / evt.total);

          }).success(function(data) {
              $scope.model.loading = false;

              $location.path("/editor/" + data.id);
              $scope.$hide();

          }).error(function(data) {

              if (data && data.message) {
                  $scope.model.errorMessage = data.message;
              }

              $scope.model.error = true;
              $scope.model.loading = false;
          });
      }
  };

  $scope.cancel = function () {
	  if(!$scope.model.loading) {
		  $scope.$hide();
	  }
  };
}]);


text:
package com.google.zxing.common;

import org.junit.Assert;
import org.junit.Test;

/**
 * @author Sean Owen
 */
public final class BitSourceTestCase extends Assert {

  @Test
  public void testSource() {
    byte[] bytes = {(byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5};
    BitSource source = new BitSource(bytes);
    assertEquals(40, source.available());
    assertEquals(0, source.readBits(1));
    assertEquals(39, source.available());
    assertEquals(0, source.readBits(6));
    assertEquals(33, source.available());
    assertEquals(1, source.readBits(1));
    assertEquals(32, source.available());
    assertEquals(2, source.readBits(8));
    assertEquals(24, source.available());
    assertEquals(12, source.readBits(10));
    assertEquals(14, source.available());
    assertEquals(16, source.readBits(8));
    assertEquals(6, source.available());
    assertEquals(5, source.readBits(6));
    assertEquals(0, source.available());
  }

}


text:
package org.springframework.boot.gradle;

import java.io.IOException;

import org.gradle.tooling.ProjectConnection;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;

import org.springframework.boot.test.rule.OutputCapture;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * Integration tests for bootRun's resource handling
 *
 * @author Andy Wilkinson
 */
public class BootRunResourceTests {

	private static final String BOOT_VERSION = Versions.getBootVersion();

	private static ProjectConnection project;

	@Rule
	public OutputCapture output = new OutputCapture();

	@BeforeClass
	public static void createProject() throws IOException {
		project = new ProjectCreator().createProject("boot-run-resources");
	}

	@Test
	public void resourcesDirectlyFromSource() {
		project.newBuild().forTasks("clean", "bootRun")
				.withArguments("-PbootVersion=" + BOOT_VERSION, "-PaddResources=true")
				.run();

		assertThat(this.output.toString()).contains("src/main/resources/test.txt");
	}

	@Test
	public void resourcesFromBuildOutput() {
		project.newBuild().forTasks("clean", "bootRun")
				.withArguments("-PbootVersion=" + BOOT_VERSION, "-PaddResources=false")
				.run();
		assertThat(this.output.toString()).contains("build/resources/main/test.txt");
	}

}


text:
Blockly.Msg.ACTUAL = "crida";
Blockly.Msg.ADD = "Afegeix";
Blockly.Msg.ADD_COMMENT = "Afegeix un comentari";
Blockly.Msg.ADD_PARAMETER = "Afegeix el paràmetre";
Blockly.Msg.CHANGE_VALUE_TITLE = "Canvia el valor:";
Blockly.Msg.CLOSE = "Tancar";
Blockly.Msg.COLLAPSE_ALL = "Col·lapsa els blocs";
Blockly.Msg.COLLAPSE_BLOCK = "Col·lapsa el bloc";
Blockly.Msg.COLOUR_BLEND_COLOUR1 = "color 1";
Blockly.Msg.COLOUR_BLEND_COLOUR2 = "color 2";
Blockly.Msg.COLOUR_BLEND_HELPURL = "http://meyerweb.com/eric/tools/color-blend/";
Blockly.Msg.COLOUR_BLEND_RATIO = "proporció";
Blockly.Msg.COLOUR_BLEND_TITLE = "barreja";
Blockly.Msg.COLOUR_BLEND_TOOLTIP = "Barreja dos colors amb la proporció donada (0.0 - 1.0).";
Blockly.Msg.COLOUR_PICKER_HELPURL = "http://ca.wikipedia.org/wiki/Color";
Blockly.Msg.COLOUR_PICKER_TOOLTIP = "Escull un color de la paleta.";
Blockly.Msg.COLOUR_RANDOM_HELPURL = "http://randomcolour.com";
Blockly.Msg.COLOUR_RANDOM_TITLE = "color aleatori";
Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "Escull un color a l'atzar.";
Blockly.Msg.COLOUR_RGB_BLUE = "blau";
Blockly.Msg.COLOUR_RGB_GREEN = "verd";
Blockly.Msg.COLOUR_RGB_HELPURL = "http://www.december.com/html/spec/colorper.html";
Blockly.Msg.COLOUR_RGB_RED = "vermell";
Blockly.Msg.COLOUR_RGB_TITLE = "color amb";
Blockly.Msg.COLOUR_RGB_TOOLTIP = "Crea un color amb la quantitat justa de vermell, verd i blau. Tots els valors han d'estar entre 0 i 100.";
Blockly.Msg.CONFIRM_DELETE_FUNCTION_MESSAGE = "Compte! Estàs segur que vols esborrar %1?";
Blockly.Msg.CONTRACT_EDITOR_HEADER = "Recepta de disseny";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://code.google.com/p/blocs/wiki/Loops#Loop_Termination_Blocs";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "surt del bucle";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "continua amb la següent iteració del bucle";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK = "Surt del bucle que el conté.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "Ignora la resta d'aquest bucle i continua amb la següent interació.";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "Avís: Aquest bloc només es pot utilitzar dins d'un bucle.";
Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://code.google.com/p/blockly/wiki/Loops#for_each";
Blockly.Msg.CONTROLS_FOREACH_INPUT_INLIST = "a la llista";
Blockly.Msg.CONTROLS_FOREACH_INPUT_INLIST_TAIL = "";
Blockly.Msg.CONTROLS_FOREACH_INPUT_ITEM = "per a cada element";
Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "Per a cada element d'una llista, defineix la variable '%1' amb l'element, i després fes algunes ordres.";
Blockly.Msg.CONTROLS_FOR_HELPURL = "https://code.google.com/p/blockly/wiki/Loops#count_with";
Blockly.Msg.CONTROLS_FOR_INPUT_FROM_TO_BY = "des de %1 fins a %2 de %3 en %3";
Blockly.Msg.CONTROLS_FOR_INPUT_WITH = "compte amb";
Blockly.Msg.CONTROLS_FOR_TOOLTIP = "Fes que la variable %1 tingui els valors del nombre inicial fins al nombre final, comptant en l'interval especificat, i fes els blocs de dintre.";
Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP = "Afegeix una condició al bloc \"si\".";
Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP = "Afegeix una condició final, que ho capta tot, al bloc \"si\".";
Blockly.Msg.CONTROLS_IF_HELPURL = "http://code.google.com/p/blockly/wiki/If_Then";
Blockly.Msg.CONTROLS_IF_IF_TOOLTIP = "Afegeix, suprimeix o reordena seccions per reconfigurar aquest bloc \"si\".";
Blockly.Msg.CONTROLS_IF_MSG_ELSE = "en cas contrari";
Blockly.Msg.CONTROLS_IF_MSG_ELSEIF = "en cas contrari, si";
Blockly.Msg.CONTROLS_IF_MSG_IF = "si";
Blockly.Msg.CONTROLS_IF_TOOLTIP_1 = "Si un valor és cert, llavors fes un bloc d'ordres.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "Si un valor és cert, llavors fes el primer bloc d'ordres. En cas contrari, fes el segon bloc d'ordres.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "Si el primer valor és cert, llavors fes el primer bloc d'ordres. En cas contrari, si el segon valor és cert, fes el segon bloc d'ordres.";
Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "Si el primer valor és cert, fes el primer bloc d'ordres. En cas contrari, si el segon valor és cert, fes el segon bloc d'ordres. Si cap dels valor són certs, fes l'últim bloc d'ordres.";
Blockly.Msg.CONTROLS_REPEAT_HELPURL = "http://en.wikipedia.org/wiki/For_loop";
Blockly.Msg.CONTROLS_REPEAT_INPUT_DO = "fer";
Blockly.Msg.CONTROLS_REPEAT_TITLE = "repeteix %1 vegades";
Blockly.Msg.CONTROLS_REPEAT_TITLE_REPEAT = "repeteix";
Blockly.Msg.CONTROLS_REPEAT_TITLE_TIMES = "vegades";
Blockly.Msg.CONTROLS_REPEAT_TOOLTIP = "Fes un bloc d'ordres moltes vegades.";
Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL = "http://code.google.com/p/bloc/wiki/Repeat";
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL = "repeteix fins que";
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "repeteix mentre";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL = "Fes un bloc d'ordres mentre un valor sigui fals.";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "Fes un bloc d'ordres mentre un valor sigui cert.";
Blockly.Msg.DEFINE_HEADER_DEFINITION = "Definició";
Blockly.Msg.DEFINE_FUNCTION_DEFINE = "Defineix";
Blockly.Msg.DEFINE_FUNCTION_FOR_EXAMPLE = "Defineix la funció de sota i torna a intentar-ho.";
Blockly.Msg.DELETE = "Elimina";
Blockly.Msg.DELETE_BLOCK = "Elimina el bloc";
Blockly.Msg.DELETE_PARAMETER = "Suprimeix el paràmetre...";
Blockly.Msg.DELETE_PARAMETER_TITLE = "Això suprimirà totes les ocurrències de paràmetre de \"%1\". Esteu segur?";
Blockly.Msg.DELETE_X_BLOCKS = "Elimina els %1 blocs";
Blockly.Msg.DISABLE_BLOCK = "Deshabilita el bloc";
Blockly.Msg.DUPLICATE_BLOCK = "Duplica";
Blockly.Msg.ENABLE_BLOCK = "Habilita el bloc";
Blockly.Msg.EXAMPLE = "Exemple";
Blockly.Msg.EXAMPLE_DESCRIPTION = "Defineix un exemple amb el comportament pevist i el real";
Blockly.Msg.EXPAND_ALL = "Expandeix els blocs";
Blockly.Msg.EXPAND_BLOCK = "Expandeix el bloc";
Blockly.Msg.EXPECTED = "resultat";
Blockly.Msg.EXTERNAL_INPUTS = "Dades d'entrada externes";
Blockly.Msg.FUNCTION_CREATE = "Crea una funció";
Blockly.Msg.FUNCTION_EDIT = "editar";
Blockly.Msg.FUNCTION_NAME_LABEL = "Anomena la funció:";
Blockly.Msg.FUNCTION_DESCRIPTION_LABEL = "Què se suposa que fa la funció?";
Blockly.Msg.FUNCTION_PARAMETERS_LABEL = "Quins paràmetres utilitza la funció?";
Blockly.Msg.FUNCTION_HEADER = "Funció";
Blockly.Msg.FUNCTIONAL_CREATE = "Bloc nou";
Blockly.Msg.FUNCTIONAL_EDIT = "editar";
Blockly.Msg.FUNCTIONAL_NAME_LABEL = "Nom";
Blockly.Msg.FUNCTIONAL_TYPE_LABEL = "Tria el tipus...";
Blockly.Msg.FUNCTIONAL_DESCRIPTION_LABEL = "Descripció";
Blockly.Msg.FUNCTIONAL_DOMAIN_LABEL = "Domini";
Blockly.Msg.FUNCTIONAL_PROCEDURE_DEFINE_TOOLTIP = "Defineix un mètode funcional";
Blockly.Msg.FUNCTIONAL_RANGE_LABEL = "Rang";
Blockly.Msg.FUNCTIONAL_VARIABLE_CREATE = "Crea una variable";
Blockly.Msg.FUNCTIONAL_VARIABLE_HEADER = "Variable";
Blockly.Msg.FUNCTIONAL_VARIABLE_TYPE = "Tipus";
Blockly.Msg.HELP = "Ajuda";
Blockly.Msg.INLINE_INPUTS = "Dades d'entrada en línia";
Blockly.Msg.KEEP = "Conservar";
Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "http://en.wikipedia.org/wiki/Linked_list#Empty_lists";
Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "crea una llista buida";
Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP = "Retorna una llista, de longitud 0, que no conté cap registre de dades";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "llista";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "Afegeix, suprimeix o reordena seccions per reconfigurar aquest bloc de llista.";
Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "crea una llista amb";
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "Afegeix un element a la llista.";
Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "Crea una llista amb qualsevol nombre d'elements.";
Blockly.Msg.LISTS_GET_INDEX_FIRST = "primer";
Blockly.Msg.LISTS_GET_INDEX_FROM_END = "# començant pel final";
Blockly.Msg.LISTS_GET_INDEX_FROM_START = "l'element #";
Blockly.Msg.LISTS_GET_INDEX_GET = "aconseguir";
Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "agafa i elimina";
Blockly.Msg.LISTS_GET_INDEX_LAST = "darrer";
Blockly.Msg.LISTS_GET_INDEX_RANDOM = "atzar";
Blockly.Msg.LISTS_GET_INDEX_REMOVE = "eliminar";
Blockly.Msg.LISTS_GET_INDEX_TAIL = "";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST = "Retorna el primer element d'una llista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_END = "Retorna l'element en la posició especificada d'una llista. #1 és l'últim element.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_START = "Retorna l'element en la posició especificada d'una llista. #1 és el primer element.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST = "Retorna l'últim element d'una llista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM = "Retorna un element aleatori d'una llista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST = "Elimina i retorna el primer element d'una llista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_END = "Elimina i retorna l'element en la posició especificada d'una llista. #1 és l'últim element.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_START = "Elimina i retorna l'element en la posició especificada d'una llista. #1 és el primer element.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST = "Elimina i retorna l'últim element d'una llista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "Elimina i retorna un element aleatori d'una llista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST = "Elimina el primer element d'una llista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_END = "Elimina l'element en la posició especificada d'una llista. #1 és l'últim element.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_START = "Elimina l'element en la posició especificada d'una llista. #1 és el primer element.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST = "Elimina l'últim element d'una llista.";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM = "Elimina un element aleatori d'una llista.";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END = "fins a # començant pel final";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START = "fins a #";
Blockly.Msg.LISTS_GET_SUBLIST_END_LAST = "fins a l'últim";
Blockly.Msg.LISTS_GET_SUBLIST_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#Getting_a_sublist";
Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST = "agafa subllista des del primer";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END = "agafa subllista des de # començant pel final";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START = "agafa subllista des de #";
Blockly.Msg.LISTS_GET_SUBLIST_TAIL = "";
Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = "Crea una còpia de la part especificada d'una llista.";
Blockly.Msg.LISTS_INDEX_OF_FIRST = "troba la primera aparició de l'element";
Blockly.Msg.LISTS_INDEX_OF_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#Getting_Items_from_a_List";
Blockly.Msg.LISTS_INDEX_OF_LAST = "troba l'última aparició de l'element";
Blockly.Msg.LISTS_INDEX_OF_TOOLTIP = "Retorna l'índex de la primera/última aparició de l'element en la llista. Retorna 0 si el text no hi apareix.";
Blockly.Msg.LISTS_INLIST = "en la llista";
Blockly.Msg.LISTS_IS_EMPTY_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#is_empty";
Blockly.Msg.LISTS_IS_EMPTY_TITLE = "%1 està buit";
Blockly.Msg.LISTS_LENGTH_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#length_of";
Blockly.Msg.LISTS_LENGTH_INPUT_LENGTH = "longitud";
Blockly.Msg.LISTS_LENGTH_TITLE = "longitud de %1";
Blockly.Msg.LISTS_LENGTH_TOOLTIP = "Retorna la quantitat d'elements d'una llista.";
Blockly.Msg.LISTS_REPEAT_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#create_list_with";
Blockly.Msg.LISTS_REPEAT_TITLE = "crea una llista amb l'element %1 repetit %2 vegades";
Blockly.Msg.LISTS_REPEAT_TOOLTIP = "Crea una llista que conté un valor repetit un nombre determinat de vegades.";
Blockly.Msg.LISTS_SET_INDEX_HELPURL = "https://code.google.com/p/blockly/wiki/Lists#in_list_..._set";
Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "com";
Blockly.Msg.LISTS_SET_INDEX_INSERT = "insereix-ho a";
Blockly.Msg.LISTS_SET_INDEX_SET = "estableix";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST = "Insereix l'element al principi d'una llista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_END = "Insereix l'element en la posició especificada d'una llista. #1 és l'últim element.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_START = "Insereix l'element en la posició especificada d'una llista. #1 és el primer element.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST = "Afegeix l'element al final d'una llista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "Insereix l'element a l'atzar en una llista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST = "Estableix el primer element d'una llista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Estableix l'element en la posició especificada d'una llista. #1 és l'últim element.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Estableix l'element en la posició especificada d'una llista. #1 és el primer element.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Estableix l'últim element d'una llista.";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Estableix un element a l'atzar en una llista.";
Blockly.Msg.LISTS_TOOLTIP = "Retorna cert si la llista està buida.";
Blockly.Msg.LOGIC_BOOLEAN_FALSE = "fals";
Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "http://code.google.com/p/blockly/wiki/True_False";
Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP = "Retorna cert o fals.";
Blockly.Msg.LOGIC_BOOLEAN_TRUE = "cert";
Blockly.Msg.LOGIC_COMPARE_HELPURL = "http://en.wikipedia.org/wiki/Inequality_(mathematics)";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ = "Retorna cert si les dues dades d'entrada són iguals.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT = "Retorna cert si la primera dada d'entrada és més gran que la segona dada d'entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = "Retorna cert si la primera dada d'entrada és més gran o igual que la segona dada d'entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT = "Retorna cert si la primera dada d'entrada és més petita que la segona dada d'entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE = "Retorna cert si la primera dada d'entrada és més petita o igual que la segona dada d'entrada.";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "Retorna cert si les dues dades d'entrada no són iguals entre si.";
Blockly.Msg.LOGIC_NEGATE_HELPURL = "http://code.google.com/p/blockly/wiki/Not";
Blockly.Msg.LOGIC_NEGATE_TITLE = "no %1";
Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "Retorna cert si l'entrada és falsa. Retorna fals si l'entrada és certa.";
Blockly.Msg.LOGIC_NULL = "nul";
Blockly.Msg.LOGIC_NULL_HELPURL = "http://en.wikipedia.org/wiki/Nullable_type";
Blockly.Msg.LOGIC_NULL_TOOLTIP = "Retorna un valor nul.";
Blockly.Msg.LOGIC_OPERATION_AND = "i";
Blockly.Msg.LOGIC_OPERATION_HELPURL = "http://code.google.com/p/blockly/wiki/And_Or";
Blockly.Msg.LOGIC_OPERATION_OR = "o";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND = "Retorna cert si les dues entrades són certes.";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR = "Retorna cert si almenys una de les entrades és certa.";
Blockly.Msg.LOGIC_TERNARY_CONDITION = "prova";
Blockly.Msg.LOGIC_TERNARY_HELPURL = "http://en.wikipedia.org/wiki/%3F:";
Blockly.Msg.LOGIC_TERNARY_IF_FALSE = "si és fals";
Blockly.Msg.LOGIC_TERNARY_IF_TRUE = "si és cert";
Blockly.Msg.LOGIC_TERNARY_TOOLTIP = "Comprova la condició en 'test'. Si la condició és certa, retorna el valor de 'si és cert'; en cas contrari, retorna el valor de 'si és fals'.";
Blockly.Msg.MATH_ADDITION_SYMBOL = "+";
Blockly.Msg.MATH_ARITHMETIC_HELPURL = "http://ca.wikipedia.org/wiki/Aritmètica";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD = "Retorna la suma dels dos nombres.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE = "Retorna la divisió de dos nombres.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS = "Retorna la resta de dos nombres.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY = "Retorna el producte de dos nombres.";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER = "Retorna el primer nombre elevat al segon nombre.";
Blockly.Msg.MATH_CHANGE_HELPURL = "http://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter";
Blockly.Msg.MATH_CHANGE_INPUT_BY = "en";
Blockly.Msg.MATH_CHANGE_TITLE_CHANGE = "canvia";
Blockly.Msg.MATH_CHANGE_TOOLTIP = "Afegeix un nombre a la variable '%1'.";
Blockly.Msg.MATH_CONSTANT_HELPURL = "http://en.wikipedia.org/wiki/Mathematical_constant";
Blockly.Msg.MATH_CONSTANT_TOOLTIP = "Retorna una de les constants més comuns: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinit).";
Blockly.Msg.MATH_CONSTRAIN_HELPURL = "http://en.wikipedia.org/wiki/Clamping_%28graphics%29";
Blockly.Msg.MATH_CONSTRAIN_TITLE = "restringeix %1 a com a mínim %2 i com a màxim %3";
Blockly.Msg.MATH_CONSTRAIN_TOOLTIP = "Restringeix un número perquè estigui entre dos límits especificats (inclosos).";
Blockly.Msg.MATH_DIVISION_SYMBOL = "÷";
Blockly.Msg.MATH_IS_DIVISIBLE_BY = "és divisible per";
Blockly.Msg.MATH_IS_EVEN = "és parell";
Blockly.Msg.MATH_IS_NEGATIVE = "és negatiu";
Blockly.Msg.MATH_IS_ODD = "és imparell";
Blockly.Msg.MATH_IS_POSITIVE = "és positiu";
Blockly.Msg.MATH_IS_PRIME = "és un nombre primer";
Blockly.Msg.MATH_IS_TOOLTIP = "Comprova si un número és parell, imparell, prim, enter, positiu, negatiu o si és divisible per un cert número. Retorna verdader o fals.";
Blockly.Msg.MATH_IS_WHOLE = "és enter";
Blockly.Msg.MATH_MODULO_HELPURL = "http://en.wikipedia.org/wiki/Modulo_operation";
Blockly.Msg.MATH_MODULO_TITLE = "residu de %1 ÷ %2";
Blockly.Msg.MATH_MODULO_TOOLTIP = "Retorna el residu de dividir entre dos números.";
Blockly.Msg.MATH_MULTIPLICATION_SYMBOL = "×";
Blockly.Msg.MATH_NUMBER_HELPURL = "http://en.wikipedia.org/wiki/Number";
Blockly.Msg.MATH_NUMBER_TOOLTIP = "Un nombre.";
Blockly.Msg.MATH_ONLIST_HELPURL = "";
Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE = "mitjana de la llista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MAX = "màxim de la llista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN = "mediana de la llista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MIN = "mínim de la llista";
Blockly.Msg.MATH_ONLIST_OPERATOR_MODE = "modes de la llista";
Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "element aleatori de la llista";
Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV = "desviació estàndard de la llista";
Blockly.Msg.MATH_ONLIST_OPERATOR_SUM = "suma de la llista";
Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE = "Retorna la mitjana (mitjana aritmètica) dels valors numèrics d'una llista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX = "Retorna el número més gran d'una llista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN = "Retorna la mediana dels números d'una llista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN = "Retorna el número més petit d'una llista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE = "Retorna una llista amb el(s) element(s) que més es repeteixen en una llista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "Retorna un element aleatori de la llista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV = "Retorna la desviació estàndard d'una llista.";
Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM = "Retorna la suma de tots els números d'una llista.";
Blockly.Msg.MATH_POWER_SYMBOL = "^";
Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "http://en.wikipedia.org/wiki/Random_number_generation";
Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "fracció aleatòria";
Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "Retorna una fracció aleatòria entre 0.0 (inclós) i 1.0 (exclós).";
Blockly.Msg.MATH_RANDOM_INT_HELPURL = "http://en.wikipedia.org/wiki/Random_number_generation";
Blockly.Msg.MATH_RANDOM_INT_TITLE = "nombre enter aleatori entre %1 i %2";
Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "Retorna un número aleatori entre dos límits especificats, inclosos.";
Blockly.Msg.MATH_ROUND_HELPURL = "http://en.wikipedia.org/wiki/Rounding";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUND = "arrodoneix";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN = "arrodoneix cap avall";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP = "arrodoneix cap amunt";
Blockly.Msg.MATH_ROUND_TOOLTIP = "Arrodoneix un nombre cap amunt o cap avall.";
Blockly.Msg.MATH_SINGLE_HELPURL = "http://en.wikipedia.org/wiki/Square_root";
Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE = "valor absolut";
Blockly.Msg.MATH_SINGLE_OP_ROOT = "arrel quadrada";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS = "Retorna el valor absolut d'un nombre.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP = "Retorna e elevat a un nombre.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LN = "Retorna el logaritme natural d'un nombre.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10 = "Retorna el logaritme en base 10 d'un nombre.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG = "Retorna la negació d'un nombre.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10 = "Retorna 10 elevat a un nombre.";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT = "Retorna l'arrel quadrada d'un nombre.";
Blockly.Msg.MATH_SUBTRACTION_SYMBOL = "-";
Blockly.Msg.MATH_TRIG_ACOS = "arccos";
Blockly.Msg.MATH_TRIG_ASIN = "arcsin";
Blockly.Msg.MATH_TRIG_ATAN = "arctan";
Blockly.Msg.MATH_TRIG_COS = "cos";
Blockly.Msg.MATH_TRIG_HELPURL = "http://en.wikipedia.org/wiki/Trigonometric_functions";
Blockly.Msg.MATH_TRIG_SIN = "sin";
Blockly.Msg.MATH_TRIG_TAN = "tan";
Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS = "Retorna l'arc cosinus d'un nombre.";
Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN = "Retorn l'arc sinus d'un nombre.";
Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "Retorna l'arc tangent d'un nombre.";
Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Retorna el cosinus d'un angle en graus (no radians).";
Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Retorna el sinus d'un angle en graus (no radians).";
Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Retorna la tangent d'un angle en graus (no radians).";
Blockly.Msg.NEW_VARIABLE = "Crea una nova variable...";
Blockly.Msg.NEW_VARIABLE_TITLE = "Nom de la nova variable:";
Blockly.Msg.ORDINAL_NUMBER_SUFFIX = "";
Blockly.Msg.PROCEDURES_BEFORE_PARAMS = "amb:";
Blockly.Msg.PROCEDURES_CALLNORETURN_CALL = "";
Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP = "Executar la funció '%1' definida per l'usuari.";
Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "Executa la funció '%1' definida per l'usuari i utilitza el resultat.";
Blockly.Msg.PROCEDURES_CREATE_DO = "Crea '%1'";
Blockly.Msg.PROCEDURES_DEFNORETURN_DO = "";
Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "fes alguna cosa";
Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE = "a";
Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP = "Crea una funció sense dades de sortida.";
Blockly.Msg.PROCEDURES_DEFRETURN_DO = "";
Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL = "http://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE = "fes alguna cosa";
Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = "a";
Blockly.Msg.PROCEDURES_DEFRETURN_RETURN = "retorna";
Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP = "Crea una funció amb resultat.";
Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Avís: Aquesta funció té paràmetres duplicats.";
Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "Destacar definició de funció";
Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "Si un valor és cert, retorna un segon valor.";
Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Avís: Aquest bloc només es pot utilitzar dins una definició de funció.";
Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "Nom de la dada d'entrada:";
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "Dades d'entrada";
Blockly.Msg.REMOVE_COMMENT = "Elimina el comentari";
Blockly.Msg.RENAME_PARAMETER = "Reanomena el paràmetre...";
Blockly.Msg.RENAME_PARAMETER_TITLE = "Reanomena tots els paràmetres \"%1\" a:";
Blockly.Msg.RENAME_VARIABLE = "Reanomena la variable...";
Blockly.Msg.RENAME_VARIABLE_TITLE = "Reanomena totes les variables '%1' a:";
Blockly.Msg.TEXT_APPEND_APPENDTEXT = "afegeix el text";
Blockly.Msg.TEXT_APPEND_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Text_modification";
Blockly.Msg.TEXT_APPEND_TO = "a";
Blockly.Msg.TEXT_APPEND_TOOLTIP = "Afegeix text a la variable '%1'.";
Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Adjusting_text_case";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "a minúscules";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE = "a Majúscules De Títol";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE = "a MAJÚSCULES";
Blockly.Msg.TEXT_CHANGECASE_TOOLTIP = "Retorna una còpia del text amb les majúscules i minúscules canviades.";
Blockly.Msg.TEXT_CHARAT_FIRST = "agafa la primera lletra";
Blockly.Msg.TEXT_CHARAT_FROM_END = "agafa la lletra # començant pel final";
Blockly.Msg.TEXT_CHARAT_FROM_START = "agafa la lletra #";
Blockly.Msg.TEXT_CHARAT_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Extracting_text";
Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT = "al text";
Blockly.Msg.TEXT_CHARAT_LAST = "agafa l'última lletra";
Blockly.Msg.TEXT_CHARAT_RANDOM = "agafa una lletra a l'atzar";
Blockly.Msg.TEXT_CHARAT_TAIL = "";
Blockly.Msg.TEXT_CHARAT_TOOLTIP = "Retorna la lletra a la posició especificada.";
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "Afegeix un element al text.";
Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "combina";
Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP = "Afegeix, suprimeix, o reordena seccions per reconfigurar aquest bloc de text.";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END = "fins a la lletra # començant pel final";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START = "fins a la lletra #";
Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST = " fins a l'última lletra";
Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL = "http://code.google.com/p/blockly/wiki/Text#Extracting_a_region_of_text";
Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT = "al text";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST = "agafa des de la primera lletra";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END = "agafa des de la lletra # començant pel final";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START = "agafa des de la lletra #";
Blockly.Msg.TEXT_GET_SUBSTRING_TAIL = "";
Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP = "Retorna una porció especificada del text.";
Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Finding_text";
Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT = "del text";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "troba la primera aparició del text";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "troba l'última aparició del text";
Blockly.Msg.TEXT_INDEXOF_TAIL = "";
Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Retorna l'índex de la primera/última aparició del primer text en el segon text. Retorna 0 si text no hi apareix.";
Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Checking_for_empty_text";
Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 està buit";
Blockly.Msg.TEXT_ISEMPTY_TOOLTIP = "Retorna cert si el text està buit.";
Blockly.Msg.TEXT_JOIN_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Text_creation";
Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH = "crea un text amb";
Blockly.Msg.TEXT_JOIN_TOOLTIP = "Crea un tros de text combinant qualsevol nombre d'elements.";
Blockly.Msg.TEXT_LENGTH_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Text_modification";
Blockly.Msg.TEXT_LENGTH_TITLE = "longitud de %1";
Blockly.Msg.TEXT_LENGTH_TOOLTIP = "Retorna el nombre de lletres (inclosos els espais en blanc) que hi ha al text especificat.";
Blockly.Msg.TEXT_PRINT_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Printing_text";
Blockly.Msg.TEXT_PRINT_TITLE = "imprimeix %1";
Blockly.Msg.TEXT_PRINT_TOOLTIP = "Imprimeix el text, nombre o un altre valor.";
Blockly.Msg.TEXT_PROMPT_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Getting_input_from_the_user";
Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER = "Demana un nombre a l'usuari.";
Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT = "Demana un text a l'usuari.";
Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER = "demana un nombre amb el missatge";
Blockly.Msg.TEXT_PROMPT_TYPE_TEXT = "demana un text amb el missatge";
Blockly.Msg.TEXT_TEXT_HELPURL = "http://en.wikipedia.org/wiki/String_(computer_science)";
Blockly.Msg.TEXT_TEXT_TOOLTIP = "Una lletra, paraula o línia de text.";
Blockly.Msg.TEXT_TRIM_HELPURL = "https://code.google.com/p/blockly/wiki/Text#Trimming_%28removing%29_spaces";
Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH = "elimina els espais al principi i al final";
Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "elimina els espais al principi";
Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "elimina els espais al final";
Blockly.Msg.TEXT_TRIM_TOOLTIP = "Retorna una còpia del text on els espais en blanc s'han eliminat en un o els dos extrems.";
Blockly.Msg.VARIABLES_DEFAULT_NAME = "element";
Blockly.Msg.VARIABLES_GET_CREATE_SET = "Crea 'estableix %1'";
Blockly.Msg.VARIABLES_GET_HELPURL = "http://code.google.com/p/blockly/wiki/Variables#Get";
Blockly.Msg.VARIABLES_GET_TAIL = "";
Blockly.Msg.VARIABLES_GET_TITLE = "";
Blockly.Msg.VARIABLES_GET_TOOLTIP = "Retorna el valor d'aquesta variable.";
Blockly.Msg.VARIABLES_SET_CREATE_GET = "Crea 'agafa %1'";
Blockly.Msg.VARIABLES_SET_HELPURL = "http://code.google.com/p/blockly/wiki/Variables#Set";
Blockly.Msg.VARIABLES_SET_TAIL = "a";
Blockly.Msg.VARIABLES_SET_TITLE = "estableix";
Blockly.Msg.VARIABLES_SET_TOOLTIP = "Estableix aquesta variable igual a la dada d'entrada.";


text:
package org.maera.plugin.util;

import org.apache.commons.lang.StringUtils;

import java.util.Comparator;

/**
 * Compares dotted version strings of varying length. Makes a best effort with
 * other delimiters and non-numeric versions.
 *

 * For dotted decimals, comparison is as you'd expect: 0.1 is before 0.2 is before
 * 1.0 is before 2.0. This works for any number of dots.
 *

 * More complicated version numbers are compared by splitting the version strings
 * into components using the {@link #DELIMITER_PATTERN} and comparing each
 * component in order. The first difference found when comparing components
 * left-to-right is returned.
 *

 * Two numeric components (containing only digits) are compared as integers. A
 * numeric component comes after any non-numeric one. Two non-numeric components
 * are ordered by {@link String#compareToIgnoreCase(String)}.
 */
public class VersionStringComparator implements Comparator<String> {
    public static final String DELIMITER_PATTERN = "[\\.,-]";
    public static final String COMPONENT_PATTERN = "[\\d\\w]+";
    public static final String VALID_VERSION_PATTERN = COMPONENT_PATTERN + "(" + DELIMITER_PATTERN + COMPONENT_PATTERN + ")*";

    public static boolean isValidVersionString(final String version) {
        return (version != null) && version.matches(VALID_VERSION_PATTERN);
    }

    /**
     * Compares two version strings. If either argument is not a String,
     * this method returns 0.
     *
     * @throws IllegalArgumentException if either argument is a String,
     * but does not match {@link #VALID_VERSION_PATTERN}.
     * @see #isValidVersionString(String)
     */
    //    public int compare(Object o1, Object o2)
    //    {
    //        if (!(o1 instanceof String)) return 0;
    //        if (!(o2 instanceof String)) return 0;
    //
    //        return compare((String) o1, (String) o2);
    //    }

    /**
     * Compares two version strings using the algorithm described above.
     *
     * @return <tt>-1</tt> if version1 is before version2, <tt>1</tt> if version2 is before
     *         version1, or <tt>0</tt> if the versions are equal.
     * @throws IllegalArgumentException if either argument does not match {@link #VALID_VERSION_PATTERN}.
     * @see #isValidVersionString(String)
     */
    public int compare(final String version1, final String version2) {
        // Get the version numbers, remove all whitespaces
        String thisVersion = "0";
        if (StringUtils.isNotEmpty(version1)) {
            thisVersion = version1.replaceAll(" ", "");
        }
        String compareVersion = "0";
        if (StringUtils.isNotEmpty(version2)) {
            compareVersion = version2.replaceAll(" ", "");
        }

        if (!thisVersion.matches(VALID_VERSION_PATTERN) || !compareVersion.matches(VALID_VERSION_PATTERN)) {
            throw new IllegalArgumentException("Version number '" + thisVersion + "' cannot be compared to '" + compareVersion + "'");
        }

        // Split the version numbers
        final String[] v1 = thisVersion.split(DELIMITER_PATTERN);
        final String[] v2 = compareVersion.split(DELIMITER_PATTERN);

        final Comparator<String> componentComparator = new VersionStringComponentComparator();

        // Compare each place, until we find a difference and then return. If empty, assume zero.
        for (int i = 0; i < (v1.length > v2.length ? v1.length : v2.length); i++) {
            final String component1 = i >= v1.length ? "0" : v1[i];
            final String component2 = i >= v2.length ? "0" : v2[i];

            if (componentComparator.compare(component1, component2) != 0) {
                return componentComparator.compare(component1, component2);
            }
        }

        return 0;
    }

    private class VersionStringComponentComparator implements Comparator<String> {
        public static final int FIRST_GREATER = 1;
        public static final int SECOND_GREATER = -1;

        //        public int compare(Object o1, Object o2)
        //        {
        //            if (!(o1 instanceof String)) return 0;
        //            if (!(o2 instanceof String)) return 0;
        //
        //            return compare((String) o1, (String) o2);
        //        }

        public int compare(final String component1, final String component2) {
            if (component1.equalsIgnoreCase(component2)) {
                return 0;
            }

            if (isInteger(component1) && isInteger(component2)) {
                // both numbers -- parse and compare
                if (Integer.parseInt(component1) > Integer.parseInt(component2)) {
                    return FIRST_GREATER;
                }
                if (Integer.parseInt(component2) > Integer.parseInt(component1)) {
                    return SECOND_GREATER;
                }
                return 0;
            }

            // 2.3-alpha < 2.3.0
            if ("0".equals(component1)) {
                return FIRST_GREATER;
            }
            if ("0".equals(component2)) {
                return SECOND_GREATER;
            }

            // 2.3a < 2.3
            if (isInteger(component1) && component2.startsWith(component1)) {
                return FIRST_GREATER;
            }
            if (isInteger(component2) && component1.startsWith(component2)) {
                return SECOND_GREATER;
            }

            // 2.3a < 2.3b
            return component1.compareToIgnoreCase(component2);
        }

        private boolean isInteger(final String string) {
            return string.matches("\\d+");
        }
    }
}


text:
package service

func (e ErrInvalidJSONFieldType) Error() string {
	return "invalid JSON field type for property " +e.Field
}

func (e ErrInvalidFieldType) Error() string {
	return "invalid field type for property " +e.Field
}


text:
//
//  BREmpiricalDistanceEstimator.m
//  BlueRangeSDK
//
// Copyright (c) 2016-2017, M-Way Solutions GmbH
// All rights reserved.
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you 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.
//

#import "BREmpiricalDistanceEstimator.h"

@implementation BREmpiricalDistanceEstimator

- /* Override */ (float) getDistanceInMetres: (float) rssi withTxPower: (float) txPower {
    if (rssi == 0) {
        return -1.0f; // if we cannot determine distance, return -1.
    }

    double ratio = rssi*1.0/txPower;
    if (ratio < 1.0) {
        return (float)(pow(ratio,10));
    } else {
        double distance =  (0.89976)*pow(ratio,7.7095) + 0.111;
        return (float)distance;
    }
}

@end


text:
//
//  XZCategory.h
//  XZCategory
//
//  Created by 徐章 on 16/4/10.
//  Copyright © 2016年 徐章. All rights reserved.
//

#ifndef XZCategory_h
#define XZCategory_h

#import "NSDate+Category.h"
#import "NSString+Category.h"
#import "NSMutableAttributedString+Category.h"

#endif /* XZCategory_h */


text:
using AutoMapper;
using Microsoft.Azure.AppService.ApiApps.Service;
using MSHealthAPI.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using TRex.Metadata;

namespace MSHealthAPI.Controllers
{

    public class MSHealthController : ApiController
    {
        public static OAuthResponse authorization;
        private AuthenticationController tokenHandler = new AuthenticationController();
        internal static TimeSpan timezoneOffset;

        //CloudIsolatedStorage storage = Runtime.FromAppSettings().IsolatedStorage;

        [Swashbuckle.Swagger.Annotations.SwaggerResponse(HttpStatusCode.Unauthorized, "You have not yet authorized.  Please go to https://{url}/authorize to authorize against Microsoft Health Service.  See the GitHub repo for details.")]
        [HttpGet, Route("api/TriggerOnDeviceSync")]
        [Trigger(TriggerType.Poll, typeof(SummaryResponse))]
        [Metadata("Trigger on Device Sync", "On a device sync, will return hourly summaries up to sync hour")]
        public async Task<HttpResponseMessage> TriggerOnDeviceSynce(string triggerState,
            [Metadata("Timezone Offset", "Timezone offset for desired return time (e.g. -7 for Pacific Daylight Time)", VisibilityType.Default)] int offset = 0)
        {
            timezoneOffset = new TimeSpan(offset, 0, 0);
            if (string.IsNullOrEmpty(triggerState))
                triggerState = DateTime.UtcNow.AddDays(-1).ToString("o");
            else
            {
                var triggerDate = DateTime.Parse(triggerState);
                triggerState = triggerDate.ToUniversalTime().ToString("o");
            }

            await tokenHandler.CheckToken();

            if (authorization == null || authorization.access_token == null)
                return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "You are not authorized. Please go to https://{url}/authorize to authorize against Microsoft Health Service.  Ensure your client ID, client Secret, and redirect are all correct.  See the GitHub repo for details.");

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", authorization.access_token);
                var profileResult = await client.GetAsync("https://api.microsofthealth.net/v1/me/Profile");

                var lastSyncedBand =
                    (DateTime)JObject.Parse((await profileResult.Content.ReadAsStringAsync()))["lastUpdateTime"];
                if (lastSyncedBand == null || lastSyncedBand < DateTime.Parse(triggerState).ToUniversalTime())
                    return Request.EventWaitPoll(null, triggerState);

                var result = await client.GetAsync(string.Format("https://api.microsofthealth.net/v1/me/Summaries/{0}?startTime={1}&endTime={2}", "Hourly", DateTime.Parse(triggerState).ToUniversalTime().ToString("o"),lastSyncedBand.ToUniversalTime().ToString("o")));
                var sumResponse = new SummaryResponse(JsonConvert.DeserializeObject<Summaries>((await result.Content.ReadAsStringAsync())), 1, lastSyncedBand);
                if (sumResponse.rows == null || sumResponse.rows.FirstOrDefault() == null)
                    return Request.EventWaitPoll(null, triggerState);

                return Request.EventTriggered(sumResponse, triggerState = sumResponse.rows.First().endTime.ToUniversalTime().ToString("o"));
            }
        }

        [Swashbuckle.Swagger.Annotations.SwaggerResponse(HttpStatusCode.Unauthorized, "You have not yet authorized.  Please go to https://{url}/authorize to authorize against Microsoft Health Service.  See the GitHub repo for details.")]
        [HttpGet, Route("api/GetHourlySummary")]
        [Trigger(TriggerType.Poll, typeof(SummaryResponse))]
        [Metadata("Get Hourly Summary")]
        public async Task<HttpResponseMessage> GetHourlySummary(string triggerState,
            [Metadata("Timezone Offset", "Timezone offset for desired return time (e.g. -7 for Pacific Daylight Time)", VisibilityType.Default)] int offset = 0,
            [Metadata("Delay", "How many hours to delay results. This is to help offset the time it takes to sync with your band.  Defaults to 1, must be >= 1.", VisibilityType.Advanced)] int delay = 1)
        {
            timezoneOffset = new TimeSpan(offset, 0, 0);
            if (string.IsNullOrEmpty(triggerState))
                triggerState = DateTime.UtcNow.AddDays(-1).ToString("o");
            else
            {
                var triggerDate = DateTime.Parse(triggerState);
                if (triggerDate.Hour == DateTime.UtcNow.Hour && triggerDate.Date == DateTime.UtcNow.Date)
                {
                    return Request.EventWaitPoll(TimeSpan.FromMinutes((60 - DateTime.UtcNow.Minute)), triggerState = triggerDate.ToUniversalTime().ToString("o"));
                }
                triggerState = triggerDate.ToUniversalTime().Add(TimeSpan.FromHours(-1 * delay)).ToString("o");
            }

            await tokenHandler.CheckToken();

            if (authorization == null || authorization.access_token == null)
                return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "You are not authorized. Please go to https://{url}/authorize to authorize against Microsoft Health Service.  See the GitHub repo for details.");

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", authorization.access_token);
                var result = await client.GetAsync(string.Format("https://api.microsofthealth.net/v1/me/Summaries/{0}?startTime={1}", "Hourly", DateTime.Parse(triggerState).ToUniversalTime().ToString("o")));
                return Request.EventTriggered( new SummaryResponse(JsonConvert.DeserializeObject<Summaries>((await result.Content.ReadAsStringAsync())), delay)  , triggerState = DateTime.UtcNow.ToString("o"));
            }
        }

        [Swashbuckle.Swagger.Annotations.SwaggerResponse(HttpStatusCode.Unauthorized, "You have not yet authorized.  Please go to https://{url}/authorize to authorize against Microsoft Health Service.  See the GitHub repo for details.")]
        [HttpGet, Route("api/TriggerOnActivity")]
        [Trigger(TriggerType.Poll, typeof(ActivityResponse))]
        [Metadata("Trigger on Activity")]
        public async Task<HttpResponseMessage> TriggerOnActivity(string triggerState,
            [Metadata("Timezone Offset", "Timezone offset for desired return time (e.g. -7 for Pacific Daylight Time)", VisibilityType.Default)] int offset = 0)
        {
            timezoneOffset = new TimeSpan(offset, 0, 0);
            if (string.IsNullOrEmpty(triggerState))
                triggerState = DateTime.UtcNow.ToString("o");
            else
            {
                triggerState = DateTime.Parse(triggerState).ToUniversalTime().ToString("o");
            }

            await tokenHandler.CheckToken();

            if (authorization == null || authorization.access_token == null)
                return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "You are not authorized. Please go to https://{url}/authorize to authorize against Microsoft Health Service.  See the GitHub repo for details.");

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", authorization.access_token);
                var result = await client.GetAsync(string.Format("https://api.microsofthealth.net/v1/me/Activities?startTime={0}", DateTime.Parse(triggerState).AddDays(-1).ToUniversalTime().ToString("o")));
                string content = await result.Content.ReadAsStringAsync();
                ActivityList resultList = JsonConvert.DeserializeObject<ActivityList>(content);
                resultList.EndTimeInclusive(DateTime.Parse(triggerState).ToUniversalTime().Add(timezoneOffset), DateTime.UtcNow.Add(timezoneOffset));
                if (resultList.NoActivities())
                    return Request.EventWaitPoll(null, triggerState);
                else
                    return Request.EventTriggered(FlattenResult(resultList), DateTime.UtcNow.ToString("o"));
            }
        }

        [Swashbuckle.Swagger.Annotations.SwaggerResponse(HttpStatusCode.OK, "MSHealth Activity Result", typeof(ActivityResponse))]
        [HttpGet, Route("api/GetActivites")]
        [Metadata("Get Activites", "Returns a set of activities and their data from Microsoft Health")]
        public async Task<HttpResponseMessage> GetActivites([Metadata("Activities After Time", "Will return all activities that ended after the time passed in.")] string activityTime,
            [Metadata("Timezone Offset", "Timezone offset for desired return time (e.g. -7 for Pacific Daylight Time)", VisibilityType.Default)] int offset = 0,
            [Required(AllowEmptyStrings = true)][Metadata("Activites Before Time", "An end-time cap into the activities returned", VisibilityType.Advanced)] string endTime = null)
        {
            timezoneOffset = new TimeSpan(offset, 0, 0);
            string startTime;
            if (string.IsNullOrEmpty(activityTime))
                startTime = DateTime.UtcNow.AddDays(-1).ToString("o");
            else
                startTime = DateTime.Parse(activityTime).ToUniversalTime().AddDays(-1).ToString("o");

            endTime = (string.IsNullOrEmpty(endTime)) ? DateTime.UtcNow.ToString("o") : DateTime.Parse(endTime).ToUniversalTime().ToString("o");

            await tokenHandler.CheckToken();

            if (authorization == null || authorization.access_token == null)
                return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "You are not authorized. Please go to https://{url}/authorize to authorize against Microsoft Health Service.  See the GitHub repo for details.");

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", authorization.access_token);
                var result = await client.GetAsync(string.Format("https://api.microsofthealth.net/v1/me/Activities?startTime={0}", DateTime.Parse(startTime).ToUniversalTime().ToString("o")));
                string content = await result.Content.ReadAsStringAsync();
                ActivityList resultList = JsonConvert.DeserializeObject<ActivityList>(content);
                resultList.EndTimeInclusive(DateTime.Parse(activityTime).ToUniversalTime(), DateTime.Parse(endTime).ToUniversalTime());
                return Request.CreateResponse<ActivityResponse>(HttpStatusCode.OK, FlattenResult(resultList));
            }

        }

        private ActivityResponse FlattenResult(ActivityList resultList)
        {

            ActivityResponse result = new ActivityResponse();
            result.runActivities = Mapper.Map<List<RunActivity>, List<RunResponse>>(resultList.runActivities);
            result.bikeActivities = Mapper.Map<List<BikeActivity>, List<BikeResponse>>(resultList.bikeActivities);
            result.freePlayActivities = Mapper.Map<List<FreePlayActivity>, List<FreePlayResponse>>(resultList.freePlayActivities);
            result.golfActivities = Mapper.Map<List<GolfActivity>, List<GolfResponse>>(resultList.golfActivities);
            result.guidedWorkoutActivities = Mapper.Map<List<GuidedWorkoutActivity>, List<GuidedWorkoutResponse>>(resultList.guidedWorkoutActivities);
            result.sleepActivities = Mapper.Map<List<SleepActivity>, List<SleepResponse>>(resultList.sleepActivities);
            return result;

        }

        ///
        /// Deprioritized for now - no big use case and don't want to expose this personal info on API that could be public by default
        ///
        //[Swashbuckle.Swagger.Annotations.SwaggerResponse(HttpStatusCode.Unauthorized, "You have not yet authorized.  Please go to https://{url}/authorize to authorize against Microsoft Health Service.  See the GitHub repo for details.")]
        //[HttpGet, Route("api/GetProfile")]
        //[Metadata("Get Profile", "Returns information about the current health user")]
        //public async Task<HttpResponseMessage> GetProfile()
        //{
        //    if (authorization == null || authorization.access_token == null)
        //        return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "You are not authorized.  Please go to https://{url}/authorize to authorize against Microsoft Health Service.  See the GitHub repo for details.");

        //    await tokenHandler.CheckToken();

        //    using (var client = new HttpClient())
        //    {
        //        client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", authorization.access_token);
        //        var result = await client.GetAsync("https://api.microsofthealth.net/v1/me/Profile");
        //        return result;
        //    }
        //}

    }
}


text:
Returns an unsorted {object} of the attributes

## Use
*For example you could use the following code:*

**Markup:**

```html
<div data-attr="foo" class="bar" />
```

**Call:**

```javascript
$('#id').attributes();
```

**Result:**

```javascript
{
	data-attr: 'foo',
	class: 'bar'
}
```

* License
    The .attributes() module is licensed under the MIT (MIT_LICENSE.txt) license.

* Copyright (c) 2011 [Alexander Guinness] (https://github.com/monolithed)


text:
from tempest.api.identity import base
from tempest.common.utils import data_utils
from tempest.test import attr

class DomainsTestJSON(base.BaseIdentityAdminTest):
    _interface = 'json'

    def _delete_domain(self, domain_id):
        # It is necessary to disable the domain before deleting,
        # or else it would result in unauthorized error
        _, body = self.v3_client.update_domain(domain_id, enabled=False)
        resp, _ = self.v3_client.delete_domain(domain_id)
        self.assertEqual(204, resp.status)

    @attr(type='smoke')
    def test_list_domains(self):
        # Test to list domains
        domain_ids = list()
        fetched_ids = list()
        for _ in range(3):
            _, domain = self.v3_client.create_domain(
                data_utils.rand_name('domain-'),
                description=data_utils.rand_name('domain-desc-'))
            # Delete the domain at the end of this method
            self.addCleanup(self._delete_domain, domain['id'])
            domain_ids.append(domain['id'])
        # List and Verify Domains
        resp, body = self.v3_client.list_domains()
        self.assertEqual(resp['status'], '200')
        for d in body:
            fetched_ids.append(d['id'])
        missing_doms = [d for d in domain_ids if d not in fetched_ids]
        self.assertEqual(0, len(missing_doms))

    @attr(type='smoke')
    def test_create_update_delete_domain(self):
        d_name = data_utils.rand_name('domain-')
        d_desc = data_utils.rand_name('domain-desc-')
        resp_1, domain = self.v3_client.create_domain(
            d_name, description=d_desc)
        self.assertEqual(resp_1['status'], '201')
        self.addCleanup(self._delete_domain, domain['id'])
        self.assertIn('id', domain)
        self.assertIn('description', domain)
        self.assertIn('name', domain)
        self.assertIn('enabled', domain)
        self.assertIn('links', domain)
        self.assertIsNotNone(domain['id'])
        self.assertEqual(d_name, domain['name'])
        self.assertEqual(d_desc, domain['description'])
        if self._interface == "json":
            self.assertEqual(True, domain['enabled'])
        else:
            self.assertEqual('true', str(domain['enabled']).lower())
        new_desc = data_utils.rand_name('new-desc-')
        new_name = data_utils.rand_name('new-name-')

        resp_2, updated_domain = self.v3_client.update_domain(
            domain['id'], name=new_name, description=new_desc)
        self.assertEqual(resp_2['status'], '200')
        self.assertIn('id', updated_domain)
        self.assertIn('description', updated_domain)
        self.assertIn('name', updated_domain)
        self.assertIn('enabled', updated_domain)
        self.assertIn('links', updated_domain)
        self.assertIsNotNone(updated_domain['id'])
        self.assertEqual(new_name, updated_domain['name'])
        self.assertEqual(new_desc, updated_domain['description'])
        self.assertEqual('true', str(updated_domain['enabled']).lower())

        resp_3, fetched_domain = self.v3_client.get_domain(domain['id'])
        self.assertEqual(resp_3['status'], '200')
        self.assertEqual(new_name, fetched_domain['name'])
        self.assertEqual(new_desc, fetched_domain['description'])
        self.assertEqual('true', str(fetched_domain['enabled']).lower())

class DomainsTestXML(DomainsTestJSON):
    _interface = 'xml'