text:
Basic Usage
===========

In order to send HTTP requests, you'll need to instantiate [[\yii\httpclient\Client]] and use its
`createRequest()` method to create new HTTP request. Then you should configure all request parameters
according to your goal and send request. As the result you'll get a [[\yii\httpclient\Response]] instance,
which holds all response information and data.
For example:

```php
use yii\httpclient\Client;

$client = new Client();
$response = $client->createRequest()
    ->setMethod('POST')
    ->setUrl('http://example.com/api/1.0/users')
    ->setData(['name' => 'John Doe', 'email' => 'johndoe@example.com'])
    ->send();
if ($response->isOk) {
    $newUserId = $response->data['id'];
}
```

You may use shortcut methods `get()`, `post()`, `put()` and so on to simplify new request preparation.
If you are using single [[\yii\httpclient\Client]] instance for multiple request to the same domain (for
example in case of using REST API), you may setup its `baseUrl` property with this domain. This will
allow you to specify only the relative URL while creating a new request.
Thus the several request to some REST API may look like following:

```php
use yii\httpclient\Client;

$client = new Client(['baseUrl' => 'http://example.com/api/1.0']);

$newUserResponse = $client->post('users', ['name' => 'John Doe', 'email' => 'johndoe@example.com'])->send();
$articleResponse = $client->get('articles', ['name' => 'Yii 2.0'])->send();
$client->post('subscriptions', ['user_id' => $newUserResponse->data['id'], 'article_id' => $articleResponse->data['id']])->send();
```

## Using different content formats

By default HTTP request data is send as 'form-urlencoded', e.g. `param1=value1&param2=value2`.
This is a common format for the web forms, but not for the REST API, which usually demands content
should be in JSON or XML format. You may setup format being used for request content using `format`
property or `setFormat()` method.
Following formats are supported:

 - [[\yii\httpclient\Client::FORMAT_JSON]] - JSON format
 - [[\yii\httpclient\Client::FORMAT_URLENCODED]] - urlencoded by RFC1738 query string
 - [[\yii\httpclient\Client::FORMAT_RAW_URLENCODED]] - urlencoded by PHP_QUERY_RFC3986 query string
 - [[\yii\httpclient\Client::FORMAT_XML]] - XML format

For example:

```php
use yii\httpclient\Client;

$client = new Client(['baseUrl' => 'http://example.com/api/1.0']);
$response = $client->createRequest()
    ->setFormat(Client::FORMAT_JSON)
    ->setUrl('articles/search')
    ->setData([
        'query_string' => 'Yii',
        'filter' => [
            'date' => ['>' => '2015-08-01']
        ],
    ])
    ->send();
```

The response object detects content format automatically based on 'Content-Type' header and content itself.
So in most cases you don't need to specify format for response, you can parse it simply using `getData()`
method or `data` property. Continuing the above example, we can get response data in the following way:

```php
$responseData = $response->getData(); // get all articles
count($response->data) // count articles
$article = $response->data[0] // get first article
```

## Working with raw content

No one is forcing you to rely on the built-in formats. You can specify raw content for your HTTP request
as well as you can process a raw content of the response. For example:

```php
use yii\httpclient\Client;

$client = new Client(['baseUrl' => 'http://example.com/api/1.0']);
$response = $client->createRequest()
    ->setUrl('articles/search')
    ->addHeaders(['content-type' => 'application/json'])
    ->setContent('{query_string: "Yii"}')
    ->send();

echo 'Search results:<br>';
echo $response->content;
```

[[\yii\httpclient\Request]] formats specified `data` only if `content` is not set.
[[\yii\httpclient\Response]] parses the `content` only if `data` is requested.

## Pre-configure request and response objects

If you are using single instance of [[\yii\httpclient\Client]] for several similar requests,
for example, while working with REST API, you may simplify and speed up your code declaring
your own configuration for request and response objects. This can be done via `requestConfig`
and `responseConfig` fields of [[\yii\httpclient\Client]].
For example: you may want to setup JSON format for all request, created by particular client:

```php
use yii\httpclient\Client;

$client = new Client([
    'baseUrl' => 'http://example.com/api/1.0',
    'requestConfig' => [
        'format' => Client::FORMAT_JSON
    ],
    'responseConfig' => [
        'format' => Client::FORMAT_JSON
    ],
]);

$request = $client->createRequest();
echo $request->format; // outputs: 'json'
```

> Tip: you may even specify your own classes for the request and response objects to facilitate
  some extra functionality you need, using 'class' key in configuration array.

## Working with headers

You may specify request headers using `setHeaders()` and `addHeaders()` methods.
You may use `getHeaders()` method or `headers` property to get already defined headers as
[[\yii\web\HeaderCollection]] instance. For example:

```php
use yii\httpclient\Client;

$client = new Client(['baseUrl' => 'http://example.com/api/1.0']);
$request = $client->createRequest()
    ->setHeaders(['content-type' => 'application/json'])
    ->addHeaders(['user-agent' => 'My User Agent']);

$request->getHeaders()->add('accept-language', 'en-US;en');
$request->headers->set('user-agent', 'User agent override');
```

Once you have a response object you can access all response headers using `getHeaders()` method
or `headers` property:

```php
$response = $request->send();
echo $response->getHeaders()->get('content-type');
echo $response->headers->get('content-encoding');
```

### HTTP Basic Authentication

