text:
// This file was automatically generated by lister-gen

package internalversion

import (
	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/tools/cache"
	extensions "k8s.io/kubernetes/pkg/apis/extensions"
)

// DaemonSetLister helps list DaemonSets.
type DaemonSetLister interface {
	// List lists all DaemonSets in the indexer.
	List(selector labels.Selector) (ret []*extensions.DaemonSet, err error)
	// DaemonSets returns an object that can list and get DaemonSets.
	DaemonSets(namespace string) DaemonSetNamespaceLister
	DaemonSetListerExpansion
}

// daemonSetLister implements the DaemonSetLister interface.
type daemonSetLister struct {
	indexer cache.Indexer
}

// NewDaemonSetLister returns a new DaemonSetLister.
func NewDaemonSetLister(indexer cache.Indexer) DaemonSetLister {
	return &daemonSetLister{indexer: indexer}
}

// List lists all DaemonSets in the indexer.
func (s *daemonSetLister) List(selector labels.Selector) (ret []*extensions.DaemonSet, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*extensions.DaemonSet))
	})
	return ret, err
}

// DaemonSets returns an object that can list and get DaemonSets.
func (s *daemonSetLister) DaemonSets(namespace string) DaemonSetNamespaceLister {
	return daemonSetNamespaceLister{indexer: s.indexer, namespace: namespace}
}

// DaemonSetNamespaceLister helps list and get DaemonSets.
type DaemonSetNamespaceLister interface {
	// List lists all DaemonSets in the indexer for a given namespace.
	List(selector labels.Selector) (ret []*extensions.DaemonSet, err error)
	// Get retrieves the DaemonSet from the indexer for a given namespace and name.
	Get(name string) (*extensions.DaemonSet, error)
	DaemonSetNamespaceListerExpansion
}

// daemonSetNamespaceLister implements the DaemonSetNamespaceLister
// interface.
type daemonSetNamespaceLister struct {
	indexer   cache.Indexer
	namespace string
}

// List lists all DaemonSets in the indexer for a given namespace.
func (s daemonSetNamespaceLister) List(selector labels.Selector) (ret []*extensions.DaemonSet, err error) {
	err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
		ret = append(ret, m.(*extensions.DaemonSet))
	})
	return ret, err
}

// Get retrieves the DaemonSet from the indexer for a given namespace and name.
func (s daemonSetNamespaceLister) Get(name string) (*extensions.DaemonSet, error) {
	obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(extensions.Resource("daemonset"), name)
	}
	return obj.(*extensions.DaemonSet), nil
}


text:
prog4: Graph.cc Graph.h GraphFileParser.cc GraphFileParser.h Vertex.h main.cc
	g++ -Wall -Werror *.cc -o prog4

redpajama_set_name: RedPajamaGithub


text:
 require 'spec_helper'

module Wimdu
  module Partner
    module HolidayHome
      describe Authentication do

        describe 'validation' do

          it 'should not be valid if there is no external_id' do
            subject.valid?
            subject.errors.full_messages.should include("External can't be blank")
          end

        end

        describe 'today' do

          it 'should return todays date in the format ddmmyyyy' do
            Timecop.travel(Date.civil(2013,1,2)) do
              subject.today.should == '02012013'
            end
          end

        end

        describe 'service_key' do

          let(:subject){Wimdu::Partner::HolidayHome::Authentication.new(external_id: '5678')}

          it 'should make an MD5 hash Md5(AgencyId + Upper(Md5(partner password)) + external_id + todays date as ddmmyyyy)' do

            Timecop.travel(Date.civil(2013,1,2)) do
              partner_id = '22156'
              password = 'Ropq5LitBd'
              external_id = '5678'
              today = '02012013'
              md5_key = Digest::MD5.hexdigest("#{partner_id}#{Digest::MD5.hexdigest(password).upcase}#{external_id}#{today}")
              subject.service_key.should == md5_key
            end
          end

          describe 'params' do

            let(:subject){Wimdu::Partner::HolidayHome::Authentication.new(external_id: '5678')}

            it 'should return the correct query string params hash' do
              Timecop.travel(Date.civil(2013,1,2)) do
                subject.params.should == {"AgencyId"=>"22156", "ServiceKey"=>"9c6c00157dc26bc6ebd0d21f5befb4cc"}
              end
            end

          end

        end

      end
    end
  end
end


text:
package life.catalogue.importer.neo.model;

import java.util.Collection;
import java.util.stream.Collectors;

import com.google.common.base.Strings;
import org.gbif.nameparser.api.Rank;
import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.Node;

/**
 * Property names of neo4j nodes and relations.
 * Any property we store in normalizer should be listed here to avoid overlaps or other confusion.
 */
public class NeoProperties {
  // propLabel used in NeoTaxon
  public static final String RANK = "rank";
  public static final String SCIENTIFIC_NAME = "scientificName";
  public static final String AUTHORSHIP = "authorship";
  // nomrel props
  public static final String NOTE = "note";
  public static final String REF_ID = "refid";
  public static final String VERBATIM_KEY = "vkey";

  public static final String NULL_NAME = "???";

  private NeoProperties() {
  }

  public static Rank getRank(Node n, Rank defaultValue) {
    if (n.hasProperty(NeoProperties.RANK)) {
      return Rank.values()[(int) n.getProperty(NeoProperties.RANK)];
    }
    return defaultValue;
  }

  public static String getScientificName(Node n) {
    return getScientificName(n, NULL_NAME);
  }

  public static String getScientificName(Node n, String defaultName) {
    return (String) n.getProperty(NeoProperties.SCIENTIFIC_NAME, defaultName);
  }

  public static String getAuthorship(Node n) {
    return (String) n.getProperty(NeoProperties.AUTHORSHIP, null);
  }

  public static String getScientificNameWithAuthorFromUsages(Collection<Node> usageNodes) {
    return usageNodes.stream()
        .map(NeoProperties::getScientificNameWithAuthorFromUsage)
        .collect(Collectors.joining("; "));
  }

  public static String getScientificNameWithAuthorFromUsage(Node usageNode) {
    return getScientificNameWithAuthor(getNameNode(usageNode), NULL_NAME);
  }

  public static String getScientificNameWithAuthor(Node nameNode) {
    return getScientificNameWithAuthor(nameNode, NULL_NAME);
  }

  public static String getScientificNameWithAuthor(Node nameNode, String defaultName) {
    StringBuilder sb = new StringBuilder();
    String sciname = getScientificName(nameNode, defaultName);
    if (!Strings.isNullOrEmpty(sciname)) {
      sb.append(sciname);
    }
    String authorship = getAuthorship(nameNode);
    if (!Strings.isNullOrEmpty(authorship)) {
      sb.append(" ");
      sb.append(authorship);
    }
    return sb.toString();
  }

  /**
   * Reads a ranked name instance purely from neo4j propLabel
   */
  public static RankedName getRankedName(Node n) {
    return new RankedName(n,
        getScientificName(n),
        getAuthorship(n),
        getRank(n, Rank.UNRANKED)
    );
  }

  /**
   * Reads a ranked usage instance purely from neo4j propLabels,
   * retrieving just the related name node.
   */
  public static RankedUsage getRankedUsage(Node u) {
    Node n = getNameNode(u);
    return new RankedUsage(u, n,
        getScientificName(n),
        getAuthorship(n),
        getRank(n, Rank.UNRANKED)
    );
  }

  /**
   * Reads a ranked usage instance purely from neo4j propLabels,
   * retrieving just the related name node.
   */
  public static RankedUsage getRankedUsage(NeoUsage u) {
    if (u.node != null && u.nameNode != null && u.usage.getName() != null) {
      return new RankedUsage(u.node, u.nameNode,
          u.usage.getName().getScientificName(), u.usage.getName().authorshipComplete(), u.usage.getName().getRank());
    } else {
      return getRankedUsage(u.node);
    }
  }

  /**
   * @return the related, single name node for a usage node.
   */
  public static Node getNameNode(Node usageNode) {
    return usageNode.getSingleRelationship(RelType.HAS_NAME, Direction.OUTGOING).getOtherNode(usageNode);
  }
}


text:
package org.cloudbus.cloudsim.lists;

import java.util.List;

import org.cloudbus.cloudsim.Host;

/**
 * HostList is a collection of operations on lists of hosts.
 *
 * @author Anton Beloglazov
 * @since CloudSim Toolkit 2.0
 */
public class HostList {

	/**
	 * Gets the Machine object for a particular ID.
	 *
	 * @param <T> the generic type
	 * @param hostList the host list
	 * @param id the host ID
	 * @return the Machine object or <tt>null</tt> if no machine exists
	 * @see gridsim.Machine
	 * @pre id >= 0
	 * @post $none
	 */
	public static <T extends Host> T getById(List<T> hostList, int id) {
		for (T host : hostList) {
			if (host.getId() == id) {
				return host;
			}
		}
		return null;
	}

	/**
	 * Gets the total number of PEs for all Machines.
	 *
	 * @param <T> the generic type
	 * @param hostList the host list
	 * @return number of PEs
	 * @pre $none
	 * @post $result >= 0
	 */
	public static <T extends Host> int getNumberOfPes(List<T> hostList) {
		int numberOfPes = 0;
		for (T host : hostList) {
			numberOfPes += host.getPeList().size();
		}
		return numberOfPes;
	}

	/**
	 * Gets the total number of <tt>FREE</tt> or non-busy PEs for all Machines.
	 *
	 * @param <T> the generic type
	 * @param hostList the host list
	 * @return number of PEs
	 * @pre $none
	 * @post $result >= 0
	 */
	public static <T extends Host> int getNumberOfFreePes(List<T> hostList) {
		int numberOfFreePes = 0;
		for (T host : hostList) {
			numberOfFreePes += PeList.getNumberOfFreePes(host.getPeList());
		}
		return numberOfFreePes;
	}

