text:
package com.sencha.gxt.examples.resources.client.model;

import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.TextResource;
import com.google.web.bindery.autobean.shared.AutoBean;
import com.google.web.bindery.autobean.shared.AutoBeanCodex;
import com.google.web.bindery.autobean.shared.AutoBeanFactory;
import com.google.web.bindery.autobean.shared.Splittable;
import com.google.web.bindery.autobean.shared.impl.StringQuoter;

public class ExampleData {

  public interface DataBundle extends ClientBundle {

    @Source("browser.json")
    TextResource browserData();

    @Source("stock.json")
    TextResource stockData();

    @Source("country.json")
    TextResource countryData();

    @Source("state.json")
    TextResource stateData();

    @Source("plant.json")
    TextResource plantData();

    @Source("task.json")
    TextResource taskData();
  }

  public interface BrowserResult {
    List<BrowserProxy> getBrowserData();
  }

  public interface StockResult {
    List<StockProxy> getStocks();
  }
  public interface CountryResult {
    List<CountryProxy> getCountries();
  }
  public interface StateResult {
    List<StateProxy> getStates();
  }
  public interface PlantResult {
    List<PlantProxy> getPlants();
  }
  public interface TaskResult {
    List<TaskProxy> getTasks();
  }

  public interface ExampleDataFactory extends AutoBeanFactory {
    AutoBean<BrowserResult> browserResult();

    AutoBean<StockResult> stockResult();

    AutoBean<CountryResult> countryResult();

    AutoBean<StateResult> stateResult();

    AutoBean<PlantResult> plantResult();

    AutoBean<TaskResult> taskResult();

  }

  public static DataBundle dataBundle = GWT.create(DataBundle.class);
  public static ExampleDataFactory dataFactory = GWT.create(ExampleDataFactory.class);

  public static List<BrowserProxy> getBrowserData() {
    Splittable s = StringQuoter.split(dataBundle.browserData().getText());
    AutoBean<BrowserResult> result = AutoBeanCodex.decode(dataFactory, BrowserResult.class, s);
    return result.as().getBrowserData();
  }

  public static List<StockProxy> getStocks() {
    Splittable s = StringQuoter.split(dataBundle.stockData().getText());
    AutoBean<StockResult> result = AutoBeanCodex.decode(dataFactory, StockResult.class, s);
    return result.as().getStocks();
  }

  public static List<CountryProxy> getCountries() {
    Splittable s = StringQuoter.split(dataBundle.countryData().getText());
    AutoBean<CountryResult> result = AutoBeanCodex.decode(dataFactory, CountryResult.class, s);
    return result.as().getCountries();
  }

  public static List<StateProxy> getStates() {
    Splittable s = StringQuoter.split(dataBundle.stateData().getText());
    AutoBean<StateResult> result = AutoBeanCodex.decode(dataFactory, StateResult.class, s);
    return result.as().getStates();
  }

  public static List<PlantProxy> getPlants() {
    Splittable s = StringQuoter.split(dataBundle.plantData().getText());
    AutoBean<PlantResult> result = AutoBeanCodex.decode(dataFactory, PlantResult.class, s);
    return result.as().getPlants();
  }

  public static List<TaskProxy> getTasks() {
    Splittable s = StringQuoter.split(dataBundle.taskData().getText());
    AutoBean<TaskResult> result = AutoBeanCodex.decode(dataFactory, TaskResult.class, s);
    return result.as().getTasks();
  }

}

redpajama_set_name: RedPajamaGithub


text:
Highly customizable page transition component for your React Router