The client has no built-in support for HTTP Authentication. If you want to use HTTP Basic Authentication you need to add
an appropriate header that follows the [format of HTTP Basic Authentication](https://tools.ietf.org/html/rfc2617#section-2).
You can authenticate by adding an `Authorization` header, that contains the word `Basic`, followed by a whitespace and
the base64 encoded string of `username:password`:

```php
$username = 'yii';
$password = 'verysecret';
$request->headers->set('Authorization', 'Basic ' . base64_encode("$username:$password"));
```

> Note: HTTP Basic Authentication sends username and password in plain text, so it should only be used
> over secure connections using HTTPS.

## Working with cookies

Although Cookies are transferred just as header values, [[\yii\httpclient\Request]] and [[\yii\httpclient\Request]]
provides separated interface to work with them using [[\yii\web\Cookie]] and [[\yii\web\CookieCollection]].

You may specify request Cookies using `setCookies()` or `addCookies()` methods.
You may use `getCookies()` method or `cookies` property to get already defined Cookies as
[[\yii\web\CookieCollection]] instance. For example:

```php
use yii\httpclient\Client;
use yii\web\Cookie;

$client = new Client(['baseUrl' => 'http://example.com/api/1.0']);
$request = $client->createRequest()
    ->setCookies([
        ['name' => 'country', 'value' => 'USA'],
        new Cookie(['name' => 'language', 'value' => 'en-US']),
    ])
    ->addCookies([
        ['name' => 'view_mode', 'value' => 'full']
    ]);

$request->cookies->add(['name' => 'display-notification', 'value' => '0']);
```

Once you have a response object you can access all response Cookies using `getCookies()` method
or `cookies` property:

```php
$response = $request->send();
echo $response->getCookies()->get('country');
echo $response->headers->get('PHPSESSID');
```

You may transfer Cookies from response object to request using simple copy.
For example: assume we need to edit user profile at some web application, which is available only
after login, so we need to log in first and use created session for further activity:

```php
use yii\httpclient\Client;

$client = new Client(['baseUrl' => 'http://example.com']);

$loginResponse = $client->post('login', [
    'username' => 'johndoe',
    'password' => 'somepassword',
])->send();

// $loginResponse->cookies->get('PHPSESSID') - holds the new session ID

$client->post('account/profile', ['birthDate' => '10/11/1982'])
    ->setCookies($loginResponse->cookies) // transfer response cookies to request
    ->send();
```

## Downloading files using `CurlTransport`

You can download a file without loading its entire content into memory (it is especially useful for big files).
Use `setOutputFile()` method to pass a stream resource (using `fopen()`, for example) to the request object. It will be
passed to the `CURLOPT_FILE` cURL option.

```php
use yii\httpclient\Client;

$fh = fopen('/path/to/local/file', 'w');
$client = new Client([
    'transport' => 'yii\httpclient\CurlTransport'
]);
$response = $client->createRequest()
    ->setMethod('GET')
    ->setUrl('http://example.com/path/to/remote/file')
    ->setOutputFile($fh)
    ->send();
```

## Uploading files using `CurlTransport` and `CurlFormatter`

You can upload a file without loading its entire content into memory (it is especially useful for big files)
using `CURLFile` (PHP 5 >= 5.5.0, PHP 7).

```php
use yii\httpclient\Client;

$client = new Client([
    'transport' => 'yii\httpclient\CurlTransport',
]);
$response = $client->createRequest()
    ->setFormat(Client::FORMAT_CURL)
    ->setMethod('POST')
    ->setUrl('http://example.com')
    ->setData([
        'name' => 'John Doe',
        'email' => 'johndoe@example.com',
        'file1' => new \CURLFile('/path/to/file1'), 'text/plain', 'file1'),
        'file2' => new \CURLFile('/path/to/file2'), 'text/plain', 'file2'),
    ])
    ->send();
```


text:
package org.apache.http.impl.io;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

import org.apache.http.ConnectionClosedException;
import org.apache.http.Consts;
import org.apache.http.impl.SessionInputBufferMock;
import org.apache.http.io.SessionInputBuffer;
import org.junit.Assert;
import org.junit.Test;

public class TestContentLengthInputStream {

    @Test
    public void testConstructors() throws Exception {
        final ContentLengthInputStream in = new ContentLengthInputStream(
                new SessionInputBufferMock(new byte[] {}), 0);
        in.close();
        try {
            new ContentLengthInputStream(null, 10);
            Assert.fail("IllegalArgumentException should have been thrown");
        } catch (final IllegalArgumentException ex) {
            // expected
        }
        try {
            new ContentLengthInputStream(new SessionInputBufferMock(new byte[] {}), -10);
            Assert.fail("IllegalArgumentException should have been thrown");
        } catch (final IllegalArgumentException ex) {
            // expected
        }
    }

    @Test
    public void testBasics() throws IOException {
        final String correct = "1234567890123456";
        final InputStream in = new ContentLengthInputStream(
                new SessionInputBufferMock(correct, Consts.ISO_8859_1), 10L);
        final ByteArrayOutputStream out = new ByteArrayOutputStream();

        final byte[] buffer = new byte[50];
        int len = in.read(buffer, 0, 2);
        out.write(buffer, 0, len);
        len = in.read(buffer);
        out.write(buffer, 0, len);

        final String result = new String(out.toByteArray(), Consts.ISO_8859_1);
        Assert.assertEquals(result, "1234567890");
        in.close();
    }

    @Test
    public void testSkip() throws IOException {
        InputStream in = new ContentLengthInputStream(new SessionInputBufferMock(new byte[20]), 10L);
        Assert.assertEquals(10, in.skip(10));
        Assert.assertTrue(in.read() == -1);

        in = new ContentLengthInputStream(new SessionInputBufferMock(new byte[20]), 10L);
        in.read();
        Assert.assertEquals(9, in.skip(10));
        Assert.assertTrue(in.read() == -1);
        in.close();

        in = new ContentLengthInputStream(new SessionInputBufferMock(new byte[20]), 2L);
        in.read();
        in.read();
        Assert.assertTrue(in.skip(10) <= 0);
        Assert.assertTrue(in.skip(-1) == 0);
        Assert.assertTrue(in.read() == -1);
        in.close();

        in = new ContentLengthInputStream(new SessionInputBufferMock(new byte[20]), 10L);
        Assert.assertEquals(5,in.skip(5));
        Assert.assertEquals(5, in.read(new byte[20]));
        in.close();
    }

    @Test
    public void testAvailable() throws IOException {
        final InputStream in = new ContentLengthInputStream(
                new SessionInputBufferMock(new byte[] {1, 2, 3}), 3L);
        Assert.assertEquals(0, in.available());
        in.read();
        Assert.assertEquals(2, in.available());
        in.close();
    }

    @Test
    public void testClose() throws IOException {
        final String correct = "1234567890123456-";
        final SessionInputBuffer inbuffer = new SessionInputBufferMock(correct, Consts.ISO_8859_1);
        final InputStream in = new ContentLengthInputStream(inbuffer, 16L);
        in.close();
        in.close();
        try {
            in.read();
            Assert.fail("IOException should have been thrown");
        } catch (final IOException ex) {
            // expected
        }
        final byte[] tmp = new byte[10];
        try {
            in.read(tmp);
            Assert.fail("IOException should have been thrown");
        } catch (final IOException ex) {
            // expected
        }
        try {
            in.read(tmp, 0, tmp.length);
            Assert.fail("IOException should have been thrown");
        } catch (final IOException ex) {
            // expected
        }
        Assert.assertEquals('-', inbuffer.read());
    }

    @Test
    public void testTruncatedContent() throws IOException {
        final String correct = "1234567890123456";
        final SessionInputBuffer inbuffer = new SessionInputBufferMock(correct, Consts.ISO_8859_1);
        final InputStream in = new ContentLengthInputStream(inbuffer, 32L);
        final byte[] tmp = new byte[32];
        final int byteRead = in.read(tmp);
        Assert.assertEquals(16, byteRead);
        try {
            in.read(tmp);
            Assert.fail("ConnectionClosedException should have been closed");
        } catch (final ConnectionClosedException ex) {
        }
        try {
            in.read();
            Assert.fail("ConnectionClosedException should have been closed");
        } catch (final ConnectionClosedException ex) {
        }
        try {
            in.close();
            Assert.fail("ConnectionClosedException should have been closed");
        } catch (final ConnectionClosedException ex) {
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
/**
 * This file is part of Picasa Photo Uploader.
 *
 * Picasa Photo Uploader is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Picasa Photo Uploader is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Picasa Photo Uploader. If not, see <http://www.gnu.org/licenses/>.
 */
package com.ettrema.android.photouploader;

/**
 * Holds image details, this class is used as queue item
 *
 * @author Jan Peter Hooiveld
 */
public class ImageItem {

    /**
     * Image id
     */
    public Integer imageId;
    /**
     * Location where image is stored
     */
    public String imagePath;
    /**
     * Filename of the image
     */
    public String imageName;
    /**
     * Image mime-type
     */
    public String imageType;
    /**
     * Image size
     */
    public int imageSize;
}


text:
<?php

/**
 * [BEGIN_COT_EXT]
 * Hooks=folio.list.query
 * Order=99
 * [END_COT_EXT]
 */
/**
 * Location Selector for Cotonti
 *
 * @package locationselector
 * @version 2.0.0
 * @author CMSWorks Team
 * @copyright Copyright (c) CMSWorks.ru, littledev.ru
 * @license BSD
 */
defined('COT_CODE') or die('Wrong URL.');

$location = cot_import_location('slocation', 'G');

$location_info = cot_getlocation($location['country'], $location['region'], $location['city']);
$out['subtitle'] .= (!empty($location_info['country'])) ? ' - ' . $location_info['country'] : '';
$out['subtitle'] .= (!empty($location_info['region'])) ? ' - ' . $location_info['region'] : '';
$out['subtitle'] .= (!empty($location_info['city'])) ? ' - ' . $location_info['city'] : '';

if(!empty($location['country'])) $where['location'] = "item_country='" . $db->prep($location['country'])."'";
if((int)$location['region'] > 0) $where['location'] =  "item_region=" . (int)$location['region'];
if((int)$location['city'] > 0) $where['location'] = "item_city=" . (int)$location['city'];

$list_url_path['slocation[country]'] = $location['country'];
$list_url_path['slocation[region]'] = $location['region'];
$list_url_path['slocation[city]'] = $location['city'];


text:
<?php
/**
 * Created by PhpStorm.
 * User: karlvaniseghem
 * Date: 14/10/15
 * Time: 15:06
 */

namespace Bakgat\Notos\Exceptions;

class BadRequestException
{
    protected $status = '400';

    public function __construct() {
        $message = $this->build(func_get_args());

        parent::__construct($message);
    }
}


text:
.class public abstract Lcom/htc/service/IWfdService$Stub;
.super Landroid/os/Binder;
.source "IWfdService.java"

# interfaces
.implements Lcom/htc/service/IWfdService;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/htc/service/IWfdService;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x409
    name = "Stub"
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/htc/service/IWfdService$Stub$Proxy;
    }
.end annotation

# static fields
.field private static final DESCRIPTOR:Ljava/lang/String; = "com.htc.service.IWfdService"

.field static final TRANSACTION_attemptToConfigure:I = 0x7

.field static final TRANSACTION_attemptToReConfigure:I = 0x8

.field static final TRANSACTION_attemptToRequestDongleToAPM:I = 0x9

.field static final TRANSACTION_cancel:I = 0xa

.field static final TRANSACTION_finishService:I = 0xc

.field static final TRANSACTION_getCurrentState:I = 0x3

.field static final TRANSACTION_registerCallback:I = 0x1

.field static final TRANSACTION_setMode:I = 0x4

.field static final TRANSACTION_setWhdmiForeground:I = 0xe

.field static final TRANSACTION_startScanDongles:I = 0x5

.field static final TRANSACTION_stopScanDongles:I = 0x6

.field static final TRANSACTION_switchOnOffMirrorMode:I = 0xd

.field static final TRANSACTION_unregisterCallback:I = 0x2

.field static final TRANSACTION_wpsTimeout:I = 0xb

# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 14
    invoke-direct {p0}, Landroid/os/Binder;-><init>()V

    .line 15
    const-string v0, "com.htc.service.IWfdService"

    invoke-virtual {p0, p0, v0}, Lcom/htc/service/IWfdService$Stub;->attachInterface(Landroid/os/IInterface;Ljava/lang/String;)V

    .line 16
    return-void
.end method

.method public static asInterface(Landroid/os/IBinder;)Lcom/htc/service/IWfdService;
    .locals 2
    .param p0, "obj"    # Landroid/os/IBinder;

    .prologue
    .line 23
    if-nez p0, :cond_0

    .line 24
    const/4 v0, 0x0

    .line 30
    :goto_0
    return-object v0

    .line 26
    :cond_0
    const-string v1, "com.htc.service.IWfdService"

    invoke-interface {p0, v1}, Landroid/os/IBinder;->queryLocalInterface(Ljava/lang/String;)Landroid/os/IInterface;

    move-result-object v0

    .line 27
    .local v0, "iin":Landroid/os/IInterface;
    if-eqz v0, :cond_1

    instance-of v1, v0, Lcom/htc/service/IWfdService;

    if-eqz v1, :cond_1

    .line 28
    check-cast v0, Lcom/htc/service/IWfdService;

    goto :goto_0

    .line 30
    :cond_1
    new-instance v0, Lcom/htc/service/IWfdService$Stub$Proxy;

    .end local v0    # "iin":Landroid/os/IInterface;
    invoke-direct {v0, p0}, Lcom/htc/service/IWfdService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V

    goto :goto_0
.end method

# virtual methods
.method public asBinder()Landroid/os/IBinder;
    .locals 0

    .prologue
    .line 34
    return-object p0
.end method

.method public onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
    .locals 4
    .param p1, "code"    # I
    .param p2, "data"    # Landroid/os/Parcel;
    .param p3, "reply"    # Landroid/os/Parcel;
    .param p4, "flags"    # I
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    const/4 v0, 0x0

    const/4 v2, 0x1

    .line 38
    sparse-switch p1, :sswitch_data_0

    .line 178
    invoke-super {p0, p1, p2, p3, p4}, Landroid/os/Binder;->onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    move-result v2

    :goto_0
    return v2

    .line 42
    :sswitch_0
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p3, v3}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    goto :goto_0

    .line 47
    :sswitch_1
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 49
    invoke-virtual {p2}, Landroid/os/Parcel;->readStrongBinder()Landroid/os/IBinder;

    move-result-object v3

    invoke-static {v3}, Lcom/htc/service/IWfdServiceCallback$Stub;->asInterface(Landroid/os/IBinder;)Lcom/htc/service/IWfdServiceCallback;

    move-result-object v0

    .line 50
    .local v0, "_arg0":Lcom/htc/service/IWfdServiceCallback;
    invoke-virtual {p0, v0}, Lcom/htc/service/IWfdService$Stub;->registerCallback(Lcom/htc/service/IWfdServiceCallback;)V

    .line 51
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto :goto_0

    .line 56
    .end local v0    # "_arg0":Lcom/htc/service/IWfdServiceCallback;
    :sswitch_2
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 58
    invoke-virtual {p2}, Landroid/os/Parcel;->readStrongBinder()Landroid/os/IBinder;

    move-result-object v3

    invoke-static {v3}, Lcom/htc/service/IWfdServiceCallback$Stub;->asInterface(Landroid/os/IBinder;)Lcom/htc/service/IWfdServiceCallback;

    move-result-object v0

    .line 59
    .restart local v0    # "_arg0":Lcom/htc/service/IWfdServiceCallback;
    invoke-virtual {p0, v0}, Lcom/htc/service/IWfdService$Stub;->unregisterCallback(Lcom/htc/service/IWfdServiceCallback;)V

    .line 60
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto :goto_0

    .line 65
    .end local v0    # "_arg0":Lcom/htc/service/IWfdServiceCallback;
    :sswitch_3
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 66
    invoke-virtual {p0}, Lcom/htc/service/IWfdService$Stub;->getCurrentState()I

    move-result v1

    .line 67
    .local v1, "_result":I
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 68
    invoke-virtual {p3, v1}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_0

    .line 73
    .end local v1    # "_result":I
    :sswitch_4
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 75
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v0

    .line 76
    .local v0, "_arg0":I
    invoke-virtual {p0, v0}, Lcom/htc/service/IWfdService$Stub;->setMode(I)V

    .line 77
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto :goto_0

    .line 82
    .end local v0    # "_arg0":I
    :sswitch_5
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 84
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    if-eqz v3, :cond_0

    move v0, v2

    .line 85
    .local v0, "_arg0":Z
    :cond_0
    invoke-virtual {p0, v0}, Lcom/htc/service/IWfdService$Stub;->startScanDongles(Z)V

    .line 86
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto :goto_0

    .line 91
    .end local v0    # "_arg0":Z
    :sswitch_6
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 92
    invoke-virtual {p0}, Lcom/htc/service/IWfdService$Stub;->stopScanDongles()V

    .line 93
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto :goto_0

    .line 98
    :sswitch_7
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 100
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    if-eqz v3, :cond_1

    .line 101
    sget-object v3, Lcom/htc/service/DongleInfo;->CREATOR:Landroid/os/Parcelable$Creator;

    invoke-interface {v3, p2}, Landroid/os/Parcelable$Creator;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/htc/service/DongleInfo;

    .line 106
    .local v0, "_arg0":Lcom/htc/service/DongleInfo;
    :goto_1
    invoke-virtual {p0, v0}, Lcom/htc/service/IWfdService$Stub;->attemptToConfigure(Lcom/htc/service/DongleInfo;)V

    .line 107
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto/16 :goto_0

    .line 104
    .end local v0    # "_arg0":Lcom/htc/service/DongleInfo;
    :cond_1
    const/4 v0, 0x0

    .restart local v0    # "_arg0":Lcom/htc/service/DongleInfo;
    goto :goto_1

    .line 112
    .end local v0    # "_arg0":Lcom/htc/service/DongleInfo;
    :sswitch_8
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 114
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    if-eqz v3, :cond_2

    .line 115
    sget-object v3, Lcom/htc/service/DongleInfo;->CREATOR:Landroid/os/Parcelable$Creator;

    invoke-interface {v3, p2}, Landroid/os/Parcelable$Creator;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/htc/service/DongleInfo;

    .line 120
    .restart local v0    # "_arg0":Lcom/htc/service/DongleInfo;
    :goto_2
    invoke-virtual {p0, v0}, Lcom/htc/service/IWfdService$Stub;->attemptToReConfigure(Lcom/htc/service/DongleInfo;)V

    .line 121
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto/16 :goto_0

    .line 118
    .end local v0    # "_arg0":Lcom/htc/service/DongleInfo;
    :cond_2
    const/4 v0, 0x0

    .restart local v0    # "_arg0":Lcom/htc/service/DongleInfo;
    goto :goto_2

    .line 126
    .end local v0    # "_arg0":Lcom/htc/service/DongleInfo;
    :sswitch_9
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 128
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    if-eqz v3, :cond_3

    .line 129
    sget-object v3, Lcom/htc/service/DongleInfo;->CREATOR:Landroid/os/Parcelable$Creator;

    invoke-interface {v3, p2}, Landroid/os/Parcelable$Creator;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/htc/service/DongleInfo;

    .line 134
    .restart local v0    # "_arg0":Lcom/htc/service/DongleInfo;
    :goto_3
    invoke-virtual {p0, v0}, Lcom/htc/service/IWfdService$Stub;->attemptToRequestDongleToAPM(Lcom/htc/service/DongleInfo;)V

    .line 135
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto/16 :goto_0

    .line 132
    .end local v0    # "_arg0":Lcom/htc/service/DongleInfo;
    :cond_3
    const/4 v0, 0x0

    .restart local v0    # "_arg0":Lcom/htc/service/DongleInfo;
    goto :goto_3

    .line 140
    .end local v0    # "_arg0":Lcom/htc/service/DongleInfo;
    :sswitch_a
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 141
    invoke-virtual {p0}, Lcom/htc/service/IWfdService$Stub;->cancel()V

    .line 142
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto/16 :goto_0

    .line 147
    :sswitch_b
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 148
    invoke-virtual {p0}, Lcom/htc/service/IWfdService$Stub;->wpsTimeout()V

    .line 149
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto/16 :goto_0

    .line 154
    :sswitch_c
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 155
    invoke-virtual {p0}, Lcom/htc/service/IWfdService$Stub;->finishService()V

    .line 156
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto/16 :goto_0

    .line 161
    :sswitch_d
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 163
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    if-eqz v3, :cond_4

    move v0, v2

    .line 164
    .local v0, "_arg0":Z
    :cond_4
    invoke-virtual {p0, v0}, Lcom/htc/service/IWfdService$Stub;->switchOnOffMirrorMode(Z)V

    .line 165
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto/16 :goto_0

    .line 170
    .end local v0    # "_arg0":Z
    :sswitch_e
    const-string v3, "com.htc.service.IWfdService"

    invoke-virtual {p2, v3}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 172
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    if-eqz v3, :cond_5

    move v0, v2

    .line 173
    .restart local v0    # "_arg0":Z
    :cond_5
    invoke-virtual {p0, v0}, Lcom/htc/service/IWfdService$Stub;->setWhdmiForeground(Z)V

    .line 174
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto/16 :goto_0

    .line 38
    nop

    :sswitch_data_0
    .sparse-switch
        0x1 -> :sswitch_1
        0x2 -> :sswitch_2
        0x3 -> :sswitch_3
        0x4 -> :sswitch_4
        0x5 -> :sswitch_5
        0x6 -> :sswitch_6
        0x7 -> :sswitch_7
        0x8 -> :sswitch_8
        0x9 -> :sswitch_9
        0xa -> :sswitch_a
        0xb -> :sswitch_b
        0xc -> :sswitch_c
        0xd -> :sswitch_d
        0xe -> :sswitch_e
        0x5f4e5446 -> :sswitch_0
    .end sparse-switch
.end method


text:
<?php

namespace Steelbot\Tests\TelegramBotApi\Method;

class GetUserProfilePhotos extends \PHPUnit_Framework_TestCase
{
    public function testGetParams()
    {
        $this->markTestIncomplete();
    }
}


text:
namespace OpenXMLSDK.Engine.Word.ReportEngine.Models.ExtendedModels
{
    public enum UnderlineValues
    {
        //
        // Summary:
        //     Single Underline.
        //     When the item is serialized out as xml, its value is "single".
        Single = 0,
        //
        // Summary:
        //     Underline Non-Space Characters Only.
        //     When the item is serialized out as xml, its value is "words".
        Words = 1,
        //
        // Summary:
        //     Double Underline.
        //     When the item is serialized out as xml, its value is "double".
        Double = 2,
        //
        // Summary:
        //     Thick Underline.
        //     When the item is serialized out as xml, its value is "thick".
        Thick = 3,
        //
        // Summary:
        //     Dotted Underline.
        //     When the item is serialized out as xml, its value is "dotted".
        Dotted = 4,
        //
        // Summary:
        //     Thick Dotted Underline.
        //     When the item is serialized out as xml, its value is "dottedHeavy".
        DottedHeavy = 5,
        //
        // Summary:
        //     Dashed Underline.
        //     When the item is serialized out as xml, its value is "dash".
        Dash = 6,
        //
        // Summary:
        //     Thick Dashed Underline.
        //     When the item is serialized out as xml, its value is "dashedHeavy".
        DashedHeavy = 7,
        //
        // Summary:
        //     Long Dashed Underline.
        //     When the item is serialized out as xml, its value is "dashLong".
        DashLong = 8,
        //
        // Summary:
        //     Thick Long Dashed Underline.
        //     When the item is serialized out as xml, its value is "dashLongHeavy".
        DashLongHeavy = 9,
        //
        // Summary:
        //     Dash-Dot Underline.
        //     When the item is serialized out as xml, its value is "dotDash".
        DotDash = 10,
        //
        // Summary:
        //     Thick Dash-Dot Underline.
        //     When the item is serialized out as xml, its value is "dashDotHeavy".
        DashDotHeavy = 11,
        //
        // Summary:
        //     Dash-Dot-Dot Underline.
        //     When the item is serialized out as xml, its value is "dotDotDash".
        DotDotDash = 12,
        //
        // Summary:
        //     Thick Dash-Dot-Dot Underline.
        //     When the item is serialized out as xml, its value is "dashDotDotHeavy".
        DashDotDotHeavy = 13,
        //
        // Summary:
        //     Wave Underline.
        //     When the item is serialized out as xml, its value is "wave".
        Wave = 14,
        //
        // Summary:
        //     Heavy Wave Underline.
        //     When the item is serialized out as xml, its value is "wavyHeavy".
        WavyHeavy = 15,
        //
        // Summary:
        //     Double Wave Underline.
        //     When the item is serialized out as xml, its value is "wavyDouble".
        WavyDouble = 16,
        //
        // Summary:
        //     No Underline.
        //     When the item is serialized out as xml, its value is "none".
        None = 17
    }
}


text:
void Log(char * message) {
	__android_log_print(ANDROID_LOG_ERROR, "OpenHttp", (const char *) message);
}

char bigMessage[300] = "";
void Log(char * message1, char * message2) {
	int message1Len = strlen(message1);
	int message2Len = strlen(message2);
	for (int i = 0; i < message1Len; i++) {
		*(bigMessage + i) = *(message1 + i);
	}
	for (int i = 0; i < message2Len; i++) {
		*(bigMessage + message1Len + i) = *(message2 + i);
	}
	*(bigMessage + message1Len + message2Len) = 0;
	__android_log_print(ANDROID_LOG_ERROR, "OpenHttp", (const char *) bigMessage);
}

void Log(char * message1, int number) {
	int message1Len = strlen(message1);
	for (int i = 0; i < message1Len; i++) {
		*(bigMessage + i) = *(message1 + i);
	}
	char message2[15] = "";
	parseNubmerToString(number, message2);
	for (int i = 0; i < 15; i++) {
		*(bigMessage + message1Len + i) = *(message2 + i);
	}
	*(bigMessage + message1Len + 15) = 0;
	__android_log_print(ANDROID_LOG_ERROR, "OpenHttp", (const char *) bigMessage);
}

void Log(int number) {
	char target[15] = "";
	parseNubmerToString(number, target);
	Log((char*) target);
}

void Log(long number) {
	char target[32] = "";
	parseNubmerToString(number, target);
	Log((char*) target);
}


text:
package com.davidbracewell.hermes.extraction.caduceus;

import com.davidbracewell.conversion.Cast;
import com.davidbracewell.conversion.Val;
import com.davidbracewell.guava.common.collect.ArrayListMultimap;
import com.davidbracewell.guava.common.collect.HashMultimap;
import com.davidbracewell.hermes.*;
import com.davidbracewell.hermes.extraction.regex.TokenMatcher;
import com.davidbracewell.hermes.extraction.regex.TokenRegex;
import com.davidbracewell.io.resource.Resource;
import com.davidbracewell.parsing.ParseException;
import com.davidbracewell.string.StringUtils;
import com.davidbracewell.tuple.Tuple2;
import lombok.NonNull;
import org.yaml.snakeyaml.Yaml;

import java.io.IOException;
import java.io.Reader;
import java.io.Serializable;
import java.util.*;

/**
 * The type Caduceus program.
 *
 * @author David B. Bracewell
 */
public final class CaduceusProgram implements Serializable {
   private static final long serialVersionUID = 1L;
   private final List<CaduceusRule> rules = new LinkedList<>();

   /**
    * Instantiates a new Caduceus program.
    */
   public CaduceusProgram() {

   }

   /**
    * Read Caduceus program.
    *
    * @param resource the resource
    * @return the lyre program
    * @throws IOException the io exception
    */
   public static CaduceusProgram read(@NonNull Resource resource) throws IOException {
      CaduceusProgram program = new CaduceusProgram();

      try (Reader reader = resource.reader()) {
         List<Object> rules = ensureList(new Yaml().load(reader), "Caduceus rules should be specified in a list");

         for (Object entry : rules) {
            Map<String, Object> ruleMap = ensureMap(entry, "Rule entry should be a map");
            String ruleName = Val.of(ruleMap.get("name")).asString();
            String pattern = Val.of(ruleMap.get("pattern")).asString();
            if (StringUtils.isNullOrBlank(pattern)) {
               throw new IOException("No pattern specified: " + entry);
            }
            if (StringUtils.isNullOrBlank(ruleName)) {
               throw new IOException("No rule name specified: " + entry);
            }

            List<CaduceusAnnotationProvider> annotationProviders = new LinkedList<>();
            if (ruleMap.containsKey("annotations")) {
               List<Object> annotationList = ensureList(ruleMap.get("annotations"),
                                                        "Annotations should be specified as a list.");
               for (Object o : annotationList) {
                  annotationProviders.add(CaduceusAnnotationProvider.fromMap(
                     ensureMap(o, "Annotation entries should be specified as a map."), resource.descriptor(),
                     ruleName));
               }
            }

            List<CaduceusRelationProvider> relationProviders = new LinkedList<>();
            if (ruleMap.containsKey("relations")) {
               List<Object> relations = ensureList(ruleMap.get("relations"),
                                                   "Relations should be specified as a list.");
               for (Object o : relations) {
                  relationProviders.add(
                     CaduceusRelationProvider.fromMap(ensureMap(o, "Relation entries should be specified as a map.")));
               }
            }

            try {
               program.rules.add(new CaduceusRule(resource.descriptor(),
                                                  ruleName,
                                                  TokenRegex.compile(pattern),
                                                  annotationProviders,
                                                  relationProviders));
            } catch (ParseException e) {
               throw new IOException("Invalid pattern for rule " + ruleName);
            }

         }

      }
      return program;
   }

   static List<Object> ensureList(Object o, String error) throws IOException {
      if (!(o instanceof List)) {
         throw new IOException("Invalid Caduceus Format: " + error);
      }
      return Cast.as(o);
   }

   static Map<String, Object> ensureMap(Object o, String error) throws IOException {
      if (!(o instanceof Map)) {
         throw new IOException("Invalid Caduceus Format: " + error);
      }
      return Cast.as(o);
   }

   private Annotation createOrGet(Document document, AnnotationType type, HString span, Map<AttributeType, Val> attributeValMap) {
      return document.substring(span.start(), span.end()).get(type).stream()
                     .filter(a -> a.getType().equals(type) && a.attributeEntrySet().equals(attributeValMap.entrySet()))
                     .findFirst()
                     .orElseGet(() -> document
                                         .annotationBuilder()
                                         .type(type)
                                         .bounds(span)
                                         .attributes(attributeValMap)
                                         .createAttached());
   }

   /**
    * Execute.
    *
    * @param document the document
    */
   public void execute(@NonNull Document document) {
      for (CaduceusRule rule : rules) {
         TokenMatcher matcher = rule.getRegex().matcher(document);
         while (matcher.find()) {
            ArrayListMultimap<String, Annotation> groups = ArrayListMultimap.create();
            ArrayListMultimap<CaduceusAnnotationProvider, Annotation> providers = ArrayListMultimap.create();

            //Process all the annotation providers
            rule.getAnnotationProviders().forEach(ap -> {
               if (ap.getGroup().equals("*")) {
                  Annotation annotation = createOrGet(document, ap.getAnnotationType(), matcher.group(),
                                                      ap.getAttributes());
                  groups.put(ap.getGroup(), annotation);
                  providers.put(ap, annotation);
               } else {
                  matcher.group(ap.getGroup()).forEach(g -> {
                     Annotation annotation = createOrGet(document, ap.getAnnotationType(), g, ap.getAttributes());
                     groups.put(ap.getGroup(), annotation);
                     providers.put(ap, annotation);
                  });
               }
            });

            if (!groups.containsKey("*")) {
               groups.putAll("*", matcher.group().tokens());
            }

            HashMultimap<String, Tuple2<Annotation, Relation>> relations = HashMultimap.create();
            for (CaduceusRelationProvider rp : rule.getRelationProviders()) {
               List<Annotation> sourceAnnotations = rp.getSource().getAnnotations(groups, matcher);
               List<Annotation> targetAnnotations = rp.getTarget().getAnnotations(groups, matcher);
               for (Annotation source : sourceAnnotations) {
                  for (Annotation target : targetAnnotations) {
                     relations.put(rp.getName(), Tuple2.of(source,
                                                           new Relation(rp.getRelationType(), rp.getRelationValue(),
                                                                        target.getId())));
                     if (rp.isReciprocal()) {
                        relations.put(rp.getName(), Tuple2.of(target,
                                                              new Relation(rp.getRelationType(), rp.getRelationValue(),
                                                                           source.getId())));
                     }
                  }
               }
            }

            Set<String> finalRelations = new HashSet<>();
            rule.getRelationProviders().stream()
                .filter(rp -> StringUtils.isNullOrBlank(rp.getRequires()) || relations.containsKey(rp.getRequires()))
                .forEach(rp -> {
                   relations.get(rp.getName()).forEach(t -> {
                      t.getV1().add(t.getV2());
                      finalRelations.add(rp.getName());
                   });
                });

            providers.entries().stream()
                     .filter(entry -> !finalRelations.containsAll(entry.getKey().getRequires()))
                     .forEach(entry -> document.remove(entry.getValue()));

         }
      }

   }

}//END OF CaduceusProgram


text:
/**
 * The file formats available for creating the report.
 */
const ExportFormat = {
  /**
   * The report file is generated as a list of Tab Separated Values.
   */
  TSV: 'TSV',

  /**
   * The report file is generated as a list of Comma Separated Values for Excel.
   */
  CSV_EXCEL: 'CSV_EXCEL',

  /**
   * The report file is generated as a list of Comma Separated Values,
   * to be used with automated machine processing.
   *

   *

   *
There is no pretty printing for the output, and no total row.

   *
Column headers are the qualified name e.g. "Dimension.ORDER_NAME".

   *
Monetary amounts are represented as micros in the
   * {@link Network#currencyCode currency of the network}.

   *
Dates are formatted according to the ISO 8601 standard YYYY-MM-DD

   *
DateTimes are formatted according to the ISO 8601 standard
   * YYYY-MM-DDThh:mm:ss[+-]hh:mm

   *

   */
  CSV_DUMP: 'CSV_DUMP',

  /**
   * The report file is generated as XML.
   */
  XML: 'XML',

  /**
   * The report file is generated as an Office Open XML spreadsheet
   * designed for Excel 2007+.
   */
  XLSX: 'XLSX'
};

export default ExportFormat;


text:
#ifndef MAPVIEW_H_
#define MAPVIEW_H_

#include <QtWidgets/QWidget>
#include <QSharedPointer>
#include "chunkcache.h"

class DefinitionManager;
class BiomeIdentifier;
class BlockIdentifier;
class OverlayItem;

class MapView : public QWidget {
  Q_OBJECT

 public:
  /// Values for the individual flags
  enum {
    flgLighting       = 1 << 0,
    flgMobSpawn       = 1 << 1,
    flgCaveMode       = 1 << 2,
    flgDepthShading   = 1 << 3,
    flgBiomeColors    = 1 << 4,
    flgSeaGround      = 1 << 5,
    flgSingleLayer    = 1 << 6,
    flgSlimeChunks    = 1 << 7,
    flgInhabitedTime  = 1 << 8
  };

  typedef struct struct_BlockLocation {
    float x, y, z;
    int scale;
    QVector3D getPos3D() const {
      return QVector3D(x,y,z);
    }
  } BlockLocation;

  explicit MapView(QWidget *parent = 0);

  QSize minimumSizeHint() const;
  QSize sizeHint() const;

  void attach(DefinitionManager *dm);

  void setLocation(double x, double z);
  void setLocation(double x, int y, double z, bool ignoreScale, bool useHeight);
  BlockLocation *getLocation();
  void setDimension(QString path, int scale);
  void setFlags(int flags);
  int  getFlags() const;
  int  getDepth() const;
  void addOverlayItem(QSharedPointer<OverlayItem> item);
  void clearOverlayItems();
  void setVisibleOverlayItemTypes(const QSet<QString>& itemTypes);

  // public for saving the png
  QString getWorldPath();

  void updateSearchResultPositions(const QVector<QSharedPointer<OverlayItem> > &searchResults);

 public slots:
  void setDepth(int depth);
  void chunkUpdated(int x, int z);
  void redraw();

  // Clears the cache and redraws, causing all chunks to be re-loaded;
  // but keeps the viewport
  void clearCache();

 signals:
  void hoverTextChanged(QString text);
  void demandDepthChange(double value);
  void demandDepthValue(double value);
  void showProperties(QVariant properties);
  void addOverlayItemType(QString type, QColor color);
  void coordinatesChanged(int x, int y, int z);

 protected:
  void mousePressEvent(QMouseEvent *event);
  void mouseMoveEvent(QMouseEvent *event);
  void mouseReleaseEvent(QMouseEvent *event);
  void mouseDoubleClickEvent(QMouseEvent *event);
  void wheelEvent(QWheelEvent *event);
  void keyPressEvent(QKeyEvent *event);
  void resizeEvent(QResizeEvent *event);
  void paintEvent(QPaintEvent *event);

 private slots:
  void addStructureFromChunk(QSharedPointer<GeneratedStructure> structure);

 private:
  void drawChunk(int x, int z);
  void getToolTip(int x, int z);
  int getY(int x, int z);
  QList<QSharedPointer<OverlayItem>> getItems(int x, int y, int z);
  void adjustZoom(double steps, bool allowZoomOut, bool cursorSource);

  template<typename ListT>
  void drawOverlayItems(const ListT& list, const OverlayItem::Cuboid& cuboid, double x1, double z1, QPainter& canvas);

  static const int CAVE_DEPTH = 16;  // maximum depth caves are searched in cave mode
  float caveshade[CAVE_DEPTH];

  int depth;
  double x, z;
  int scale;
  double zoomLevel;
  double zoom;
  int flags;
  int lastMouseX = -1, lastMouseY = -1;
  ChunkCache &cache;
  QImage imageChunks;
  QImage imageOverlays;
  DefinitionManager *dm;
  uchar placeholder[16 * 16 * 4];  // no chunk found placeholder
  QSet<QString> overlayItemTypes;
  QMap<QString, QList<QSharedPointer<OverlayItem>>> overlayItems;
  BlockLocation currentLocation;

  QVector<QSharedPointer<OverlayItem> > currentSearchResults;
};

#endif  // MAPVIEW_H_


text:
package br.unicamp.ic.lsd.mercurius.cryptographymgr.impl;

import br.unicamp.ic.lsd.mercurius.cryptographymgr.spec.prov.CryptographyManager;

import com.google.common.base.Charsets;
import com.google.common.hash.HashCode;
import com.google.common.hash.HashFunction;
import com.google.common.hash.Hashing;

class CryptographyMgtImpl {

	private final CryptographyManager manager;

	CryptographyMgtImpl(CryptographyManager manager) {
		super();
		this.manager = manager;
	}

	byte[] hashString(String string) {
		HashFunction hashFunction = Hashing.sha512();
		HashCode hashCode = hashFunction.newHasher().putString(string, Charsets.UTF_8).hash();
		return hashCode.asBytes();
	}

}


text:
package org.hl7.fhir.utilities.graphql;

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

import org.hl7.fhir.utilities.graphql.Operation.OperationType;

public class  Operation {
  public enum OperationType {qglotQuery, qglotMutation}

  private String name;
  private Operation.OperationType operationType;
  private List<Selection> selectionSet = new ArrayList<Selection>();
  private List<Variable> variables = new ArrayList<Variable>();
  private List<Directive> directives = new ArrayList<Directive>();

  public String getName() {
    return name;
  }
  public void setName(String name) {
    this.name = name;
  }
  public Operation.OperationType getOperationType() {
    return operationType;
  }
  public void setOperationType(Operation.OperationType operationType) {
    this.operationType = operationType;
  }
  public List<Selection> getSelectionSet() {
    return selectionSet;
  }
  public List<Variable> getVariables() {
    return variables;
  }
  public List<Directive> getDirectives() {
    return directives;
  }

}


text:
<?php
namespace app\modules\pages\widgets;

use Yii;
use yii\helpers\Html;
use yii\data\ActiveDataProvider;

use app\modules\pages\models\Page;

class PortletSinglePage extends Portlet
{
	public $title='Content';

	/**
	 * here we set the id of the current page, to which we will fetch all children
	 * @var integer the pk of the currently displayed record
	 */
	public $id = 1;

	/**
	 * here we set the model, which will be viewed inside the single page portlet
	 * @var object the model containing the page record
	 */
	private $_model;

	/**
	 * @var string the CSS class for the portlet title tag. Defaults to 'portlet-title'.
	 */
	public $titleCssClass='fg-color-white bg-color-orangepic smallspace';

	public $contentCssClass='fg-color-white footer-box';

	public $htmlOptions=array();

	public function init() {
		$this->_model = Page::find($this->id);
		if(!is_null($this->_model)){
			$this->title = $this->_model->title;
			$this->adminActions[] = array(
					'action'=>Html::url(array('/pages/page/onlineview','id'=>$this->_model->id)),
					'content'=>" "
			);
			$this->adminActions[] = array(
					'action'=>Html::url(array('/pages/page/update','id'=>$this->_model->id)),
					'content'=>" "
			);
		}
		parent::init();
	}

	protected function renderContent()
	{
 		//here we don't return the view, here we just echo it!
		echo $this->render('@app/modules/pages/widgets/views/_page',array('model'=>$this->_model));
	}

	/**
	 * Renders the decoration for the portlet.
	 * The default implementation will render the title if it is set.
	 */
	protected function renderDecoration()
	{
		if($this->title!==null)
		{
			$this->title = Yii::t('app',$this->title);
			echo "
titleCssClass}\"> {$this->title}
\n";
		}
	}
}


text:
page-stylings works!

Raised Buttons

  <button mat-raised-button class="button__">Basic</button>
  <button mat-raised-button class="button__" color="primary">Primary</button>
  <button mat-raised-button class="button__" color="accent">Accent</button>
  <button mat-raised-button class="button__" color="warn">Warn</button>
  <button mat-raised-button class="button__" disabled>Disabled</button>
  Link

Raised Buttons

  <button mat-raised-button>Basic</button>
  <button mat-raised-button color="primary">Primary</button>
  <button mat-raised-button color="accent">Accent</button>
  <button mat-raised-button color="warn">Warn</button>
  <button mat-raised-button disabled>Disabled</button>
  Link


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="Ginx Corp.">
//   Copyright © 2013 · Ginx Corp. · All rights reserved.
// </copyright>
// <summary>
//   AssemblyInfo.cs
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System.Reflection;

[assembly: AssemblyTitle("GinxFx")]
[assembly: AssemblyDescription("Ginx Framework")]


text:
package textutil

import (
	"fmt"
	"io"
	"unicode"
)

// WrapWriter implements an io.Writer filter that formats input text into output
// lines with a given target width in runes.
//
// Each input rune is classified into one of three kinds:
//   EOL:    end-of-line, consisting of \f, \n, \r, \v, U+2028 or U+2029
//   Space:  defined by unicode.IsSpace
//   Letter: everything else
//
// The input text is expected to consist of words, defined as sequences of
// letters.  Sequences of words form paragraphs, where paragraphs are separated
// by either blank lines (that contain no letters), or an explicit U+2029
// ParagraphSeparator.  Input lines with leading spaces are treated verbatim.
//
// Paragraphs are output as word-wrapped lines; line breaks only occur at word
// boundaries.  Output lines are usually no longer than the target width.  The
// exceptions are single words longer than the target width, which are output on
// their own line, and verbatim lines, which may be arbitrarily longer or
// shorter than the width.
//
// Output lines never contain trailing spaces.  Only verbatim output lines may
// contain leading spaces.  Spaces separating input words are output verbatim,
// unless it would result in a line with leading or trailing spaces.
//
// EOL runes within the input text are never written to the output; the output
// line terminator and paragraph separator may be configured, and some EOL may
// be output as a single space ' ' to maintain word separation.
//
// The algorithm greedily fills each output line with as many words as it can,
// assuming that all Unicode code points have the same width.  Invalid UTF-8 is
// silently transformed to the replacement character U+FFFD and treated as a
// single rune.
//
// Flush must be called after the last call to Write; the input is buffered.
//
//   Implementation note: line breaking is a complicated topic.  This approach
//   attempts to be simple and useful; a full implementation conforming to
//   Unicode Standard Annex #14 would be complicated, and is not implemented.
//   Languages that don't use spaces to separate words (e.g. CJK) won't work
//   well under the current approach.
//
//   http://www.unicode.org/reports/tr14 [Unicode Line Breaking Algorithm]
//   http://www.unicode.org/versions/Unicode4.0.0/ch05.pdf [5.8 Newline Guidelines]
type WrapWriter struct {
	// State configured by the user.
	w             io.Writer
	runeDecoder   RuneChunkDecoder
	width         runePos
	lineTerm      []byte
	paragraphSep  string
	indents       []string
	forceVerbatim bool

	// The buffer contains a single output line.
	lineBuf byteRuneBuffer

	// Keep track of the previous state and rune.
	prevState state
	prevRune  rune

	// Keep track of blank input lines.
	inputLineHasLetter bool

	// lineBuf positions where the line starts (after separators and indents), a
	// new word has started and the last word has ended.
	lineStart    bytePos
	newWordStart bytePos
	lastWordEnd  bytePos

	// Keep track of paragraph terminations and line indices, so we can output the
	// paragraph separator and indents correctly.
	terminateParagraph bool
	paragraphLineIndex int
	wroteFirstLine     bool
}

type state int

const (
	stateWordWrap  state = iota // Perform word-wrapping [start state]
	stateVerbatim               // Verbatim output-line, no word-wrapping
	stateSkipSpace              // Skip spaces in input line.
)

// NewWrapWriter returns a new WrapWriter with the given target width in runes,
// producing output on the underlying writer w.  The dec and enc are used to
// respectively decode runes from Write calls, and encode runes to w.
func NewWrapWriter(w io.Writer, width int, dec RuneChunkDecoder, enc RuneEncoder) *WrapWriter {
	ret := &WrapWriter{
		w:            w,
		runeDecoder:  dec,
		width:        runePos(width),
		lineTerm:     []byte("\n"),
		paragraphSep: "\n",
		prevState:    stateWordWrap,
		prevRune:     LineSeparator,
		lineBuf:      byteRuneBuffer{enc: enc},
	}
	ret.resetLine()
	return ret
}

// NewUTF8WrapWriter returns a new WrapWriter filter that implements io.Writer,
// and decodes and encodes runes in UTF-8.
func NewUTF8WrapWriter(w io.Writer, width int) *WrapWriter {
	return NewWrapWriter(w, width, &UTF8ChunkDecoder{}, UTF8Encoder{})
}

// Width returns the target width in runes.  If width < 0 the width is
// unlimited; each paragraph is output as a single line.
func (w *WrapWriter) Width() int { return int(w.width) }

// SetLineTerminator sets the line terminator for subsequent Write calls.  Every
// output line is terminated with term; EOL runes from the input are never
// written to the output.  A new WrapWriter instance uses "\n" as the default
// line terminator.
//
// Calls Flush internally, and returns any Flush error.
func (w *WrapWriter) SetLineTerminator(term string) error {
	if err := w.Flush(); err != nil {
		return err
	}
	w.lineTerm = []byte(term)
	w.resetLine()
	return nil
}

// SetParagraphSeparator sets the paragraph separator for subsequent Write
// calls.  Every consecutive pair of non-empty paragraphs is separated with sep;
// EOL runes from the input are never written to the output.  A new WrapWriter
// instance uses "\n" as the default paragraph separator.
//
// Calls Flush internally, and returns any Flush error.
func (w *WrapWriter) SetParagraphSeparator(sep string) error {
	if err := w.Flush(); err != nil {
		return err
	}
	w.paragraphSep = sep
	w.resetLine()
	return nil
}

// SetIndents sets the indentation for subsequent Write calls.  Multiple indents
// may be set, corresponding to the indent to use for the corresponding
// paragraph line.  E.g. SetIndents("AA", "BBB", C") means the first line in
// each paragraph is indented with "AA", the second line in each paragraph is
// indented with "BBB", and all subsequent lines in each paragraph are indented
// with "C".
//
// SetIndents() is equivalent to SetIndents(""), SetIndents("", ""), etc.
//
// A new WrapWriter instance has no indents by default.
//
// Calls Flush internally, and returns any Flush error.
func (w *WrapWriter) SetIndents(indents ...string) error {
	if err := w.Flush(); err != nil {
		return err
	}
	// Copy indents in case the user passed the slice via SetIndents(p...), and
	// canonicalize the all empty case to nil.
	allEmpty := true
	w.indents = make([]string, len(indents))
	for ix, indent := range indents {
		w.indents[ix] = indent
		if indent != "" {
			allEmpty = false
		}
	}
	if allEmpty {
		w.indents = nil
	}
	w.resetLine()
	return nil
}

// ForceVerbatim forces w to stay in verbatim mode if v is true, or lets w
// perform its regular line writing algorithm if v is false.  This is useful if
// there is a sequence of lines that should be written verbatim, even if the
// lines don't start with spaces.
//
// Calls Flush internally, and returns any Flush error.
func (w *WrapWriter) ForceVerbatim(v bool) error {
	w.forceVerbatim = v
	return w.Flush()
}

// Write implements io.Writer by buffering data into the WrapWriter w.  Actual
// writes to the underlying writer may occur, and may include data buffered in
// either this Write call or previous Write calls.
//
// Flush must be called after the last call to Write.
func (w *WrapWriter) Write(data []byte) (int, error) {
	return WriteRuneChunk(w.runeDecoder, w.addRune, data)
}

// Flush flushes any remaining buffered text, and resets the paragraph line
// count back to 0, so that indents will be applied starting from the first
// line.  It does not imply a paragraph separator; repeated calls to Flush with
// no intervening calls to other methods is equivalent to a single Flush.
//
// Flush must be called after the last call to Write, and may be called an
// arbitrary number of times before the last Write.
func (w *WrapWriter) Flush() error {
	if err := FlushRuneChunk(w.runeDecoder, w.addRune); err != nil {
		return err
	}
	// Add U+2028 to force the last line (if any) to be written.
	if err := w.addRune(LineSeparator); err != nil {
		return err
	}
	// Reset the paragraph line count.
	w.paragraphLineIndex = 0
	w.resetLine()
	return nil
}

// addRune is called every time w.runeDecoder decodes a full rune.
func (w *WrapWriter) addRune(r rune) error {
	state, lineBreak := w.nextState(r, w.updateRune(r))
	if lineBreak {
		if err := w.writeLine(); err != nil {
			return err
		}
	}
	w.bufferRune(r, state, lineBreak)
	w.prevState = state
	w.prevRune = r
	return nil
}

// We classify each incoming rune into three kinds for easier handling.
type kind int

const (
	kindEOL kind = iota
	kindSpace
	kindLetter
)

func runeKind(r rune) kind {
	switch r {
	case '\f', '\n', '\r', '\v', LineSeparator, ParagraphSeparator:
		return kindEOL
	}
	if unicode.IsSpace(r) {
		return kindSpace
	}
	return kindLetter
}

func (w *WrapWriter) updateRune(r rune) bool {
	forceLineBreak := false
	switch kind := runeKind(r); kind {
	case kindEOL:
		// Update lastWordEnd if the last word just ended.
		if w.newWordStart != -1 {
			w.newWordStart = -1
			w.lastWordEnd = w.lineBuf.ByteLen()
		}
		switch {
		case w.prevRune == '\r' && r == '\n':
			// Treat "\r\n" as a single EOL; we've already handled the logic for '\r',
			// so there's nothing to do when we see '\n'.
		case r == LineSeparator:
			// Treat U+2028 as a pure line break; it's never a paragraph break.
			forceLineBreak = true
		case r == ParagraphSeparator || !w.inputLineHasLetter:
			// The paragraph has just been terminated if we see an explicit U+2029, or
			// if we see a blank line, which may contain spaces.
			forceLineBreak = true
			w.terminateParagraph = true
		}
		w.inputLineHasLetter = false
	case kindSpace:
		// Update lastWordEnd if the last word just ended.
		if w.newWordStart != -1 {
			w.newWordStart = -1
			w.lastWordEnd = w.lineBuf.ByteLen()
		}
	case kindLetter:
		// Update newWordStart if a new word just started.
		if w.newWordStart == -1 {
			w.newWordStart = w.lineBuf.ByteLen()
		}
		w.inputLineHasLetter = true
		w.terminateParagraph = false
	default:
		panic(fmt.Errorf("textutil: updateRune unhandled kind %d", kind))
	}
	return forceLineBreak
}

// nextState returns the next state and whether we should break the line.
//
// Here's a handy table that describes all the scenarios in which we will line
// break input text, grouped by the reason for the break.  The current position
// is the last non-* rune in each pattern, which is where we decide to break.
//
//              w.prevState   Next state   Buffer reset
//              -----------   ----------   ------------
//   ===== Force line break (U+2028 / U+2029, blank line) =====
//   a..*|***   *             wordWrap     empty
//   a._.|***   *             wordWrap     empty
//   a+**|***   *             wordWrap     empty
//
//   ===== verbatim: wait for any EOL =====
//   _*.*|***   verbatim      wordWrap     empty
//
//   ===== wordWrap: switch to verbatim =====
//   a._*|***   wordWrap      verbatim     empty
//
//   ===== wordWrap: line is too wide =====
//   abc.|***   wordWrap      wordWrap     empty
//   abcd|.**   wordWrap      wordWrap     empty
//   abcd|e.*   wordWrap      wordWrap     empty
//   a_cd|.**   wordWrap      wordWrap     empty
//
//   abc_|***   wordWrap      skipSpace    empty
//   abcd|_**   wordWrap      skipSpace    empty
//   abcd|e_*   wordWrap      skipSpace    empty
//   a_cd|_**   wordWrap      skipSpace    empty
//
//   a_cd|e**   wordWrap      start        newWordStart
//
//   LEGEND
//     abcde  Letter
//     .      End-of-line
//     +      End-of-line (only U+2028 / U+2029)
//     _      Space
//     *      Any rune (letter, line-end or space)
//     |      Visual indication of width=4, has no width itself.
//
// Note that Flush calls behave exactly as if an explicit U+2028 line separator
// were added to the end of all buffered data.
func (w *WrapWriter) nextState(r rune, forceLineBreak bool) (state, bool) {
	kind := runeKind(r)
	if w.forceVerbatim {
		return stateVerbatim, forceLineBreak || kind == kindEOL
	}
	if forceLineBreak {
		return stateWordWrap, true
	}
	// Handle non word-wrap states, which are easy.
	switch w.prevState {
	case stateVerbatim:
		if kind == kindEOL {
			return stateWordWrap, true
		}
		return stateVerbatim, false
	case stateSkipSpace:
		if kind == kindSpace {
			return stateSkipSpace, false
		}
		return stateWordWrap, false
	}
	// Handle stateWordWrap, which is more complicated.

	// Switch to the verbatim state when we see a space right after an EOL.
	if runeKind(w.prevRune) == kindEOL && kind == kindSpace {
		return stateVerbatim, true
	}
	// Break on EOL or space when the line is too wide.  See above table.
	if w.width >= 0 && w.width <= w.lineBuf.RuneLen()+1 {
		switch kind {
		case kindEOL:
			return stateWordWrap, true
		case kindSpace:
			return stateSkipSpace, true
		}
		// case kindLetter falls through
	}
	// Handle the newWordStart case in the above table.
	if w.width >= 0 && w.width < w.lineBuf.RuneLen()+1 && w.newWordStart != w.lineStart {
		return stateWordWrap, true
	}
	// Stay in the wordWrap state and don't break the line.
	return stateWordWrap, false
}

func (w *WrapWriter) writeLine() error {
	if w.lastWordEnd == -1 {
		// Don't write blank lines, but we must reset the line in case the paragraph
		// has just been terminated.
		w.resetLine()
		return nil
	}
	// Write the line (without trailing spaces) followed by the line terminator.
	line := w.lineBuf.Bytes()[:w.lastWordEnd]
	if _, err := w.w.Write(line); err != nil {
		return err
	}
	if _, err := w.w.Write(w.lineTerm); err != nil {
		return err
	}
	// Reset the line buffer.
	w.wroteFirstLine = true
	w.paragraphLineIndex++
	if w.newWordStart != -1 {
		// If we have an unterminated new word, we must be in the newWordStart case
		// in the table above.  Handle the special buffer reset here.
		newWord := string(w.lineBuf.Bytes()[w.newWordStart:])
		w.resetLine()
		w.newWordStart = w.lineBuf.ByteLen()
		w.lineBuf.WriteString(newWord)
	} else {
		w.resetLine()
	}
	return nil
}

func (w *WrapWriter) resetLine() {
	w.lineBuf.Reset()
	w.newWordStart = -1
	w.lastWordEnd = -1
	// Write the paragraph separator if the previous paragraph has terminated.
	// This consumes no runes from the line width.
	if w.wroteFirstLine && w.terminateParagraph {
		w.lineBuf.WriteString0Runes(w.paragraphSep)
		w.paragraphLineIndex = 0
	}
	// Add indent; a non-empty indent consumes runes from the line width.
	var indent string
	switch {
	case w.paragraphLineIndex < len(w.indents):
		indent = w.indents[w.paragraphLineIndex]
	case len(w.indents) > 0:
		indent = w.indents[len(w.indents)-1]
	}
	w.lineBuf.WriteString(indent)
	w.lineStart = w.lineBuf.ByteLen()
}

func (w *WrapWriter) bufferRune(r rune, state state, lineBreak bool) {
	// Never add leading spaces to the buffer in the wordWrap state.
	wordWrapNoLeadingSpaces := state == stateWordWrap && !lineBreak
	switch kind := runeKind(r); kind {
	case kindEOL:
		// When we're word-wrapping and we see a letter followed by EOL, we convert
		// the EOL into a single space in the buffer, to break the previous word
		// from the next word.
		if wordWrapNoLeadingSpaces && runeKind(w.prevRune) == kindLetter {
			w.lineBuf.WriteRune(' ')
		}
	case kindSpace:
		if wordWrapNoLeadingSpaces || state == stateVerbatim {
			w.lineBuf.WriteRune(r)
		}
	case kindLetter:
		w.lineBuf.WriteRune(r)
	default:
		panic(fmt.Errorf("textutil: bufferRune unhandled kind %d", kind))
	}
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>WorkNet</title>

    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">

    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css" type="text/css">

    <link rel="stylesheet" href="css/animate.min.css" type="text/css">

    <link rel="stylesheet" href="css/creative.css" type="text/css">

                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>

 WorkNet

                        Acerca de Worknet

                        Desarrolladores

                        Imágenes

                        ¡Contáctenos!

¡Conoce WorkNet!

WorkNet es una red social en la que los empresarios pueden  hacer "Workneting", pueden trabajar ayudandose entre ellos mismos, e incluso pueden ofrecer trabajos a personas que lo necesiten. Esta red social a sido desarrollada como un proyecto especial para las empresas que van naciendo y que necesitan apoyo.

Misión:

Ser una red social que ayude a los usuarios a que puedan ayudarse entres si para crecer como empresas o empresarios; porque es mejor ayudarse entre si que aplastar a otras empresas.

Visión:

Buscamos ayudar a los empresarios que van naciendo, enseñándoles que se puede hacer un trabajo entre diferentes empresas, sin necesidad de opacarse entre si, mas bien ayudarse.

                    Comieza a hacer WorkNeting

Desarrolladores

Julio César Rodríguez Gómez

Estudiante de tercer año de sistemas informáticos e inglés técnico. Diseñador y desarrolador de Worknet.

Carlos Antonio Minero Dubón

Estudiante de tercer año de sistemas informáticos e inglés técnico. Diseñador y desarrolador de Worknet.

José Atilio García Sibrián

Estudiante de tercer año de sistemas informáticos e inglés técnico. Diseñador y desarrolador de Worknet.

                                    WorkNet

                                    ¡La red social para empresas!

                                    Julio Rodríguez

                                    Desarrollador Web y Diseñador

                                    Carlos Minero

                                    Desarrollador Web

                                     Julio Rodríguez y José Sibrián

                                    Desarrolladores Web

                                    Carlos Minero

                                    Desarrollador Web

                                    José Sibrián

                                    Desarrollador Web

¡Contáctenos!

Puede contactarnos por los siguientes medios:

facebook.com/NetWork2015

worknett2015@gmail.com


text:
require 'cisco_node_utils' if Puppet.features.cisco_node_utils?
begin
  require 'puppet_x/cisco/autogen'
rescue LoadError # seen on master, not on agent
  # See longstanding Puppet issues #4248, #7316, #14073, #14149, etc. Ugh.
  require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..',
                                     'puppet_x', 'cisco', 'autogen.rb'))