	/**
	 * Gets the total number of <tt>BUSY</tt> PEs for all Machines.
	 *
	 * @param <T> the generic type
	 * @param hostList the host list
	 * @return number of PEs
	 * @pre $none
	 * @post $result >= 0
	 */
	public static <T extends Host> int getNumberOfBusyPes(List<T> hostList) {
		int numberOfBusyPes = 0;
		for (T host : hostList) {
			numberOfBusyPes += PeList.getNumberOfBusyPes(host.getPeList());
		}
		return numberOfBusyPes;
	}

	/**
	 * Gets a Machine with free Pe.
	 *
	 * @param <T> the generic type
	 * @param hostList the host list
	 * @return a machine object or <tt>null</tt> if not found
	 * @pre $none
	 * @post $none
	 */
	public static <T extends Host> T getHostWithFreePe(List<T> hostList) {
		return getHostWithFreePe(hostList, 1);
	}

	/**
	 * Gets a Machine with a specified number of free Pe.
	 *
	 * @param <T> the generic type
	 * @param hostList the host list
	 * @param pesNumber the pes number
	 * @return a machine object or <tt>null</tt> if not found
	 * @pre $none
	 * @post $none
	 */
	public static <T extends Host> T getHostWithFreePe(List<T> hostList, int pesNumber) {
		for (T host : hostList) {
			if (PeList.getNumberOfFreePes(host.getPeList()) >= pesNumber) {
				return host;
			}
		}
		return null;
	}

	/**
	 * Sets the particular Pe status on a Machine.
	 *
	 * @param <T> the generic type
	 * @param hostList the host list
	 * @param status Pe status, either <tt>Pe.FREE</tt> or <tt>Pe.BUSY</tt>
	 * @param hostId the host id
	 * @param peId the pe id
	 * @return <tt>true</tt> if the Pe status has changed, <tt>false</tt> otherwise (Machine id or
	 *         Pe id might not be exist)
	 * @pre machineID >= 0
	 * @pre peID >= 0
	 * @post $none
	 */
	public static <T extends Host> boolean setPeStatus(List<T> hostList, int status, int hostId, int peId) {
		T host = getById(hostList, hostId);
		if (host == null) {
			return false;
		}
		return host.setPeStatus(peId, status);
	}

}


text:
export interface Birthday
{
    name: string
    dob: Date
}

export interface BirthdayState
{
    birthdays: Birthday[]
}