Currently does not fully support react-router 4, see [Using with React Router 4](#using-with-react-router-4).

# Introduction

**React Router** is awesome, but doing transition between pages is hard, especially for complex ones.

No worries **react-router-page-transition** is here to help. You can use css to define your own transition
effect with custom data and callbacks, so now you can apply cool technique like [FLIP your animation](https://aerotwist.com/blog/flip-your-animations/)
and implement cool transitions like this:

**Live demo**: https://trungdq88.github.io/react-router-page-transition/

|Simple|Material|Reveal|
|------|--------|------|
|![rrpt-leave](https://cloud.githubusercontent.com/assets/4214509/22519594/709cbdc6-e8e3-11e6-9e35-1182e6121e27.gif)|![material](https://cloud.githubusercontent.com/assets/4214509/16781947/aa83ca34-48a7-11e6-8c93-dfdd794d7a28.gif) | ![reveal](https://cloud.githubusercontent.com/assets/4214509/16783423/1c58b880-48ae-11e6-97fb-5e92a7da1b40.gif)|

# Installation

    npm install react-router-page-transition --save

# Add to your project

```js
import PageTransition from 'react-router-page-transition';
```

```jsx
<PageTransition>
  {this.props.children}
</PageTransition>
```
- **Important:** `this.props.children` **must have** `transition-item` class in its root element. Example if you are passing `<ListPage />` as `this.props.children`:

```jsx
export default class ListPage extends React.Component {
  render() {
    return (
      <div id="list-page" class="transition-item">
      ...
      </div>
    );
  }
}
```

# How it works

- `PageTransition` component renders `{this.props.children}` inside a `<div class="transition-wrapper">...</div>`.

- When the route change, CSS classes will be added as following:

![image](https://cloud.githubusercontent.com/assets/4214509/22550195/903cb304-e981-11e6-8a36-c6e0d1a28e94.png)

- You'll need to define the transition in your CSS:

Example: sliding animation

```less
.detail-page {
  overflow: auto;
  box-sizing: border-box;
  padding: 20px;
  height: 100vh;
  background-color: #03a9f4;
  transition: transform 0.5s, opacity 0.5s;

  &.transition-appear {
    opacity: 0;
    transform: translate3d(100%, 0, 0);
  }

  &.transition-appear.transition-appear-active {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  &.transition-leave {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  &.transition-leave.transition-leave-active {
    opacity: 0;
    transform: translate3d(100%, 0, 0);
  }
}

```

Sometimes it is impossible to implement your designer's awesome animation idea in just **only CSS**. In that case, you'll need the callbacks to customize your animation with **additional data**. See **API** document and example for more information.

# API

## Properties
- **timeout**: transition duration in milisecond, this must be the same with the `transition-duration` in your CSS.

   Example:
    ```jsx
        <PageTransition timeout={500}>
          {props.children}
        </PageTransition>
    ```

- **data**: custom data to send to the page component via `onTransitionWillStart`, `onTransitionDidEnd`, `transitionManuallyStart`, `transitionManuallyEnd`.

    Example:
    ```jsx
        <PageTransition
          data={{ clickedItemData: this.state.clickedItemData }}
        >
          {this.props.children}
        </PageTransition>
    ```

- **onLoad**: this callback will be call after the new page is finished replaced.

    Example:
    ```jsx
        <PageTransition
          onLoad={() => this.refs.scrollArea.scrollTop = 0}
        >
          {this.props.children}
        </PageTransition>
    ```

- **transitionAction**: this prop can be used to add additional state to the transition, for example you can identify if a transition is a "go back" or "go forward" by using `history.action` from History API.

    Example:
    ```jsx
        <PageTransition
          transitionAction={this.props.history.action}
        >
          {this.props.children}
        </PageTransition>
    ```
    When `transitionAction` presence, class `transition-${action}` will be added along with `transition-appear`, and will be removed along with `transition-leave`.

## Callback on children component
`PageTransition` component calls a several callbacks to its child component to pass user defined additional data for the animation. Child components are mounted via React Router when the route change.

**Notice:** all these callbacks will be called in a **Promise chain**, so if you are handleing async tasks inside the callback (for example `setState`), make sure you **return a Promise** to make everything work properly.

- **onTransitionWillStart(data)**: before the transition starts (before `transition-appear-active` class is added). `data` is the variable received from the `data` property of `PageTransition`.
- **transitionManuallyStart(data)**: if you don't use `transition-appear-active` class in CSS to animate your page, you can define this method in the child component to do the animation mannually. `transition-appear-active` will not be added to the child's DOM when this method exists.
- **onTransitionDidStart(data)**: after the transition started.
- **onTransitionWillEnd(data)**: before the transition stops (before `transition-appear-active` class is removed).
- **transitionManuallyStop(data)**: similar to `transitionManuallyStart`. `transition-appear-active` will not be removed to the child's DOM when this method exists.
- **onTransitionDidEnd(data)**: after the transition stopped (after `transition-appear-active` class is removed)

    Example:
    ```jsx
    export default class DetailPage extends React.Component {
      ...
      onTransitionWillStart(data) {
        return new Promise(resolve => {
            this.setState({ animating: false, postiton: data.position, opacity: 0 }, resolve);
        });
      }
      transitionManuallyStart(data) {
        return new Promise(resolve => {
            this.setState({ animating: true, postiton: DEFAULT_POSITION, opacity: 1 }, resolve);
        });
      }
      onTransitionDidStart(data) {
        // Animation is happening
      }
      onTransitionWillEnd(data) {
        // Animation is about to stop
      }
      transitionManuallyStop(data) {
        return new Promise(resolve => {
            this.setState({ animating: false }, resolve);
        });
      }
      onTransitionDidEnd(data) {
        // Page successfully replaced and finished animate
        this.callMyBusinessApi();
      }

      ...
    ```

Similar callbacks for **leave** event:

- onTransitionLeaveWillStart(data)
- transitionLeaveManuallyStart(data)
- onTransitionLeaveDidStart(data)
- onTransitionLeaveWillEnd(data)
- transitionLeaveManuallyStop(data)
- onTransitionLeaveDidEnd(data)

## Available CSS functional class names

- `transition-appear`, `transition-appear-active`, `transition-leave`, `transition-leave-active`.
- Root element of the transited page must have `transition-item` class.

## Using with Redux

By default, `PageTransition` will animates its children when `componentWillReceiveProps` is triggered. It compares `this.props.children !== nextProps.children` to know if the page has changed (ex: move from page Login to page AdminPanel).

When using `PageTransition` with Redux, you may end up having the animation triggered everytime the Redux state changes (ex: state change when you enter username, `componentWillReceiveProps` is triggered but the page is still Login page). In order to resolve this, you can use `data-transition-id` for the child components.

```jsx
    <PageTransition>
      {isLoggedIn() ?
        <AdminPanel data-transition-id="admin-page" ... />
        :
        <Login data-transition-id="login-page" ... />
      }
    </PageTransition>
```

When `data-transition-id` prop is provided, `PageTransition` will use this value
to compare the childrens. Now you can control exactly when will the pages are changed.

## Using with React Router 4

At the moment, callbacks are not supported on React Router 4, however the basic CSS transitions still works. You have to wrap your `<Route>` with `<Switch>`. Please notice that you **have to** pass the `location` prop to `<Switch>` to make it work.

```jsx
        <PageTransition>
          <Switch location={this.props.location}>
            <Route exact path="/" component={ListPage} />
            <Route path="/detail/:itemId" component={ItemDetailPage} />
          </Switch>
        </PageTransition>
```

See a live demo: https://codesandbox.io/s/n3rrym5y1l

# When to use this?

**Pros:**
 - Give you ability to implement complex animations / transitions.
 - Keep page structure clean.

**Cons:**
 - Requires extra setup for the components

# Examples

See [EXAMPLES.md](https://github.com/trungdq88/react-router-page-transition/blob/master/EXAMPLES.md)

# LICENSE

```
MIT License

Copyright (c) 2016 Dinh Quang Trung

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```


text:
<?php

use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;

class User extends Eloquent implements UserInterface, RemindableInterface
{
	use UserTrait, RemindableTrait, SoftDeletingTrait;

	protected $table = 'user';

	protected $fillable = array('email', 'username', 'password');

	protected $hidden = array('password');

}


text:
package filelink

import (
	"net/http"

	stripe "github.com/stripe/stripe-go/v74"
	"github.com/stripe/stripe-go/v74/form"
)

// Client is used to invoke /file_links APIs.
type Client struct {
	B   stripe.Backend
	Key string
}

// New creates a new file link.
func New(params *stripe.FileLinkParams) (*stripe.FileLink, error) {
	return getC().New(params)
}

// New creates a new file link.
func (c Client) New(params *stripe.FileLinkParams) (*stripe.FileLink, error) {
	filelink := &stripe.FileLink{}
	err := c.B.Call(http.MethodPost, "/v1/file_links", c.Key, params, filelink)
	return filelink, err
}

// Get returns the details of a file link.
func Get(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) {
	return getC().Get(id, params)
}

// Get returns the details of a file link.
func (c Client) Get(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) {
	path := stripe.FormatURLPath("/v1/file_links/%s", id)
	filelink := &stripe.FileLink{}
	err := c.B.Call(http.MethodGet, path, c.Key, params, filelink)
	return filelink, err
}

// Update updates a file link's properties.
func Update(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) {
	return getC().Update(id, params)
}

// Update updates a file link's properties.
func (c Client) Update(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) {
	path := stripe.FormatURLPath("/v1/file_links/%s", id)
	filelink := &stripe.FileLink{}
	err := c.B.Call(http.MethodPost, path, c.Key, params, filelink)
	return filelink, err
}

// List returns a list of file links.
func List(params *stripe.FileLinkListParams) *Iter {
	return getC().List(params)
}

// List returns a list of file links.
func (c Client) List(listParams *stripe.FileLinkListParams) *Iter {
	return &Iter{
		Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
			list := &stripe.FileLinkList{}
			err := c.B.CallRaw(http.MethodGet, "/v1/file_links", c.Key, b, p, list)

			ret := make([]interface{}, len(list.Data))
			for i, v := range list.Data {
				ret[i] = v
			}

			return ret, list, err
		}),
	}
}

// Iter is an iterator for file links.
type Iter struct {
	*stripe.Iter
}

// FileLink returns the file link which the iterator is currently pointing to.
func (i *Iter) FileLink() *stripe.FileLink {
	return i.Current().(*stripe.FileLink)
}

// FileLinkList returns the current list object which the iterator is
// currently using. List objects will change as new API calls are made to
// continue pagination.
func (i *Iter) FileLinkList() *stripe.FileLinkList {
	return i.List().(*stripe.FileLinkList)
}

func getC() Client {
	return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}


text:
+++
Talk_date = ""
Talk_start_time = ""
Talk_end_time = ""
Title = "AirFlow and GCP: tomorrow's health service data platform"
Type = "talk"
Speakers = ["nataliia-godec"]
+++

At Babylon Health, we are on a mission to put accessible and affordable healthcare in the hands of every person on Earth. You might imagine that such an endeavour would generate incredible amounts of data! And, since AI is in the core of our product, leveraging data from our microservices and clients is crucial to our success. So we set off to build a data platform of the future, based both in AWS and GCP, leveraging our existing infrastructure and CICD and building the missing parts.


text:
<form class="TopBarForm InboxSearch">

			 <input type="search" onkeyup="showHint(this.value)" class="form-control searchinbox" name="Search" placeholder="Search"/>

	</form>

	     <?php if(isset($mails))
	     foreach ($mails as $row):;?>

								<a href="#" class="inboxname" onclick="ShowMail(<?php echo $row['id'] ?>)"><?php echo $row['name']; ?>

						<?php echo"" ?>

<?php echo $row['subject'] ;?>

 <?php echo $row['created_at'];?>

						<?php //echo'show '?>

			<?php endforeach; ?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xliff PUBLIC "-//XLIFF//DTD XLIFF//EN" "http://www.oasis-open.org/committees/xliff/documents/xliff.dtd">
<xliff version="1.0">
  <file source-language="EN" target-language="es" datatype="plaintext" original="messages" date="2010-03-08T01:57:46Z" product-name="messages">
    <header/>
    <body>
      <trans-unit id="1">
        <source>Logout</source>
        <target>Salir</target>
      </trans-unit>

      <trans-unit id="2">
        <source>Content</source>
        <target>Contenido</target>
      </trans-unit>

      <trans-unit id="3">
        <source>list</source>
        <target>listado</target>
      </trans-unit>

      <trans-unit id="4">
        <source>Pages</source>
        <target>Páginas</target>
      </trans-unit>

      <trans-unit id="5">
        <source>Finish</source>
        <target>Final</target>
      </trans-unit>
      <trans-unit id="6">
        <source>Configuration</source>
        <target>Configuración</target>
      </trans-unit>
      <trans-unit id="7">
        <source>Users</source>
        <target>Usuarios</target>
      </trans-unit>
      <trans-unit id="8">
        <source>List</source>
        <target>Listado</target>
      </trans-unit>
      <trans-unit id="9">
        <source>Groups</source>
        <target>Grupos</target>
      </trans-unit>
      <trans-unit id="10">
        <source>Permissions</source>
        <target>Credenciales</target>
      </trans-unit>
      <trans-unit id="11">
        <source>Forms</source>
        <target>Formularios</target>
      </trans-unit>
      <trans-unit id="12">
        <source>New form</source>
        <target>Nuevo Formulario</target>
      </trans-unit>

      <trans-unit id="13">
        <source>Add page</source>
        <target>Agregar página</target>
      </trans-unit>

      <trans-unit id="14">
        <source>Login</source>
        <target>Ingresar</target>
      </trans-unit>
      <trans-unit id="15">
        <source>sign in</source>
        <target>Acceder</target>
      </trans-unit>
      <trans-unit id="16">
        <source>Forgot your password?</source>
        <target>Olvido su contraseña ?</target>
      </trans-unit>
      <trans-unit id="17">
        <source>You don't have the required permission to access this page.</source>
        <target>Usted no tiene permisos para ingresar a esta página.</target>
      </trans-unit>

      <trans-unit id="18">
        <source>Name</source>
        <target>Nombre</target>
      </trans-unit>

      <trans-unit id="19">
        <source>Description</source>
        <target>Descripción</target>
      </trans-unit>

      <trans-unit id="20">
        <source>Created at</source>
        <target>Creado en</target>
      </trans-unit>

      <trans-unit id="21">
        <source>actions</source>
        <target>acciones</target>
      </trans-unit>

      <trans-unit id="22">
        <source>Group</source>
        <target>Grupo</target>
      </trans-unit>

      <trans-unit id="23">
        <source>Title</source>
        <target>Título</target>
      </trans-unit>

      <trans-unit id="25">
        <source>Back to list</source>
        <target>Volver al listado</target>
      </trans-unit>

      <trans-unit id="27">
        <source>Number</source>
        <target>Número</target>
      </trans-unit>

      <trans-unit id="29">
        <source>Updated at</source>
        <target>Actualizado en</target>
      </trans-unit>

      <trans-unit id="32">
        <source>Stated</source>
        <target>Estado</target>
      </trans-unit>

      <trans-unit id="37">
        <source>The username and/or password is invalid.</source>
        <target>El nombre de usuario y/o la contraseña es incorrecto</target>
      </trans-unit>

      <trans-unit id="38">
        <source>Required.</source>
        <target>Requerido.</target>
      </trans-unit>

      <trans-unit id="39">
        <source>Username</source>
        <target>Nombre de cuenta</target>
      </trans-unit>

      <trans-unit id="40">
        <source>Password</source>
        <target>Contraseña</target>
      </trans-unit>

      <trans-unit id="41">
        <source>Remember</source>
        <target>Recordar</target>
      </trans-unit>

      <trans-unit id="42">
        <source>Invalid mime type (%mime_type%).</source>
        <target>Tipo de Archivo inválido (%mime_type%).</target>
      </trans-unit>

      <trans-unit id="43">
        <source>empty</source>
        <target>vacío</target>
      </trans-unit>

      <trans-unit id="44">
        <source>Choose File</source>
        <target>Selecciona Archivo</target>
      </trans-unit>

      <trans-unit id="43">
        <source>State</source>
        <target>Estado</target>
      </trans-unit>

      <trans-unit id="44">
        <source>First name</source>
        <target>Nombre</target>
      </trans-unit>

      <trans-unit id="45">
        <source>Last name</source>
        <target>Apellido</target>
      </trans-unit>

      <trans-unit id="46">
        <source>Is active</source>
        <target>Activo</target>
      </trans-unit>

      <trans-unit id="47">
        <source>Is super admin</source>
        <target>Superadmin</target>
      </trans-unit>

      <trans-unit id="48">
        <source>Last login</source>
        <target>Ultimo login</target>
      </trans-unit>

      <trans-unit id="49">
        <source>Add user</source>
        <target>Agregar Usuario</target>
      </trans-unit>

      <trans-unit id="50">
        <source>User list</source>
        <target>Listado de Usuarios</target>
      </trans-unit>

      <trans-unit id="51">
        <source>Group list</source>
        <target>Listado de Grupos</target>
      </trans-unit>

      <trans-unit id="52">
        <source>Permission list</source>
        <target>Listado de Credenciales</target>
      </trans-unit>

      <trans-unit id="53">
        <source>Edit user</source>
        <target>Editar usuario</target>
      </trans-unit>

      <trans-unit id="54">
        <source>Author</source>
        <target>Autor</target>
      </trans-unit>

      <trans-unit id="55">
        <source>New page</source>
        <target>Página nueva</target>
      </trans-unit>

      <trans-unit id="56">
        <source>Parent page</source>
        <target>Página padre</target>
      </trans-unit>

      <trans-unit id="57">
        <source>Edit page</source>
        <target>Editar Página</target>
      </trans-unit>

      <trans-unit id="58">
        <source>New Category</source>
        <target>Categoría nueva</target>
      </trans-unit>

      <trans-unit id="59">
        <source>Categories</source>
        <target>Categorías</target>
      </trans-unit>

      <trans-unit id="60">
        <source>Add category</source>
        <target>Agregar categoría</target>
      </trans-unit>

      <trans-unit id="61">
        <source>Categories list</source>
        <target>Lista de categorías</target>
      </trans-unit>

      <trans-unit id="62">
        <source>New category</source>
        <target>Categoría nueva</target>
      </trans-unit>

      <trans-unit id="63">
        <source>New user</source>
        <target>Usuario Nuevo</target>
      </trans-unit>

      <trans-unit id="64">
        <source>Categorys List</source>
        <target>Listado de Categorías</target>
      </trans-unit>

      <trans-unit id="65">
        <source>Page list</source>
        <target>Listado de páginas</target>
      </trans-unit>

      <trans-unit id="66">
        <source>New</source>
        <target>Nuevo</target>
      </trans-unit>

      <trans-unit id="67">
        <source>Picture</source>
        <target>Imagen</target>
      </trans-unit>

      <trans-unit id="68">
        <source>Save</source>
        <target>Guardar</target>
      </trans-unit>

      <trans-unit id="69">
        <source>Date</source>
        <target>Fecha</target>
      </trans-unit>

      <trans-unit id="70">
        <source>Publication date</source>
        <target>Fecha de Publicación</target>
      </trans-unit>

      <trans-unit id="71">
        <source>Due date</source>
        <target>Fecha de Expiración</target>
      </trans-unit>

      <trans-unit id="72">
        <source>Image</source>
        <target>Imagen</target>
      </trans-unit>

      <trans-unit id="73">
        <source>Add event</source>
        <target>Agregar evento</target>
      </trans-unit>

      <trans-unit id="74">
        <source>Events</source>
        <target>Eventos</target>
      </trans-unit>

      <trans-unit id="75">
        <source>Parent category</source>
        <target>Categoría padre</target>
      </trans-unit>

      <trans-unit id="76">
        <source>Abstract</source>
        <target>Resúmen</target>
      </trans-unit>

      <trans-unit id="77">
        <source>Edit Page</source>
        <target>Editar Página</target>
      </trans-unit>

      <trans-unit id="78">
        <source>New Page</source>
        <target>Página nueva</target>
      </trans-unit>

      <trans-unit id="79">
        <source>The two passwords must be the same.</source>
        <target>Las dos contraseñas deben ser iguales.</target>
      </trans-unit>

      <trans-unit id="80">
        <source>Pages List</source>
        <target>Listado de páginas</target>
      </trans-unit>

      <trans-unit id="81">
        <source>Events List</source>
        <target>Listado de eventos</target>
      </trans-unit>

      <trans-unit id="82">
        <source>New Users</source>
        <target>Nuevos Usuarios</target>
      </trans-unit>

      <trans-unit id="83">
        <source>Profile</source>
        <target>Perfil</target>
      </trans-unit>

      <trans-unit id="84">
        <source>Password again</source>
        <target>Contraseña nuevamente</target>
      </trans-unit>

      <trans-unit id="85">
        <source>Users List</source>
        <target>Listado de usuarios</target>
      </trans-unit>

      <trans-unit id="86">
        <source>Start</source>
        <target>Inicio</target>
      </trans-unit>
      <trans-unit id="87">
        <source>Log Off</source>
        <target>Cerrar Sesión</target>
      </trans-unit>
      <trans-unit id="88">
        <source>User</source>
        <target>Usuario</target>
      </trans-unit>

      <trans-unit id="89">
        <source>Edit Groups</source>
        <target>Editar Grupos</target>
      </trans-unit>

      <trans-unit id="90">
        <source>Save and add</source>
        <target>Guardar y agregar nuevo</target>
      </trans-unit>

      <trans-unit id="91">
        <source>Filter</source>
        <target>Filtro</target>
      </trans-unit>

      <trans-unit id="92">
        <source>Go</source>
        <target>Ejecutar</target>
      </trans-unit>

      <trans-unit id="93">
        <source>New Event</source>
        <target>Evento Nuevo</target>
      </trans-unit>

      <trans-unit id="94">
        <source>Edit Event</source>
        <target>Editar Evento</target>
      </trans-unit>

      <trans-unit id="95">
        <source>New User</source>
        <target>Usuario Nuevo</target>
      </trans-unit>

      <trans-unit id="96">
        <source>Edit User</source>
        <target>Editar Usuario</target>
      </trans-unit>

      <trans-unit id="97">
        <source>Edit Category</source>
        <target>Editar Categoría</target>
      </trans-unit>

      <trans-unit id="98">
        <source>Categories List</source>
        <target>Listado de Categorías</target>
      </trans-unit>

      <trans-unit id="99">
        <source>Do you need a new password?</source>
        <target>Necesita un nuevo password?</target>
      </trans-unit>

     <trans-unit id="100">
        <source>Remember User?</source>
        <target>Recordar Usuario?</target>
      </trans-unit>

    <trans-unit id="101">
      <source>Gallery</source>
      <target>Galería</target>
    </trans-unit>

    <trans-unit id="102">
      <source>Photos</source>
      <target>Fotos</target>
    </trans-unit>

    <trans-unit id="103">
      <source>Galleries</source>
      <target>Galerías</target>
    </trans-unit>

    <trans-unit id="104">
      <source>Albums</source>
      <target>Álbumes</target>
    </trans-unit>

    <trans-unit id="105">
      <source>Photo</source>
      <target>Foto</target>
    </trans-unit>

    <trans-unit id="106">
      <source>Galleries list</source>
      <target>Lista de galerías</target>
    </trans-unit>
    </body>
  </file>
</xliff>


text:
<!doctype html>

<html>
<head>
  <script src="assets/js/pace.min.js"></script>
  <link rel="stylesheet" href="assets/css/pace.css">

  <title>PolymerGoogleMapsApp</title>

  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-capable" content="yes">

  <script src="bower_components/webcomponentsjs/webcomponents.js"></script>

  <link rel="import" href="bower_components/core-field/core-field.html">
  <link rel="import" href="bower_components/core-icon/core-icon.html">
  <link rel="import" href="bower_components/core-icons/core-icons.html">
  <link rel="import" href="bower_components/core-icons/maps-icons.html">
  <link rel="import" href="bower_components/core-item/core-item.html">
  <link rel="import" href="bower_components/core-selector/core-selector.html">
  <link rel="import" href="bower_components/paper-slider/paper-slider.html">

  <link rel="import" href="bower_components/font-roboto/roboto.html">
  <link rel="import" href="bower_components/google-map/google-map.html">
  <link rel="import" href="bower_components/google-map/google-map-directions.html">

  <link rel="stylesheet" href="assets/css/styles.css">
</head>

<body>

  <template is="auto-binding">

    <google-map map="{{map}}" latitude="37.779" longitude="-122.3892" zoom="{{range}}" disableDefaultUI>

      <google-map-marker latitude="37.779" longitude="-122.3892" title="Map marker!"
        draggable="true"></google-map-marker>

    </google-map>
    <google-map-directions travelMode="{{travelMode.label}}" map="{{map}}" startAddress="{{start}}" endAddress="{{end}}">
    </google-map-directions>

    <div id="inputs">
      <core-field>
        <core-icon icon="icons:search"></core-icon>
        <input id="startAddress" placeholder="Start address" value="{{start}}">
      </core-field>
      <core-field>
        <core-icon icon="icons:search"></core-icon>
        <input id="endAddress" placeholder="End address" value="{{end}}">
      </core-field>

      <core-selector selected="0" selectedItem="{{travelMode}}" layout horizontal>
        <core-item icon="maps:directions-car" label="DRIVING"></core-item>
        <core-item icon="maps:directions-walk" label="WALKING"></core-item>
        <core-item icon="maps:directions-bike" label="BICYCLING"></core-item>
        <core-item icon="maps:directions-transit" label="TRANSIT"></core-item>
      </core-selector>
    </div>

    <paper-slider min="5" value="{{range}}" max="15" ></paper-slider>

  </template>

  <script src="assets/js/main.js"></script>
</body>
</html>


text:
<?php

/* HeticSiteBundle:Category:createcategory.html.twig */
class __TwigTemplate_3e4f819b9a124d2e88d14932444127678b98ca2c04ae34dbee486d649f0b8f3e extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = $this->env->loadTemplate("HeticSiteBundle::layout.html.twig");

        $this->blocks = array(
            'javascripts' => array($this, 'block_javascripts'),
            'content' => array($this, 'block_content'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "HeticSiteBundle::layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    public function block_javascripts($context, array $blocks = array())
    {
        // line 4
        echo "    ";
        $this->displayParentBlock("javascripts", $context, $blocks);
        echo "
    ";
        // line 5
        if (isset($context['assetic']['debug']) && $context['assetic']['debug']) {
            // asset "4c2c099_0"
            $context["asset_url"] = isset($context['assetic']['use_controller']) && $context['assetic']['use_controller'] ? $this->env->getExtension('routing')->getPath("_assetic_4c2c099_0") : $this->env->getExtension('assets')->getAssetUrl("js/4c2c099_product_1.js");
            // line 6
            echo "
    ";
        } else {
            // asset "4c2c099"
            $context["asset_url"] = isset($context['assetic']['use_controller']) && $context['assetic']['use_controller'] ? $this->env->getExtension('routing')->getPath("_assetic_4c2c099") : $this->env->getExtension('assets')->getAssetUrl("js/4c2c099.js");
            echo "
    ";
        }
        unset($context["asset_url"]);
    }

    // line 11
    public function block_content($context, array $blocks = array())
    {
        // line 12
        echo "

        env->getExtension('routing')->getPath("hetic_site_categories");
        echo "\">← Revenir à la liste des
            catégories

 Créer une catégory

        <form novalidate=\"novalidate\" action=\"";
        // line 20
        echo $this->env->getExtension('routing')->getPath("hetic_site_add_category");
        echo "\" method=\"post\">

                    Titre

                        ";
        // line 26
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "name"), 'widget');
        echo "

                                          <button class=\"btn btn-search btn-primary\"></button>

                    ";
        // line 33
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "name"), 'errors');
        echo "

                    Résumé
                    ";
        // line 40
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "cover"), 'widget');
        echo "
                    ";
        // line 41
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "cover"), 'errors');
        echo "

                    Description
                        ";
        // line 47
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "description"), 'widget');
        echo "
                    ";
        // line 48
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "description"), 'errors');
        echo "

                    Articles
                        ";
        // line 55
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "articles"), 'widget');
        echo "
                    ";
        // line 56
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "articles"), 'errors');
        echo "

            ";
        // line 59
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), 'rest');
        echo "

            <button class=\"btn btn-primary btn-large\" type=\"submit\"> Ajouter
                cette catégorie
            </button>
        </form>