end

Puppet::Type.type(:cisco_evpn_vni).provide(:cisco) do
  desc 'The Cisco provider for cisco evpn vni'

  confine feature: :cisco_node_utils

  mk_resource_methods

  # Property symbol arrays for method auto-generation.
  EVPN_VNI_ARRAY_FLAT_PROPS = [
    :route_target_both,
    :route_target_export,
    :route_target_import,
  ]
  EVPN_VNI_NON_BOOL_PROPS = [
    :route_distinguisher
  ]
  EVPN_VNI_ALL_PROPS = EVPN_VNI_ARRAY_FLAT_PROPS + EVPN_VNI_NON_BOOL_PROPS

  PuppetX::Cisco::AutoGen.mk_puppet_methods(:array_flat, self, '@nu',
                                            EVPN_VNI_ARRAY_FLAT_PROPS)
  PuppetX::Cisco::AutoGen.mk_puppet_methods(:non_bool, self, '@nu',
                                            EVPN_VNI_NON_BOOL_PROPS)

  def initialize(value={})
    super(value)
    @nu = Cisco::EvpnVni.vnis[@property_hash[:name]]
    @property_flush = {}
  end # initialize

  def self.properties_get(vni_id, nu_obj)
    debug "Checking instance, vni #{vni_id}"
    current_state = {
      vni:    vni_id,
      name:   vni_id,
      ensure: :present,
    }

    # Call node_utils getter for each property
    EVPN_VNI_ALL_PROPS.each { |prop| current_state[prop] = nu_obj.send(prop) }

    new(current_state)
  end # self.properties_get

  def self.instances
    vnis = []
    Cisco::EvpnVni.vnis.each do |vni_id, nu_obj|
      vnis << properties_get(vni_id, nu_obj)
    end
    vnis
  end # self.instances

  def self.prefetch(resources)
    vnis = instances

    resources.keys.each do |id|
      provider = vnis.find { |vni| vni.instance_name == id }
      resources[id].provider = provider unless provider.nil?
    end
  end

  def exists?
    @property_hash[:ensure] == :present
  end

  def create
    @property_flush[:ensure] = :present
  end

  def destroy
    @property_flush[:ensure] = :absent
  end

  def instance_name
    vni
  end

  def properties_set(new_vni=false)
    EVPN_VNI_ALL_PROPS.each do |prop|
      next unless @resource[prop]
      send("#{prop}=", @resource[prop]) if new_vni

      next if @property_flush[prop].nil?
      @nu.send("#{prop}=", @property_flush[prop]) if
        @nu.respond_to?("#{prop}=")
    end
  end

  def flush
    if @property_flush[:ensure] == :absent
      @nu.destroy
      @nu = nil
    else
      # Create/Update
      if @nu.nil?
        new_vni = true
        @nu = Cisco::EvpnVni.new(@resource[:vni])
      end
      properties_set(new_vni)
    end
  end