text:
{-# LANGUAGE Safe #-}

{- arch-tag: ConfigParser lexer support
Copyright (C) 2004, 2008 John Goerzen <jgoerzen@complete.org>
Copyright (C) 2015-2016 David Farrell <shokku.ra@gmail.com>
-}

{- |
   Module      : Polar.ConfigFile.Lexer
   Copyright   : Copyright (C) 2004, 2008 John Goerzen, 2015-2016 David Farrell
   License     : BSD3

   Maintainer  : David Farrell <shokku.ra@gmail.com>
   Stability   : unstable
   Portability : portable

Lexer support for "Polar.ConfigFile".  This module is not intended to be
used directly by your programs.

Copyright (C) 2004, 2008 John Goerzen \<jgoerzen\@complete.org\>, 2015-2016 David Farrell \<shokku.ra\@gmail.com\>.
-}

module Polar.ConfigFile.Lexer
(
       -- -- * Temporary for testing
       --comment_chars, eol, optionsep, whitespace_chars, comment_line,
       --empty_line, sectheader_chars, sectheader, oname_chars, value_chars,
       --extension_line, optionkey, optionvalue, optionpair
       loken,
       CPTok(..),
       GeneralizedToken,
       GeneralizedTokenParser,
       togtok
) where

import Text.ParserCombinators.Parsec
import Polar.ConfigFile.Utils

data CPTok = IGNOREDATA
           | NEWSECTION String
           | NEWSECTION_EOF String
           | EXTENSIONLINE String
           | NEWOPTION (String, String)
             deriving (Eq, Show, Ord)

comment_chars :: CharParser st Char
comment_chars = oneOf "#;"
eol :: GenParser Char st String
eol = string "\n" <|> string "\r\n" <|> string "\r" <?> "End of line"
eoleof :: GenParser Char st ()
eoleof = eof <|> do {eol; return ()}
optionsep :: GenParser Char st Char
optionsep = oneOf ":=" <?> "option separator"
whitespace_chars :: GenParser Char st Char
whitespace_chars = oneOf " \t" <?> "whitespace"
comment_line :: GenParser Char st ()
comment_line = do skipMany whitespace_chars
                  comment_chars             <?> "start of comment"
                  (many $ noneOf "\r\n")   <?> "content of comment"
                  eoleof
eolstuff :: GenParser Char st ()
eolstuff = (try comment_line) <|> (try empty_line)
empty_line :: GenParser Char st ()
empty_line = do many whitespace_chars
                eoleof
             <?> "empty line"
sectheader_chars :: CharParser st Char
sectheader_chars = noneOf "]\r\n"
sectheader :: GenParser Char st String
sectheader = do char '['
                sname <- many1 $ sectheader_chars
                char ']'
                eolstuff
                return sname
             <?> "start of section"
oname_chars :: CharParser st Char
oname_chars = noneOf ":=\r\n"
value_chars :: CharParser st Char
value_chars = noneOf "\r\n"
extension_line :: GenParser Char st String
extension_line = do many1 whitespace_chars
                    c1 <- noneOf "\r\n#;"
                    remainder <- many value_chars
                    eolstuff
                    return (c1 : remainder)

optionkey, optionvalue :: GenParser Char st String
optionkey = many1 oname_chars
optionvalue = many value_chars
optionpair :: GenParser Char st (String, String)
optionpair = do key <- optionkey
                value <- option "" $ do { optionsep; optionvalue }
                eolstuff
                return (key, value)
             <?> "key/value option"

iloken :: Parser (GeneralizedToken CPTok)
iloken =
    -- Ignore these things
    try (do {comment_line; togtok $ IGNOREDATA})
    <|> try (do {empty_line; togtok $ IGNOREDATA})

    -- Real stuff
    <|> (do {sname <- sectheader; togtok $ NEWSECTION sname})
    <|> try (do {extension <- extension_line; togtok $ EXTENSIONLINE extension})
    <|> try (do {pair <- optionpair; togtok $ NEWOPTION pair})
--    <?> "Invalid syntax in configuration file"

loken :: Parser [GeneralizedToken CPTok]
loken = do x <- manyTill iloken eof
           return $ filter (\y -> snd y /= IGNOREDATA) x


text:
<?php

namespace Gecko\NewsletterBundle\DataFixtures\ORM;

use Doctrine\Common\Persistence\ObjectManager;
use Gecko\NewsletterBundle\Entity\SubscriberList;
use Sylius\Bundle\CoreBundle\DataFixtures\ORM\DataFixture;

/**
 * Default subscriber lists
 */
class LoadSubscriberListsData extends DataFixture
{
	private $listNumber = 0;

    public function load(ObjectManager $manager)
    {
		$subscriberList = $this->getSubscriberListWithNameNumber();

        for ($i = 1; $i <= 30; $i++) {
        	$subscriber = $this->getReference('Gecko.Newsletter.Subscriber-'.$i);
            $subscriberList->addSubscriber($subscriber);

            if(rand(1, 10) == 1 || $i == 30)
            {
	            $manager->persist($subscriberList);
	            $this->setReference('Gecko.Newsletter.SubscriberList-'.$this->listNumber, $subscriberList);

	            if($i < 30)
	            {
		            $subscriberList = $this->getSubscriberListWithNameNumber();
	            }
            }
        }

        $manager->flush();
    }

    public function getSubscriberListWithNameNumber()
    {
    	$this->listNumber++;
    	$subscriberList = new SubscriberList();
    	$subscriberList->setName("Lista ".$this->listNumber);

    	return $subscriberList;
    }

    public function getOrder()
    {
        return 2;
    }
}


text:
package com.google.android.apps.authenticator;

import com.google.android.apps.authenticator2.R;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;

/**
 * Circular countdown indicator. The indicator is a filled arc which starts as a full circle ({@code
 * 360} degrees) and shrinks to {@code 0} degrees the less time is remaining.
 * @author klyubin@google.com (Alex Klyubin)
 */
public class CountdownIndicator extends View {
  private final Paint mRemainingSectorPaint;
  private final Paint mBorderPaint;
  private static final int DEFAULT_COLOR = 0xff3060c0;

  /**
   * Countdown phase starting with {@code 1} when a full cycle is remaining and shrinking to
   * {@code 0} the closer the countdown is to zero.
   */
  private double mPhase;

  public CountdownIndicator(Context context) {
    this(context, null);
  }

  public CountdownIndicator(Context context, AttributeSet attrs) {
    super(context, attrs);

    int color = DEFAULT_COLOR;
    Resources.Theme theme = context.getTheme();
    TypedArray appearance = theme.obtainStyledAttributes(
        attrs, R.styleable.CountdownIndicator, 0, 0);
    if (appearance != null) {
      int n = appearance.getIndexCount();
      for (int i = 0; i < n; i++) {
        int attr = appearance.getIndex(i);

        switch (attr) {
        case R.styleable.CountdownIndicator_color:
          color = appearance.getColor(attr, DEFAULT_COLOR);
          break;
        }
      }
    }

    mBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mBorderPaint.setStrokeWidth(0); // hairline
    mBorderPaint.setStyle(Style.STROKE);
    mBorderPaint.setColor(color);
    mRemainingSectorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mRemainingSectorPaint.setColor(mBorderPaint.getColor());
  }

  @Override
  protected void onDraw(Canvas canvas) {
    float remainingSectorSweepAngle = (float) (mPhase * 360);
    float remainingSectorStartAngle = 270 - remainingSectorSweepAngle;

    // Draw the sector/filled arc
    // We need to leave the leftmost column and the topmost row out of the drawingRect because
    // in anti-aliased mode drawArc and drawOval use these areas for some reason.
    RectF drawingRect = new RectF(1, 1, getWidth() - 1, getHeight() - 1);
    if (remainingSectorStartAngle < 360) {
      canvas.drawArc(
          drawingRect,
          remainingSectorStartAngle,
          remainingSectorSweepAngle,
          true,
          mRemainingSectorPaint);
    } else {
      // 360 degrees is equivalent to 0 degrees for drawArc, hence the drawOval below.
      canvas.drawOval(drawingRect, mRemainingSectorPaint);
    }

    // Draw the outer border
    canvas.drawOval(drawingRect, mBorderPaint);
  }

  /**
   * Sets the phase of this indicator.
   *
   * @param phase phase {@code [0, 1]}: {@code 1} when the maximum amount of time is remaining,
   *        {@code 0} when no time is remaining.
   */
  public void setPhase(double phase) {
    if ((phase < 0) || (phase > 1)) {
      throw new IllegalArgumentException("phase: " + phase);
    }

    mPhase = phase;
    invalidate();
  }
}


text:
Have you ever lost your phone and all your important text messages? Have you ever struggled with finding a very important  message in your iMessage application? Is Gmail your main e-mail client? Check out i2Gmail!

i2Gmail is a Python utility which allows you to backup your iMessages from your macOS desktop computer to your Gmail account. If your macOS computer is [configured to send and receive SMS messages](https://support.apple.com/en-us/HT202549), your SMS messages will be backed up as well. Messages are stored on Gmail as regular emails. They are already read, archived, labeled as `Text` and easily searchable.

Please note: i2Gmail is in beta. Expect hick-ups. Please [report all the issues](https://github.com/jakublipinski/i2Gmail-Backup-macOS-Messages-To-Gmail/issues).

## Installation

In order to use i2Gmail you will need to:

### Clone the i2Gmail repository
```
git clone git@github.com:jakublipinski/i2Gmail-Backup-macOS-Messages-To-Gmail.git i2Gmail
cd i2Gmail
```
### Install google-api-python-client
```
easy_install --upgrade google-api-python-client
```
### Alternatively use virtual env
```
virtualenv -p /usr/bin/python2.7 venv
source venv/bin/activate
pip install -r requirements.txt
```
### Create your `client_secrets.json` file
For i2Gmail to connect to your Gmail account you need to create a new application at Google APIs Console.

1. Go to [Google APIs Console](https://console.developers.google.com/flows/enableapi?apiid=gmail,contacts&credential=client_key)
2. Verify that `Create a project` is selected
3. Click the `Continue` button
4. Within a few seconds, your project will be created. Click the `Go to Credentials`.
5. Click the `Credentials` from the menu on the left side.
6. Go to the `OAuth consent screen` tab.
7. Enter `i2Gmail` into the `Product name shown to users` box. Press `Save`.
8. Go to the `Credentials` tab if not taken there automatically.
9. Click the 'Create credentials` blue button dropdown and select `OAuth client ID`.
10. Select `Other` from the list, enter `Console client` into `Name` field and press `Create`.
11. Close the pop-up window.
12. Click the `Download JSON` arrow located on the right side of the `Console client` label.
13. Save the file into the `i2Gmail` folder as `client_secrets.json`

### Add your phone number and email to Gmail Contacts
Add your phone number and all your email addresses you use with iMessage to [Gmail Contacts](https://www.google.com/contacts/).

### i2Gmail uses `Text` label
i2Gmail labals all the backed up messages with `Text`. If you already use such label, it's strongly recommened to change it to something else. You can change the label name in the `config.py` by modifing the `GMAIL_LABEL` variable.

## Backuping your Messages

### First backup

To start backup run:
```
python i2Gmail.py
```
A browser window will open asking to authorize the application against GMail. Choose the desired account and authorize the script. The backup procedure will start. The script will output its progress to the console. You can also follow the backup progress by searching for `label:text` in your Gmail account.

### Subsequent backup

To start subsequent backup run:
```
python i2Gmail.py
```
i2Gmail stores the last backed up message id in the file `settings.json` and backs up only new messages.

### Contacts Suggestions

i2Gmail outputs duplicate email addresses and phone number which are assigned to different contacts. It's recommened to fix these duplicates so that i2Gmail assigns correct contact details to each message.

### Restarting backup

In order to start backup from scratch:
1. Remove the `settings.json` file
```
rm settings.json
```
2. Remove previously backed up messages from Gmail by searching `label:text`, selecting all messages and pressing `Delete` button

### Changing the Gmail account

In order to change the Gmail account to which the backup is performed delete the `credentials.storage` file. You will be asked to choose and authorize your Gmail account next time you run the script.

### Search your backed up messages.

You can search your backed up messages by ussing `label:text` search query in Gmail. You can combine it with other queries such as: `label:text from:me`, `label:text to:John`, etc

## Security

### Credentials needed
Application needs following Gmail permissions:
`Know who you are on Google` - to use your first and last name to indicate sender of your messages
`View your email address`	- to use your email address to indicate sender of your messages
`Insert mail into your mailbox`	- to backup your messages
`Manage mailbox labels` - to create `Text` label
`View your contacts` - to translate phone numbers and email addresses to people names

### Keep your files secured

Keep your `clients_secrets.json` and `credentials.storage` files secured. They give access to your Gmail account.

## Under the hood

### Original bearer

If you need to learn what was the original bearer of the message (SMS or iMessage) you can click `Show original` options from the dropdown menu next to your message and loook for `X-Original-Bearer` header.


text:
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <X11/Xatom.h>

#include <stdio.h>

#include "../bitmaps/icon_bitmap"
#define BITMAPDEPTH 1

/* Display and screen are used as arguments to nearly every Xlib routine,
 * so it simplifies routine calls to declare them global.  If there were
 * additional source files, these variables would be declared extern in
 * them. */
Display *display;
int screen;

/* values for window_size in main, is window big enough to be useful? */
#define SMALL 1
#define OK 0

static char *vistype[] = {
"StaticGray",
"GrayScale",
"StaticColor",
"PseudoColor",
"TrueColor",
"DirectColor"
};

void main(argc, argv)
int argc;
char **argv;
{
	Window win;
	unsigned int width, height, x, y;     /* window size and position */
	unsigned int borderwidth = 4;	      /* four pixels */
	unsigned int display_width, display_height;
	unsigned int icon_width, icon_height;
	char *window_name = "Basic Window Program";
	char *icon_name = "basicwin";
	Pixmap icon_pixmap;
	XSizeHints size_hints;
	XEvent report;
	GC gc;
	XFontStruct *font_info;
	char *display_name = NULL;
	int window_size = 0;    /* OK, or too SMALL to display contents */
	Visual *visual;
	XStandardColormap stndcmap;

	/* connect to X server */

	if ( (display=XOpenDisplay(display_name)) == NULL )
	{
		(void) fprintf( stderr,
				"basicwin: cannot connect to X server %s\\n",
				XDisplayName(display_name));
		exit( -1 );
	}

	/* get screen size from display structure macro */
	screen = DefaultScreen(display);
	display_width = DisplayWidth(display, screen);
	display_height = DisplayHeight(display, screen);

	visual = DefaultVisual(display, screen);
	printf("red mask: %d\ngreen mask: %d\nblue mask: %d\n", visual->red_mask, visual->blue_mask, visual->green_mask);
	printf("default visual class: %s\n", vistype[visual->class]);
	printf("bits per rgb: %d\n", visual->bits_per_rgb);
	printf("number of colormap entries: %d\n", visual->map_entries);

	if (!XGetStandardColormap(display, RootWindow(display, screen), &stndcmap, XA_RGB_DEFAULT_MAP))
		printf("no RGB_DEFAULT_MAP standard colormap defined.\n");
	else {
		printf("stnd colormap ID: %d\n", stndcmap.colormap);
		printf("red_max: %d\n", stndcmap.red_max);
		printf("blue_max: %d\n", stndcmap.blue_max);
		printf("green_max: %d\n", stndcmap.green_max);
		printf("red_mult: %d\n", stndcmap.red_mult);
		printf("blue_mult: %d\n", stndcmap.blue_mult);
		printf("green_mult: %d\n", stndcmap.green_mult);
		printf("base pixel: %d\n", stndcmap.base_pixel);
	}

	printf("default colormap ID %d\n", DefaultColormap(display, screen));

	/* place window */
	x = display_width/3, y = display_height/3;

	/* size window with enough room for text */
	width = display_width/3, height = display_height/4;

	/* create opaque window */
	win = XCreateSimpleWindow(display, RootWindow(display,screen), x, y,
			width, height, borderwidth, BlackPixel(display,
	    		screen), WhitePixel(display,screen));

	/* Create pixmap of depth 1 (bitmap) for icon */
	icon_pixmap = XCreateBitmapFromData(display, win, icon_bitmap_bits,
			icon_bitmap_width, icon_bitmap_height);

	/* Set resize hints */
	size_hints.flags = PPosition | PSize | PMinSize;
	size_hints.x = x;
	size_hints.y = y;
	size_hints.width = width;
	size_hints.height = height;
	size_hints.min_width = 350;
	size_hints.min_height = 250;

	/* set Properties for window manager (always before mapping) */
	XSetStandardProperties(display, win, window_name, icon_name,
	    icon_pixmap, argv, argc, &size_hints);

	/* Select event types wanted */
	XSelectInput(display, win, ExposureMask | KeyPressMask |
			ButtonPressMask | StructureNotifyMask);

	load_font(&font_info);

	/* create GC for text and drawing */
	get_GC(win, &gc, font_info);

	/* Display window */
	XMapWindow(display, win);

	/* get events, use first to display text and graphics */
	while (1)  {
		XNextEvent(display, &report);
		switch  (report.type) {
		case Expose:
			/* get all other Expose events on the queue */
			while (XCheckTypedEvent(display, Expose, &report));
			if (window_size == SMALL)
			       TooSmall(win, gc, font_info);
			else {
				/* place text in window */
			       place_text(win, gc, font_info, width, height);

				/* place graphics in window, */
			       place_graphics(win, gc, width, height);
			}
			break;
		case ConfigureNotify:
			/* window has been resized, change width and
			 * height to send to place_text and place_graphics
			 * in next Expose */
			width = report.xconfigure.width;
			height = report.xconfigure.height;
			if ((width < size_hints.min_width) ||
					(height < size_hints.min_height))
				window_size = SMALL;
			else
				window_size = OK;
			break;
		case ButtonPress:
			/* trickle down into KeyPress (no break) */
		case KeyPress:
			XUnloadFont(display, font_info->fid);
			XFreeGC(display, gc);
			XCloseDisplay(display);
			exit(1);
		default:
			/* all events selected by StructureNotifyMask
			 * except ConfigureNotify are thrown away here,
			 * since nothing is done with them */
			break;
		} /* end switch */
	} /* end while */
}

get_GC(win, gc, font_info)
Window win;
GC *gc;
XFontStruct *font_info;
{
	unsigned long valuemask = 0; /* ignore XGCvalues and use defaults */
	XGCValues values;
	unsigned int line_width = 6;
	int line_style = LineOnOffDash;
	int cap_style = CapRound;
	int join_style = JoinRound;
	int dash_offset = 0;
	static char dash_list[] = {
		12, 24	};
	int list_length = 2;

	/* Create default Graphics Context */
	*gc = XCreateGC(display, win, valuemask, &values);

	/* specify font */
	XSetFont(display, *gc, font_info->fid);

	/* specify black foreground since default may be white on white */
	XSetForeground(display, *gc, BlackPixel(display,screen));

	/* set line attributes */
	XSetLineAttributes(display, *gc, line_width, line_style, cap_style,
			join_style);

	/* set dashes to be line_width in length */
	XSetDashes(display, *gc, dash_offset, dash_list, list_length);
}

load_font(font_info)
XFontStruct **font_info;
{
	char *fontname = "9x15";

	/* Access font */
	if ((*font_info = XLoadQueryFont(display,fontname)) == NULL)
	{
		(void) fprintf( stderr, "Basic: Cannot open 9x15 font\\n");
		exit( -1 );
	}
}

place_text(win, gc, font_info, win_width, win_height)
Window win;
GC gc;
XFontStruct *font_info;
unsigned int win_width, win_height;
{
	int y = 20; 	/* offset from corner of window*/
	char *string1 = "Hi! I'm a window, who are you?";
	char *string2 = "To terminate program; Press any key";
	char *string3 = "or button while in this window.";
	char *string4 = "Screen Dimensions:";
	int len1, len2, len3, len4;
	int width1, width2, width3;
	char cd_height[50], cd_width[50], cd_depth[50];
	int font_height;
	int initial_y_offset, x_offset;

	/* need length for both XTextWidth and XDrawString */
	len1 = strlen(string1);
	len2 = strlen(string2);
	len3 = strlen(string3);

	/* get string widths for centering */
	width1 = XTextWidth(font_info, string1, len1);
	width2 = XTextWidth(font_info, string2, len2);
	width3 = XTextWidth(font_info, string3, len3);

	/* output text, centered on each line */
	XDrawString(display,win,gc,(win_width - width1)/2,y,string1,len1);
	XDrawString(display,win,gc,(win_width - width2)/2,
			(int)(win_height - 35),string2,len2);
	XDrawString(display,win,gc,(win_width - width3)/2,
			(int)(win_height - 15),string3,len3);

	/* copy numbers into string variables */
	(void) sprintf(cd_height, " Height - %d pixels",
			DisplayHeight(display,screen));
	(void) sprintf(cd_width, " Width  - %d pixels",
			DisplayWidth(display,screen));
	(void) sprintf(cd_depth, " Depth  - %d plane(s)",
			DefaultDepth(display, screen));

	/* reuse these for same purpose */
	len4 = strlen(string4);
	len1 = strlen(cd_height);
	len2 = strlen(cd_width);
	len3 = strlen(cd_depth);

	font_height = font_info->max_bounds.ascent +
			font_info->max_bounds.descent;

	/* To center strings vertically, we place the first string
	 * so that the top of it is two font_heights above the center
	 * of the window.  Since the baseline of the string is what we
	 * need to locate for XDrawString, and the baseline is one
	 * font_info->max_bounds.ascent below the top of the chacter,
	 * the final offset of the origin up from the center of the
	 * window is one font_height + one descent. */

	initial_y_offset = win_height/2 - font_height -
			font_info->max_bounds.descent;
	x_offset = (int) win_width/4;
	XDrawString(display, win, gc, x_offset, (int) initial_y_offset,
			string4,len4);

	XDrawString(display, win, gc, x_offset, (int) initial_y_offset +
			font_height,cd_height,len1);
	XDrawString(display, win, gc, x_offset, (int) initial_y_offset +
			2 * font_height,cd_width,len2);
	XDrawString(display, win, gc, x_offset, (int) initial_y_offset +
			3 * font_height,cd_depth,len3);
}

place_graphics(win, gc, window_width, window_height)
Window win;
GC gc;
unsigned int window_width, window_height;
{
	int x, y;
	int width, height;

	height = window_height/2;
	width = 3 * window_width/4;
	x = window_width/2 - width/2;  /* center */
	y = window_height/2 - height/2;
	XDrawRectangle(display, win, gc, x, y, width, height);
}

TooSmall(win, gc, font_info)
Window win;
GC gc;
XFontStruct *font_info;
{
	char *string1 = "Too Small";
	int y_offset, x_offset;

	y_offset = font_info->max_bounds.ascent + 2;
	x_offset = 2;

	/* output text, centered on each line */
	XDrawString(display, win, gc, x_offset, y_offset, string1,
			strlen(string1));
}


text:
package app.bennsandoval.com.woodmin.models;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Mackbook on 1/21/15.
 */
public class Resume {

    private String title;
    private List<DataResume> data = new ArrayList<>();

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<DataResume> getData() {
        return data;
    }

    public void setData(List<DataResume> data) {
        this.data = data;
    }
}


text:
layout: post
author:
    name: Chris Brody
    url: https://twitter.com/brodybits
title:  "Cordova-lib Release"
categories: news
tags: release tools
---

We are happy to announce that `cordova-lib 8.1.1` was released in October 2018.

## Release Highlights

The purpose of this release is to resolve possible dependency breakage that was introduced in version `8.1.0`, as reported in [GH-706](https://github.com/apache/cordova-lib/issues/706). Here are the important changes:

* [GH-708](https://github.com/apache/cordova-lib/pull/708) reintroduce `xcode` dependency to to avoid breaking plugins such as `branch-cordova-sdk` before next major release
* [GH-708](https://github.com/apache/cordova-lib/pull/708) reintroduce other dependencies that were dropped in version `8.1.0` to better ensure that any other plugins or applications using `requireCordovaModule` would not be broken by a minor release upgrade

## Deprecation Note

As NodeJS 4.x support ended on April 30th, 2018, we are proceeding with our [previously announced](http://cordova.apache.org/news/2016/10/01/0.x-4.x-deprecation-timeline.html) deprecation timeline.  This is probably the last release that will support NodeJS 4.x.


text:
package loglang.symbol;

import loglang.TypeUtil;
import loglang.lang.OperatorTable;
import nez.peg.tpeg.type.LType;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.Method;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

/**
 * Created by skgchxngsxyz-osx on 15/08/27.
 */
public abstract class MemberRef {
    /**
     * if this is constructor, name is <init>
     */
    protected final String internalName;

    /**
     * the type which the method belong to.
     */
    protected final LType ownerType;

    public MemberRef(String internalName, LType ownerType) {
        this.internalName = Objects.requireNonNull(internalName);
        this.ownerType = Objects.requireNonNull(ownerType);
    }

    public final String getInternalName() {
        return internalName;
    }

    public final LType getOwnerType() {
        return ownerType;
    }

    /**
     * for symbol entry attribute
     */
    public final static int READ_ONLY         = 1;
    public final static int LOCAL_VAR         = 1 << 1;
    public final static int INSTANCE_FIELD    = 1 << 2;
    public final static int PREFIX_TREE_FIELD = 1 << 3;
    public final static int CASE_TREE_FIELD   = 1 << 4;
    public final static int TREE_FIELD        = 1 << 5;

    /**
     * for instance field and local variable
     */
    public static class FieldRef extends MemberRef {
        private final LType fieldType;

        /**
         * if represents instance field(state), index is -1
         */
        private final int index;

        private final int attribute;

        /**
         *
         * @param index
         * @param fieldType
         * @param fieldName
         * @param ownerType
         * @param attribute
         */
        public FieldRef(int index, LType fieldType, String fieldName, LType ownerType, int attribute) {
            super(fieldName, ownerType);
            this.fieldType = Objects.requireNonNull(fieldType);
            this.index = index;
            this.attribute = attribute;
        }

        public LType getFieldType() {
            return fieldType;
        }

        public int getIndex() {
            return index;
        }

        public int getAttribute() {
            return attribute;
        }

        @Override
        public String toString() {
            return "(" + this.fieldType + " " + this.getInternalName() + " in " + this.getOwnerType() + ")";
        }

        @Override
        public boolean equals(Object obj) {
            return obj instanceof FieldRef
                    && this.internalName.equals(((FieldRef) obj).internalName)
                    && this.ownerType.equals(((FieldRef) obj).ownerType)
                    && this.fieldType.equals(((FieldRef) obj).fieldType)
                    && this.index == ((FieldRef) obj).index
                    && this.attribute == ((FieldRef) obj).attribute;
        }
    }

    public enum InvocationKind {
        INVOKE_STATIC,
        INVOKE_SPECIAL,
        INVOKE_VIRTUAL,
        INVOKE_INTERFACE,
        INVOKE_DYNAMIC,
    }

    public static class MethodRef extends MemberRef {
        protected final LType returnType;

        /**
         * not contains receiver type.
         */
        protected List<LType> paramTypes = new ArrayList<>();

        protected InvocationKind kind;

        /**
         * if exist same name method, not null
         */
        protected MethodRef next = null;

        public MethodRef(LType returnType, String methodName, List<LType> paramTypes, LType ownerType) {
            super(methodName, ownerType);
            this.returnType = Objects.requireNonNull(ownerType);
            this.kind = InvocationKind.INVOKE_VIRTUAL;
            for(LType paramType : paramTypes) {
                this.paramTypes.add(Objects.requireNonNull(paramType));
            }
            // read only
            this.paramTypes = Collections.unmodifiableList(this.paramTypes);
        }

        public LType getReturnType() {
            return returnType;
        }

        /**
         *
         * @return
         * read only list.
         */
        public List<LType> getParamTypes() {
            return paramTypes;
        }

        public InvocationKind getKind() {
            return kind;
        }

        public Method asMethod() {
            return new Method(this.internalName, TypeUtil.asType(this.returnType),
                    this.paramTypes.stream().map(TypeUtil::asType).toArray(Type[]::new));
        }

        /**
         *
         * @return
         * may be null
         */
        public MethodRef getNext() {
            return next;
        }

        void setNext(MethodRef ref) {
            this.next = Objects.requireNonNull(ref);
        }

        @Override
        public String toString() {
            StringBuilder sBuilder = new StringBuilder()
                    .append("(")
                    .append(this.returnType)
                    .append(" ")
                    .append(this.internalName)
                    .append("(");

            final int size = this.paramTypes.size();
            for(int i = 0; i < size; i++) {
                if(i > 0) {
                    sBuilder.append(", ");
                }
                sBuilder.append(this.paramTypes.get(i));
            }
            sBuilder.append(") in ").append(this.ownerType).append(")");
            return sBuilder.toString();
        }

        @Override
        public boolean equals(Object obj) {
            return obj instanceof MethodRef
                    && this.internalName.equals(((MethodRef) obj).internalName)
                    && this.ownerType.equals(((MethodRef) obj).ownerType)
                    && this.returnType.equals(((MethodRef) obj).returnType)
                    && this.paramTypes.equals(((MethodRef) obj).paramTypes);
        }
    }

    public static class StaticMethodRef extends MethodRef {
        public StaticMethodRef(LType returnType, String methodName, List<LType> paramTypes, LType ownerType) {
            super(returnType, methodName, paramTypes, ownerType);
            this.kind = InvocationKind.INVOKE_STATIC;
        }
    }

    public static class ConstructorRef extends MethodRef {
        public ConstructorRef(LType ownerType, List<LType> paramTypes) {
            super(LType.voidType, "<init>", paramTypes, ownerType);
            this.kind = InvocationKind.INVOKE_SPECIAL;
        }
    }

    public final static LType operatorHolderType = new LType(OperatorTable.class, LType.anyType);
}


text:
const BaseElementCommand = require('./_baseElementCommand.js');
/**
 * Returns the element immediately following the specified one in their parent's childNodes. The element will be returned as web element JSON object (with an added .getId() convenience method).
 *
 *
 * @example
 * module.exports = {
 *  'demo Test': function(browser) {
 *     const resultElement = await browser.getNextSibling('.features-container li:first-child');
 *
 *     console.log('next sibling element Id:', resultElement.getId());
 *   },
 *
 * @syntax browser.getNextSibling(selector, callback)
 * @syntax browser.getNextSibling(selector)
 * @param {string} [using] The locator strategy to use. See [W3C Webdriver - locator strategies](https://www.w3.org/TR/webdriver/#locator-strategies)
 * @param {string|object} selector The selector (CSS/Xpath) used to locate the element. Can either be a string or an object which specifies [element properties](https://nightwatchjs.org/guide#element-properties).
 * @param {function} callback Callback function which is called with the result value.
 * @method getNextSibling
 * @moreinfo developer.mozilla.org/en-US/docs/Web/API/Element/nextElementSibling
 * @since 2.0.0
 * @api protocol.elements
 */
class GetNextSibling extends BaseElementCommand {

  get extraArgsCount() {
    return 0;
  }

  async protocolAction() {
    return await this.executeProtocolAction('getNextSibling');
  }
}

module.exports = GetNextSibling;


text:
package mcjty.rftools.blocks.storagemonitor;

import mcjty.lib.container.EmptyContainer;
import mcjty.lib.container.GenericGuiContainer;
import mcjty.lib.entity.SyncedValueList;
import mcjty.lib.gui.Window;
import mcjty.lib.gui.events.ButtonEvent;
import mcjty.lib.gui.events.DefaultSelectionEvent;
import mcjty.lib.gui.events.TextEvent;
import mcjty.lib.gui.events.ValueEvent;
import mcjty.lib.gui.layout.HorizontalAlignment;
import mcjty.lib.gui.layout.HorizontalLayout;
import mcjty.lib.gui.layout.VerticalLayout;
import mcjty.lib.gui.widgets.*;
import mcjty.lib.gui.widgets.Button;
import mcjty.lib.gui.widgets.Label;
import mcjty.lib.gui.widgets.Panel;
import mcjty.lib.gui.widgets.TextField;
import mcjty.lib.network.Argument;
import mcjty.lib.varia.Coordinate;
import mcjty.lib.varia.Logging;
import mcjty.rftools.BlockInfo;
import mcjty.rftools.RFTools;
import mcjty.rftools.network.RFToolsMessages;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.input.Keyboard;

import java.awt.*;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class GuiStorageScanner extends GenericGuiContainer<StorageScannerTileEntity> {
    public static final int STORAGE_MONITOR_WIDTH = 256;
    public static final int STORAGE_MONITOR_HEIGHT = 224;

    private WidgetList storageList;
    private WidgetList itemList;
    private EnergyBar energyBar;
    private EnergyBar progressBar;
    private ScrollableLabel radiusLabel;
    private Button scanButton;
    private int clientVersion = -1;

    // For client side: the hilighted coordinates.
    public static Set<Coordinate> fromServer_coordinates = new HashSet<Coordinate>();

    public GuiStorageScanner(StorageScannerTileEntity storageScannerTileEntity, EmptyContainer storageScannerContainer) {
        super(RFTools.instance, RFToolsMessages.INSTANCE, storageScannerTileEntity, storageScannerContainer, RFTools.GUI_MANUAL_MAIN, "stomon");
        storageScannerTileEntity.setCurrentRF(storageScannerTileEntity.getEnergyStored(ForgeDirection.DOWN));

        xSize = STORAGE_MONITOR_WIDTH;
        ySize = STORAGE_MONITOR_HEIGHT;
    }

    @Override
    public void initGui() {
        super.initGui();

        int maxEnergyStored = tileEntity.getMaxEnergyStored(ForgeDirection.DOWN);
        energyBar = new EnergyBar(mc, this).setFilledRectThickness(1).setVertical().setDesiredWidth(8).setDesiredHeight(84).setMaxValue(maxEnergyStored).setShowText(false);
        energyBar.setValue(tileEntity.getCurrentRF());

        storageList = createStyledList().addSelectionEvent(new DefaultSelectionEvent() {
            @Override
            public void select(Widget parent, int index) {
                itemList.removeChildren();
                tileEntity.clearShowingItems();
                getInventoryOnServer();
            }

            @Override
            public void doubleClick(Widget parent, int index) {
                hilightSelectedContainer(index);
            }
        });

        Slider storageListSlider = new Slider(mc, this).setDesiredWidth(10).setVertical().setScrollable(storageList);

        Panel topPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setSpacing(1).setHorizontalMargin(1)).
                setDesiredHeight(90).
                addChild(energyBar).
                addChild(storageList).addChild(storageListSlider);

        itemList = createStyledList();
        Slider itemListSlider = new Slider(mc, this).setDesiredWidth(10).setVertical().setScrollable(itemList);
        Panel midPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setSpacing(1).setHorizontalMargin(1)).
                addChild(itemList).addChild(itemListSlider);

        scanButton = new Button(mc, this).
                setText("Scan").
                setDesiredWidth(50).
                setDesiredHeight(14).
                addButtonEvent(new ButtonEvent() {
                    @Override
                    public void buttonClicked(Widget parent) {
                        startStopScan();
                    }
                }).
                setTooltips("Start/stop a scan of", "all storage units", "in radius");
        progressBar = new EnergyBar(mc, this).setShowText(false).
                setColor1(0xFF777777).setColor2(0xFF555555).
                setHorizontal().setMaxValue(100).setDesiredWidth(30).setValue(0);
        radiusLabel = new ScrollableLabel(mc, this).
                addValueEvent(new ValueEvent() {
                    @Override
                    public void valueChanged(Widget parent, int newValue) {
                        changeRadius(newValue);
                    }
                }).
                setRealMinimum(1).
                setRealMaximum(20).
                setDesiredWidth(30);
        radiusLabel.setRealValue(tileEntity.getRadius());

        TextField textField = new TextField(mc, this).addTextEvent(new TextEvent() {
            @Override
            public void textChanged(Widget parent, String newText) {
                storageList.clearHilightedRows();
                fromServer_coordinates.clear();
                startSearch(newText);
            }
        });
        Panel searchPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).setDesiredHeight(18).addChild(new Label(mc, this).setText("Search:")).addChild(textField);

        Slider radiusSlider = new Slider(mc, this).
                setHorizontal().
                setTooltips("Radius of scan").
                setScrollable(radiusLabel);
        Panel scanPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).setDesiredHeight(18).addChild(scanButton).addChild(progressBar).addChild(radiusSlider).addChild(radiusLabel);

        Widget toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout().setSpacing(1).setVerticalMargin(3)).addChild(topPanel).addChild(midPanel).addChild(searchPanel).addChild(scanPanel);
        toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));

        window = new Window(this, toplevel);

        Keyboard.enableRepeatEvents(true);

        tileEntity.requestRfFromServer(RFToolsMessages.INSTANCE);
    }

    private void hilightSelectedContainer(int index) {
        if (index == -1) {
            return;
        }
        SyncedValueList<InvBlockInfo> inventories = tileEntity.getInventories();
        Coordinate c = inventories.get(index).getCoordinate();
        RFTools.instance.clientInfo.hilightBlock(c, System.currentTimeMillis()+1000* StorageScannerConfiguration.hilightTime);
        Logging.message(mc.thePlayer, "The inventory is now highlighted");
        mc.getMinecraft().thePlayer.closeScreen();
    }

    private void changeRadius(int r) {
        sendServerCommand(RFToolsMessages.INSTANCE, StorageScannerTileEntity.CMD_SETRADIUS, new Argument("r", r));
    }

    private void startStopScan() {
        sendServerCommand(RFToolsMessages.INSTANCE, StorageScannerTileEntity.CMD_STARTSCAN, new Argument("start", !tileEntity.isScanning()));
    }

    private void startSearch(String text) {
        if (!text.isEmpty()) {
            RFToolsMessages.INSTANCE.sendToServer(new PacketSearchItems(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, text));
        }
    }

    private void getInventoryOnServer() {
        InvBlockInfo invBlockInfo = getSelectedContainer();
        if (invBlockInfo != null) {
            Coordinate c = invBlockInfo.getCoordinate();
            RFToolsMessages.INSTANCE.sendToServer(new PacketGetInventory(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord,
                    c.getX(), c.getY(), c.getZ()));
        }
    }

    private InvBlockInfo getSelectedContainer() {
        int selected = storageList.getSelected();
        if (selected != -1) {
            SyncedValueList<InvBlockInfo> inventories = tileEntity.getInventories();
            if (selected < inventories.size()) {
                InvBlockInfo invBlockInfo = inventories.get(selected);
                return invBlockInfo;
            }
        }
        return null;
    }

    private void updateContentsList() {
        List<ItemStack> items = tileEntity.getShowingItems();
        if (itemList.getMaximum() == 0) {
            // We need to refresh.
            for (ItemStack stack : items) {
                if (stack != null) {
                    String displayName = BlockInfo.getReadableName(stack, 0);

                    Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout());
                    panel.addChild(new BlockRender(mc, this).setRenderItem(stack));
                    panel.addChild(new Label(mc, this).setDynamic(true).setText(displayName).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT));
                    itemList.addChild(panel);
                }
            }
        }
    }

    private void updateStorageList() {
        SyncedValueList<InvBlockInfo> inventories = tileEntity.getInventories();
        if (inventories.getClientVersion() != clientVersion) {
            clientVersion = inventories.getClientVersion();
            storageList.removeChildren();
            for (InvBlockInfo blockInfo : inventories) {
                Coordinate c = blockInfo.getCoordinate();
                Block block = mc.theWorld.getBlock(c.getX(), c.getY(), c.getZ());
                int meta = mc.theWorld.getBlockMetadata(c.getX(), c.getY(), c.getZ());
                String displayName;
                if (block == null || block.isAir(mc.theWorld, c.getX(), c.getY(), c.getZ())) {
                    displayName = "[REMOVED]";
                    block = null;
                } else {
                    displayName = BlockInfo.getReadableName(block, meta);
                }

                Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout());
                panel.addChild(new BlockRender(mc, this).setRenderItem(block));
                panel.addChild(new Label(mc, this).setText(displayName).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT).setDesiredWidth(90));
                panel.addChild(new Label(mc, this).setDynamic(true).setText(c.toString()));
                storageList.addChild(panel);
            }
        }
        storageList.clearHilightedRows();
        Set<Coordinate> coordinates = fromServer_coordinates;
        int i = 0;
        for (InvBlockInfo blockInfo : inventories) {
            Coordinate c = blockInfo.getCoordinate();
            if (coordinates.contains(c)) {
                storageList.addHilightedRow(i);
            }
            i++;
        }
    }

    @Override
    protected void drawGuiContainerBackgroundLayer(float v, int i, int i2) {
        updateStorageList();
        updateContentsList();
        updateScanButton();
        drawWindow();
        int currentRF = tileEntity.getCurrentRF();
        energyBar.setValue(currentRF);
        tileEntity.requestRfFromServer(RFToolsMessages.INSTANCE);
    }

    private void updateScanButton() {
        if (tileEntity.isScanning()) {
            scanButton.setText("Stop");
            progressBar.setValue(tileEntity.getProgress());
        } else {
            scanButton.setText("Scan");
            progressBar.setValue(0);
        }
    }
}