";
    }

    public function getTemplateName()
    {
        return "HeticSiteBundle:Category:createcategory.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  139 => 59,  133 => 56,  129 => 55,  119 => 48,  115 => 47,  106 => 41,  102 => 40,  92 => 33,  82 => 26,  73 => 20,  64 => 14,  60 => 12,  57 => 11,  41 => 6,  37 => 5,  32 => 4,  29 => 3,);
    }
}


text:
<?php
/**
 * Post Types
 *
 * Registers post types and taxonomies
 *
 * @class       WCV_Post_types
 */

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

/**
 * WCV_Post_types Class
 */
class WCV_Post_types {

	/**
	 * Hook in methods.
	 */
	public static function init() {
		add_action( 'woocommerce_register_post_type', array( __CLASS__, 'register_shop_order_vendor' ) );
	}

	/**
	 * Register vendor order type
	 */
	public static function register_shop_order_vendor() {
		wc_register_order_type(
			'shop_order_vendor',
			apply_filters( 'woocommerce_register_post_type_shop_order_vendor',
				array(
					'label'                            => __( 'Vendor Orders', 'woocommerce' ),
					'capability_type'                  => 'shop_order',
					'public'                           => false,
					'hierarchical'                     => false,
					'supports'                         => false,
					'exclude_from_orders_screen'       => false,
					'add_order_meta_boxes'             => false,
					'exclude_from_order_count'         => true,
					'exclude_from_order_views'         => false,
					'exclude_from_order_reports'       => false,
					'exclude_from_order_sales_reports' => true,
					'class_name'                       => 'WC_Order_Vendor'
				)
			)
		);
	}
}

WCV_Post_types::init();


text:
package net.tridentsdk.inventory;

import net.tridentsdk.Impl;
import org.junit.Test;
import org.mockito.Mockito;

import static org.junit.Assert.assertNotNull;

public class InventoryTest {
    static {
        Impl.setImpl(Mockito.mock(Impl.Provider.class));
        Mockito.when(Impl.get().newInventory(InventoryType.PLAYER, 49)).
                thenReturn(Mockito.mock(Inventory.class));
    }

    @Test
    public void newInventory() throws Exception {
        assertNotNull(Inventory.newInventory(InventoryType.PLAYER, 49));
    }
}


text:
import test from 'ava';
import sinon from 'sinon';
import { createFolderNameRegistry } from '../../src/core/registry.js';

