text:
project_path: /web/_project.yaml
book_path: /web/tools/_book.yaml
description: Bibliotecas de service worker.

{# wf_published_on: 2015-01-01 #}
{# wf_updated_on: 2016-11-07 #}

# Bibliotecas de service worker {: .page-title }

Use nossas bibliotecas de [service worker](/web/fundamentals/getting-started/primers/service-workers)
para simplificar o desenvolvimento, eliminando código
clichê de service workers.

Visão geral das bibliotecas de service workers

**sw-precache —** integra-se ao processo de compilação para gerar um service
worker que armazena previamente em cache ativos estáticos como, por exemplo, um shell
de aplicativo.

**sw-toolbox —** implementa padrões comuns de armazenamento em cache em tempo de execução, como conteúdo
dinâmico, chamadas de API e recursos de terceiros com a mesma facilidade da criação de um arquivo LEIAME.

**sw-offline-google-analytics —** retém temporariamente e tenta executar
novamente solicitações de análise para evitar perdê-las em desconexões de rede.

## Por que usar bibliotecas de service workers?

Você já está convencido das vantagens de adicionar um service worker ao seu app
da Web, trocando a incerteza da rede pela promessa de uma experiência rápida, voltada ao modo
off-line com base em service workers. No entanto, para criar o seu próprio service worker
desde o início, você tem de superar alguns obstáculos:

* Armazenar previamente em cache URLs com facilidade e confiabilidade.
* Incrementar uma string de versão de cache para garantir a atualização de recursos armazenados previamente em
  cache.
* Implementar uma estratégia de expiração de cache para considerar o tamanho do cache ou o vencimento
  da entrada.
* Criar padrões comuns como tempos limite de rede e código clichê [lie-fi](http://www.urbandictionary.com/define.php?term=lie-fi).

* Capturar e relatar dados do Google Analytics durante o uso off-line.

Você pode resolver todos esses inconvenientes usando nossas bibliotecas de service workers.

## Service Worker Precache

O [Service Worker Precache](https://github.com/GoogleChrome/sw-precache/) (`sw-precache`) é um
módulo para gerar um service worker que
armazena previamente em cache os recursos. O módulo pode ser usado em scripts de compilação baseados em JavaScript,
como os criados pelo [`gulp`](https://gulpjs.com/), além de oferecer uma
[interface de linha de comando](https://github.com/GoogleChrome/sw-precache/#command-line-interface). Você pode usar o módulo
diretamente ou, se preferir usar os [wrappers](https://github.com/GoogleChrome/sw-precache/#wrappers-and-starter-kits)
em volta de `sw-precache` para ambientes de compilação específicos, como
[`webpack`](https://webpack.github.io/).

Ele pode ser [usado juntamente com](https://github.com/GoogleChrome/sw-precache/blob/master/sw-precache-and-sw-toolbox.md) a biblioteca [`sw-toolbox`](https://github.com/GoogleChrome/sw-toolbox),
que funciona bem seguindo o [modelo App Shell + conteúdo dinâmico](/web/fundamentals/architecture/app-shell).

A documentação completa está no arquivo [leiame](https://github.com/GoogleChrome/sw-precache/blob/master/README.md).
O [guia de primeiros passos](https://github.com/GoogleChrome/sw-precache/blob/master/GettingStarted.md)
oferece um ponto de partida mais rápido.

[Obter sw-precache](https://github.com/GoogleChrome/sw-precache/){: .button .button-primary }

### Recursos

| Recurso | Resumo |
|---------|---------|
| Armazene previamente em cache o shell do aplicativo | O shell do seu app da Web (HTML, JavaScript e CSS essenciais) pode ser armazenado previamente em cache quando um usuário acessa a sua página. |
| Integração em tempo de compilação | Coloque-o no processo de compilação existente: [Gulp](https://github.com/GoogleChrome/sw-precache/blob/master/demo/gulpfile.js), [Grunt](https://github.com/GoogleChrome/sw-precache/blob/master/demo/Gruntfile.js) ou [linha de comando](https://github.com/GoogleChrome/sw-precache#command-line-interface). |
| Sempre atualizado | Mudanças na sua versão atualizam o script dos service workers. Os usuários recebem atualizações, mas não é necessário controlar manualmente a versão do conteúdo ou dos caches. |
| Sem rede, sem problema | Os recursos estáticos são entregues [primeiro do cache](/web/fundamentals/instant-and-offline/offline-cookbook/#cache-falling-back-to-network), rapidamente, independentemente de a rede estar ou não disponível. |

## Service Worker Toolbox

O [Service Worker Toolbox](https://github.com/GoogleChrome/sw-toolbox/) (`sw-toolbox`) oferece
alguns auxiliares simples para uso na criação de seus próprios service workers. Especificamente,
ele oferece padrões comuns de armazenamento em cache e uma
[abordagem expressiva](https://googlechrome.github.io/sw-toolbox/docs/master/tutorial-api#expressive-approach)
do uso dessas estratégias para solicitações em tempo de execução.

[Obter sw-toolbox](https://github.com/GoogleChrome/sw-toolbox/){: .button .button-primary }

### Recursos

| Recurso | Resumo |
|---------|---------|
| Armazenamento em cache em tempo de execução | Armazene em cache recursos grandes ou pouco usados, como imagens, em tempo de execução, quando forem usados pela primeira vez. |
| Fallbacks off-line | Carregue imagens novas, respostas de API e outro conteúdo dinâmico pela rede quando estiver on-line, mas faça fallback para um marcador armazenado em cache quando off-line. |
| Adeus Lie-Fi | Enfrente o [lie-fi](https://www.youtube.com/watch?v=oRcxExzWlc0) executando automaticamente fallback para uma resposta armazenada em cache quando a rede ficar muito lenta. |
| Combata a ocupação excessiva do cache | Essa imagem do mês passado não precisa ficar no cache para sempre. A expiração do cache com base em com pouco uso recente ou vencidos ajuda a liberar espaço.|

## Google Analytics off-line

O [Google Analytics off-line](https://github.com/GoogleChrome/sw-helpers/tree/master/packages/sw-offline-google-analytics)
retém temporariamente e tenta executar novamente solicitações de análise para evitar perdê-las em desconexões
de rede. Essa ferramenta pode ser instalada facilmente no sistema de compilação
usando npm e importada com facilidade para o script do service worker. Configure-a usando uma
chamada de função parametrizada.

[Obter sw-offline-google-analytics](https://github.com/GoogleChrome/sw-helpers/tree/master/packages/sw-offline-google-analytics){: .button .button-primary }

### Recursos

| Recurso | Resumo |
|---------|---------|
| Google Analytics off-line | Cria gerenciadores de recuperação que garantem a disponibilidade off-line do JavaScript do Google Analytics. |
| Armazena temporariamente dados em cache | Mantém solicitações de análise efetuadas quando o dispositivo está off-line e tenta executá-las novamente na próxima vez em que o service worker é inicializado. |
| Valores para reprodução personalizada | Pares chave-valor a serem adicionados a solicitações reproduzidas do Google Analytics. Por exemplo, você pode definir uma dimensão personalizada para indicar que uma solicitação foi reproduzida. |
| Parâmetros de ocorrência modificados | Permite modificar programaticamente os parâmetros de uma ocorrência para, por exemplo, rastrear o tempo decorrido em uma tentativa e reprodução de ocorrência. |

## Saiba mais

### Artigos

[Primeiros passos com o sw-toolbox](http://deanhume.com/home/blogpost/getting-started-with-the-service-worker-toolbox/10134), de Dean Hume

[Adicionar compatibilidade com o modo off-line para create-react-app usando sw-precache](https://medium.com/dev-channel/create-react-pwa-7b69425ffa86#.nqsrshawm), de Jeffrey Posnick

O estudo de caso [Service workers em produção](/web/showcase/case-study/service-workers-iowa)
oferece uma visão aprofundada sobre como as bibliotecas `sw-precache` e `sw-toolbox`
foram usadas juntas como base para o
[app da Web da Google I/O 2015](https://events.google.com/io2015/).

### Codelabs

[Adicionar um service worker com sw-precache](https://codelabs.developers.google.com/codelabs/sw-precache/index.html#0)

### Vídeos

A apresentação de Jeff Posnick do Chrome Dev Summit 2015,
_Carregamento instantâneo com service workers_, descreve como usar eficazmente
`sw-precache` e `sw-toolbox` juntos para criar apps da Web que podem ser carregados rapidamente e
funcionar off-line.

[Slides](https://speakerdeck.com/jeffposnick/instant-loading-with-service-workers-chrome-dev-summit-15)

Matt Gaunt e Addy Osmani explicam como nossas bibliotecas de service workers podem ajudar
apps da Web a funcionar off-line quase que imediatamente. Este vídeo descreve
`sw-precache` e `sw-toolbox`.

Neste episódio de Totally Tooling Mini-Tips, Matt e Addy percorrem o
`sw-toolbox`.

Na Google I/O 2016, Mat Scales descreve bibliotecas e ferramentas ótimas para fazer com que
Progressive Web Apps sejam carregados rapidamente, funcionem muito bem off-line e sejam aprimorados progressivamente,
tudo isso para oferecer uma melhor experiência do usuário.

{# wf_devsite_translation #}


text:
// Copyright (c) Gaurav Aroraa
// Licensed under the MIT License. See License.txt in the project root for license information.
using NUnit.Framework;

namespace TDD_Katas_project.OddEvenKata
{
    [TestFixture]
    [Category("OddEven Kata")]
    public class TestOddEven
    {
        [Test]
        [TestCase(1, 50)]
        [TestCase(1, 100)]
        [TestCase(5, 150)]
        public void CanPrintOddEven(int startRange, int endRange)
        {
            var result = OddEven.PrintOddEven(startRange, endRange);
            Assert.NotNull(result, string.Format("{0}", result));
        }

        [Test]
        [TestCase(1, "Odd")]
        [TestCase(3, "3")]
        [TestCase(5, "5")]
        [TestCase(4, "Even")]
        [TestCase(9, "Odd")]
        [TestCase(10, "Even")]
        public void CanPrintOddEvenForSingleNumber(int number, string expectedresult)
        {
            var actualresult = OddEven.PrintSingleOddEven(number);
            Assert.That(expectedresult, Is.EqualTo(actualresult),
                        string.Format("result of entered number [{0}] is [{1}] but it should be [{2}]", number,
                                      actualresult, expectedresult));
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">

	<mvc:annotation-driven>
		<mvc:argument-resolvers>
			<bean class="org.springframework.web.servlet.config.TestWebArgumentResolver"/>
			<bean class="org.springframework.web.servlet.config.TestHandlerMethodArgumentResolver"/>
            <ref bean="customArgumentResolver" />
		</mvc:argument-resolvers>
	</mvc:annotation-driven>

    <bean id="customArgumentResolver" class="org.springframework.web.servlet.config.TestHandlerMethodArgumentResolver"/>

</beans>


text:
{% extends "base.html" %}

{% block title %}The Blue Alliance - Match Input{% endblock %}

{% block meta_description %}Interface to update matches using The Blue Alliance's write API.{% endblock %}

{% block content %}

2015 Championship Match Input

Because we care, and we know you do too!

Setup

      <form class="form-horizontal" role="form">

          Event Key

            <input type="text" class="form-control" id="event_key" placeholder="Event Key">

          Auth Id

            <input type="password" class="form-control" id="auth_id" placeholder="Auth ID">

          Auth Secret

            <input type="password" class="form-control" id="auth_secret" placeholder="Auth Secret">

      </form>

Update Matches

      <button class="btn btn-success" id="setup-ok"> Get Matches</button>

{% endblock %}

{% block inline_javascript %}

{% endblock %}


text:
package ru.fastcards.recipientselectors;

import ru.fastcards.ListContacts;
import ru.fastcards.R;
import ru.fastcards.common.Comunication;
import ru.fastcards.common.ISendableItem;
import ru.fastcards.manager.ManageGroupActivity;
import ru.fastcards.social.api.VkLoginActivity;
import ru.fastcards.utils.Account;
import ru.fastcards.utils.Constants;
import ru.fastcards.utils.Utils;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Switch;
import android.widget.TextView;

import com.sromku.simple.fb.SimpleFacebook;
import com.sromku.simple.fb.SimpleFacebook.OnLoginListener;

public class SendYourselfActivity extends SelectorActivity {
	private CompoundButton sendYourselfTrigger;

	private Account account = Account.getInstance();

	private Context context;
	private ImageView contactInfoIv;
	private TextView contactInfoTv;
	private LinearLayout sendYourselfContactView;

	@Override
	public void onItemRemove() {}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.context = this;
	}

	protected OnItemClickListener itemClickListener = new OnItemClickListener() {
		@Override
		public void onItemClick(AdapterView<?> parent, View view, int position,	long id) {
			ISendableItem item = itemsList.get(position - 1);
			if (item.isGroup())
				startPreviewListActivity(((ListContacts) item), Constants.FLAG_MODIFY_TEMPORARY, position - 1);
		}
	};

	void startPreviewListActivity(ListContacts group, String flag, int position) {
		Intent intent = new Intent(this, PreviewListActivity.class);
		intent.putExtra(Constants.EXTRA_ID, group.getId());
		startActivity(intent);
	}

	/**
	 * Creates send yourself header view.
	 * @return header view
	 */
	protected View getHeaderView(){
		LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
		View header = inflater.inflate(R.layout.header_recipient_selector, null);

		contactInfoIv = (ImageView) header.findViewById(R.id.iv_contact_icon);
		contactInfoTv = (TextView) header.findViewById(R.id.tv_recipient_name);
		sendYourselfContactView = (LinearLayout) header.findViewById(R.id.ll_contact_info);

		Comunication com = account.getPrimaryComunication(context);
		setInfoView(com == null? null : com.getType());

		if (Utils.hasHoneycomb()) {
			sendYourselfTrigger = (Switch) header.findViewById(R.id.toogle_send_myself);
		} else {
			sendYourselfTrigger = (CheckBox) header.findViewById(R.id.toogle_send_myself);
		}
		sendYourselfTrigger.setOnCheckedChangeListener(onSendYourselfClickListener);
		return header;
	}

	private void setInfoView(String primaryContact) {
		contactInfoIv.setImageBitmap(getContactInfoBitmap(primaryContact));
		contactInfoTv.setText(getSendYourselfText(primaryContact));
		sendYourselfContactView.setOnClickListener(new OnUserContactInfoClickListener(context, contactInfoIv, contactInfoTv, primaryContact));
	}

	private OnCheckedChangeListener onSendYourselfClickListener = new OnCheckedChangeListener(){

		@Override
		public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
		{
			if (!sendYourselfTrigger.isChecked()){

			}else{
				if (account.isLoggedInFb()){
					setInfoView(Constants.COMUNICATION_TYPE_FB);
					sendYourselfTrigger.setChecked(true);
				}else if(account.isLoggedInVk()){
					setInfoView(Constants.COMUNICATION_TYPE_VK);
					sendYourselfTrigger.setChecked(true);
				}else{
					sendYourselfTrigger.setChecked(false);
					createLoginSocialDialog();
				}
			}
		}
	};

//	private boolean isLoggedInSomewere() {
//		return account.isLoggedInFb() || account.isLoggedInVk();
//	}

	private void createLoginSocialDialog() {
		AlertDialog.Builder builder = new AlertDialog.Builder(context);
		builder.setMessage(getString(R.string.str_auth_sn_to_sendyourself));

		builder.setPositiveButton(getString(R.string.str_vkontakte), vkAuthClickListener);
		builder.setNeutralButton(getString(R.string.str_facebook), fbAuthClickListener);
		builder.setNegativeButton(getString(R.string.str_cancel), cancelClickListener);

		builder.create().show();
	}

	private android.content.DialogInterface.OnClickListener vkAuthClickListener = new android.content.DialogInterface.OnClickListener(){
		@Override
		public void onClick(DialogInterface dialog, int which) {
			Intent intent = new Intent(context, VkLoginActivity.class);
			startActivityForResult(intent, Constants.REQUEST_VK_AUTH_SENDYOURSELF);
		}
	};

	private android.content.DialogInterface.OnClickListener fbAuthClickListener = new android.content.DialogInterface.OnClickListener(){;

		@Override
		public void onClick(DialogInterface dialog, int which) {
			SimpleFacebook.getInstance(((Activity) context)).login(facebookAuthCallback);
		}
	};

	private android.content.DialogInterface.OnClickListener cancelClickListener = new android.content.DialogInterface.OnClickListener(){
		@Override
		public void onClick(DialogInterface dialog, int which) {
			dialog.dismiss();
		}
	};

	private CharSequence getSendYourselfText(String primaryContact) {
		if (Constants.COMUNICATION_TYPE_VK.equals(primaryContact) && account.isLoggedInVk()){
			return getString(R.string.str_post_vk);
		}
		if (Constants.COMUNICATION_TYPE_FB.equals(primaryContact) && account.isLoggedInFb()){
			return getString(R.string.str_post_fb);
		}
		return getString(R.string.str_authorize);
	}

	private Bitmap getContactInfoBitmap(String comType) {
		System.out.println("getContactInfoBitmap "+ comType);
		Bitmap bmp = null;
		if (Constants.COMUNICATION_TYPE_VK.equals(comType) && account.isLoggedInVk()){
			return BitmapFactory.decodeResource(context.getResources(), R.drawable.btn_vk_medium);
		}

		if (Constants.COMUNICATION_TYPE_FB.equals(comType) && account.isLoggedInFb()){
			return BitmapFactory.decodeResource(context.getResources(), R.drawable.btn_fb_medium);

		}
		return bmp;
	}

	public boolean isSendYourself(){
		return sendYourselfTrigger.isChecked();
	}

	private OnLoginListener facebookAuthCallback = new OnLoginListener() {

		@Override
		public void onFail(String reason) {
			// TODO Auto-generated method stub

		}

		@Override
		public void onException(Throwable throwable) {
			// TODO Auto-generated method stub

		}

		@Override
		public void onThinking() {
			// TODO Auto-generated method stub

		}

		@Override
		public void onNotAcceptingPermissions() {
			// TODO Auto-generated method stub

		}

		@Override
		public void onLogin() {
			account.setPrimaryContact(context, Constants.COMUNICATION_TYPE_FB);
			setInfoView(account.getPrimaryComunication(context).getType());
			sendYourselfTrigger.setChecked(true);

		}
	};

	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
	    SimpleFacebook.getInstance().onActivityResult(this, requestCode, resultCode, data);
		super.onActivityResult(requestCode, resultCode, data);
		if (resultCode == RESULT_OK) {
			switch (requestCode) {
			case Constants.REQUEST_VK_AUTH_SENDYOURSELF: {
				account.setPrimaryContact(context, Constants.COMUNICATION_TYPE_VK);
				setInfoView(account.getPrimaryComunication(context).getType());
				sendYourselfTrigger.setChecked(true);
			}
				break;
			case Constants.REQUEST_MODIFY_GROUP: {
//				modifyGroup(data);
			}
				break;
			default:
				break;
			}
		}
	}

}


text:
require 'spec_helper'
require 'guard/zeus_server/runner'
require 'fakefs/spec_helpers'

describe Guard::ZeusServer::Runner do
  include FakeFS::SpecHelpers
  let(:options) { { :port => 3000, :command => "server" } }
  let(:runner) { Guard::ZeusServer::Runner.new(options) }
  let(:pid_file) { File.expand_path("tmp/pids/zeus_server.pid") }

  before do
    FileUtils.mkdir_p "/project"
    Dir.chdir "/project"
    runner.stub :system
  end

  describe "#start" do
    before do
      runner.stub(:wait_until) { true }
    end
    it "should start zeus server" do
      runner.should_receive(:system).with("cd /project; zeus server -d -p 3000 -P #{pid_file}")

      runner.start
    end

    it "should set the pid" do
      command_should_include(" -P #{pid_file}")

      runner.start
    end

    it "should be daemonized" do
      command_should_include(" -d")

      runner.start
    end

    it "should let you change the port" do
      options[:port] = 1234
      command_should_include(" -p 1234")

      runner.start
    end

    it "should delete the pidfile if it's not running" do
      create_pid_file(54444)
      runner.stub(:system).with("kill -0 54444") { false }

      runner.start
      File.file?(pid_file).should_not be
    end

    it "should not start the server if it is already running" do
      create_pid_file(54444)
      runner.stub(:system).with("kill -0 54444") { true }
      runner.should_not_receive(:system).with do |command|
        command =~ /zeus/
      end

      runner.start
    end
  end

  describe "#stop" do
    it "should kill an existing pid" do
      create_pid_file(54444)

      runner.should_receive(:system).with("kill -SIGINT 54444") do
        FileUtils.rm pid_file
      end
      runner.stub(:system).with("kill 0 54444") { false }

      runner.stop
    end
  end

  describe "#restart" do
    it "should stop then start" do
      runner.should_receive(:stop).ordered
      runner.should_receive(:start).ordered

      runner.restart
    end
  end

  def command_should_include(part)
    runner.should_receive(:system).with do |command|
      command.should match /#{part}\b/
    end
  end

  def create_pid_file(pid)
    FileUtils.mkdir_p File.dirname(pid_file)
    File.open(pid_file, 'w') { |file| file.print pid }
  end
end


text:
//********************************************************************
//*
//* Warning: This file was generated by ecore4CPP Generator
//*
//********************************************************************

#ifndef OCL_EXPRESSIONS_STATEEXPSTATEEXPIMPL_HPP
#define OCL_EXPRESSIONS_STATEEXPSTATEEXPIMPL_HPP

//*********************************
// generated Includes

// namespace macro header include
#include "ocl/ocl.hpp"

// model includes
#include "../StateExp.hpp"

#include "ocl/Expressions/impl/ExpressionsFactoryImpl.hpp"
#include "ocl/Expressions/impl/OclExpressionImpl.hpp"

//*********************************
namespace ocl::Expressions
{
	class OCL_API StateExpImpl : virtual public OclExpressionImpl, virtual public StateExp
	{
		public:
			StateExpImpl(const StateExpImpl & obj);
			virtual std::shared_ptr<ecore::EObject> copy() const;
			StateExpImpl& operator=(StateExpImpl const&);

		protected:
			friend class ocl::Expressions::ExpressionsFactoryImpl;
			StateExpImpl();
			virtual std::shared_ptr<ocl::Expressions::StateExp> getThisStateExpPtr() const;
			virtual void setThisStateExpPtr(std::weak_ptr<ocl::Expressions::StateExp> thisStateExpPtr);

			//Additional constructors for the containments back reference
			StateExpImpl(std::weak_ptr<ocl::Expressions::CallExp> par_appliedElement);
			//Additional constructors for the containments back reference
			StateExpImpl(std::weak_ptr<ocl::Expressions::IfExp> par_IfExp, const int reference_id);
			//Additional constructors for the containments back reference
			StateExpImpl(std::weak_ptr<ocl::Expressions::CollectionRange> par_CollectionRange, const int reference_id);
			//Additional constructors for the containments back reference
			//Additional constructors for the containments back reference
			StateExpImpl(std::weak_ptr<ocl::Expressions::Variable> par_initializedElement);
			//Additional constructors for the containments back reference
			//Additional constructors for the containments back reference
			StateExpImpl(std::weak_ptr<ocl::Expressions::LoopExp> par_loopBodyOwner);
			//Additional constructors for the containments back reference
			StateExpImpl(std::weak_ptr<ocl::Expressions::OperationCallExp> par_parentCall);
			//Additional constructors for the containments back reference
			StateExpImpl(std::weak_ptr<ocl::Expressions::NavigationCallExp> par_parentNav);
			//Additional constructors for the containments back reference
			//Additional constructors for the containments back reference
			StateExpImpl(std::weak_ptr<ocl::Expressions::ExpressionInOcl> par_topExpression);

		public:
			//destructor
			virtual ~StateExpImpl();

			//*********************************
			// Operations
			//*********************************

			//*********************************
			// Attribute Getters & Setters
			//*********************************

			//*********************************
			// Reference Getters & Setters
			//*********************************
			virtual std::shared_ptr<uml::State> getReferredState() const ;
			virtual void setReferredState(std::shared_ptr<uml::State>) ;

			//*********************************
			// Union Reference Getters
			//*********************************

			//*********************************
			// Container Getter
			//*********************************
			virtual std::shared_ptr<ecore::EObject> eContainer() const ;

			//*********************************
			// Persistence Functions
			//*********************************
			virtual void load(std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler) ;
			virtual void loadAttributes(std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler, std::map<std::string, std::string> attr_list);
			virtual void loadNode(std::string nodeName, std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler);
			virtual void resolveReferences(const int featureID, std::vector<std::shared_ptr<ecore::EObject> > references) ;
			virtual void save(std::shared_ptr<persistence::interfaces::XSaveHandler> saveHandler) const ;
			virtual void saveContent(std::shared_ptr<persistence::interfaces::XSaveHandler> saveHandler) const;

		protected:
			virtual std::shared_ptr<ecore::EClass> eStaticClass() const;

			//*********************************
			// EStructuralFeature Get/Set/IsSet
			//*********************************
			virtual Any eGet(int featureID, bool resolve, bool coreType) const ;
			virtual bool eSet(int featureID, Any newValue) ;
			virtual bool internalEIsSet(int featureID) const ;

			//*********************************
			// EOperation Invoke
			//*********************************
			virtual Any eInvoke(int operationID, std::shared_ptr<std::list<Any>> arguments) ;

		private:
			std::weak_ptr<ocl::Expressions::StateExp> m_thisStateExpPtr;
	};
}
#endif /* end of include guard: OCL_EXPRESSIONS_STATEEXPSTATEEXPIMPL_HPP */


text:
package ol;

import ol.View;
import ol.ViewOptions;
import ol.proj.Projection;
import ol.OLFactory;
import ol.proj.ProjectionOptions;

/**
 *
 * @author Tino Desjardins
 *
 */
public class ViewTest extends GwtOL3BaseTestCase {

    public void testView() {

        injectUrlAndTest(new TestWithInjection() {

            @Override
            public void test() {

                ProjectionOptions projectionOptions = OLFactory.createOptions();
                projectionOptions.setCode("EPSG:21781");
                projectionOptions.setUnits("m");

                assertNotNull(projectionOptions);

                Projection projection = new Projection(projectionOptions);

                assertNotNull(projection);

                ViewOptions viewOptions = OLFactory.createOptions();
                viewOptions.setProjection(projection);
                View view = new View(viewOptions);

                Coordinate centerCoordinate = OLFactory.createCoordinate(660000, 190000);

                view.setCenter(centerCoordinate);
                view.setZoom(9);

                assertNotNull(view);
                assertTrue(view instanceof Object);

            }

        });

    }

}


text:
#include "NxOgreStable.h"
#include "NxOgreWorld.h"
#include "NxOgreWorldDescription.h"
#include "NxOgrePrototypeFunctions.h"
#include "NxOgreErrorStream.h"
#include "NxOgreResourceSystem.h"
#include "NxOgreMeshManager.h"
#include "NxOgreHeightFieldManager.h"
#include "NxOgreReason.h"
#include "NxOgrePhysXOutputStream.h"
#include "NxOgrePhysXUserAllocator.h"
#include "NxOgreScene.h"
#include "NxOgreSceneDescription.h"
#include "NxOgreCallback.h"
#include "NxOgreVisualDebugger.h"
#include "NxOgreRemoteDebugger.h"
#include "NxOgreUtil.h"
#include "NxOgrePrincipalScene.h"
#include "NxOgreAuxiliaryScene.h"
#include "NxPhysics.h"
#include "NxCooking.h"

#if NxOgreHasCharacterController == 1
#include "ControllerManager.h"
#include "NxOgrePhysXControllerHitReport.h"
#endif

namespace NxOgre
{

World* World::sWorldInstance = 0;
NxCookingInterface* World::mCookingInterface = 0;

void World::precreateSingletons()
{

 mCookingInterface = NxGetCookingLib(NX_PHYSICS_SDK_VERSION);

 if (mCookingInterface == 0)
 {
  throw PhysXSystemSoftwareException(__FILE__, __LINE__, Classes::_World);
  return;
 }

 mCookingInterface->NxInitCooking();

 if (ErrorStream::getSingleton() == 0)
 {
  NxOgre_DebugPrint_Core("World::precreateSingletons -- Creating ErrorStream");
  GC::safe_new0<ErrorStream>(NXOGRE_GC_THIS);
 }

 if (ResourceSystem::getSingleton() == 0)
 {
  NxOgre_DebugPrint_Core("World::precreateSingletons -- Creating ResourceSystem");
  GC::safe_new0<ResourceSystem>(NXOGRE_GC_THIS);
 }

 if (MeshManager::getSingleton() == 0)
 {
  NxOgre_DebugPrint_Core("World::precreateSingletons -- Creating MeshManager");
  GC::safe_new0<MeshManager>(NXOGRE_GC_THIS);
 }

 if (HeightFieldManager::getSingleton() == 0)
 {
  NxOgre_DebugPrint_Core("World::precreateSingletons -- Creating HeightFieldManager");
  GC::safe_new0<HeightFieldManager>(NXOGRE_GC_THIS);
 }

#ifdef NXOGRE_OPTIONS_USE_LOG
 {
  Resource* resource = ResourceSystem::getSingleton()->open(Path("file://NxOgre.log"), Enums::ResourceAccess_WriteOnly);
  if (resource)
   ErrorStream::getSingleton()->setLogResource(resource);
 }
#endif

 NxOgre_DebugPrint_Core("World::precreateSingletons -- Function Exit -- Okay");

}

void World::destroySingletons()
{

 if (ErrorStream::getSingleton() != 0)
 {
  NxOgre_DebugPrint_Core("World::precreateSingletons -- Destroying ErrorStream");
  GC::safe_delete(ErrorStream::getSingleton(), NXOGRE_GC_THIS);
  ResourceSystem::sSingleton = 0;
 }

 if (ResourceSystem::getSingleton() != 0)
 {
  NxOgre_DebugPrint_Core("World::precreateSingletons -- Destroying ResourceSystem");
  GC::safe_delete(ResourceSystem::getSingleton(), NXOGRE_GC_THIS);
  ResourceSystem::sSingleton = 0;
 }

 if (MeshManager::getSingleton() != 0)
 {
  NxOgre_DebugPrint_Core("World::precreateSingletons -- Destroying MeshManager");
  GC::safe_delete(MeshManager::getSingleton(), NXOGRE_GC_THIS);
  MeshManager::sSingleton = 0;
 }

 if (HeightFieldManager::getSingleton() != 0)
 {
  NxOgre_DebugPrint_Core("World::precreateSingletons -- Destroying HeightFieldManager");
  GC::safe_delete(HeightFieldManager::getSingleton(), NXOGRE_GC_THIS);
  HeightFieldManager::sSingleton = 0;
 }

 mCookingInterface->NxCloseCooking();

}

World* World::createWorld(const WorldDescription& description)
{

 if (World::sWorldInstance != 0)
 {
  NxOgre_DebugPrint_Core("World::createWorld -- World could not be created. Reason: sWorldInstance is not null. sWorldInstance = '" << sWorldInstance << "'");
  return 0;
 }

 precreateSingletons();
 World::sWorldInstance = GC::safe_new1<World>(description, NXOGRE_GC_THIS);
 NxOgre_DebugPrint_Core("World::createWorld -- World was created, pointer is = '" << sWorldInstance << "'");
 return World::sWorldInstance;

}

void World::destroyWorld(bool also_destroy_singletons)
{

 if (World::sWorldInstance == 0)
 {
  NxOgre_DebugPrint_Core("World::destroyWorld -- World could not be destroyed. Reason: sWorldInstance pointer is null.");
  return;
 }

#if NXOGRE_DEBUG_MEMORY == 1
 GC::gc_debugger_last_frame();
#endif

#if NxOgreHasCharacterController == 1
 if (World::sWorldInstance->mControllerManager != 0)
 {
  NxReleaseControllerManager(World::sWorldInstance->mControllerManager);
  World::sWorldInstance->mControllerManager = 0;
 }
#endif

 // Clear all scenes
 World::sWorldInstance->mScenes.remove_all();

 // Clear all singletons
 if (also_destroy_singletons)
  destroySingletons();

 // Shutdown PhysX.
 GC::safe_delete(World::sWorldInstance, NXOGRE_GC_THIS);
 World::sWorldInstance = 0;

 NxOgre_DebugPrint_Core("World::destroyWorld -- World is destroyed.");

}

World::World(const WorldDescription& description)
: mSDK(0), mDeadSDK(false), mPhysXOutputStream(0), mPhysXUserAllocator(0), mNullCallback(0)
#if NxOgreHasCharacterController == 1
 , mControllerManager(0)
 , mPhysXCharacterHitReport(0)
#endif
{

 mPhysXOutputStream = GC::safe_new0<PhysXOutputStream>(NXOGRE_GC_THIS);
 mPhysXUserAllocator = GC::safe_new0<PhysXUserAllocator>(NXOGRE_GC_THIS);
 mNullCallback = GC::safe_new0<Callback>(NXOGRE_GC_THIS);

 NxPhysicsSDKDesc sdk_description;
 sdk_description.cookerThreadMask = description.mCookerThreadMask;

 sdk_description.flags = 0;
#if NX_SDK_VERSION_MAJOR >= 2 && NX_SDK_VERSION_MINOR >= 8 && NX_SDK_VERSION_BUGFIX > 1
 sdk_description.flags |= NX_SDKF_PER_SCENE_BATCHING;
#endif

 if (description.mNoHardware)
  sdk_description.flags |= NX_SDKF_NO_HARDWARE;

 sdk_description.hwConvexMax = description.mHardwareMaximumConvex;
 sdk_description.hwPageMax = description.mHardwareMaximumPage;
 sdk_description.hwPageSize = 65536; // Restriction imposed by NxPhysXSDKDesc

 NxSDKCreateError errorCode = NXCE_NO_ERROR;
 mSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION, mPhysXUserAllocator, mPhysXOutputStream, sdk_description, &errorCode);

 if (errorCode != NXCE_NO_ERROR || mSDK == 0)
 {

  if (errorCode == NXCE_PHYSX_NOT_FOUND)
  {
    throw PhysXSystemSoftwareException(__FILE__, __LINE__, Classes::_World);
  }
  else
  {
    NxOgre_ThrowException(PhysXSDKCreationFailedException, Reason::Exceptionise(sdk_description, mSDK == 0, errorCode), Classes::_World);
  }

  mDeadSDK = true;
  return;
 }

 mVisualDebugger = GC::safe_new1<VisualDebugger>(this);
 mRemoteDebugger = GC::safe_new1<RemoteDebugger>(this);

}

World::~World()
{

 GC::safe_delete(mRemoteDebugger, NXOGRE_GC_THIS);
 GC::safe_delete(mVisualDebugger, NXOGRE_GC_THIS);

 mScenes.remove_all();

 if (!mDeadSDK && mSDK)
  mSDK->release();

 GC::safe_delete(mNullCallback, NXOGRE_GC_THIS);
 GC::safe_delete(mPhysXOutputStream, NXOGRE_GC_THIS);
 GC::safe_delete(mPhysXUserAllocator, NXOGRE_GC_THIS);

}

bool World::isDead() const
{
 return mDeadSDK;
}

Scene* World::createScene(const NxOgre::SceneDescription& description, Enums::SceneType scene_type)
{

 Scene* scene = 0;

 if (scene_type == Enums::SceneType_Prinicipal)
  scene = GC::safe_new2<PrincipalScene>(description, mSDK, NXOGRE_GC_THIS);
 else
  scene = GC::safe_new2<AuxiliaryScene>(description, mSDK, NXOGRE_GC_THIS);

 mScenes.insert(scene->getNameHash(), scene);

 return scene;

}

void World::destroyScene(Scene* scene)
{

 if (scene == 0)
  return;

 mScenes.remove(scene->getNameHash(), scene);

}

bool World::hasHardware() const
{
 if (mDeadSDK)
  return false;
 return mSDK->getHWVersion() != NX_HW_VERSION_NONE;
}

Enums::HardwareVersion World::getHardwareVersion() const
{
 return (Enums::HardwareVersion) (int) mSDK->getHWVersion();
}

World* World::getWorld()
{
 return sWorldInstance;
}

World* World::getSingleton()
{
 return sWorldInstance;
}

Callback* World::getNullCallback() const
{
 return mNullCallback;
}

VisualDebugger* World::getVisualDebugger() const
{
 return mVisualDebugger;
}

RemoteDebugger* World::getRemoteDebugger() const
{
 return mRemoteDebugger;
}

World::SceneIterator World::getScenes() const
{
 return mScenes.elements();
}

NxPhysicsSDK* World::getPhysXSDK() const
{
 return mSDK;
}

NxCookingInterface* World::getPhysXCookingInterface() const
{
 return mCookingInterface;
}

#if NxOgreHasCharacterController == 1

NxControllerManager* World::getPhysXControllerManager()
{
 if (mControllerManager == 0)
  mControllerManager = NxCreateControllerManager(mPhysXUserAllocator);

 return mControllerManager;
}

PhysXCharacterHitReport* World::getPhysXCharacterHitReport()
{
 if (mPhysXCharacterHitReport == 0)
  mPhysXCharacterHitReport = new PhysXCharacterHitReport();

 return mPhysXCharacterHitReport;
}

#endif

void World::advance(Real deltaTime)
{
 // Primary Simulation and Rendering.
 for (SceneIterator it = mScenes.elements(); it != it.end(); it++)
 {
  it->simulate(deltaTime);
  if (it->canRender() == false)
   mSceneSecondaryBuffer.push_back((*it));
  else
   it->render(deltaTime);
 } // for

 // Secondary Rendering
 if (mSceneSecondaryBuffer.size())
 {
  for (SceneBufferIterator it = mSceneSecondaryBuffer.elements(); it != it.end(); it++)
  {
   if (it->canRender() == false)
    mSceneTertiaryBuffer.push_back((*it));
   else
    it->render(deltaTime);
  } // for
  mSceneSecondaryBuffer.remove_all();
 } // if

 // Tertiary Rendering
 if (mSceneTertiaryBuffer.size())
 {
  for (SceneBufferIterator it = mSceneTertiaryBuffer.elements(); it != it.end(); it++)
  {
   while(true)
   {
    if (it->canRender() == false)
     continue;
    it->render(deltaTime);
    break;
   } // while
  } // for
  mSceneTertiaryBuffer.remove_all();
 } // if

}

void World::setSkinWidth(float value)
{
 mSDK->setParameter(NX_SKIN_WIDTH, value);
}

float World::getSkinWidth() const
{
 return mSDK->getParameter(NX_SKIN_WIDTH);
}

void World::setDefaultSleepLinearVelocitySquared(float value)
{
 mSDK->setParameter(NX_DEFAULT_SLEEP_LIN_VEL_SQUARED, value);
}

float World::getDefaultSleepLinearVelocitySquared() const
{
 return mSDK->getParameter(NX_DEFAULT_SLEEP_LIN_VEL_SQUARED);
}

void World::setDefaultSleepAngularVelocitySquared(float value)
{
 mSDK->setParameter(NX_DEFAULT_SLEEP_ANG_VEL_SQUARED, value);
}

float World::getDefaultSleepAngularVelocitySquared() const
{
 return mSDK->getParameter(NX_DEFAULT_SLEEP_ANG_VEL_SQUARED);
}

void World::setBounceThreshold(float value)
{
 mSDK->setParameter(NX_BOUNCE_THRESHOLD, value);
}

float World::getBounceThreshold() const
{
 return mSDK->getParameter(NX_BOUNCE_THRESHOLD);
}

void World::setDynamicFrictionScaling(float value)
{
 mSDK->setParameter(NX_DYN_FRICT_SCALING, value);
}

float World::getDynamicFrictionScaling() const
{
 return mSDK->getParameter(NX_DYN_FRICT_SCALING);
}

void World::setStaticFrictionScaling(float value)
{
 mSDK->setParameter(NX_STA_FRICT_SCALING, value);
}

float World::getStaticFrictionScaling() const
{
 return mSDK->getParameter(NX_STA_FRICT_SCALING);
}

void World::setMaxAngularVelocity(float value)
{
 mSDK->setParameter(NX_MAX_ANGULAR_VELOCITY, value);
}

float World::getMaxAngularVelocity() const
{
 return mSDK->getParameter(NX_MAX_ANGULAR_VELOCITY);
}

void World::setCCDEnabled(bool value)
{
 mSDK->setParameter(NX_CONTINUOUS_CD, float(value));
}

bool World::getCCDEnabled() const
{
 return mSDK->getParameter(NX_CONTINUOUS_CD) == 1.0f;
}

void World::setCCDEpsilon(float value)
{
 mSDK->setParameter(NX_CCD_EPSILON, value);
}

float World::getCCDEpilson() const
{
 return mSDK->getParameter(NX_CCD_EPSILON);
}

void World::setAdaptiveForce(float value)
{
 mSDK->setParameter(NX_ADAPTIVE_FORCE, value);
}

float World::getAdaptiveForce() const
{
 return mSDK->getParameter(NX_ADAPTIVE_FORCE);
}

void World::setJointCollisionsEnabled(bool value)
{
 mSDK->setParameter(NX_COLL_VETO_JOINTED, float(value));
}

bool World::getJointCollisionsEnabled() const
{
 return mSDK->getParameter(NX_COLL_VETO_JOINTED) == 1.0f;
}

void World::setTriggerTriggerCallbackEnabled(bool value)
{
 mSDK->setParameter(NX_TRIGGER_TRIGGER_CALLBACK, float(value));
}

bool World::getTriggerTriggerCallbackEnabled() const
{
 return mSDK->getParameter(NX_TRIGGER_TRIGGER_CALLBACK) == 1.0f;
}

void World::setSolverConvergenceThreshold(float value)
{
 mSDK->setParameter(NX_SOLVER_CONVERGENCE_THRESHOLD, value);
}

float World::getSolverConvergenceThreshold() const
{
 return mSDK->getParameter(NX_SOLVER_CONVERGENCE_THRESHOLD);
}

void World::setBoundingBoxNoiseLevel(float value)
{
 mSDK->setParameter(NX_BBOX_NOISE_LEVEL, value);
}

float World::getBoundingBoxNoiseLevel() const
{
 return mSDK->getParameter(NX_BBOX_NOISE_LEVEL);
}

void World::setImplicitSweepCacheSize(float value)
{
 mSDK->setParameter(NX_IMPLICIT_SWEEP_CACHE_SIZE, value);
}

float World::getImplicitSweepCacheSize() const
{
 return mSDK->getParameter(NX_IMPLICIT_SWEEP_CACHE_SIZE);
}

void  World::setDefaultSleepEnergy(float value)
{
 mSDK->setParameter(NX_DEFAULT_SLEEP_ENERGY, value);
}

float World::getDefaultSleepEnergy() const
{
 return mSDK->getParameter(NX_DEFAULT_SLEEP_ENERGY);
}

void  World::setAsynchronousMeshCreation(bool value)
{
 mSDK->setParameter(NX_ASYNCHRONOUS_MESH_CREATION, bool(value));
}

bool World::getAsynchronousMeshCreation() const
{
 return mSDK->getParameter(NX_ASYNCHRONOUS_MESH_CREATION) == 1.0f;
}

void World::setForceFieldCustomKernelEpsilon(float value)
{
 mSDK->setParameter(NX_FORCE_FIELD_CUSTOM_KERNEL_EPSILON, value);
}

float World::getForceFieldCustomKernelEpsilon() const
{
 return mSDK->getParameter(NX_FORCE_FIELD_CUSTOM_KERNEL_EPSILON);
}

void World::setImprovedSpringSolver(bool value)
{
 mSDK->setParameter(NX_IMPROVED_SPRING_SOLVER, bool(value));
}

bool World::getImprovedSpringSolver() const
{
 return mSDK->getParameter(NX_IMPROVED_SPRING_SOLVER) == 1.0f;
}

std::string World::to_s() const
{
 return NxOgre::to_s((void*)this, String("World"));
}

} // namespace NxOgre


text:
package com.github.davidmoten.rx.jdbc;

import com.github.davidmoten.guavamini.Preconditions;

import rx.Observable;

/**
 * Builds base information for a query (either select or update).
 */
final class QueryBuilder {

    /**
     * JDBC sql either select/update/insert.
     */
    private String sql;

    /**
     * Parameters for the query corresponding to ? characters in the sql.
     */
    private Observable<Parameter> parameters = Observable.empty();

    /**
     * Observables to complete before the query is executed.
     */
    private Observable<?> depends = Observable.empty();

    /**
     * {@link Database} to use the query against.
     */
    private final Database db;

    /**
     * Execution context to use to run the query.
     */
    private final QueryContext context;

    /**
     * Constructor.
     *
     * @param sql
     * @param db
     */
    QueryBuilder(String sql, Database db) {
        this.sql = sql;
        this.db = db;
        this.context = db.queryContext();
    }

    /**
     * Appends the given parameters to the parameter list for the query. If
     * there are more parameters than required for one execution of the query
     * then more than one execution of the query will occur.
     *
     * @param params
     */
    <T> void parameters(Observable<T> params) {
        this.parameters = Observable.concat(parameters, params.map(Parameter.TO_PARAMETER));
    }

    /**
     * Appends the given parameter values to the parameter list for the query.
     * If there are more parameters than required for one execution of the query
     * then more than one execution of the query will occur.
     *
     * @param objects
     */
    void parameters(Object... objects) {
        for (Object object : objects)
            parameter(object);
    }

    /**
     * Appends a parameter to the parameter list for the query. If there are
     * more parameters than required for one execution of the query then more
     * than one execution of the query will occur.
     *
     * @param value
     */
    void parameter(Object value) {
        // TODO check on supported types?
        if (value instanceof Observable)
            throw new IllegalArgumentException(
                    "use parameters() method not the parameter() method for an Observable");
        parameters(Observable.just(value));
    }

    /**
     * Sets a named parameter. If name is null throws a
     * {@link NullPointerException}. If value is instance of Observable then
     * throws an {@link IllegalArgumentException}.
     *
     * @param name
     *            the parameter name. Cannot be null.
     * @param value
     *            the parameter value
     */
    void parameter(String name, Object value) {
        Preconditions.checkNotNull(name, "parameter name cannot be null");
        if (value instanceof Observable)
            throw new IllegalArgumentException(
                    "use parameters() method not the parameter() method for an Observable");
        this.parameters = parameters.concatWith(Observable.just(new Parameter(name, value)));
    }

    /**
     * Appends a dependency to the dependencies that have to complete their
     * emitting before the query is executed.
     *
     * @param dependency
     */
    void dependsOn(Observable<?> dependency) {
        depends = Observable.concat(depends, dependency);
    }

    /**
     * Appends a dependency on the result of the last transaction (
     * true for commit or false for rollback) to the
     * dependencies that have to complete their emitting before the query is
     * executed.
     */
    void dependsOnLastTransaction() {
        dependsOn(db.lastTransactionResult());
    }

    /**
     * Returns the sql of the query.
     *
     * @return sql
     */
    String sql() {
        return sql;
    }

    /**
     * Returns the parameters for the query.
     *
     * @return parameters
     */
    Observable<Parameter> parameters() {
        return parameters;
    }

    /**
     * Returns the dependencies of the query.
     *
     * @return dependencies
     */
    public Observable<?> depends() {
        return depends;
    }

    /**
     * Returns the query's {@link QueryContext}.
     *
     * @return context
     */
    QueryContext context() {
        return context;
    }

    void clearParameters() {
        this.parameters = Observable.empty();
    }

    void setSql(String sql) {
        this.sql = sql;
    }
}


text:
require 'spec_helper'
require 'aws/http/httparty_handler'

module AWS
  module Http
    describe HTTPartyHandler do

      let(:handler) { HTTPartyHandler.new(default_request_options) }

      let(:default_request_options) { {} }

      context '#initialize' do

        it 'should set the default request options' do
          described_class.new(:foo => "BAR").default_request_options.
            should == { :foo => "BAR" }
        end

      end

      context '#handle' do

        let(:req) do
          r = Http::Request.new
          r.host = "foo.bar.com"
          r
        end

        let(:resp) { Http::Response.new }

        let(:httparty_options) do
          options = nil
          HTTPartyHandler.should_receive(:post). with do |url, opts|
            options = opts
            double("http response",
               :body => "<foo/>",
               :code => 200,
               :to_hash => {})
          end
          handler.handle(req, resp)
          options
        end

        context 'default request options' do

          let(:default_request_options) do
           { :foo => "BAR",
              :ssl_ca_file => "blarg" }
          end

         it 'passes extra options through to HTTParty' do
            httparty_options[:foo].should == "BAR"
          end

          it 'uses the default when the request option is not set' do
            httparty_options[:ssl_ca_file].should == "blarg"
          end

          it 'prefers the request option when set' do
            req.use_ssl = true
            req.ssl_verify_peer = true
            req.ssl_ca_file = "something"
            httparty_options[:ssl_ca_file].should == "something"
          end

        end

        context ':proxy_uri' do

          it 'passes proxy address and port from the request' do

            req.proxy_uri = URI.parse('https://user:pass@proxy.com:443/path?query')

            httparty_options[:http_proxyaddr].
              should == 'https://user:pass@proxy.com/path?query'

            httparty_options[:http_proxyport].should == 443

          end

        end

        context 'CA cert path' do

          context 'use_ssl? is true' do

            before(:each) { req.use_ssl = true }

            context 'ssl_verify_peer? is true' do

              before(:each) do
                req.ssl_verify_peer = true
                req.ssl_ca_file = "foobar.txt"
              end

              it 'should use the ssl_ca_file attribute of the request' do
                httparty_options[:ssl_ca_file].should == "foobar.txt"
              end

            end

            it 'should not set the ssl_ca_file option without ssl_verify_peer?' do
              httparty_options.should_not include(:ssl_ca_file)
            end

          end

          it 'should not set the ssl_ca_file option without use_ssl?' do
            httparty_options.should_not include(:ssl_ca_file)
          end

        end

      end

    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

  <meta name="author" content="Ruven Pillay <ruven@users.sourceforge.netm>"/>
  <meta name="author" content="Ryan Chute <rchute@users.sourceforge.netm>"/>
  <meta name="keywords" content="djatoka IIPImage Ajax IIP Zooming Streaming High Resolution Mootools"/>
  <meta name="description" content="djatoka IIPImage Viewer: High Resolution Remote Image Streaming Viewing"/>
  <meta name="copyright" content="© 2003-2008 Ruven Pillay"/>

  <link rel="stylesheet" type="text/css" media="all" href="css/iip.compressed.css" />
  <link rel="shortcut icon" href="images/djatoka.16x16.png" />
  <title>djatoka Viewer, based on IIPMooViewer 1.1</title>


text:
<?php

namespace BungieNetPlatform\Services\Destiny\Manifest;

use BungieNetPlatform\BungieNet;
use Cola\Object;
use GuzzleHttp\Client as GuzzleClient;

/**
 * Content
 */
class Content extends Object {

	/**
	 * Language the content is in
	 * @var string
	 */
	protected $_Language;

	/**
	 * Path to the remote content file
	 * @var string
	 */
	protected $_Path;

	/**
	 *
	 * @param string $language
	 * @param string $path Remote path to compressed database file
	 */
	public function __construct($language, $path) {
		$this->_Language = $language;
		$this->_Path = $path;
	}

	/**
	 * Downloads and uncompresses the database file
	 * @return string Temp file location of database file
	 * @todo change _Path to be a Uri pointing to bungie.net
	 */
	public function downloadDatabase(){

		throw new \Cola\Exceptions\DeprecatedException(__METHOD__);

		//Download
		$client = new \GuzzleHttp\Client([
			'base_url' => BungieNet::PlatformPath() . '/'
		]);
		$r = $client->get($this->_Path);

		//Put response in temp file
		$fName = \tempnam(\sys_get_temp_dir(), '');
		$temp = \fopen($fName, 'w');
		\fwrite($temp, $r);
		\fclose($temp);

		//Load file into zip archive
		$zip = new \ZipArchive();
		$zip->open($fName);
		$dbTempFile = \tempnam(\sys_get_temp_dir(), '');
		$zip->extractTo($dbTempFile, [ $zip->getNameIndex(0) ]);

		//Clean up
		$zip->close();
		\unlink($fName);

		return $dbTempFile;

	}

	public function __toString() {
		return \sprintf('Manifest content [%s]', $this->_Language);
	}

}


text:
/* */
var argv = require("../index").usage('Count the lines in a file.\nUsage: $0').demand('f').alias('f', 'file').describe('f', 'Load a file').argv;
;
var fs = require("fs");
var s = fs.createReadStream(argv.file);
var lines = 0;
s.on('data', function(buf) {
  lines += buf.toString().match(/\n/g).length;
});
s.on('end', function() {
  console.log(lines);
});


text:
sort_order: 15
tei_id: p.idm239149097088
annotation_count: 0
images:
  small-thumbnail: http://example.com/books/emory:7st9j/pages/readux-rsk:pg7hf/mini-thumbnail/
  json: http://example.com/books/emory:7st9j/pages/readux-rsk:pg7hf/info/
  full: http://example.com/books/emory:7st9j/pages/readux-rsk:pg7hf/fs/
  page: http://example.com/books/emory:7st9j/pages/readux-rsk:pg7hf/single-page/
  thumbnail: http://example.com/books/emory:7st9j/pages/readux-rsk:pg7hf/thumbnail/
title: Page 15
number: 15
permalink: /pages/15/

---

  {% raw %}CREJ/OA'NE GARDEN.S. ii{% endraw %}

  {% raw %}of some \-oUune which I had not seen for a very long time.{% endraw %}

  {% raw %}The)'were of all sorts: some of my father's old Charterhouse{% endraw %}

  {% raw %}schoolbooks; editions of the Classics, free from all that{% endraw %}

  {% raw %}erudite annotation which has been so productive of head¬{% endraw %}

  {% raw %}ache to schoolboys of more recent date; some of my own{% endraw %}

  {% raw %}schoolbooks with names once familiar, now long forgotten,{% endraw %}

  {% raw %}scrawled on the margin of the pages, and a fancy portrait of{% endraw %}

  {% raw %}Euripides (very fancy) on the fly-leaf of the Orestes; Jones's{% endraw %}

  {% raw %}early poems. Twilight Musings, with my name inscribed on{% endraw %}

  {% raw %}the title-page in Jones's own hand, " from his devoted{% endraw %}

  {% raw %}friend and cue-fellow." Jones is now principal vitriol-{% endraw %}

  {% raw %}thrower on the Scalpel literary newspaper, and is popularly{% endraw %}

  {% raw %}believed to have written that review of his devoted friend{% endraw %}

  {% raw %}and cue-fellow's last book of travels which caused the{% endraw %}

  {% raw %}devoted f and c.-f to spend an evening rolling on his{% endraw %}

  {% raw %}hearthrug in agonies of rage and despair. Here are other{% endraw %}

  {% raw %}given books: Manna in the Wilderness, or the Smitten Pock^{% endraw %}

  {% raw %}presented to me at " Crismass 1844," as the written legend{% endraw %}

  {% raw %}records, by my cousin Augustus, who was great at morality,{% endraw %}

  {% raw %}but weak in orthography, and who in the next spring ran{% endraw %}

  {% raw %}away and joined Herr Carlos Wilkinsoni's travelling cirque,{% endraw %}

  {% raw %}after having forged his father's name to a cheque for twenty{% endraw %}

  {% raw %}pounds. Here is my first copy of Shakespeare, with my{% endraw %}

  {% raw %}name in faded ink, and underneath it two sets of initials in{% endraw %}

  {% raw %}different handwritings, the owners of which, long separated{% endraw %}

  {% raw %}by death, are, I pray Heaven, more happily reunited ; and{% endraw %}

  {% raw %}here is a copy of Blugg's collected works, with the sixpenny{% endraw %}

  {% raw %}label of the bookstall still sticking to it. Poor Dick Blugg,{% endraw %}

  {% raw %}who combined so much capacity for writing and gin-and-{% endraw %}

  {% raw %}water, and whose life was divided between a bare room{% endraw %}

  {% raw %}containing a desk, a blotting-pad, an ink-bottle, and a pile{% endraw %}

  {% raw %}of paper, where he did his work, and the night-houses in the{% endraw %}

  {% raw %}Haymarket, where he spent his money. Other books acting{% endraw %}

  {% raw %}as milestones in one's life : copy of Mr. Thomas Moore's{% endraw %}

  {% raw %}Laila Rookh, with the " young gazelle" bit very much{% endraw %}


text:
Meteor.startup(function() {
  WiFiControl.init();
});


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2010 The Android Open Source Project

     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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent"
    android:orientation="vertical">
    <!-- Title -->
    <TextView android:id="@+id/title" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:singleLine="true"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textStyle="bold" android:shadowColor="#BB000000"
        android:shadowRadius="2.75" android:gravity="center_vertical" />
    <!-- Content -->
    <ScrollView android:layout_width="match_parent"
        android:layout_height="0dip" android:layout_weight="1">
        <LinearLayout android:id="@+id/list" android:layout_width="match_parent"
            android:layout_height="wrap_content" android:orientation="vertical" />
    </ScrollView>
</LinearLayout>


text:
"""
    release
    ~~~~~~~

    Helper script that performs a release.  Does pretty much everything
    automatically for us.

    :copyright: (c) 2014 by the J5.
    :license: BSD, see LICENSE for more details.

    :copyright: (c) 2014 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
"""
import pkg_resources
import sys
import os
import re
from datetime import datetime, date
from subprocess import Popen, PIPE

def get_current_version():
    try:
        release = pkg_resources.get_distribution('Zask').version
    except pkg_resources.DistributionNotFound:
        print 'To build the documentation, The distribution information of Zask'
        print 'Has to be available.  Either install the package into your'
        print 'development environment or run "setup.py develop" to setup the'
        print 'metadata.  A virtualenv is recommended!'
        sys.exit(1)

    if '-dev' in release:
        release = release.split('-dev')[0]

    version = '.'.join(release.split('.')[:2])
    return version

def bump_version(version):
    try:
        parts = map(int, version.split('.'))
    except ValueError:
        fail('Current version is not numeric')
    parts[-1] += 1
    return '.'.join(map(str, parts))

def set_filename_version(filename, version_number, pattern):
    changed = []

    def inject_version(match):
        before, old, after = match.groups()
        changed.append(True)
        return before + version_number + after
    with open(filename) as f:
        contents = re.sub(r"^(\s*%s\s*=\s*')(.+?)(')(?sm)" % pattern,
                          inject_version, f.read())

    if not changed:
        fail('Could not find %s in %s', pattern, filename)

    with open(filename, 'w') as f:
        f.write(contents)

def set_init_version(version):
    info('Setting __init__.py version to %s', version)
    set_filename_version('zask/__init__.py', version, '__version__')

def set_setup_version(version):
    info('Setting setup.py version to %s', version)
    set_filename_version('setup.py', version, 'version')

def fail(message, *args):
    print >> sys.stderr, 'Error:', message % args
    sys.exit(1)

def info(message, *args):
    print >> sys.stderr, message % args

def get_git_tags():
    return set(Popen(['git', 'tag'], stdout=PIPE).communicate()[0].splitlines())

def git_is_clean():
    return Popen(['git', 'diff', '--quiet']).wait() == 0

def make_git_commit(message, *args):
    message = message % args
    Popen(['git', 'commit', '-am', message]).wait()

def make_git_tag(tag):
    info('Tagging "%s"', tag)
    Popen(['git', 'tag', tag]).wait()

def main():
    os.chdir(os.path.join(os.path.dirname(__file__), '..'))

    version = get_current_version()
    dev_version = bump_version(version) + '-dev'

    info('Releasing %s', version)
    tags = get_git_tags()

    if version in tags:
        fail('Version "%s" is already tagged', version)

    if not git_is_clean():
        fail('You have uncommitted changes in git')

    set_init_version(version)
    set_setup_version(version)
    make_git_commit('Bump version number to %s', version)
    make_git_tag(version)
    set_init_version(dev_version)
    set_setup_version(dev_version)

if __name__ == '__main__':
    main()


text:
'use strict';

var babelHelpers = require('./util/babelHelpers.js');

var React = require('react'),
    warning = require('react/lib/warning'),
    CustomPropTypes = require('./util/propTypes'),
    compat = require('./util/compat'),
    cx = require('classnames'),
    _ = require('./util/_');

module.exports = React.createClass({

  displayName: 'List',

  mixins: [require('./mixins/WidgetMixin'), require('./mixins/DataHelpersMixin'), require('./mixins/ListMovementMixin')],

  propTypes: {
    data: React.PropTypes.array,
    onSelect: React.PropTypes.func,
    onMove: React.PropTypes.func,

    itemComponent: CustomPropTypes.elementType,
    groupComponent: CustomPropTypes.elementType,

    selected: React.PropTypes.any,
    focused: React.PropTypes.any,

    valueField: React.PropTypes.string,
    textField: CustomPropTypes.accessor,

    optID: React.PropTypes.string,

    groupBy: CustomPropTypes.accessor,

    messages: React.PropTypes.shape({
      emptyList: CustomPropTypes.message
    })
  },

  getDefaultProps: function getDefaultProps() {
    return {
      optID: '',
      onSelect: function onSelect() {},
      data: [],
      messages: {
        emptyList: 'There are no items in this list'
      }
    };
  },

  getInitialState: function getInitialState() {
    var keys = [];

    return {
      groups: this._group(this.props.groupBy, this.props.data, keys),

      sortedKeys: keys
    };
  },

  componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
    var keys = [];

    if (nextProps.data !== this.props.data || nextProps.groupBy !== this.props.groupBy) this.setState({
      groups: this._group(nextProps.groupBy, nextProps.data, keys),
      sortedKeys: keys
    });
  },

  componentDidMount: function componentDidMount(prevProps) {
    this.move();
  },

  componentDidUpdate: function componentDidUpdate() {
    this.move();
  },

  render: function render() {
    var _this = this;

    var _$omit = _.omit(this.props, ['data', 'selectedIndex']);

    var className = _$omit.className;
    var props = babelHelpers.objectWithoutProperties(_$omit, ['className']);
    var groups = this.state.groups;
    var items = [];
    var idx = -1;
    var group;

    if (this.props.data.length) {
      items = this.state.sortedKeys.reduce(function (items, key) {
        group = groups[key];
        items.push(_this._renderGroupHeader(key));

        for (var itemIdx = 0; itemIdx < group.length; itemIdx++) items.push(_this._renderItem(key, group[itemIdx], ++idx));

        return items;
      }, []);
    } else items = React.createElement(
      'li',
      { className: 'rw-list-empty' },
      _.result(this.props.messages.emptyList, this.props)
    );

    return React.createElement(
      'ul',
      babelHelpers._extends({}, props, {
        className: (className || '') + ' rw-list  rw-list-grouped',
        ref: 'scrollable',
        role: 'listbox' }),
      items
    );
  },

  _renderGroupHeader: function _renderGroupHeader(group) {
    var ItemComponent = this.props.groupComponent;

    return React.createElement(
      'li',
      {
        key: 'item_' + group,
        tabIndex: '-1',
        role: 'separator',
        className: 'rw-list-optgroup' },
      ItemComponent ? React.createElement(ItemComponent, { item: group }) : group
    );
  },

  _renderItem: function _renderItem(group, item, idx) {
    var focused = this.props.focused === item,
        selected = this.props.selected === item,
        ItemComponent = this.props.itemComponent;

    //console.log('hi')
    return React.createElement(
      'li',
      {
        key: 'item_' + group + '_' + idx,
        role: 'option',
        id: focused ? this.props.optID : undefined,
        'aria-selected': selected,
        onClick: this.props.onSelect.bind(null, item),
        className: cx({
          'rw-state-focus': focused,
          'rw-state-selected': selected,
          'rw-list-option': true
        }) },
      ItemComponent ? React.createElement(ItemComponent, { item: item, value: this._dataValue(item), text: this._dataText(item) }) : this._dataText(item)
    );
  },

  _isIndexOf: function _isIndexOf(idx, item) {
    return this.props.data[idx] === item;
  },

  _group: function _group(groupBy, data, keys) {
    var iter = typeof groupBy === 'function' ? groupBy : function (item) {
      return item[groupBy];
    };

    // the keys array ensures that groups are rendered in the order they came in
    // which means that if you sort the data array it will render sorted,
    // so long as you also sorted by group
    keys = keys || [];

    warning(typeof groupBy !== 'string' || !data.length || _.has(data[0], groupBy), '[React Widgets] You are seem to be trying to group this list by a ' + ('property `' + groupBy + '` that doesn\'t exist in the dataset items, this may be a typo'));

    return data.reduce(function (grps, item) {
      var group = iter(item);

      _.has(grps, group) ? grps[group].push(item) : (keys.push(group), grps[group] = [item]);

      return grps;
    }, {});
  },

  _data: function _data() {
    var groups = this.state.groups;

    return this.state.sortedKeys.reduce(function (flat, grp) {
      return flat.concat(groups[grp]);
    }, []);
  },

  move: function move() {
    var selected = this.getItemDOMNode(this.props.focused);

    if (!selected) return;

    this.notify('onMove', [selected, compat.findDOMNode(this), this.props.focused]);
  },

  getItemDOMNode: function getItemDOMNode(item) {
    var list = compat.findDOMNode(this),
        groups = this.state.groups,
        idx = -1,
        itemIdx,
        child;

    this.state.sortedKeys.some(function (group) {
      itemIdx = groups[group].indexOf(item);
      idx++;

      if (itemIdx !== -1) return !!(child = list.children[idx + itemIdx + 1]);

      idx += groups[group].length;
    });

    return child;
  }

});


text:
'use strict';

angular.module('core').controller('HomeController', ['$scope', 'Authentication',
	function($scope, Authentication) {
		// This provides Authentication context.
		$scope.authentication = Authentication;
		var baseURL='http://lorempixel.com/960/300/';
  	$scope.setInterval=5000;

  	$scope.slides = [
   	{
         title:'trend media beta',
         image:baseURL+'city/',
         text:'Want more people to see your tweets?'
   	},
   	{
         title:'twitter',
         image:baseURL+'abstract/',
         text:'¡tweets seen by the trending topic country you choose!'
   	},

    ];
	}
]);