text:
external help file: Microsoft.Azure.Commands.LogicApp.dll-Help.xml
ms.assetid: 5F1A4FE0-CB57-45D3-9F08-879469A61E1E
online version:
schema: 2.0.0
---

# New-AzureRmIntegrationAccount

## SYNOPSIS
Creates an integration account.

## SYNTAX

```
New-AzureRmIntegrationAccount -ResourceGroupName <String> -Name <String> -Location <String> [-Sku <String>]
 [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-WhatIf] [-Confirm]
 [<CommonParameters>]
```

## DESCRIPTION
The **New-AzureRmIntegrationAccount** cmdlet creates an integration account.
This cmdlet returns an object that represents the integration account.Specify a name, location, resource group name, and SKU name.

Template parameter file values that you specify at the command line take precedence over template parameter values in a template parameter object.

This module supports dynamic parameters.
To use a dynamic parameter, type it in the command.
To discover the names of dynamic parameters, type a hyphen (-) after the cmdlet name, and then press the Tab key repeatedly to cycle through the available parameters.
If you omit a required template parameter, the cmdlet prompts you for the value.

## EXAMPLES

### Example 1: Create an integration account
```
PS C:\>New-AzureRmIntegrationAccount -ResourceGroupName "ResourceGroup11" -Name "IntegrationAccount31" -Location "brazilsouth" -Sku "Standard"
Id          : /subscriptions/<SubscriptionId>/resourceGroups/ResourceGroup11/providers/Microsoft.Logic/integrationAccounts/IntegrationAccount31
Name        : IntegrationAccount31
Type        : Microsoft.Logic/integrationAccounts
Location    : brazilsouth
Sku         :
CreatedTime : 3/26/2016 4:26:07 PM
ChangedTime : 3/26/2016 4:26:07 PM
```