test('createFolderNameRegistry should create a registry function that applies all transformations and invokes a callback', (t) => {

    const path = './path/index.js';
    const value = { a: 1 };

    const transformedPath = 'transformedPath';
    const transformedValue = { a: 2 };

    const pathTransformer = sinon.spy((path) => transformedPath);
    const valueValidator = sinon.spy();
    const valueTransformer = sinon.spy((value) => ({ a: 2 }));
    const callback = sinon.spy();
    const registry = createFolderNameRegistry('pretty name', [pathTransformer], [valueValidator], [valueTransformer], callback);

    const application = {};
    const warn = () => {};
    const debug = () => {};
    const info = () => {};
    const error = () => {};

    const context = () => ({ default: value });
    context.keys = () => [path];

    registry(context, { application, warn, debug, info, error });
    t.true(pathTransformer.calledOnce);
    t.true(valueValidator.calledOnce);
    t.true(valueTransformer.calledOnce);
    t.true(callback.calledOnce);
    t.true(callback.calledWith(application, transformedPath, transformedValue))
});


text:
<?php

namespace SERVERSOAP\interfaces\filter;

use SERVERSOAP\implement\core\SoapResponse;

/**
 * Interface for response filter
 *
 * @author Cleidson Dias do Nascimento - cleidsondias@hotmail.com
 *
 */
interface SoapResponseFilter {
	/**
	 *
	 * @param SoapResponse $response
	 */
	public function filterResponse(SoapResponse $response);
}

?>


text:
package org.apache.syncope.core.persistence.jpa.dao;

import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.persistence.NoResultException;
import javax.persistence.Query;
import javax.persistence.TypedQuery;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.IdRepoEntitlement;
import org.apache.syncope.core.persistence.api.dao.AnyDAO;
import org.apache.syncope.core.persistence.api.dao.AnyMatchDAO;
import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
import org.apache.syncope.core.persistence.api.dao.AnySearchDAO;
import org.apache.syncope.core.persistence.api.dao.DerSchemaDAO;
import org.apache.syncope.core.persistence.api.dao.DynRealmDAO;
import org.apache.syncope.core.persistence.api.dao.GroupDAO;
import org.apache.syncope.core.persistence.api.dao.PlainAttrDAO;
import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
import org.apache.syncope.core.persistence.api.dao.UserDAO;
import org.apache.syncope.core.persistence.api.dao.search.AssignableCond;
import org.apache.syncope.core.persistence.api.dao.search.SearchCond;
import org.apache.syncope.core.persistence.api.entity.AnyType;
import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
import org.apache.syncope.core.persistence.api.entity.AnyUtils;
import org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory;
import org.apache.syncope.core.persistence.api.entity.ExternalResource;
import org.apache.syncope.core.persistence.api.entity.Realm;
import org.apache.syncope.core.persistence.api.entity.anyobject.ADynGroupMembership;
import org.apache.syncope.core.persistence.api.entity.anyobject.AMembership;
import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
import org.apache.syncope.core.persistence.api.entity.group.Group;
import org.apache.syncope.core.persistence.api.entity.group.TypeExtension;
import org.apache.syncope.core.persistence.api.entity.user.UDynGroupMembership;
import org.apache.syncope.core.persistence.api.entity.user.UMembership;
import org.apache.syncope.core.persistence.api.entity.user.User;
import org.apache.syncope.core.persistence.api.search.SearchCondConverter;
import org.apache.syncope.core.persistence.api.search.SearchCondVisitor;
import org.apache.syncope.core.persistence.jpa.entity.anyobject.JPAADynGroupMembership;
import org.apache.syncope.core.persistence.jpa.entity.anyobject.JPAAMembership;
import org.apache.syncope.core.persistence.jpa.entity.group.JPAGroup;
import org.apache.syncope.core.persistence.jpa.entity.group.JPATypeExtension;
import org.apache.syncope.core.persistence.jpa.entity.user.JPAUDynGroupMembership;
import org.apache.syncope.core.persistence.jpa.entity.user.JPAUMembership;
import org.apache.syncope.core.provisioning.api.event.AnyLifecycleEvent;
import org.apache.syncope.core.provisioning.api.utils.RealmUtils;
import org.apache.syncope.core.spring.security.AuthContextUtils;
import org.apache.syncope.core.spring.security.DelegatedAdministrationException;
import org.identityconnectors.framework.common.objects.SyncDeltaType;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.transaction.annotation.Transactional;

public class JPAGroupDAO extends AbstractAnyDAO<Group> implements GroupDAO {

    public static final String UDYNMEMB_TABLE = "UDynGroupMembers";

    public static final String ADYNMEMB_TABLE = "ADynGroupMembers";

    protected final ApplicationEventPublisher publisher;

    protected final AnyMatchDAO anyMatchDAO;

    protected final PlainAttrDAO plainAttrDAO;

    protected final UserDAO userDAO;

    protected final AnyObjectDAO anyObjectDAO;

    protected final AnySearchDAO anySearchDAO;

    protected final SearchCondVisitor searchCondVisitor;

    public JPAGroupDAO(
            final AnyUtilsFactory anyUtilsFactory,
            final ApplicationEventPublisher publisher,
            final PlainSchemaDAO plainSchemaDAO,
            final DerSchemaDAO derSchemaDAO,
            final DynRealmDAO dynRealmDAO,
            final AnyMatchDAO anyMatchDAO,
            final PlainAttrDAO plainAttrDAO,
            final UserDAO userDAO,
            final AnyObjectDAO anyObjectDAO,
            final AnySearchDAO searchDAO,
            final SearchCondVisitor searchCondVisitor) {

        super(anyUtilsFactory, plainSchemaDAO, derSchemaDAO, dynRealmDAO);
        this.publisher = publisher;
        this.anyMatchDAO = anyMatchDAO;
        this.plainAttrDAO = plainAttrDAO;
        this.userDAO = userDAO;
        this.anyObjectDAO = anyObjectDAO;
        this.anySearchDAO = searchDAO;
        this.searchCondVisitor = searchCondVisitor;
    }

    @Override
    protected AnyUtils init() {
        return anyUtilsFactory.getInstance(AnyTypeKind.GROUP);
    }

    @Transactional(readOnly = true)
    @Override
    public String findKey(final String name) {
        return findKey(name, JPAGroup.TABLE);
    }

    @Transactional(readOnly = true)
    @Override
    public OffsetDateTime findLastChange(final String key) {
        return findLastChange(key, JPAGroup.TABLE);
    }

    @Override
    public int count() {
        Query query = entityManager().createQuery(
                "SELECT COUNT(e) FROM  " + anyUtils().anyClass().getSimpleName() + " e");
        return ((Number) query.getSingleResult()).intValue();
    }

    @Override
    public Map<String, Integer> countByRealm() {
        Query query = entityManager().createQuery(
                "SELECT e.realm, COUNT(e) FROM  " + anyUtils().anyClass().getSimpleName() + " e GROUP BY e.realm");

        @SuppressWarnings("unchecked")
        List<Object[]> results = query.getResultList();
        return results.stream().collect(Collectors.toMap(
                result -> ((Realm) result[0]).getFullPath(),
                result -> ((Number) result[1]).intValue()));
    }

    @Transactional(readOnly = true)
    @Override
    public void securityChecks(
            final Set<String> authRealms,
            final String key,
            final String realm) {

        // 1. check if AuthContextUtils.getUsername() is owner of the group, or
        // if group is in Realm (or descendants) for which AuthContextUtils.getUsername() owns entitlement
        boolean authorized = authRealms.stream().anyMatch(authRealm -> realm.startsWith(authRealm)
                || authRealm.equals(RealmUtils.getGroupOwnerRealm(realm, key)));

        // 2. check if groups is in at least one DynRealm for which AuthContextUtils.getUsername() owns entitlement
        if (!authorized) {
            authorized = findDynRealms(key).stream().anyMatch(authRealms::contains);
        }

        if (authRealms.isEmpty() || !authorized) {
            throw new DelegatedAdministrationException(realm, AnyTypeKind.GROUP.name(), key);
        }
    }

    @Override
    protected void securityChecks(final Group group) {
        Set<String> authRealms = AuthContextUtils.getAuthorizations().
                getOrDefault(IdRepoEntitlement.GROUP_READ, Set.of());

        securityChecks(authRealms, group.getKey(), group.getRealm().getFullPath());
    }

    @Override
    public Group findByName(final String name) {
        TypedQuery<Group> query = entityManager().createQuery(
                "SELECT e FROM " + anyUtils().anyClass().getSimpleName() + " e WHERE e.name = :name", Group.class);
        query.setParameter("name", name);

        Group result = null;
        try {
            result = query.getSingleResult();
        } catch (NoResultException e) {
            LOG.debug("No group found with name {}", name, e);
        }

        return result;
    }

    @Override
    public List<String> findKeysByNamePattern(final String pattern) {
        Query query = entityManager().createNativeQuery(
                "SELECT id FROM " + JPAGroup.TABLE + " WHERE LOWER(name) LIKE LOWER(?1)");
        query.setParameter(1, pattern);

        @SuppressWarnings("unchecked")
        List<Object> raw = query.getResultList();
        return raw.stream().map(Object::toString).collect(Collectors.toList());
    }

    @Transactional(readOnly = true)
    @Override
    public List<Group> findOwnedByUser(final String userKey) {
        User owner = userDAO.find(userKey);
        if (owner == null) {
            return List.of();
        }

        StringBuilder queryString = new StringBuilder("SELECT e FROM ").append(anyUtils().anyClass().getSimpleName())
                .append(" e WHERE e.userOwner=:owner ");
        userDAO.findAllGroupKeys(owner).forEach(groupKey -> queryString
                .append("OR e.groupOwner.id='").append(groupKey).append("' "));

        TypedQuery<Group> query = entityManager().createQuery(queryString.toString(), Group.class);
        query.setParameter("owner", owner);

        return query.getResultList();
    }

    @Transactional(readOnly = true)
    @Override
    public List<Group> findOwnedByGroup(final String groupKey) {
        Group owner = find(groupKey);
        if (owner == null) {
            return List.of();
        }

        TypedQuery<Group> query = entityManager().createQuery(
                "SELECT e FROM " + anyUtils().anyClass().getSimpleName() + " e WHERE e.groupOwner=:owner", Group.class);
        query.setParameter("owner", owner);

        return query.getResultList();
    }

    @Override
    public List<AMembership> findAMemberships(final Group group) {
        TypedQuery<AMembership> query = entityManager().createQuery(
                "SELECT e FROM " + JPAAMembership.class.getSimpleName() + " e WHERE e.rightEnd=:group",
                AMembership.class);
        query.setParameter("group", group);

        return query.getResultList();
    }

    @Override
    public List<UMembership> findUMemberships(final Group group) {
        TypedQuery<UMembership> query = entityManager().createQuery(
                "SELECT e FROM " + JPAUMembership.class.getSimpleName() + " e WHERE e.rightEnd=:group",
                UMembership.class);
        query.setParameter("group", group);

        return query.getResultList();
    }

    @Override
    public List<Group> findAll(final int page, final int itemsPerPage) {
        TypedQuery<Group> query = entityManager().createQuery(
                "SELECT e FROM  " + anyUtils().anyClass().getSimpleName() + " e ORDER BY e.id", Group.class);
        query.setFirstResult(itemsPerPage * (page <= 0 ? 0 : page - 1));
        query.setMaxResults(itemsPerPage);

        return query.getResultList();
    }

    @Override
    public List<String> findAllKeys(final int page, final int itemsPerPage) {
        return findAllKeys(JPAGroup.TABLE, page, itemsPerPage);
    }