end # Puppet::Type


text:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="top|left" >

    <LinearLayout
        android:id="@+id/editItem_layout_p1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="top"
        android:gravity="top"
        android:orientation="vertical" >

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:singleLine="true"
                android:text="@string/store_name"
                android:textSize="19sp" />

            <TextView
                android:id="@+id/textView_name_editItem"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawableLeft="@android:drawable/ic_lock_lock"
                android:text=""
                android:textColor="#3366FF"
                android:textSize="21sp" />

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:text="@string/store_address"
                android:textSize="19sp" />

            <Spinner
                android:id="@+id/spinner_country_editItem"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:layout_weight="1" />

            <EditText
                android:id="@+id/editText_township_editItem"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:singleLine="true" />

            <EditText
                android:id="@+id/editText_address_editItem"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="top"
                android:ems="10"
                android:inputType="textMultiLine"
                android:lines="3" />
        </LinearLayout>

</ScrollView>


text:
Android Data Binding Library samples
===================================

A collection of samples using the [Android Data Binding Library](https://developer.android.com/topic/libraries/data-binding/index.html):

### Samples

* **[BasicSample](https://github.com/googlesamples/android-databinding/blob/master/BasicSample)** - (Kotlin) Shows basic usage of layout expressions, binding adapters, and integration with ViewModels.
* **[TwoWaySample](https://github.com/googlesamples/android-databinding/blob/master/TwoWaySample)** - (Kotlin) Shows usage of two-way data binding, advanced Binding Adapters, animations, converters and inverse converters.

### Other official samples using Data Binding

* **[Android Architecture Blueprints (todo-mvvm-live-kotlin branch)](https://github.com/googlesamples/android-architecture/tree/todo-mvvm-live-kotlin/)** - Shows basic Data Binding usage with architecture best practices and Architecture Components, in Kotlin.
* **[Android Architecture Components Samples](https://github.com/googlesamples/android-architecture-components/tree/master/GithubBrowserSample)** - An advanced sample that uses the Architecture components, Dagger and the Github API, in Kotlin.
* **[Android Sunflower](https://github.com/googlesamples/android-sunflower)** - A gardening app illustrating Android development best practices with Android Jetpack, including Data Binding.

### Reporting Issues

You can report an [Issue](https://github.com/googlesamples/android-databinding/issues) on the samples using this repository. If you find an issue with the library related to build, report it using the [Gradle Plugin issue tracker](https://b.corp.google.com/issues/new?component=192709&template=842921). If it's related to the Android Studio integration, report it using the [Android Studio issue tracker](https://b.corp.google.com/issues/new?component=192708&template=840533).

License
-------

Copyright 2018 The Android Open Source Project, Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements.  See the NOTICE file distributed with this work for
additional information regarding copyright ownership.  The ASF licenses this
file to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License.  You may obtain a copy of
the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
License for the specific language governing permissions and limitations under
the License.