This command creates an integration account named IntegrationAccount31 in the specified resource group.

## PARAMETERS

### -ResourceGroupName
Specifies the name of a resource group.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Name
Specifies a name for the integration account.

```yaml
Type: String
Parameter Sets: (All)
Aliases: IntegrationAccountName, ResourceName

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Location
Specifies a location for the integration account.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Sku
Specifies a SKU name for the integration account.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -InformationAction
Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

- Continue
- Ignore
- Inquire
- SilentlyContinue
- Stop
- Suspend

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: infa

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -InformationVariable
Specifies an information variable.

```yaml
Type: String
Parameter Sets: (All)
Aliases: iv

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### Microsoft.Azure.Management.Logic.Models.IntegrationAccount

## NOTES

## RELATED LINKS

[Get-AzureRmIntegrationAccount](./Get-AzureRmIntegrationAccount.md)

[Remove-AzureRmIntegrationAccount](./Remove-AzureRmIntegrationAccount.md)

[Set-AzureRmIntegrationAccount](./Set-AzureRmIntegrationAccount.md)


text:
/**
 * @preserve
 * Sharer.js
 *
 * @description Create your own social share buttons
 * @version 0.3.4
 * @author Ellison Leao <ellisonleao@gmail.com>
 * @license GPLv3
 *
 */