    protected SearchCond buildDynMembershipCond(final String baseCondFIQL, final Realm groupRealm) {
        AssignableCond cond = new AssignableCond();
        cond.setRealmFullPath(groupRealm.getFullPath());
        cond.setFromGroup(true);

        return SearchCond.getAnd(
                SearchCond.getLeaf(cond),
                SearchCondConverter.convert(searchCondVisitor, baseCondFIQL));
    }

    @Override
    public Group saveAndRefreshDynMemberships(final Group group) {
        Group merged = save(group);

        // refresh dynamic memberships
        clearUDynMembers(merged);
        if (merged.getUDynMembership() != null) {
            SearchCond cond = buildDynMembershipCond(merged.getUDynMembership().getFIQLCond(), merged.getRealm());
            int count = anySearchDAO.count(
                    merged.getRealm(), true, Set.of(merged.getRealm().getFullPath()), cond, AnyTypeKind.USER);
            for (int page = 1; page <= (count / AnyDAO.DEFAULT_PAGE_SIZE) + 1; page++) {
                List<User> matching = anySearchDAO.search(
                        merged.getRealm(),
                        true,
                        Set.of(merged.getRealm().getFullPath()),
                        cond,
                        page,
                        AnyDAO.DEFAULT_PAGE_SIZE,
                        List.of(),
                        AnyTypeKind.USER);

                matching.forEach(user -> {
                    Query insert = entityManager().createNativeQuery("INSERT INTO " + UDYNMEMB_TABLE + " VALUES(?, ?)");
                    insert.setParameter(1, user.getKey());
                    insert.setParameter(2, merged.getKey());
                    insert.executeUpdate();

                    publisher.publishEvent(
                            new AnyLifecycleEvent<>(this, SyncDeltaType.UPDATE, user, AuthContextUtils.getDomain()));
                });
            }
        }
        clearADynMembers(merged);
        merged.getADynMemberships().forEach(memb -> {
            SearchCond cond = buildDynMembershipCond(memb.getFIQLCond(), merged.getRealm());
            int count = anySearchDAO.count(
                    merged.getRealm(), true, Set.of(merged.getRealm().getFullPath()), cond, AnyTypeKind.ANY_OBJECT);
            for (int page = 1; page <= (count / AnyDAO.DEFAULT_PAGE_SIZE) + 1; page++) {
                List<AnyObject> matching = anySearchDAO.search(
                        merged.getRealm(),
                        true,
                        Set.of(merged.getRealm().getFullPath()),
                        cond,
                        page,
                        AnyDAO.DEFAULT_PAGE_SIZE,
                        List.of(),
                        AnyTypeKind.ANY_OBJECT);

                matching.forEach(any -> {
                    Query insert = entityManager().createNativeQuery(
                            "INSERT INTO " + ADYNMEMB_TABLE + " VALUES(?, ?, ?)");
                    insert.setParameter(1, any.getType().getKey());
                    insert.setParameter(2, any.getKey());
                    insert.setParameter(3, merged.getKey());
                    insert.executeUpdate();

                    publisher.publishEvent(
                            new AnyLifecycleEvent<>(this, SyncDeltaType.UPDATE, any, AuthContextUtils.getDomain()));
                });
            }
        });

        dynRealmDAO.refreshDynMemberships(merged);

        return merged;
    }

    @Override
    public void delete(final Group group) {
        dynRealmDAO.removeDynMemberships(group.getKey());

        findAMemberships(group).forEach(membership -> {
            AnyObject leftEnd = membership.getLeftEnd();
            leftEnd.remove(membership);
            membership.setRightEnd(null);
            leftEnd.getPlainAttrs(membership).forEach(attr -> {
                leftEnd.remove(attr);
                attr.setOwner(null);
                attr.setMembership(null);
                plainAttrDAO.delete(attr);
            });

            anyObjectDAO.save(leftEnd);
            publisher.publishEvent(
                    new AnyLifecycleEvent<>(this, SyncDeltaType.UPDATE, leftEnd, AuthContextUtils.getDomain()));
        });

        findUMemberships(group).forEach(membership -> {
            User leftEnd = membership.getLeftEnd();
            leftEnd.remove(membership);
            membership.setRightEnd(null);
            leftEnd.getPlainAttrs(membership).forEach(attr -> {
                leftEnd.remove(attr);
                attr.setOwner(null);
                attr.setMembership(null);

                plainAttrDAO.delete(attr);
            });

            userDAO.save(leftEnd);
            publisher.publishEvent(
                    new AnyLifecycleEvent<>(this, SyncDeltaType.UPDATE, leftEnd, AuthContextUtils.getDomain()));
        });

        clearUDynMembers(group);
        clearADynMembers(group);

        entityManager().remove(group);
    }

    @Override
    public List<TypeExtension> findTypeExtensions(final AnyTypeClass anyTypeClass) {
        TypedQuery<TypeExtension> query = entityManager().createQuery(
                "SELECT e FROM " + JPATypeExtension.class.getSimpleName()
                + " e WHERE :anyTypeClass MEMBER OF e.auxClasses", TypeExtension.class);
        query.setParameter("anyTypeClass", anyTypeClass);

        return query.getResultList();
    }

    @Override
    @SuppressWarnings("unchecked")
    public List<String> findADynMembers(final Group group) {
        List<String> result = new ArrayList<>();

        group.getADynMemberships().forEach(memb -> {
            Query query = entityManager().createNativeQuery(
                    "SELECT any_id FROM " + ADYNMEMB_TABLE + " WHERE group_id=? AND anyType_id=?");
            query.setParameter(1, group.getKey());
            query.setParameter(2, memb.getAnyType().getKey());

            query.getResultList().stream().map(key -> key instanceof Object[]
                    ? (String) ((Object[]) key)[0]
                    : ((String) key)).
                    filter(anyObject -> !result.contains((String) anyObject)).
                    forEach(anyObject -> result.add((String) anyObject));
        });

        return result;
    }

    @Override
    public int countAMembers(final Group group) {
        Query query = entityManager().createNativeQuery(
                "SELECT COUNT(anyObject_id) FROM " + JPAAMembership.TABLE + " WHERE group_id=?");
        query.setParameter(1, group.getKey());

        return ((Number) query.getSingleResult()).intValue();
    }

    @Override
    public int countUMembers(final Group group) {
        Query query = entityManager().createNativeQuery(
                "SELECT COUNT(user_id) FROM " + JPAUMembership.TABLE + " WHERE group_id=?");
        query.setParameter(1, group.getKey());

        return ((Number) query.getSingleResult()).intValue();
    }

    @Override
    public int countADynMembers(final Group group) {
        Query query = entityManager().createNativeQuery(
                "SELECT COUNT(any_id) FROM " + ADYNMEMB_TABLE + " WHERE group_id=?");
        query.setParameter(1, group.getKey());

        return ((Number) query.getSingleResult()).intValue();
    }

    @Override
    public int countUDynMembers(final Group group) {
        if (group.getUDynMembership() == null) {
            return 0;
        }

        Query query = entityManager().createNativeQuery(
                "SELECT COUNT(any_id) FROM " + UDYNMEMB_TABLE + " WHERE group_id=?");
        query.setParameter(1, group.getKey());

        return ((Number) query.getSingleResult()).intValue();
    }

    @Override
    public void clearADynMembers(final Group group) {
        Query delete = entityManager().createNativeQuery("DELETE FROM " + ADYNMEMB_TABLE + " WHERE group_id=?");
        delete.setParameter(1, group.getKey());
        delete.executeUpdate();
    }

    protected List<ADynGroupMembership> findWithADynMemberships(final AnyType anyType) {
        TypedQuery<ADynGroupMembership> query = entityManager().createQuery(
                "SELECT e FROM " + JPAADynGroupMembership.class.getSimpleName() + " e  WHERE e.anyType=:anyType",
                ADynGroupMembership.class);
        query.setParameter("anyType", anyType);
        return query.getResultList();
    }

    @Transactional
    @Override
    public Pair<Set<String>, Set<String>> refreshDynMemberships(final AnyObject anyObject) {
        Query query = entityManager().createNativeQuery(
                "SELECT group_id FROM " + JPAGroupDAO.ADYNMEMB_TABLE + " WHERE any_id=?");
        query.setParameter(1, anyObject.getKey());

        Set<String> before = new HashSet<>();
        Set<String> after = new HashSet<>();
        findWithADynMemberships(anyObject.getType()).forEach(memb -> {
            boolean matches = anyMatchDAO.matches(
                    anyObject,
                    buildDynMembershipCond(memb.getFIQLCond(), memb.getGroup().getRealm()));
            if (matches) {
                after.add(memb.getGroup().getKey());
            }

            Query find = entityManager().createNativeQuery(
                    "SELECT any_id FROM " + ADYNMEMB_TABLE + " WHERE group_id=? AND any_id=?");
            find.setParameter(1, memb.getGroup().getKey());
            find.setParameter(2, anyObject.getKey());
            boolean existing = !find.getResultList().isEmpty();
            if (existing) {
                before.add(memb.getGroup().getKey());
            }

            if (matches && !existing) {
                Query insert = entityManager().createNativeQuery(
                        "INSERT INTO " + ADYNMEMB_TABLE + " VALUES(?, ?, ?)");
                insert.setParameter(1, anyObject.getType().getKey());
                insert.setParameter(2, anyObject.getKey());
                insert.setParameter(3, memb.getGroup().getKey());
                insert.executeUpdate();
            } else if (!matches && existing) {
                Query delete = entityManager().createNativeQuery(
                        "DELETE FROM " + ADYNMEMB_TABLE + " WHERE group_id=? AND any_id=?");
                delete.setParameter(1, memb.getGroup().getKey());
                delete.setParameter(2, anyObject.getKey());
                delete.executeUpdate();
            }

            publisher.publishEvent(
                    new AnyLifecycleEvent<>(this, SyncDeltaType.UPDATE, memb.getGroup(), AuthContextUtils.getDomain()));
        });

        return Pair.of(before, after);
    }

    @Override
    public Set<String> removeDynMemberships(final AnyObject anyObject) {
        List<Group> dynGroups = anyObjectDAO.findDynGroups(anyObject.getKey());

        Query delete = entityManager().createNativeQuery("DELETE FROM " + ADYNMEMB_TABLE + " WHERE any_id=?");
        delete.setParameter(1, anyObject.getKey());
        delete.executeUpdate();

        Set<String> before = new HashSet<>();
        dynGroups.forEach(group -> {
            before.add(group.getKey());

            publisher.publishEvent(
                    new AnyLifecycleEvent<>(this, SyncDeltaType.UPDATE, group, AuthContextUtils.getDomain()));
        });

        return before;
    }

    @Override
    @SuppressWarnings("unchecked")
    public List<String> findUDynMembers(final Group group) {
        if (group.getUDynMembership() == null) {
            return List.of();
        }

        Query query = entityManager().createNativeQuery(
                "SELECT any_id FROM " + UDYNMEMB_TABLE + " WHERE group_id=?");
        query.setParameter(1, group.getKey());

        List<String> result = new ArrayList<>();
        query.getResultList().stream().map(key -> key instanceof Object[]
                ? (String) ((Object[]) key)[0]
                : ((String) key)).
                forEach(user -> result.add((String) user));
        return result;
    }

    @Override
    public void clearUDynMembers(final Group group) {
        Query delete = entityManager().createNativeQuery("DELETE FROM " + UDYNMEMB_TABLE + " WHERE group_id=?");
        delete.setParameter(1, group.getKey());
        delete.executeUpdate();
    }

    protected List<UDynGroupMembership> findWithUDynMemberships() {
        TypedQuery<UDynGroupMembership> query = entityManager().createQuery(
                "SELECT e FROM " + JPAUDynGroupMembership.class.getSimpleName() + " e",
                UDynGroupMembership.class);

        return query.getResultList();
    }

    @Transactional
    @Override
    public Pair<Set<String>, Set<String>> refreshDynMemberships(final User user) {
        Query query = entityManager().createNativeQuery(
                "SELECT group_id FROM " + JPAGroupDAO.UDYNMEMB_TABLE + " WHERE any_id=?");
        query.setParameter(1, user.getKey());

        Set<String> before = new HashSet<>();
        Set<String> after = new HashSet<>();
        findWithUDynMemberships().forEach(memb -> {
            boolean matches = anyMatchDAO.matches(
                    user,
                    buildDynMembershipCond(memb.getFIQLCond(), memb.getGroup().getRealm()));
            if (matches) {
                after.add(memb.getGroup().getKey());
            }

            Query find = entityManager().createNativeQuery(
                    "SELECT any_id FROM " + UDYNMEMB_TABLE + " WHERE group_id=? AND any_id=?");
            find.setParameter(1, memb.getGroup().getKey());
            find.setParameter(2, user.getKey());
            boolean existing = !find.getResultList().isEmpty();
            if (existing) {
                before.add(memb.getGroup().getKey());
            }

            if (matches && !existing) {
                Query insert = entityManager().createNativeQuery(
                        "INSERT INTO " + UDYNMEMB_TABLE + " VALUES(?, ?)");
                insert.setParameter(1, user.getKey());
                insert.setParameter(2, memb.getGroup().getKey());
                insert.executeUpdate();
            } else if (!matches && existing) {
                Query delete = entityManager().createNativeQuery(
                        "DELETE FROM " + UDYNMEMB_TABLE + " WHERE group_id=? AND any_id=?");
                delete.setParameter(1, memb.getGroup().getKey());
                delete.setParameter(2, user.getKey());
                delete.executeUpdate();
            }

            publisher.publishEvent(
                    new AnyLifecycleEvent<>(this, SyncDeltaType.UPDATE, memb.getGroup(), AuthContextUtils.getDomain()));
        });

        return Pair.of(before, after);
    }

    @Override
    public Set<String> removeDynMemberships(final User user) {
        List<Group> dynGroups = userDAO.findDynGroups(user.getKey());

        Query delete = entityManager().createNativeQuery("DELETE FROM " + UDYNMEMB_TABLE + " WHERE any_id=?");
        delete.setParameter(1, user.getKey());
        delete.executeUpdate();

        Set<String> before = new HashSet<>();
        dynGroups.forEach(group -> {
            before.add(group.getKey());

            publisher.publishEvent(
                    new AnyLifecycleEvent<>(this, SyncDeltaType.UPDATE, group, AuthContextUtils.getDomain()));
        });

        return before;
    }

    @Transactional(readOnly = true)
    @Override
    public Collection<String> findAllResourceKeys(final String key) {
        return find(key).getResources().stream().map(ExternalResource::getKey).collect(Collectors.toList());
    }
}


text:
'use strict';

import nls = require('vs/nls');
import { TPromise } from 'vs/base/common/winjs.base';
import URI from 'vs/base/common/uri';
import { Dimension, Builder } from 'vs/base/browser/builder';
import objects = require('vs/base/common/objects');
import types = require('vs/base/common/types');
import errors = require('vs/base/common/errors');
import DOM = require('vs/base/browser/dom');
import { CodeEditor } from 'vs/editor/browser/codeEditor';
import { EditorInput, EditorOptions } from 'vs/workbench/common/editor';
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
import { IEditorViewState, IEditor } from 'vs/editor/common/editorCommon';
import { Position } from 'vs/platform/editor/common/editor';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { Scope } from 'vs/workbench/common/memento';
import { getCodeEditor } from 'vs/editor/browser/services/codeEditorService';
import { ITextFileService, SaveReason, AutoSaveMode } from 'vs/workbench/services/textfile/common/textfiles';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { IEditorOptions } from 'vs/editor/common/config/editorOptions';
import { isDiffEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';

const TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY = 'textEditorViewState';

export interface IEditorConfiguration {
	editor: object;
	diffEditor: object;
}

/**
 * The base class of editors that leverage the text editor for the editing experience. This class is only intended to
 * be subclassed and not instantiated.
 */
export abstract class BaseTextEditor extends BaseEditor {
	private editorControl: IEditor;
	private _editorContainer: Builder;
	private hasPendingConfigurationChange: boolean;
	private lastAppliedEditorOptions: IEditorOptions;

	constructor(
		id: string,
		@ITelemetryService telemetryService: ITelemetryService,
		@IInstantiationService private _instantiationService: IInstantiationService,
		@IStorageService private storageService: IStorageService,
		@ITextResourceConfigurationService private _configurationService: ITextResourceConfigurationService,
		@IThemeService protected themeService: IThemeService,
		@ITextFileService private _textFileService: ITextFileService,
		@IEditorGroupService protected editorGroupService: IEditorGroupService
	) {
		super(id, telemetryService, themeService);

		this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.handleConfigurationChangeEvent(this.configurationService.getValue<IEditorConfiguration>(this.getResource()))));
	}

	protected get instantiationService(): IInstantiationService {
		return this._instantiationService;
	}

	protected get configurationService(): ITextResourceConfigurationService {
		return this._configurationService;
	}

	protected get textFileService(): ITextFileService {
		return this._textFileService;
	}

	private handleConfigurationChangeEvent(configuration?: IEditorConfiguration): void {
		if (this.isVisible()) {
			this.updateEditorConfiguration(configuration);
		} else {
			this.hasPendingConfigurationChange = true;
		}
	}

	private consumePendingConfigurationChangeEvent(): void {
		if (this.hasPendingConfigurationChange) {
			this.updateEditorConfiguration();
			this.hasPendingConfigurationChange = false;
		}
	}

	protected computeConfiguration(configuration: IEditorConfiguration): IEditorOptions {

		// Specific editor options always overwrite user configuration
		const editorConfiguration: IEditorOptions = types.isObject(configuration.editor) ? objects.deepClone(configuration.editor) : Object.create(null);
		objects.assign(editorConfiguration, this.getConfigurationOverrides());

		// ARIA label
		editorConfiguration.ariaLabel = this.computeAriaLabel();

		return editorConfiguration;
	}

	private computeAriaLabel(): string {
		let ariaLabel = this.getAriaLabel();

		// Apply group information to help identify in which group we are
		if (ariaLabel && typeof this.position === 'number') {
			ariaLabel = nls.localize('editorLabelWithGroup', "{0}, Group {1}.", ariaLabel, this.position + 1);
		}

		return ariaLabel;
	}

	protected getConfigurationOverrides(): IEditorOptions {
		const overrides = {};
		objects.assign(overrides, {
			overviewRulerLanes: 3,
			lineNumbersMinChars: 3,
			fixedOverflowWidgets: true
		});

		return overrides;
	}

	protected createEditor(parent: Builder): void {

		// Editor for Text
		this._editorContainer = parent;
		this.editorControl = this.createEditorControl(parent, this.computeConfiguration(this.configurationService.getValue<IEditorConfiguration>(this.getResource())));

		// Model & Language changes
		const codeEditor = getCodeEditor(this);
		if (codeEditor) {
			this.toUnbind.push(codeEditor.onDidChangeModelLanguage(e => this.updateEditorConfiguration()));
			this.toUnbind.push(codeEditor.onDidChangeModel(e => this.updateEditorConfiguration()));
		}

		// Application & Editor focus change to respect auto save settings
		if (isCodeEditor(this.editorControl)) {
			this.toUnbind.push(this.editorControl.onDidBlurEditor(() => this.onEditorFocusLost()));
		} else if (isDiffEditor(this.editorControl)) {
			this.toUnbind.push(this.editorControl.getOriginalEditor().onDidBlurEditor(() => this.onEditorFocusLost()));
			this.toUnbind.push(this.editorControl.getModifiedEditor().onDidBlurEditor(() => this.onEditorFocusLost()));
		}

		this.toUnbind.push(this.editorGroupService.onEditorsChanged(() => this.onEditorFocusLost()));
		this.toUnbind.push(DOM.addDisposableListener(window, DOM.EventType.BLUR, () => this.onWindowFocusLost()));
	}

	private onEditorFocusLost(): void {
		this.maybeTriggerSaveAll(SaveReason.FOCUS_CHANGE);
	}

	private onWindowFocusLost(): void {
		this.maybeTriggerSaveAll(SaveReason.WINDOW_CHANGE);
	}

	private maybeTriggerSaveAll(reason: SaveReason): void {
		const mode = this.textFileService.getAutoSaveMode();

		// Determine if we need to save all. In case of a window focus change we also save if auto save mode
		// is configured to be ON_FOCUS_CHANGE (editor focus change)
		if (
			(reason === SaveReason.WINDOW_CHANGE && (mode === AutoSaveMode.ON_FOCUS_CHANGE || mode === AutoSaveMode.ON_WINDOW_CHANGE)) ||
			(reason === SaveReason.FOCUS_CHANGE && mode === AutoSaveMode.ON_FOCUS_CHANGE)
		) {
			if (this.textFileService.isDirty()) {
				this.textFileService.saveAll(void 0, { reason }).done(null, errors.onUnexpectedError);
			}
		}
	}

	/**
	 * This method creates and returns the text editor control to be used. Subclasses can override to
	 * provide their own editor control that should be used (e.g. a DiffEditor).
	 *
	 * The passed in configuration object should be passed to the editor control when creating it.
	 */
	protected createEditorControl(parent: Builder, configuration: IEditorOptions): IEditor {

		// Use a getter for the instantiation service since some subclasses might use scoped instantiation services
		return this.instantiationService.createInstance(CodeEditor, parent.getHTMLElement(), configuration);
	}

	public setInput(input: EditorInput, options?: EditorOptions): TPromise<void> {
		return super.setInput(input, options).then(() => {

			// Update editor options after having set the input. We do this because there can be
			// editor input specific options (e.g. an ARIA label depending on the input showing)
			this.updateEditorConfiguration();
			this._editorContainer.getHTMLElement().setAttribute('aria-label', this.computeAriaLabel());
		});
	}

	public changePosition(position: Position): void {
		super.changePosition(position);

		// Make sure to update ARIA label if the position of this editor changed
		if (this.editorControl) {
			this.editorControl.updateOptions({ ariaLabel: this.computeAriaLabel() });
		}
	}

	protected setEditorVisible(visible: boolean, position: Position = null): void {

		// Pass on to Editor
		if (visible) {
			this.consumePendingConfigurationChangeEvent();
			this.editorControl.onVisible();
		} else {
			this.editorControl.onHide();
		}

		super.setEditorVisible(visible, position);
	}

	public focus(): void {
		this.editorControl.focus();
	}

	public layout(dimension: Dimension): void {

		// Pass on to Editor
		this.editorControl.layout(dimension);
	}

	public getControl(): IEditor {
		return this.editorControl;
	}

	/**
	 * Saves the text editor view state under the given key.
	 */
	protected saveTextEditorViewState(key: string): void {
		const memento = this.getMemento(this.storageService, Scope.WORKSPACE);
		let textEditorViewStateMemento: { [key: string]: { [position: number]: IEditorViewState } } = memento[TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY];
		if (!textEditorViewStateMemento) {
			textEditorViewStateMemento = Object.create(null);
			memento[TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY] = textEditorViewStateMemento;
		}

		const editorViewState = this.getControl().saveViewState();

		let lastKnownViewState = textEditorViewStateMemento[key];
		if (!lastKnownViewState) {
			lastKnownViewState = Object.create(null);
			textEditorViewStateMemento[key] = lastKnownViewState;
		}

		if (typeof this.position === 'number') {
			lastKnownViewState[this.position] = editorViewState;
		}
	}

	/**
	 * Clears the text editor view state under the given key.
	 */
	protected clearTextEditorViewState(keys: string[]): void {
		const memento = this.getMemento(this.storageService, Scope.WORKSPACE);
		const textEditorViewStateMemento: { [key: string]: { [position: number]: IEditorViewState } } = memento[TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY];
		if (textEditorViewStateMemento) {
			keys.forEach(key => delete textEditorViewStateMemento[key]);
		}
	}

	/**
	 * Loads the text editor view state for the given key and returns it.
	 */
	protected loadTextEditorViewState(key: string): IEditorViewState {
		const memento = this.getMemento(this.storageService, Scope.WORKSPACE);
		const textEditorViewStateMemento: { [key: string]: { [position: number]: IEditorViewState } } = memento[TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY];
		if (textEditorViewStateMemento) {
			const viewState = textEditorViewStateMemento[key];
			if (viewState) {
				return viewState[this.position];
			}
		}

		return null;
	}

	private updateEditorConfiguration(configuration = this.configurationService.getValue<IEditorConfiguration>(this.getResource())): void {
		if (!this.editorControl) {
			return;
		}

		const editorConfiguration = this.computeConfiguration(configuration);

		// Try to figure out the actual editor options that changed from the last time we updated the editor.
		// We do this so that we are not overwriting some dynamic editor settings (e.g. word wrap) that might
		// have been applied to the editor directly.
		let editorSettingsToApply = editorConfiguration;
		if (this.lastAppliedEditorOptions) {
			editorSettingsToApply = objects.distinct(this.lastAppliedEditorOptions, editorSettingsToApply);
		}

		if (Object.keys(editorSettingsToApply).length > 0) {
			this.lastAppliedEditorOptions = editorConfiguration;
			this.editorControl.updateOptions(editorSettingsToApply);
		}
	}

	protected getResource(): URI {
		const codeEditor = getCodeEditor(this);
		if (codeEditor) {
			const model = codeEditor.getModel();
			if (model) {
				return model.uri;
			}
		}

		if (this.input) {
			return this.input.getResource();
		}

		return null;
	}

	protected abstract getAriaLabel(): string;

	public dispose(): void {
		this.lastAppliedEditorOptions = void 0;
		this.editorControl.dispose();

		super.dispose();
	}
}