(function (window, document) {
    'use strict';
    /**
     * @constructor
     */
    var Sharer = function(elem) {
        this.elem = elem;
    };

    /**
     *  @function init
     *  @description bind the events for multiple sharer elements
     *  @returns {Empty}
     */
    Sharer.init = function() {
        var elems = document.querySelectorAll('[data-sharer]'),
            i,
            l = elems.length;

        for (i = 0; i < l ; i++) {
            elems[i].addEventListener('click', Sharer.add);
        }
    };

    /**
     *  @function add
     *  @description bind the share event for a single dom element
     *  @returns {Empty}
     */
    Sharer.add = function(elem) {
        var target = elem.currentTarget || elem.srcElement;
        var sharer = new Sharer(target);
        sharer.share();
    };

    // instance methods
    Sharer.prototype = {
        constructor: Sharer,
        /**
         *  @function getValue
         *  @description Helper to get the attribute of a DOM element
         *  @param {String} attr DOM element attribute
         *  @param {String} defaultValue value to use for attr
         *  @returns {String|Empty} returns the attr value or empty string
         */
        getValue: function(attr, defaultValue) {
            defaultValue = (defaultValue === undefined) ? '' : defaultValue;
            var val = this.elem.getAttribute('data-' + attr);
            return (val === undefined || val === null) ? defaultValue : val;
        },

        /**
         * @event share
         * @description Main share event. Will pop a window or redirect to a link
         * based on the data-sharer attribute.
         */
        share: function() {
            var sharer = this.getValue('sharer').toLowerCase(),
                sharers = {
                    facebook: {
                        shareUrl: 'https://www.facebook.com/sharer/sharer.php',
                        params: {
                            u: this.getValue('url'),
                            hashtag: '#' + this.getValue('hashtag'),
                        }
                    },
                    linkedin: {
                        shareUrl: 'https://www.linkedin.com/shareArticle',
                        params: {
                            url: this.getValue('url'),
                            mini: true
                        }
                    },
                    twitter: {
                        shareUrl: 'https://twitter.com/intent/tweet/',
                        params: {
                            text: this.getValue('title'),
                            url: this.getValue('url'),
                            hashtags: this.getValue('hashtags'),
                            via: this.getValue('via')
                        }
                    },
                    email: {
                        shareUrl: 'mailto:' + this.getValue('to'),
                        params: {
                            subject: this.getValue('subject'),
                            body: this.getValue('title') + '\n' + this.getValue('url')
                        },
                        isLink: true
                    },
                    whatsapp: {
                        shareUrl: 'whatsapp://send',
                        params: {
                            text: this.getValue('title') + ' ' + this.getValue('url')
                        },
                        isLink: true
                    },
                    telegram: {
                        shareUrl: 'tg://msg_url',
                        params: {
                            text: this.getValue('title') + ' ' + this.getValue('url')
                        },
                        isLink: true
                    },
                    viber: {
                        shareUrl: 'viber://forward',
                        params: {
                            text: this.getValue('title') + ' ' + this.getValue('url')
                        },
                        isLink: true
                    },
                    line: {
                        shareUrl: 'http://line.me/R/msg/text/?' + encodeURIComponent(this.getValue('title') + ' ' + this.getValue('url')),
                        isLink: true
                    },
                    pinterest: {
                        shareUrl: 'https://www.pinterest.com/pin/create/button/',
                        params: {
                            url: this.getValue('url'),
                            media: this.getValue('image'),
                            description: this.getValue('description')
                        }
                    },
                    tumblr: {
                        shareUrl: 'http://tumblr.com/widgets/share/tool',
                        params: {
                            canonicalUrl: this.getValue('url'),
                            content: this.getValue('url'),
                            posttype: 'link',
                            title: this.getValue('title'),
                            caption: this.getValue('caption'),
                            tags: this.getValue('tags')
                        }
                    },
                    hackernews: {
                        shareUrl: 'https://news.ycombinator.com/submitlink',
                        params: {
                            u: this.getValue('url'),
                            t: this.getValue('title')
                        }
                    },
                    reddit: {
                        shareUrl: 'https://www.reddit.com/submit',
                        params: {'url': this.getValue('url')}
                    },
                    vk: {
                        shareUrl: 'http://vk.com/share.php',
                        params: {
                            url: this.getValue('url'),
                            title: this.getValue('title'),
                            description: this.getValue('caption'),
                            image: this.getValue('image')
                        }
                    },
                    xing: {
                        shareUrl: 'https://www.xing.com/app/user',
                        params: {
                            'op': 'share',
                            'url': this.getValue('url'),
                            'title': this.getValue('title')
                        }
                    },
                    buffer: {
                        shareUrl: 'https://buffer.com/add',
                        params: {
                            url: this.getValue('url'),
                            title: this.getValue('title'),
                            via: this.getValue('via'),
                            picture: this.getValue('picture')
                        }
                    },
                    instapaper: {
                        shareUrl: 'http://www.instapaper.com/edit',
                        params: {
                            url: this.getValue('url'),
                            title: this.getValue('title'),
                            description: this.getValue('description')
                        }
                    },
                    pocket: {
                        shareUrl: 'https://getpocket.com/save',
                        params: {
                            url: this.getValue('url')
                        }
                    },
                    digg: {
                        shareUrl: 'http://www.digg.com/submit',
                        params: {
                            url: this.getValue('url')
                        }
                    },
                    stumbleupon: {
                        shareUrl: 'http://www.stumbleupon.com/submit',
                        params: {
                            url: this.getValue('url'),
                            title: this.getValue('title')
                        }
                    },
                    flipboard: {
                        shareUrl: 'https://share.flipboard.com/bookmarklet/popout',
                        params: {
                            v: 2,
                            title: this.getValue('title'),
                            url: this.getValue('url'),
                            t: Date.now()
                        }
                    },
                    weibo: {
                        shareUrl: 'http://service.weibo.com/share/share.php',
                        params: {
                            url: this.getValue('url'),
                            title: this.getValue('title'),
                            pic: this.getValue('image'),
                            appkey: this.getValue('appkey'),
                            ralateUid: this.getValue('ralateuid'),
                            language: 'zh_cn'
                        }
                    },
                    renren: {
                        shareUrl: 'http://share.renren.com/share/buttonshare',
                        params: {
                            link: this.getValue('url')
                        }
                    },
                    myspace: {
                        shareUrl: 'https://myspace.com/post',
                        params: {
                            u: this.getValue('url'),
                            t: this.getValue('title'),
                            c: this.getValue('description')
                        }
                    },
                    blogger: {
                        shareUrl: 'https://www.blogger.com/blog-this.g',
                        params: {
                            u: this.getValue('url'),
                            n: this.getValue('title'),
                            t: this.getValue('description')
                        }
                    },
                    baidu: {
                        shareUrl: 'http://cang.baidu.com/do/add',
                        params: {
                            it: this.getValue('title'),
                            iu: this.getValue('url')
                        }
                    },
                    douban: {
                        shareUrl: 'https://www.douban.com/share/service',
                        params: {
                            name: this.getValue('title'),
                            href: this.getValue('url'),
                            image: this.getValue('image')
                        }
                    },
                    okru: {
                        shareUrl: 'https://connect.ok.ru/dk',
                        params: {
                            'st.cmd': 'WidgetSharePreview',
                            'st.shareUrl': this.getValue('url'),
                            'title': this.getValue('title')
                        }
                    },
                    mailru: {
                        shareUrl: 'http://connect.mail.ru/share',
                        params: {
                            'share_url': this.getValue('url'),
                            'linkname': this.getValue('title'),
                            'linknote': this.getValue('description'),
                            'type': 'page'
                        }
                    }
                },
                s = sharers[sharer];

            // custom popups sizes
            if (s) {
                s.width = this.getValue('width');
                s.height = this.getValue('height');
            }
            return s !== undefined ? this.urlSharer(s) : false;
        },
        /**
         * @event urlSharer
         * @param {Object} sharer
         */
        urlSharer: function(sharer) {
            var p = sharer.params || {},
                keys = Object.keys(p),
                i,
                str = keys.length > 0 ? '?' : '';
            for (i = 0; i < keys.length; i++) {
                if (str !== '?') {
                    str += '&';
                }
                if (p[keys[i]]) {
                    str += keys[i] + '=' + encodeURIComponent(p[keys[i]]);
                }
            }
            sharer.shareUrl += str;

            if (!sharer.isLink) {
                var popWidth = sharer.width || 600,
                    popHeight = sharer.height || 480,
                    left = window.innerWidth / 2 - popWidth / 2 + window.screenX,
                    top = window.innerHeight / 2 - popHeight / 2 + window.screenY,
                    popParams = 'scrollbars=no, width=' + popWidth + ', height=' + popHeight + ', top=' + top + ', left=' + left,
                    newWindow = window.open(sharer.shareUrl, '', popParams);

                if (window.focus) {
                    newWindow.focus();
                }
            } else {
                window.location.href = sharer.shareUrl;
            }
        }
    };

    // adding sharer events on domcontentload
    if (document.readyState === 'complete' || document.readyState !== 'loading') {
        Sharer.init();
    } else {
        document.addEventListener('DOMContentLoaded', Sharer.init);
    }

    // turbolinks compatibility
    window.addEventListener('page:load', Sharer.init);

    // exporting sharer for external usage
    window.Sharer = Sharer;

})(window, document);


text:
'use strict';

var angular = require('angular');
var sinon   = require('sinon');
var expect  = require('../expect');

describe('ConvexRequest', function () {

  var ConvexRequest, request, convexConfig, $httpBackend, $window, $timeout;
  beforeEach(angular.mock.module(require('../../')));
  beforeEach(angular.mock.inject(function ($injector) {
    ConvexRequest = $injector.get('ConvexRequest');
    convexConfig = $injector.get('convexConfig');
    $httpBackend = $injector.get('$httpBackend');
    $window = $injector.get('$window');
    $timeout = $injector.get('$timeout');
    request = new ConvexRequest({});
  }));

  afterEach(function () {
    request.$$cache.destroy();
  });

  describe('Constructor/Config', function () {

    it('stores the configuration with defaults', function () {
      expect(new ConvexRequest({foo: 'bar'}))
        .to.have.property('config')
        .and.contain({
          method: 'GET',
          foo: 'bar'
        });
    });

    it('can accept a full url', function () {
      expect(new ConvexRequest({url: 'http://api/foo'}))
        .to.have.property('config')
        .and.contain({
          url: 'http://api/foo',
          base: 'http://api',
          path: '/foo'
        });
    });

    it('can accept a base and path', function () {
      expect(new ConvexRequest({
        base: 'http://api',
        path: '/foo'
      }))
      .to.have.property('config')
      .and.contain({
        url: 'http://api/foo',
        base: 'http://api',
        path: '/foo'
      });
    });

    it('can accept a query', function () {
      expect(new ConvexRequest({
        base: 'http://api',
        path: '/foo',
        params: {bar: 'baz'}
      }))
      .to.have.property('config')
      .and.contain({
        url: 'http://api/foo?bar=baz',
        base: 'http://api',
        path: '/foo'
      });
    });

    it('creates a deferred', function () {
      expect(request)
        .to.have.deep.property('deferred.promise');
    });

  });

  describe('#toJSON', function () {

    it('outputs parameters needed for batching', function () {
      expect(request.toJSON()).to.have.keys([
        'method',
        'path',
        'payload'
      ]);
      expect(request.toJSON()).to.not.have.keys([
        'url',
        'query',
        'base'
      ]);
      request.config.path = '/p';
      request.config.params = {foo: 'bar'};
      expect(request.toJSON().path).to.equal('/p?foo=bar');
    });

  });

  describe('#send', function () {

    beforeEach(function () {
      request.config.url = 'http://api';
    });

    it('can send a GET', function () {
      $httpBackend.expectGET(request.config.url)
        .respond(200, {foo: 'bar'});
      request.send().then(function (response) {
        expect(response).to.deep.equal({foo: 'bar'});
      });
      $httpBackend.flush();
    });

    it('can cache a GET in memory', function () {
      $httpBackend.expectGET(request.config.url)
        .respond(200, {foo: 'bar'});
      request.config.cache = true;
      request.send().then(function () {
        expect(request.$$cache.get(request.config.url))
          .to.deep.equal({
            foo: 'bar'
          });
      });
      $httpBackend.flush();
    });

    it('can skip a $http call for GET in cache', function () {
      request.config.cache = true;
      request.$$cache.put(request.config.url, {foo: 'bar'});
      request.send().then(function (response) {
        expect(response)
          .to.deep.equal({
            foo: 'bar'
          });
      });
      $timeout.flush();
    });

    it('can cache in localStorage', function () {
      $httpBackend.expectGET(request.config.url)
        .respond(200, {foo: 'bar'});
      request.config.cache = 'persist';
      request.send().then(function () {
        expect($window.localStorage.getItem('convex-' + request.config.url))
          .to.equal('{"foo":"bar"}');
      });
      $httpBackend.flush();
    });

    it('can respond from localStorage', function () {
      $window.localStorage
        .setItem('convex-' + request.config.url, angular.toJson({
          bar: 'baz'
        }));
      request.config.cache = 'persist';
      request.send().then(function (response) {
        expect(response).to.deep.equal({bar: 'baz'});
      });
      $timeout.flush();
    });

    it('can force a cache bypass', function () {
      $httpBackend.expectGET(request.config.url)
        .respond(200, {foo: 'bar'});
      request.config.cache = true;
      request.config.force = true;
      request.$$cache.put(request.config.url, {foo: 'bar'});
      request.send().then(function (response) {
        expect(response).to.deep.equal({bar: 'baz'});
      });
      $timeout.flush();
    });

    it('performs exponential backoff', function () {
      $httpBackend.expectGET(request.config.url)
        .respond(503);
      var response;
      request.send().then(function (_response_) {
        response = _response_;
      });
      $httpBackend.flush();
      $httpBackend.expectGET(request.config.url)
        .respond(503);
      $timeout.flush(2000);
      $httpBackend.flush();
      $httpBackend.expectGET(request.config.url)
        .respond(200, {foo: 'bar'});
      $timeout.flush(4000);
      $httpBackend.flush();
      expect(response).to.deep.equal({
        foo: 'bar'
      });
    });

    it('fails after 3 attempts', function () {
      $httpBackend.expectGET(request.config.url)
        .respond(503);
      var err;
      request.send().catch(function (_err_) {
        err = _err_;
      });
      $httpBackend.flush();
      $httpBackend.expectGET(request.config.url)
        .respond(503);
      $timeout.flush(2000);
      $httpBackend.flush();
      $httpBackend.expectGET(request.config.url)
        .respond(503);
      $timeout.flush(4000);
      $httpBackend.flush();
      $httpBackend.expectGET(request.config.url)
        .respond(503);
      $timeout.flush(8000);
      $httpBackend.flush();
      expect(err).to.be.ok;
    });

    it('can send a POST', function () {
      $httpBackend.expectPOST(request.config.url, {})
        .respond(200, {bar: 'baz'});
      request.config.data = {};
      request.config.method = 'post';
      request.send().then(function (response) {
        expect(response).to.deep.equal({bar: 'baz'});
      });
      $httpBackend.flush();
    });

    it('uses #fulfill to handle a success', function () {
      $httpBackend.expectGET(request.config.url)
        .respond(200);
      sinon.spy(request, 'fulfill');
      request.send().then(function () {
        expect(request.fulfill)
          .to.have.been.calledWith(sinon.match({
            status: 200,
          }));
      });
      $httpBackend.flush();
    });

    it('uses #reject to handle an error', function () {
      $httpBackend.expectGET(request.config.url)
        .respond(404);
      sinon.spy(request, 'reject');
      request.send().then(function () {
        expect(request.reject)
          .to.have.been.calledWith(sinon.match({
            status: 404
          }));
      });
      $httpBackend.flush();
    });

  });

  describe('#fulfill', function () {

    it('handles an angular response object', function () {
      expect(request.fulfill({
        status: 200,
        data: {foo: 'bar'},
        headers: function () {}
      }))
      .to.eventually.deep.equal({
        foo: 'bar'
      });
      $timeout.flush();
    });

    it('handles a generic response object', function () {
      expect(request.fulfill({
        foo: 'bar'
      }))
      .to.eventually.deep.equal({
        foo: 'bar'
      });
      $timeout.flush();
    });

    it('handles a boom error object', function () {
      sinon.spy(request, 'reject');
      expect(request.fulfill({
        error: 'Error!',
        statusCode: 404
      }))
      .to.be.rejected
      .then(function (err) {
        expect(request.reject)
          .to.have.been.calledWith(sinon.match({
            status: 404,
            data: {
              statusCode: 404,
              error: 'Error!'
            }
          }));
        expect(err.statusCode).to.equal(404);
        expect(err.message).to.equal('Error!');
      });
      $timeout.flush();
    });

  });

  describe('#reject', function () {

    it('handles generic errors', function () {
      expect(request.reject({
        status: 404,
        data: {
          statusCode: 404,
          error: 'Not Found'
        }
      }))
      .to.be.rejected
      .then(function (err) {
        expect(err.message).to.equal('Not Found');
        expect(err.statusCode).to.equal(404);
        expect(err.data).to.deep.equal({
          statusCode: 404,
          error: 'Not Found'
        });
      });
      $timeout.flush();
    });

    it('handles custom error messages', function () {
      expect(request.reject({
        status: 404,
        data: {
          statusCode: 404,
          error: 'Not Found',
          message: 'Oh dear...'
        }
      }))
      .to.be.rejected
      .then(function (err) {
        expect(err.message).to.equal('Oh dear...');
      });
      $timeout.flush();
    });

    it('handles bad responses', function () {
      expect(request.reject({
        status: 0,
        data: void 0
      }))
      .to.be.rejected
      .then(function (err) {
        expect(err.statusCode).to.equal(0);
        expect(err.data).to.be.empty;
        expect(err.name).to.equal('Invalid Response');
        expect(err.message).to.equal(err.name);
      });
      $timeout.flush();
    });

  });

  describe('#then', function () {

    it('handles success and failure', function () {
      var then = sinon.spy(request.deferred.promise, 'then');
      var success = sinon.spy();
      var failure = sinon.spy();
      expect(request.then(success, failure)).to.respondTo('then');
      expect(then).to.have.been.calledWith(success, failure);
    });

  });

  describe('#catch', function () {

    it('handles failure', function () {
      var pCatch = sinon.spy(request.deferred.promise, 'catch');
      var failure = sinon.spy();
      expect(request.catch(failure)).to.respondTo('then');
      expect(pCatch).to.have.been.calledWith(failure);
    });

  });

});