text:
from otp.ai.AIBaseGlobal import *
import DistributedCCharBaseAI
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from direct.task import Task
import random
import CharStateDatasAI
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer

class DistributedDonaldDockAI(DistributedCCharBaseAI.DistributedCCharBaseAI):
    notify = DirectNotifyGlobal.directNotify.newCategory('DistributedDonaldDockAI')

    def __init__(self, air):
        DistributedCCharBaseAI.DistributedCCharBaseAI.__init__(self, air, TTLocalizer.DonaldDock)
        self.fsm = ClassicFSM.ClassicFSM('DistributedDonaldDockAI', [
            State.State('Off', self.enterOff, self.exitOff, [
                'Lonely',
                'TransitionToCostume']),
            State.State('Lonely', self.enterLonely, self.exitLonely, [
                'Chatty',
                'TransitionToCostume']),
            State.State('Chatty', self.enterChatty, self.exitChatty, [
                'Lonely',
                'TransitionToCostume']),
            State.State('TransitionToCostume', self.enterTransitionToCostume, self.exitTransitionToCostume, [
                'Off'])], 'Off', 'Off')
        self.fsm.enterInitialState()
        self.handleHolidays()

    def delete(self):
        self.fsm.requestFinalState()
        DistributedCCharBaseAI.DistributedCCharBaseAI.delete(self)
        self.lonelyDoneEvent = None
        self.lonely = None
        self.chattyDoneEvent = None
        self.chatty = None

    def generate(self):
        DistributedCCharBaseAI.DistributedCCharBaseAI.generate(self)
        self.lonelyDoneEvent = self.taskName('DonaldDock-lonely-done')
        self.lonely = CharStateDatasAI.CharLonelyStateAI(self.lonelyDoneEvent, self)
        self.chattyDoneEvent = self.taskName('DonaldDock-chatty-done')
        self.chatty = CharStateDatasAI.CharChattyStateAI(self.chattyDoneEvent, self)

    def start(self):
        self.fsm.request('Lonely')

    def _DistributedDonaldDockAI__decideNextState(self, doneStatus):
        if doneStatus['state'] == 'lonely' and doneStatus['status'] == 'done':
            if len(self.nearbyAvatars) > 0:
                self.fsm.request('Chatty')
            else:
                self.fsm.request('Lonely')
        elif doneStatus['state'] == 'chatty' and doneStatus['status'] == 'done':
            self.fsm.request('Lonely')

    def enterOff(self):
        pass

    def exitOff(self):
        DistributedCCharBaseAI.DistributedCCharBaseAI.exitOff(self)

    def enterLonely(self):
        self.notify.debug('Entering Lonely')
        self.lonely.enter()
        self.acceptOnce(self.lonelyDoneEvent, self._DistributedDonaldDockAI__decideNextState)

    def exitLonely(self):
        self.notify.debug('Exiting Lonely')
        self.ignore(self.lonelyDoneEvent)
        self.lonely.exit()

    def enterChatty(self):
        self.notify.debug('Entering Chatty')
        self.chatty.enter()
        self.acceptOnce(self.chattyDoneEvent, self._DistributedDonaldDockAI__decideNextState)

    def exitChatty(self):
        self.notify.debug('Exiting Chatty')
        self.ignore(self.chattyDoneEvent)
        self.chatty.exit()

    def avatarEnterNextState(self):
        if len(self.nearbyAvatars) == 1:
            self.fsm.request('Chatty')
        else:
            self.notify.debug('avatarEnterNextState: num avatars: ' + str(len(self.nearbyAvatars)))

    def avatarExitNextState(self):
        if len(self.nearbyAvatars) == 0:
            self.fsm.request('Lonely')

    def enterTransitionToCostume(self):
        pass

    def exitTransitionToCostume(self):
        pass


text:
/**
 * @author Jadic
 * @created 2012-4-24
 */
package com.jadic.ftp;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.util.regex.Matcher;

import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPFileFilter;
import org.apache.commons.net.ftp.FTPReply;

import com.jadic.utils.KKLog;
import com.jadic.utils.KKTool;

public class FTPClientTool {

	//private boolean isAnonymous;
	private String host;
	private int port;
	private String userName;
	private String userPass;
	private boolean isConnected;
	private boolean isLogined;
	private String encoding;

	private int downloadBufSize = 8 * 1024;//default, min 1 max 1024 * 1024;
	private int uploadBufSize = 10 * 1024;//default, min 1 max 1024 * 1024;

	public static final String ISO = "iso-8859-1";

	final static int FTP_TIMEOUT = 10000;

	private FTPClient ftpClient;

	public FTPClientTool(String host, int port, String userName, String userPass) {
		//this.isAnonymous = isAnonymous;
		this.host = host;
		this.port = port;
		this.userName = userName;
		this.userPass = userPass;
		this.isConnected = false;
		this.isLogined = false;
		this.encoding = "UTF-8";

		ftpClient = new FTPClient();
		ftpClient.setConnectTimeout(FTP_TIMEOUT);
		ftpClient.setDataTimeout(FTP_TIMEOUT);
		ftpClient.setDefaultTimeout(FTP_TIMEOUT);
		ftpClient.setControlEncoding(this.encoding);

//		this.ftpClient.addProtocolCommandListener(new PrintCommandListener(
//				new PrintWriter(System.out)));
	}

	/**
	 * connect to ftpserver
	 * @return
	 */
	public boolean connect() {
		try {
			ftpClient.connect(this.host, this.port);
			this.isConnected = FTPReply.isPositiveCompletion(ftpClient
					.getReplyCode());
			ftpClient.setSoTimeout(FTP_TIMEOUT);
		} catch (SocketException e) {
			this.isConnected = false;
		} catch (IOException e) {
			this.isConnected = false;
		}
		return this.isConnected;
	}

	/**
	 * disconnect from ftpserver
	 */
	public void disConnect() {
		try {
			if (this.ftpClient.isConnected())
				this.ftpClient.disconnect();
		} catch (IOException e) {
		}
		this.isConnected = false;
	}

	/**
	 * login to ftpserver
	 * @return
	 */
	public boolean login() {
		if (!this.isConnected)
			return false;

		try {
			if (this.userName.equals("") && this.userPass.equals(""))
				return false;
			isLogined = ftpClient.login(this.userName, this.userPass);
			return isLogined;
		} catch (IOException e) {
		}
		return false;
	}

	/**
	 * logout from ftpserver
	 * @return
	 */
	public boolean logout() {
		if (!this.isConnected || !this.ftpClient.isConnected())
			return false;
		try {
			this.isLogined = !this.ftpClient.logout();
			return this.isLogined;
		} catch (IOException e) {
		}
		return false;
	}

	/**
	 * download file from ftpserver
	 *

	 * 1.check remote file if exists
	 *

	 * 2.if Support download from Breakpoint, check the file if downloaded or
	 * downloaded partially, if downloaded partially, download from the
	 * breakpoint
	 *

	 * 3.if not support download from breakpoint, download the file
	 *

	 *
	 * @param remoteFile
	 *            absolute file path at ftpserver
	 * @param localFile
	 *            absolute file path at local disk
	 * @param isSupportBreakpoint
	 *            true to support download file from breakpoint, false to
	 *            override the file if existed
	 * @return ftpdownloadstatus
	 */
	public FtpDownloadStatus download(String remoteFileName,
			String localFileName, boolean isSupportBreakpoint) {
		FtpDownloadStatus downloadStat = FtpDownloadStatus.DOWNLOAD_UNKNOWN;
		try {
			FTPFile remoteFtpFile = getRemoteFile(remoteFileName);
			if (remoteFtpFile != null) {
				long remoteFileSize = remoteFtpFile.getSize();
				File localFile = new File(localFileName);
				if (localFile.exists() && isSupportBreakpoint) {
					long localFileSize = localFile.length();
					if (localFileSize >= remoteFileSize) {
						downloadStat = FtpDownloadStatus.DOWNLOAD_FILE_DOWNLOADED;
					} else {
						downloadStat = downloadFile(remoteFtpFile, remoteFileName,
								localFile, localFileSize);
					}
				} else {
					downloadStat = downloadFile(remoteFtpFile, remoteFileName,
							localFile, 0);
				}
			} else {
				downloadStat = FtpDownloadStatus.DOWNLOAD_REMOTE_FILE_NOT_EXIST;
			}
		} catch (Exception e) {
		}

		return downloadStat;
	}

	/**
	 * write remote file content to local file
	 * @param remoteFtpFile
	 * @param remoteFileName
	 * @param localFile
	 * @param offset
	 * @return
	 */
	private FtpDownloadStatus downloadFile(FTPFile remoteFtpFile,
			String remoteFileName, File localFile, long offset) {
		FtpDownloadStatus downloadStat = FtpDownloadStatus.DOWNLOAD_UNKNOWN;

		if (remoteFileName != null && localFile != null) {
			OutputStream outputStream = null;
			InputStream inputStream = null;
			try {
				if (offset == 0) {
					outputStream = new FileOutputStream(localFile, false);
				} else {
					outputStream = new FileOutputStream(localFile, true);
				}
				this.ftpClient.enterLocalPassiveMode();
				this.ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
				this.ftpClient.setRestartOffset(offset);

				inputStream = this.ftpClient.retrieveFileStream(remoteFileName);
				if (inputStream != null) {
					byte[] buf = new byte[this.downloadBufSize];// 8k per read
					int c = 0;
					while ((c = inputStream.read(buf)) != -1) {
						outputStream.write(buf, 0, c);
					}
					outputStream.flush();
					downloadStat = ftpClient.completePendingCommand() ? (offset == 0 ? FtpDownloadStatus.DOWNLOAD_SUCC_NEW : FtpDownloadStatus.DOWNLOAD_SUCC_BREAK)
																	  : (offset == 0 ? FtpDownloadStatus.DOWNLOAD_FAIL_NEW : FtpDownloadStatus.DOWNLOAD_FAIL_BREAK);
				} else {
					downloadStat = FtpDownloadStatus.DOWNLOAD_FAIL_NO_AUTH;
				}
			} catch (FileNotFoundException e) {
				downloadStat = (offset == 0 ? FtpDownloadStatus.DOWNLOAD_FAIL_NEW : FtpDownloadStatus.DOWNLOAD_FAIL_BREAK);
				KKLog.error("Ftp download File FileNotFoundException:" + KKTool.getExceptionTip(e));
			} catch (SocketTimeoutException e) {
				downloadStat = (offset == 0 ? FtpDownloadStatus.DOWNLOAD_FAIL_TIMEOUT_NEW : FtpDownloadStatus.DOWNLOAD_FAIL_TIMEOUT_BREAK);
				KKLog.error("Ftp download File SocketTimeoutException:" + KKTool.getExceptionTip(e));
			} catch (IOException e) {
				downloadStat = (offset == 0 ? FtpDownloadStatus.DOWNLOAD_FAIL_IOEXCEPTION_NEW : FtpDownloadStatus.DOWNLOAD_FAIL_IOEXCEPTION_BREAK);
				KKLog.error("Ftp download File IOException:" + KKTool.getExceptionTip(e));
			} catch (Exception e) {
				downloadStat = (offset == 0 ? FtpDownloadStatus.DOWNLOAD_FAIL_NEW : FtpDownloadStatus.DOWNLOAD_FAIL_BREAK);
				KKLog.error("Ftp download File Exception:" + KKTool.getExceptionTip(e));
			} finally {
				if (outputStream != null) {
					try {
						outputStream.close();
						outputStream = null;
					} catch (IOException e) {
						downloadStat = FtpDownloadStatus.DOWNLOAD_CLOSEREMOTESTREAM_ERROR;
					}
				}

				if (inputStream != null) {
					try {
						inputStream.close();
					} catch (IOException e) {
						downloadStat = FtpDownloadStatus.DOWNLOAD_CLOSELOCALSTREAM_ERROR;
					}
				}
			}
		}

		return downloadStat;
	}

	/**
	 * get FTPFile by file name
	 *
	 * @param remoteFile
	 * @return FTPFile
	 */
	private FTPFile getRemoteFile(String remoteFile) {
		FTPFile ftpFile = null;
		try {
			this.ftpClient.enterLocalPassiveMode();
			FTPFile[] ftpFiles = this.ftpClient.listFiles(remoteFile);
			if (ftpFiles.length == 1)//
				ftpFile = ftpFiles[0];
		} catch (IOException e) {
			ftpFile = null;
		}
		return ftpFile;
	}

	/**
	 * list all files in the specified remote directory
	 * @param remotePath
	 * @return
	 */
	public FTPFile[] listFtpFiles(String remotePath) {
		FTPFile[] ftpFiles = null;
		if (this.isConnected()) {
			ftpClient.enterLocalPassiveMode();
			try {
				ftpFiles = ftpClient.listFiles(remotePath);
			} catch (IOException e) {
			}
		}
		return ftpFiles;
	}

	/**
	 * list all files in the specified remote directory with FtpFileFilter
	 * @param remotePath
	 * @param fileFilter
	 * @return
	 */
	public FTPFile[] listFtpFiles(String remotePath, FTPFileFilter fileFilter) {
		FTPFile[] ftpFiles = null;
		if (this.isConnected()) {
			ftpClient.enterLocalPassiveMode();
			try {
				ftpFiles = ftpClient.listFiles(remotePath, fileFilter);
			} catch (IOException e) {
			}
		}
		return ftpFiles;
	}

	/**
	 * upload local file to ftpserver 1.check local file exist
	 *

	 * 2.check remote dir exist, if not exist, create dir
	 *

	 * 3.check remote file if need upload from breakpoint
	 *

	 *
	 * @param remoteFile
	 *            absolute file path at ftpserver. seperator:'/'
	 * @param localFile
	 *            absolute file path at local disk
	 * @param isSupportBreakpoint
	 *            true to support upload file from breakpoint
	 * @return FtpUploadStatus
	 */
	public FtpUploadStatus upload(String remoteFileName, String localFileName,
			boolean isSupportBreakpoint) {
		FtpUploadStatus uploadStat = FtpUploadStatus.UPLOAD_UNKNOWN;
		File localFile = new File(localFileName);
		if (localFile.exists()) {
			FTPFile remoteFtpFile = getRemoteFile(remoteFileName);
			if (remoteFtpFile == null) {// remote file not exist, create dir if need at ftpserver
				if(!createRemoteDir(remoteFileName)) {
					uploadStat = FtpUploadStatus.UPLOAD_REMOTE_DIR_CREATE_FAIL;
					return uploadStat;
				}
			}
			if (isSupportBreakpoint && remoteFtpFile != null) {
				long offset = 0;
				long localFileSize = localFile.length();
				long remoteFileSize = remoteFtpFile.getSize();

				if (remoteFileSize < localFileSize) {
					offset = remoteFileSize;
					uploadStat = uploadFile(remoteFtpFile, remoteFileName, localFile, offset);
				} else {// uploaded
					uploadStat = FtpUploadStatus.UPLOAD_FILE_UPLOADED;
				}
			} else {
				uploadStat = uploadFile(remoteFtpFile, remoteFileName, localFile, 0);
			}
		} else {
			uploadStat = FtpUploadStatus.UPLOAD_LOCAL_FILE_NOT_EXIST;
		}
		return uploadStat;
	}

	/**
	 *
	 * @param remoteFileName
	 * @return
	 */
	private boolean createRemoteDir(String remoteFileName) {
		try {
			remoteFileName = remoteFileName.replaceAll(Matcher.quoteReplacement("\\"), "/");
			this.ftpClient.changeWorkingDirectory("/");
			int fsIndex = remoteFileName.lastIndexOf("/");
			if (fsIndex > 0) {
				String[] dirs = remoteFileName.split("/");
				StringBuilder parentDir = new StringBuilder("");
				for(int i = 0; i < dirs.length - 1; i ++) {
					if (dirs[i].equals(""))
						continue;
					this.ftpClient.makeDirectory(dirs[i]);
					parentDir.append("/" + dirs[i]);
					this.ftpClient.changeWorkingDirectory(parentDir.toString());
				}
			} else {
				return true;
			}
		} catch (IOException e) {
			return false;
		}
		return true;
	}

	/**
	 * write local file content to remote file at ftpserver
	 * @param remoteFtpFile
	 * @param remoteFileName
	 * @param localFile
	 * @param offset
	 * @return
	 */
	private FtpUploadStatus uploadFile(FTPFile remoteFtpFile,
			String remoteFileName, File localFile, long offset) {
		FtpUploadStatus uploadStatus = FtpUploadStatus.UPLOAD_UNKNOWN;
		RandomAccessFile raf = null;
		OutputStream outputStream = null;
		try {
			this.ftpClient.enterLocalPassiveMode();
			this.ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
			raf = new RandomAccessFile(localFile, "r");
			remoteFileName = remoteFileName.replaceAll(Matcher.quoteReplacement("\\"), "/");
			int i = remoteFileName.lastIndexOf("/");
			if (i > 0) {
				this.ftpClient.changeWorkingDirectory(remoteFileName.substring(0, i));//make sure
				remoteFileName = remoteFileName.substring(i + 1);
			}
			outputStream = this.ftpClient.appendFileStream(remoteFileName);
			if (offset > 0) {
				this.ftpClient.setRestartOffset(offset);
				raf.seek(offset);
			}
			byte[] buf = new byte[this.uploadBufSize];
			int c = 0;
			while ((c = raf.read(buf)) != -1) {
				outputStream.write(buf, 0, c);
			}
			outputStream.flush();
			outputStream.close();
			raf.close();
			uploadStatus = ftpClient.completePendingCommand() ? (offset == 0 ? FtpUploadStatus.UPLOAD_SUCC_NEW : FtpUploadStatus.UPLOAD_SUCC_BREAK)
																: (offset == 0 ? FtpUploadStatus.UPLOAD_FAIL_NEW : FtpUploadStatus.UPLOAD_FAIL_BREAK);
		} catch (FileNotFoundException e) {
			uploadStatus = (offset == 0 ? FtpUploadStatus.UPLOAD_FAIL_NEW : FtpUploadStatus.UPLOAD_FAIL_BREAK);
		} catch(SocketTimeoutException e) {
			uploadStatus = (offset == 0 ? FtpUploadStatus.UPLOAD_FAIL_TIMEOUT_NEW : FtpUploadStatus.UPLOAD_FAIL_TIMEOUT_BREAK);
		} catch (IOException e) {
			uploadStatus = (offset == 0 ? FtpUploadStatus.UPLOAD_FAIL_IOEXCEPTION_NEW : FtpUploadStatus.UPLOAD_FAIL_IOEXCEPTION_BREAK);
		} catch (Exception e) {
			uploadStatus = (offset == 0 ? FtpUploadStatus.UPLOAD_FAIL_NEW : FtpUploadStatus.UPLOAD_FAIL_BREAK);
		} finally {
			if (outputStream != null) {
				try {
					outputStream.close();
					outputStream = null;
				} catch (IOException e) {
					uploadStatus = FtpUploadStatus.UPLOAD_CLOSEREMOTESTREAM_ERROR;
				}
			}

			if (raf != null) {
				try {
					raf.close();
					raf = null;
				} catch (IOException e) {
					uploadStatus = FtpUploadStatus.UPLOAD_CLOSELOCALSTREAM_ERROR;
				}
			}
		}
		return uploadStatus;
	}

	public String getHost() {
		return host;
	}

	public int getPort() {
		return port;
	}

	public String getUserName() {
		return userName;
	}

	public String getUserPass() {
		return userPass;
	}

	public boolean isConnected() {
		return isConnected && ftpClient.isConnected() && this.isLogined;
	}

	public String getEncoding() {
		return encoding;
	}

	public void setEncoding(String encoding) {
		if (encoding != null && !encoding.equals(this.encoding)) {
			this.encoding = encoding;
			this.ftpClient.setControlEncoding(this.encoding);
		}
	}

	public int getDownloadBufSize() {
		return downloadBufSize;
	}

	public void setDownloadBufSize(int downloadBufSize) {
		this.downloadBufSize = downloadBufSize > 0 && downloadBufSize <= 1024 * 1024 ? downloadBufSize : this.downloadBufSize;;
	}

	public int getUploadBufSize() {
		return uploadBufSize;
	}

	public void setUploadBufSize(int uploadBufSize) {
		this.uploadBufSize = uploadBufSize > 0 && uploadBufSize <= 1024 * 1024 ? uploadBufSize : this.uploadBufSize;
	}
}