text:
package com.github.javaparser.ast.stmt;

import com.github.javaparser.Range;
import com.github.javaparser.ast.expr.Expression;
import com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;

/**
 * @author Julio Vilmar Gesser
 */
public final class SynchronizedStmt extends Statement implements NodeWithBlockStmt<SynchronizedStmt> {

    private Expression expr;

    private BlockStmt block;

    public SynchronizedStmt() {
    }

    public SynchronizedStmt(final Expression expr, final BlockStmt block) {
        setExpr(expr);
        setBlock(block);
    }

    public SynchronizedStmt(Range range, final Expression expr,
                            final BlockStmt block) {
        super(range);
        setExpr(expr);
        setBlock(block);
    }

    @Override
    public <R, A> R accept(final GenericVisitor<R, A> v, final A arg) {
        return v.visit(this, arg);
    }

    @Override
    public <A> void accept(final VoidVisitor<A> v, final A arg) {
        v.visit(this, arg);
    }

    /**
     * @deprecated use {@link #getBody()}
     * @return
     */
    @Deprecated
    public BlockStmt getBlock() {
        return block;
    }

    public Expression getExpr() {
        return expr;
    }

    /**
     * @deprecated Use {@link #setBody(BlockStmt)} instead
     * @param block
     */
    @Deprecated
    public SynchronizedStmt setBlock(final BlockStmt block) {
        this.block = block;
        setAsParentNodeOf(this.block);
        return this;
    }

    public SynchronizedStmt setExpr(final Expression expr) {
        this.expr = expr;
        setAsParentNodeOf(this.expr);
        return this;
    }

    @Override
    public BlockStmt getBody() {
        return block;
    }

    @Override
    public SynchronizedStmt setBody(BlockStmt block) {
        this.block = block;
        setAsParentNodeOf(this.block);
        return this;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="blue"> #0b6184</color>
    <color name="blue_light"> #3f92d2</color>
    <color name="blue_dark"> #25567b</color>
    <color name="yellow">#FFD200</color>
    <color name="yellow_light">#FFDD40</color>
    <color name="yellow_dark">#BFA630</color>
    <color name="red">#ff0700</color>
    <color name="red_light">#ff4540</color>
    <color name="red_dark">#bf3330</color>
    <color name="orange">#ff9200</color>
    <color name="orange_light">#ffad40</color>
    <color name="orange_dark">#bf8230</color>
    <color name="white">#ffffff</color>
</resources>


text:
#import "SObjectDataFieldSpec.h"

@implementation SObjectDataFieldSpec

- (id)initWithFieldName:(NSString *)fieldName searchable:(BOOL)isSearchable {
    self = [super init];
    if (self) {
        self.fieldName = fieldName;
        self.isSearchable = isSearchable;
    }
    return self;
}

@end