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

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Plus.V1.Model.ActivityFeed do
  @moduledoc """

  ## Attributes

  *   `etag` (*type:* `String.t`, *default:* `nil`) - ETag of this response for caching purposes.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The ID of this collection of activities. Deprecated.
  *   `items` (*type:* `list(GoogleApi.Plus.V1.Model.Activity.t)`, *default:* `nil`) - The activities in this page of results.
  *   `kind` (*type:* `String.t`, *default:* `plus#activityFeed`) - Identifies this resource as a collection of activities. Value: "plus#activityFeed".
  *   `nextLink` (*type:* `String.t`, *default:* `nil`) - Link to the next page of activities.
  *   `nextPageToken` (*type:* `String.t`, *default:* `nil`) - The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - Link to this activity resource.
  *   `title` (*type:* `String.t`, *default:* `nil`) - The title of this collection of activities, which is a truncated portion of the content.
  *   `updated` (*type:* `DateTime.t`, *default:* `nil`) - The time at which this collection of activities was last updated. Formatted as an RFC 3339 timestamp.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :etag => String.t(),
          :id => String.t(),
          :items => list(GoogleApi.Plus.V1.Model.Activity.t()),
          :kind => String.t(),
          :nextLink => String.t(),
          :nextPageToken => String.t(),
          :selfLink => String.t(),
          :title => String.t(),
          :updated => DateTime.t()
        }

  field(:etag)
  field(:id)
  field(:items, as: GoogleApi.Plus.V1.Model.Activity, type: :list)
  field(:kind)
  field(:nextLink)
  field(:nextPageToken)
  field(:selfLink)
  field(:title)
  field(:updated, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.Plus.V1.Model.ActivityFeed do
  def decode(value, options) do
    GoogleApi.Plus.V1.Model.ActivityFeed.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Plus.V1.Model.ActivityFeed do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end


/******************************************************************************
 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
 *
 * Based on the r8180 driver, which is:
 * Copyright 2004-2005 Andrea Merello <andreamrl@tiscali.it>, et al.
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program 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
 * this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
 *
 * The full GNU General Public License is included in this distribution in the
 * file called LICENSE.
 *
 * Contact Information:
 * wlanfae <wlanfae@realtek.com>
 *****************************************************************************
 */
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/delay.h>

#include "rtl_core.h"

static void rtl819x_ethtool_get_drvinfo(struct net_device *dev,
		struct ethtool_drvinfo *info)
{
	struct r8192_priv *priv = rtllib_priv(dev);

	strcpy(info->driver, DRV_NAME);
	strcpy(info->version, DRV_VERSION);
	strcpy(info->bus_info, pci_name(priv->pdev));
}

static u32 rtl819x_ethtool_get_link(struct net_device *dev)
{
	struct r8192_priv *priv = rtllib_priv(dev);

	return ((priv->rtllib->state == RTLLIB_LINKED) ||
		(priv->rtllib->state == RTLLIB_LINKED_SCANNING));
}

const struct ethtool_ops rtl819x_ethtool_ops = {
	.get_drvinfo = rtl819x_ethtool_get_drvinfo,
	.get_link = rtl819x_ethtool_get_link,
};


---
bodyclass: docs
headline: gRPC Concepts
layout: docs
sidenav: doc-side-guides-nav.html
title: gRPC Concepts
type: markdown
---

This document introduces some key gRPC concepts with an overview
of gRPC's architecture and RPC life cycle.

It assumes that you've read [What is gRPC?]({{site.baseurl}}/docs/guides). For
language-specific details, see the Quick Start, tutorial, and reference
documentation for your chosen language(s), where available (complete reference
docs are coming soon).

## Overview

### Service definition

Like many RPC systems, gRPC is based around the idea of defining a service,
specifying the methods that can be called remotely with their parameters and
return types. By default, gRPC uses [protocol
buffers](https://developers.google.com/protocol-buffers/) as the Interface
Definition Language (IDL) for describing both the service interface and the
structure of the payload messages. It is possible to use other alternatives if
desired.

```
service HelloService {
  rpc SayHello (HelloRequest) returns (HelloResponse);
}

message HelloRequest {
  string greeting = 1;
}

message HelloResponse {
  string reply = 1;
}
```

gRPC lets you define four kinds of service method:

- Unary RPCs where the client sends a single request to the server and gets a
  single response back, just like a normal function call.

```
rpc SayHello(HelloRequest) returns (HelloResponse){
}
```

- Server streaming RPCs where the client sends a request to the server and gets
  a stream to read a sequence of messages back. The client reads from the
  returned stream until there are no more messages. gRPC guarantees message
  ordering within an individual RPC call.

```
rpc LotsOfReplies(HelloRequest) returns (stream HelloResponse){
}
```

- Client streaming RPCs where the client writes a sequence of messages and sends
  them to the server, again using a provided stream. Once the client has
  finished writing the messages, it waits for the server to read them and return
  its response.  Again gRPC guarantees message ordering within an individual RPC
  call.

```
rpc LotsOfGreetings(stream HelloRequest) returns (HelloResponse) {
}
```

- Bidirectional streaming RPCs where both sides send a sequence of messages
  using a read-write stream. The two streams operate independently, so clients
  and servers can read and write in whatever order they like: for example, the
  server could wait to receive all the client messages before writing its
  responses, or it could alternately read a message then write a message, or
  some other combination of reads and writes. The order of messages in each
  stream is preserved.

```
rpc BidiHello(stream HelloRequest) returns (stream HelloResponse){
}
```

We'll look at the different types of RPC in more detail in the RPC life cycle section below.

### Using the API surface

Starting from a service definition in a .proto file, gRPC provides protocol
buffer compiler plugins that generate client- and server-side code. gRPC users
typically call these APIs on the client side and implement the corresponding API
on the server side.

- On the server side, the server implements the methods declared by the service
  and runs a gRPC server to handle client calls. The gRPC infrastructure decodes
  incoming requests, executes service methods, and encodes service responses.
- On the client side, the client has a local object known as *stub* (for some
  languages, the preferred term is *client*) that implements the same methods as
  the service. The client can then just call those methods on the local object,
  wrapping the parameters for the call in the appropriate protocol buffer
  message type - gRPC looks after sending the request(s) to the server and
  returning the server's protocol buffer response(s).

### Synchronous vs. asynchronous

Synchronous RPC calls that block until a response arrives from the server are
the closest approximation to the abstraction of a procedure call that RPC
aspires to. On the other hand, networks are inherently asynchronous and in many
scenarios it's useful to be able to start RPCs without blocking the current
thread.

The gRPC programming surface in most languages comes in both synchronous and
asynchronous flavors. You can find out more in each language's tutorial and
reference documentation (complete reference docs are coming soon).

## RPC life cycle

Now let's take a closer look at what happens when a gRPC client calls a gRPC
server method. We won't look at implementation details, you can find out more
about these in our language-specific pages.

### Unary RPC

First let's look at the simplest type of RPC, where the client sends a single request and gets back a single response.

- Once the client calls the method on the stub/client object, the server is
  notified that the RPC has been invoked with the client's [metadata](#metadata)
  for this call, the method name, and the specified [deadline](#deadlines) if
  applicable.
- The server can then either send back its own initial metadata (which must be
  sent before any response) straight away, or wait for the client's request
  message - which happens first is application-specific.
- Once the server has the client's request message, it does whatever work is
  necessary to create and populate its response. The response is then returned
  (if successful) to the client together with status details (status code and
  optional status message) and optional trailing metadata.
- If the status is OK, the client then gets the response, which completes the
  call on the client side.

### Server streaming RPC

A server-streaming RPC is similar to our simple example, except the server sends
back a stream of responses after getting the client's request message. After
sending back all its responses, the server's status details (status code and
optional status message) and optional trailing metadata are sent back to
complete on the server side. The client completes once it has all the server's
responses.

### Client streaming RPC

A client-streaming RPC is also similar to our simple example, except the client
sends a stream of requests to the server instead of a single request. The server
sends back a single response, typically but not necessarily after it has
received all the client's requests, along with its status details and optional
trailing metadata.

### Bidirectional streaming RPC

In a bidirectional streaming RPC, again the call is initiated by the client
calling the method and the server receiving the client metadata, method name,
and deadline. Again the server can choose to send back its initial metadata or
wait for the client to start sending requests.

What happens next depends on the application, as the client and server can read
and write in any order - the streams operate completely independently. So, for
example, the server could wait until it has received all the client's messages
before writing its responses, or the server and client could "ping-pong": the
server gets a request, then sends back a response, then the client sends another
request based on the response, and so on.

### Deadlines/Timeouts

gRPC allows clients to specify how long they are willing to wait for an RPC to
complete before the RPC is terminated with the error `DEADLINE_EXCEEDED`. On
the server side, the server can query to see if a particular RPC has timed out,
or how much time is left to complete the RPC.

How the deadline or timeout is specified varies from language to language - for
example, not all languages have a default deadline, some language APIs work in
terms of a deadline (a fixed point in time), and some language APIs work in
terms of timeouts (durations of time).

### RPC termination

In gRPC, both the client and server make independent and local determinations of
the success of the call, and their conclusions may not match. This means that,
for example, you could have an RPC that finishes successfully on the server side
("I have sent all my responses!") but fails on the client side ("The responses
arrived after my deadline!"). It's also possible for a server to decide to
complete before a client has sent all its requests.

### Cancelling RPCs

Either the client or the server can cancel an RPC at any time. A cancellation
terminates the RPC immediately so that no further work is done. It is *not* an
"undo": changes made before the cancellation will not be rolled back.

### Metadata

Metadata is information about a particular RPC call (such as authentication details) in the
form of a list of key-value pairs, where the keys are strings and the values are
typically strings (but can be binary data). Metadata is opaque to gRPC itself -
it lets the client provide information associated with the call to the server
and vice versa.

Access to metadata is language-dependent.

### Channels

A gRPC channel provides a connection to a gRPC server on a specified host and
port and is used when creating a client stub (or just "client" in some
languages). Clients can specify channel arguments to modify gRPC's default
behaviour, such as switching on and off message compression. A channel has
state, including connected and idle.

How gRPC deals with closing down channels is language-dependent. Some languages
also permit querying channel state.


- Start Date: 2019-04-09
- Target Major Version: 3.x
- Reference Issues: N/A
- Implementation PR: N/A

# Summary

- Re-design custom directive API so that it better aligns with component lifecycle

- Custom directives usage on components will follow the same rules as discussed in the [Attribute Fallthrough Behavior RFC](https://github.com/vuejs/rfcs/pull/26). It will be controlled by the child component via `v-bind="$attrs"`.

# Basic example

## Before

``` js
const MyDirective = {
  bind(el, binding, vnode, prevVnode) {},
  inserted() {},
  update() {},
  componentUpdated() {},
  unbind() {}
}
```

## After

``` js
const MyDirective = {
  beforeMount(el, binding, vnode, prevVnode) {},
  mounted() {},
  beforeUpdate() {},
  updated() {},
  beforeUnmount() {}, // new
  unmounted() {}
}
```

# Motivation

Make custom directive hook names more consistent with the component lifecycle.

# Detailed design

## Hooks Renaming

Existing hooks are renamed to map better to the component lifecycle, with some timing adjustments. Arguments passed to the hooks remain unchanged.

- **new** `created` (called before vnode props are applied to DOM node)
- `bind` -> `beforeMount` (called after vnode props have been applied to DOM node)
- `inserted` -> `mounted` (called after children have been inserted into the DOM node, and the DOM node itself has been inserted into parent element)
- **new** `beforeUpdate` (called before the element itself is updated)
- ~~`update`~~ *removed, use `updated` instead*
- `componentUpdated` -> `updated` (called after the element itself and its children have been updated)
- **new** `beforeUnmount`
- `unbind` -> `unmounted`

## Usage on Components

In 3.0, with fragments support, components can potentially have more than one root nodes. This creates an issue when a custom directive is used on a component with multiple root nodes.

To explain the details of how custom directives will work on components in 3.0, we need to first understand how custom directives are compiled in 3.0. For a directive like this:

``` html
<div v-foo="bar"></div>
```

Will roughly compile into this:

``` js
const vFoo = resolveDirective('foo')

return withDirectives(h('div'), [
  [vFoo, bar]
])
```

Where `vFoo` will be the directive object written by the user, which contains hooks like `mounted` and `updated`.

`withDirectives` returns a cloned VNode with the user hooks wrapped and injected as vnode lifecycle hooks (see [Render Function API Changes](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0008-render-function-api-change.md#special-reserved-props) for more details):

``` js
{
  onVnodeMounted(vnode) {
    // call vFoo.mounted(...)
  }
}
```

**As a result, custom directives are fully included as part of a VNode's data. When a custom directive is used on a component, these `onVnodeXXX` hooks are passed down to the component as extraneous props and end up in `this.$attrs`.**

This also means it's possible to directly hook into an element's lifecycle like this in the template, which can be handy when a custom directive is too involved:

``` html
<div @vnodeMounted="myHook" />
```

This is consistent with the attribute fallthrough behavior discussed in [vuejs/rfcs#26](https://github.com/vuejs/rfcs/pull/26). So, the rule for custom directives on a component will be the same as other extraneous attributes: it is up to the child component to decide where and whether to apply it. When the child component uses `v-bind="$attrs"` on an inner element, it will apply any custom directives used on it as well.

# Drawbacks

N/A

# Alternatives

N/A

# Adoption strategy

- The renaming should be easy to support in the compat build
- Codemod should also be straightforward
- For directives used on components, the warning on unused `$attrs` as discussed in [Attribute Fallthrough Behavior](https://github.com/vuejs/rfcs/pull/26) should apply as well.

# Unresolved questions

N/A


<!DOCTYPE html><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source to the Rust file `/Users/rseymour/.cargo/registry/src/github.com-1ecc6299db9ec823/libflate-0.1.16/src/non_blocking/zlib.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>zlib.rs.html -- source</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle">
☰

<button id="theme-picker" aria-label="Pick another theme!"></button>

<form class="search-form js-only">
<input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search">
</form>

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241

//! The encoder and decoder of the ZLIB format.
//!
//! The ZLIB format is defined in [RFC-1950](https://tools.ietf.org/html/rfc1950).
//!
//! # Examples
//! ```</span>
<span class="doccomment">//! use std::io::{self, Read};</span>
<span class="doccomment">//! use libflate::zlib::Encoder;</span>
<span class="doccomment">//! use libflate::non_blocking::zlib::Decoder;</span>
<span class="doccomment">//!</span>
<span class="doccomment">//! // Encoding</span>
<span class="doccomment">//! let mut encoder = Encoder::new(Vec::new()).unwrap();</span>
<span class="doccomment">//! io::copy(&mut &b"Hello World!"[..], &mut encoder).unwrap();</span>
<span class="doccomment">//! let encoded_data = encoder.finish().into_result().unwrap();</span>
<span class="doccomment">//!</span>
<span class="doccomment">//! // Decoding</span>
<span class="doccomment">//! let mut decoder = Decoder::new(&encoded_data[..]);</span>
<span class="doccomment">//! let mut decoded_data = Vec::new();</span>
<span class="doccomment">//! decoder.read_to_end(&mut decoded_data).unwrap();</span>
<span class="doccomment">//!</span>
<span class="doccomment">//! assert_eq!(decoded_data, b"Hello World!");</span>
<span class="doccomment">//! ```
use byteorder::BigEndian;
use byteorder::ReadBytesExt;
use std::io::{self, Read};

use checksum;
use non_blocking::deflate;
use zlib::Header;

/// ZLIB decoder which supports non-blocking I/O.
#[derive(Debug)]
pub struct Decoder<R> {
    header: Option<Header>,
    reader: deflate::Decoder<R>,
    adler32: checksum::Adler32,
    eos: bool,
}
impl<R: Read> Decoder<R> {
    /// Makes a new decoder instance.
    ///
    /// `inner` is to be decoded ZLIB stream.
    ///
    /// # Examples
    /// ```</span>
    <span class="doccomment">/// use std::io::Read;</span>
    <span class="doccomment">/// use libflate::non_blocking::zlib::Decoder;</span>
    <span class="doccomment">///</span>
    <span class="doccomment">/// let encoded_data = [120, 156, 243, 72, 205, 201, 201, 87, 8, 207, 47,</span>
    <span class="doccomment">///                     202, 73, 81, 4, 0, 28, 73, 4, 62];</span>
    <span class="doccomment">///</span>
    <span class="doccomment">/// let mut decoder = Decoder::new(&encoded_data[..]);</span>
    <span class="doccomment">/// let mut buf = Vec::new();</span>
    <span class="doccomment">/// decoder.read_to_end(&mut buf).unwrap();</span>
    <span class="doccomment">///</span>
    <span class="doccomment">/// assert_eq!(buf, b"Hello World!");</span>
    <span class="doccomment">/// ```
    pub fn new(inner: R) -> Self {
        Decoder {
            header: None,
            reader: deflate::Decoder::new(inner),
            adler32: checksum::Adler32::new(),
            eos: false,
        }
    }

    /// Returns the header of the ZLIB stream.
    ///
    /// # Examples
    /// ```</span>
    <span class="doccomment">/// use libflate::zlib::CompressionLevel;</span>
    <span class="doccomment">/// use libflate::non_blocking::zlib::Decoder;</span>
    <span class="doccomment">///</span>
    <span class="doccomment">/// let encoded_data = [120, 156, 243, 72, 205, 201, 201, 87, 8, 207, 47,</span>
    <span class="doccomment">///                     202, 73, 81, 4, 0, 28, 73, 4, 62];</span>
    <span class="doccomment">///</span>
    <span class="doccomment">/// let mut decoder = Decoder::new(&encoded_data[..]);</span>
    <span class="doccomment">/// assert_eq!(decoder.header().unwrap().compression_level(),</span>
    <span class="doccomment">///            CompressionLevel::Default);</span>
    <span class="doccomment">/// ```
    pub fn header(&mut self) -> io::Result<&Header> {
        if let Some(ref header) = self.header {
            Ok(header)
        } else {
            let header = self.reader
                .bit_reader_mut()
                .transaction(|r| Header::read_from(r.as_inner_mut()))?;
            self.header = Some(header);
            self.header()
        }
    }

    /// Returns the immutable reference to the inner stream.
    pub fn as_inner_ref(&self) -> &R {
        self.reader.as_inner_ref()
    }

    /// Returns the mutable reference to the inner stream.
    pub fn as_inner_mut(&mut self) -> &mut R {
        self.reader.as_inner_mut()
    }

    /// Unwraps this `Decoder`, returning the underlying reader.
    ///
    /// # Examples
    /// ```</span>
    <span class="doccomment">/// use std::io::Cursor;</span>
    <span class="doccomment">/// use libflate::non_blocking::zlib::Decoder;</span>
    <span class="doccomment">///</span>
    <span class="doccomment">/// let encoded_data = [120, 156, 243, 72, 205, 201, 201, 87, 8, 207, 47,</span>
    <span class="doccomment">///                     202, 73, 81, 4, 0, 28, 73, 4, 62];</span>
    <span class="doccomment">///</span>
    <span class="doccomment">/// let decoder = Decoder::new(Cursor::new(&encoded_data));</span>
    <span class="doccomment">/// assert_eq!(decoder.into_inner().into_inner(), &encoded_data);</span>
    <span class="doccomment">/// ```
    pub fn into_inner(self) -> R {
        self.reader.into_inner()
    }
}
impl<R: Read> Read for Decoder<R> {
    fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
        if self.header.is_none() {
            self.header()?;
        }
        if self.eos {
            Ok(0)
        } else {
            let read_size = self.reader.read(buf)?;
            if read_size == 0 {
                let adler32 = self.reader
                    .bit_reader_mut()
                    .transaction(|r| r.as_inner_mut().read_u32::<BigEndian>())?;
                self.eos = true;
                if adler32 != self.adler32.value() {
                    Err(invalid_data_error!(
                        "Adler32 checksum mismatched: value={}, expected={}",
                        self.adler32.value(),
                        adler32
                    ))
                } else {
                    Ok(0)
                }
            } else {
                self.adler32.update(&buf[..read_size]);
                Ok(read_size)
            }
        }
    }
}

#[cfg(test)]
mod test {
    use super::*;
    use std::io;
    use util::{nb_read_to_end, WouldBlockReader};
    use zlib::{EncodeOptions, Encoder};

    fn decode_all(buf: &[u8]) -> io::Result<Vec<u8>> {
        let decoder = Decoder::new(WouldBlockReader::new(buf));
        nb_read_to_end(decoder)
    }
    fn default_encode(buf: &[u8]) -> io::Result<Vec<u8>> {
        let mut encoder = Encoder::new(Vec::new()).unwrap();
        io::copy(&mut &buf[..], &mut encoder).unwrap();
        encoder.finish().into_result()
    }
    macro_rules! assert_encode_decode {
        ($input:expr) => {{
            let encoded = default_encode(&$input[..]).unwrap();
            assert_eq!(decode_all(&encoded).unwrap(), &$input[..]);
        }};
    }

    const DECODE_WORKS_TESTDATA: [u8; 20] = [
        120, 156, 243, 72, 205, 201, 201, 87, 8, 207, 47, 202, 73, 81, 4, 0, 28, 73, 4, 62,
    ];
    #[test]
    fn decode_works() {
        let encoded = DECODE_WORKS_TESTDATA;
        let buf = decode_all(&encoded[..]).unwrap();
        let expected = b"Hello World!";
        assert_eq!(buf, expected);
    }

    #[test]
    fn default_encode_works() {
        let plain = b"Hello World! Hello ZLIB!!";
        let mut encoder = Encoder::new(Vec::new()).unwrap();
        io::copy(&mut &plain[..], &mut encoder).unwrap();
        let encoded = encoder.finish().into_result().unwrap();
        assert_eq!(decode_all(&encoded).unwrap(), plain);
    }

    #[test]
    fn best_speed_encode_works() {
        let plain = b"Hello World! Hello ZLIB!!";
        let mut encoder =
            Encoder::with_options(Vec::new(), EncodeOptions::default().fixed_huffman_codes())
                .unwrap();
        io::copy(&mut &plain[..], &mut encoder).unwrap();
        let encoded = encoder.finish().into_result().unwrap();
        assert_eq!(decode_all(&encoded).unwrap(), plain);
    }

    const RAW_ENCODE_WORKS_EXPECTED: [u8; 23] = [
        120, 1, 1, 12, 0, 243, 255, 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 28, 73,
        4, 62,
    ];
    #[test]
    fn raw_encode_works() {
        let plain = b"Hello World!";
        let mut encoder =
            Encoder::with_options(Vec::new(), EncodeOptions::new().no_compression()).unwrap();
        io::copy(&mut &plain[..], &mut encoder).unwrap();
        let encoded = encoder.finish().into_result().unwrap();
        let expected = RAW_ENCODE_WORKS_EXPECTED;
        assert_eq!(encoded, expected);
        assert_eq!(decode_all(&encoded).unwrap(), plain);
    }

    #[test]
    fn test_issue_2() {
        // See: https://github.com/sile/libflate/issues/2
        assert_encode_decode!([
            163, 181, 167, 40, 62, 239, 41, 125, 189, 217, 61, 122, 20, 136, 160, 178, 119, 217,
            217, 41, 125, 189, 97, 195, 101, 47, 170,
        ]);
        assert_encode_decode!([
            162, 58, 99, 211, 7, 64, 96, 36, 57, 155, 53, 166, 76, 14, 238, 66, 66, 148, 154, 124,
            162, 58, 99, 188, 138, 131, 171, 189, 54, 229, 192, 38, 29, 240, 122, 28,
        ]);
        assert_encode_decode!([
            239, 238, 212, 42, 5, 46, 186, 67, 122, 247, 30, 61, 219, 62, 228, 202, 164, 205, 139,
            109, 99, 181, 99, 181, 99, 122, 30, 12, 62, 46, 27, 145, 241, 183, 137,
        ]);
        assert_encode_decode!([
            88, 202, 64, 12, 125, 108, 153, 49, 164, 250, 71, 19, 4, 108, 111, 108, 237, 205, 208,
            77, 217, 100, 118, 49, 10, 64, 12, 125, 51, 202, 69, 67, 181, 146, 86,
        ]);
    }
}

Help

Keyboard Shortcuts

?

Show this help dialog

S

Focus the search field

↑

Move up in search results

↓

Move down in search results

↹

Switch tab

⏎

Go to active search result

+

Expand all sections

-

Collapse all sections

Search Tricks

Prefix searches with a type followed by a colon (e.g. fn:) to restrict the search to a given type.

Accepted types are: fn, mod, struct, enum, trait, type, macro, and const.

Search functions by type signature (e.g. vec -> usize or * -> vec)

Search multiple things at once by splitting your query with comma (e.g. str,u8 or String,struct:Vec,test)


/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json
{
    public partial class JsonArray
    {
        internal override object ToValue() =>  Count == 0 ? new object[0] : System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(this, each => each.ToValue()));
    }

}


#
# Copyright 2010-2011 Freescale Semiconductor, Inc.
#
# This program 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 2 of the License, or (at your option)
# any later version.
#

include $(TOPDIR)/config.mk

LIB	= $(obj)lib$(BOARD).o

COBJS-y	+= $(BOARD).o
COBJS-y	+= law.o
COBJS-y	+= tlb.o

SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS	:= $(addprefix $(obj),$(COBJS-y))
SOBJS	:= $(addprefix $(obj),$(SOBJS))

$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
	$(call cmd_link_o_target, $(OBJS))

#########################################################################

# defines $(obj).depend target
include $(SRCTREE)/rules.mk

sinclude $(obj).depend

#########################################################################


/*
 * Copyright (c) 2009-2017, Peter Abeles. All Rights Reserved.
 *
 * This file is part of Efficient Java Matrix Library (EJML).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.ejml.data;

/**
 * Interface for all complex 64 bit floating point rectangular matrices.
 *
 * @author Peter Abeles
 */
public interface ZMatrix extends Matrix {

    /**
     * Returns the complex value of the matrix's element
     * @param row Matrix element's row index..
     * @param col Matrix element's column index.
     * @param output Storage for the complex number
     */
    void get( int row , int col , Complex_F64 output );

    /**
     * Set's the complex value of the matrix's element
     *
     * @param row Matrix element's row index..
     * @param col Matrix element's column index.
     * @param real The real component
     * @param imaginary The imaginary component
     */
    void set( int row , int col , double real , double imaginary );

    /**
     * Returns the real component of the matrix's element.
     *
     * @param row Matrix element's row index..
     * @param col Matrix element's column index.
     * @return The specified element's value.
     */
    double getReal(int row, int col);

    /**
     * Sets the real component of the matrix's element.
     *
     * @param row Matrix element's row index..
     * @param col Matrix element's column index.
     * @param val  The element's new value.
     */
    void setReal(int row, int col, double val);

    /**
     * Returns the imaginary component of the matrix's element.
     *
     * @param row Matrix element's row index..
     * @param col Matrix element's column index.
     * @return The specified element's value.
     */
    double getImag(int row, int col);

    /**
     * Sets the imaginary component of the matrix's element.
     *
     * @param row Matrix element's row index..
     * @param col Matrix element's column index.
     * @param val  The element's new value.
     */
    void setImag(int row, int col, double val);

    /**
     * Returns the number of elements in the internal data array
     *
     * @return Number of elements in the data array.
     */
    int getDataLength();

}


/*
 * Windfarm PowerMac thermal control. Generic PID helpers
 *
 * (c) Copyright 2005 Benjamin Herrenschmidt, IBM Corp.
 *                    <benh@kernel.crashing.org>
 *
 * Released under the term of the GNU GPL v2.
 */

#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/module.h>

#include "windfarm_pid.h"

#undef DEBUG

#ifdef DEBUG
#define DBG(args...)	printk(args)
#else
#define DBG(args...)	do { } while(0)
#endif

void wf_pid_init(struct wf_pid_state *st, struct wf_pid_param *param)
{
	memset(st, 0, sizeof(struct wf_pid_state));
	st->param = *param;
	st->first = 1;
}
EXPORT_SYMBOL_GPL(wf_pid_init);

s32 wf_pid_run(struct wf_pid_state *st, s32 new_sample)
{
	s64	error, integ, deriv;
	s32	target;
	int	i, hlen = st->param.history_len;

	/* Calculate error term */
	error = new_sample - st->param.itarget;

	/* Get samples into our history buffer */
	if (st->first) {
		for (i = 0; i < hlen; i++) {
			st->samples[i] = new_sample;
			st->errors[i] = error;
		}
		st->first = 0;
		st->index = 0;
	} else {
		st->index = (st->index + 1) % hlen;
		st->samples[st->index] = new_sample;
		st->errors[st->index] = error;
	}

	/* Calculate integral term */
	for (i = 0, integ = 0; i < hlen; i++)
		integ += st->errors[(st->index + hlen - i) % hlen];
	integ *= st->param.interval;

	/* Calculate derivative term */
	deriv = st->errors[st->index] -
		st->errors[(st->index + hlen - 1) % hlen];
	deriv /= st->param.interval;

	/* Calculate target */
	target = (s32)((integ * (s64)st->param.gr + deriv * (s64)st->param.gd +
		  error * (s64)st->param.gp) >> 36);
	if (st->param.additive)
		target += st->target;
	target = max(target, st->param.min);
	target = min(target, st->param.max);
	st->target = target;

	return st->target;
}
EXPORT_SYMBOL_GPL(wf_pid_run);

void wf_cpu_pid_init(struct wf_cpu_pid_state *st,
		     struct wf_cpu_pid_param *param)
{
	memset(st, 0, sizeof(struct wf_cpu_pid_state));
	st->param = *param;
	st->first = 1;
}
EXPORT_SYMBOL_GPL(wf_cpu_pid_init);

s32 wf_cpu_pid_run(struct wf_cpu_pid_state *st, s32 new_power, s32 new_temp)
{
	s64	integ, deriv, prop;
	s32	error, target, sval, adj;
	int	i, hlen = st->param.history_len;

	/* Calculate error term */
	error = st->param.pmaxadj - new_power;

	/* Get samples into our history buffer */
	if (st->first) {
		for (i = 0; i < hlen; i++) {
			st->powers[i] = new_power;
			st->errors[i] = error;
		}
		st->temps[0] = st->temps[1] = new_temp;
		st->first = 0;
		st->index = st->tindex = 0;
	} else {
		st->index = (st->index + 1) % hlen;
		st->powers[st->index] = new_power;
		st->errors[st->index] = error;
		st->tindex = (st->tindex + 1) % 2;
		st->temps[st->tindex] = new_temp;
	}

	/* Calculate integral term */
	for (i = 0, integ = 0; i < hlen; i++)
		integ += st->errors[(st->index + hlen - i) % hlen];
	integ *= st->param.interval;
	integ *= st->param.gr;
	sval = st->param.tmax - (s32)(integ >> 20);
	adj = min(st->param.ttarget, sval);

	DBG("integ: %lx, sval: %lx, adj: %lx\n", integ, sval, adj);

	/* Calculate derivative term */
	deriv = st->temps[st->tindex] -
		st->temps[(st->tindex + 2 - 1) % 2];
	deriv /= st->param.interval;
	deriv *= st->param.gd;

	/* Calculate proportional term */
	prop = st->last_delta = (new_temp - adj);
	prop *= st->param.gp;

	DBG("deriv: %lx, prop: %lx\n", deriv, prop);

	/* Calculate target */
	target = st->target + (s32)((deriv + prop) >> 36);
	target = max(target, st->param.min);
	target = min(target, st->param.max);
	st->target = target;

	return st->target;
}
EXPORT_SYMBOL_GPL(wf_cpu_pid_run);

MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
MODULE_DESCRIPTION("PID algorithm for PowerMacs thermal control");
MODULE_LICENSE("GPL");


<!DOCTYPE html>
<html>
  <head>
    <title>Test</title>
  </head>
  <body>
    <script>
      var varGloballyDeclared = 1
      let letGloballyDeclared = 1
      function functionGloballyDeclared() {}
      class ClassGloballyDeclared {}

      varNotYetGloballyDeclared
      letNotYetGloballyDeclared
      functionNotYetGloballyDeclared
      ClassNotYetGloballyDeclared
    </script>

    <script>
      var varNotYetGloballyDeclared = 2
      let letNotYetGloballyDeclared = 2
      function functionNotYetGloballyDeclared() {}
      class ClassNotYetGloballyDeclared {}

      varGloballyDeclared
      letGloballyDeclared
      functionGloballyDeclared
      ClassGloballyDeclared
    </script>
  </body>
</html>


export let node = {
	theDomNode: true
};


"use strict";

exports.__generic = function (t, a) {
	var iterator = t.call(this);
	a.deep(iterator.next(), { value: [0, "1"], done: false });
	a.deep(iterator.next(), { value: [1, "2"], done: false });
	a.deep(iterator.next(), { value: [2, "3"], done: false });
	a.deep(iterator.next(), { value: undefined, done: true });
};


package com.github.eclipsecolortheme.mapper;

import org.eclipse.core.runtime.preferences.IEclipsePreferences;

import com.github.eclipsecolortheme.ColorThemeMapping;
import com.github.eclipsecolortheme.ColorThemeSemanticHighlightingMapping;
import com.github.eclipsecolortheme.ColorThemeSetting;

/**
 * Maps color themes to preferences for Eclipse's XML, HTML and CSS editors.
 */
public class WebEditorMapper extends GenericMapper {
    @Override
    protected ColorThemeMapping createMapping(String pluginKey, String themeKey) {
        return new Mapping(pluginKey, themeKey);
    }

    @Override
    protected ColorThemeSemanticHighlightingMapping createSemanticHighlightingMapping(
            String pluginKey, String themeKey) {
        return new SemanticMapping(pluginKey, themeKey);
    }

    private class Mapping extends ColorThemeMapping {
        public Mapping(String pluginKey, String themeKey) {
            super(pluginKey, themeKey);
        }

        @Override
        public void putPreferences(IEclipsePreferences preferences,
                ColorThemeSetting setting) {
            String value = setting.getColor().asHex() + " | "
                    + defaultBackground.getHexColorOrNull() + " | "
                    + setting.isBoldEnabled() + " | "
                    + setting.isItalicEnabled() + " | "
                    + setting.isStrikethroughEnabled() + " | "
                    + setting.isUnderlineEnabled();
            preferences.put(pluginKey, value);
        }
    }

    private class SemanticMapping extends ColorThemeSemanticHighlightingMapping {
        public SemanticMapping(String pluginKey, String themeKey) {
            super(pluginKey, themeKey);
        }

        @Override
        public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) {
            super.putPreferences(preferences, setting);
            preferences.put(pluginKey + separator + "color", setting.getColor().asHex());
        }
    }
}


\input{fontspec-testsetup.tex}
\usepackage{fontspec}
\begin{document}

\aliasfontfeature{Numbers}{123}
\aliasfontfeatureoption{Numbers}{Lining}{UC}
\aliasfontfeatureoption{Numbers}{OldStyle}{LC}

\fontspec[123=UC]{texgyrepagella-regular.otf}
Numbers: 12345
\CURRNFSS

\fontspec[123=LC]{texgyrepagella-regular.otf}
Numbers: 12345
\CURRNFSS

\end{document}


import React, { useMemo, useContext, useRef, Children } from 'react';
import {
  State,
  Component,
  ChildElement,
  HTMLType
} from '../../interfaces/Interfaces';
import { useDrag, useDrop, DropTargetMonitor } from 'react-dnd';
import { ItemTypes } from '../../constants/ItemTypes';
import { stateContext } from '../../context/context';
import { combineStyles } from '../../helperFunctions/combineStyles';
import IndirectChild from './IndirectChild';
import HTMLTypes from '../../context/HTMLTypes';
import globalDefaultStyle from '../../public/styles/globalDefaultStyles';

function DirectChildComponent({ childId, type, typeId, style }: ChildElement) {
  const [state, dispatch] = useContext(stateContext);
  const ref = useRef(null);

  // find the top-level component corresponding to this instance of the component
  // find the current component to render on the canvas
  const referencedComponent: Component = state.components.find(
    (elem: Component) => elem.id === typeId
  );

  const [{ isDragging }, drag] = useDrag({
    // setting item attributes to be referenced when updating state with new instance of dragged item
    item: {
      type: ItemTypes.INSTANCE,
      newInstance: false,
      childId: childId,
      instanceType: type,
      instanceTypeId: typeId
    },
    collect: monitor => ({
      isDragging: !!monitor.isDragging()
    })
  });

  const changeFocus = (componentId: number, childId: number | null) => {
    dispatch({ type: 'CHANGE FOCUS', payload: { componentId, childId } });
  };

  // onClickHandler is responsible for changing the focused component and child component
  function onClickHandler(event) {
    event.stopPropagation();
    changeFocus(state.canvasFocus.componentId, childId);
  }

  // combine all styles so that higher priority style specifications overrule lower priority style specifications
  // priority order is 1) style directly set for this child (style), 2) style of the referenced component, and 3) default styling
  const interactiveStyle = {
    border:
      state.canvasFocus.childId === childId
        ? '3px solid rgb(11,212,112)'
        : '1px Solid grey',
    boxShadow:
      state.canvasFocus.childId === childId ? '1px 1px 3px rgb(11,212,112)' : ''
  };

  const combinedStyle = combineStyles(
    combineStyles(
      combineStyles(globalDefaultStyle, referencedComponent.style),
      style
    ),
    interactiveStyle
  );

  // helper function to render children of direct child components
  // all children of direct child components will be indirect components
  // indirect child components are not interactive with the exception of route links which, when clicked, will change the canvas focus
  const renderIndirectChildren = (
    referencedComponent: Component | ChildElement
  ) => {
    // iterate through all children of referenced
    return referencedComponent.children.map(child => {
      if (child.type === 'Component') {
        // If indirect child of referenced component is a component, find the top level component referenced by the child
        const childReferencedComponent: Component = state.components.find(
          (elem: Component) => elem.id === child.typeId
        );
        // combine the styles of the child with the reference component but give higher priority to the child's styles
        const combinedStyle = combineStyles(
          childReferencedComponent.style,
          child.style
        );
        // render an IndirectChild component, and also call renderIndirectChildren recursively to render any of the child Component's children
        return (
          <IndirectChild
            // combine styles of instance and referenced component. instance styles have higher priority
            key={
              'indChild' + child.childId.toString() + child.typeId.toString()
            }
            style={combinedStyle}
            placeHolder=""
            linkId={null}
          >
            {renderIndirectChildren(childReferencedComponent)}
          </IndirectChild>
        );
      } else if (child.type === 'HTML Element') {
        // if indirect chidl is an HTML element, render an IndirectChild component with no children
        // if the HTML element has children, then also render its children
        // get the default style/placeholder value for that type of HTML element
        // combine the default style of that HTML element and combine in with the custom styles applied to that element
        const HTMLType: HTMLType = HTMLTypes.find(
          (type: HTMLType) => type.id === child.typeId
        );
        const HTMLDefaultStyle = HTMLType.style;
        const HTMLDefaultPlacholder = HTMLType.placeHolderShort;
        const combinedStyle = combineStyles(HTMLDefaultStyle, child.style);
        return (
          <React.Fragment
            key={
              'indChildFrag' +
              child.childId.toString() +
              child.typeId.toString()
            }
          >
            {child.children.length === 0 ? (
              <IndirectChild
                style={combinedStyle}
                placeHolder={HTMLDefaultPlacholder}
                linkId={null}
                key={
                  'indChild' +
                  child.childId.toString() +
                  child.typeId.toString()
                }
              >
                {''}
              </IndirectChild>
            ) : (
              <IndirectChild
                style={combinedStyle}
                placeHolder={HTMLDefaultPlacholder}
                linkId={null}
                key={
                  'indChild' +
                  child.childId.toString() +
                  child.typeId.toString()
                }
              >
                {renderIndirectChildren(child)}
              </IndirectChild>
            )}
          </React.Fragment>
        );
      } else if (child.type === 'Route Link') {
        // Render a next.js route link
        // pass the component id of the component referenced in the link as a prop
        // IndirectChild will render the referenced component name as a clickable link
        return (
          <IndirectChild
            key={
              'indChild' + child.childId.toString() + child.typeId.toString()
            }
            style={combinedStyle}
            placeHolder=""
            linkId={child.typeId}
          >
            {''}
          </IndirectChild>
        );
      }
    });
  };
  return (
    <div
      onClick={onClickHandler}
      // key={'childComp' + childId}
      style={combinedStyle}
      ref={drag}
    >
      {renderIndirectChildren(referencedComponent)}
    </div>
  );
}

export default DirectChildComponent;


module Types

open System

type PersonalDetails = {
    FirstName: string
    LastName: string
    DateOfBirth: DateTime
}

[<Measure>] type EUR
[<Measure>] type USD

type Notifications =
    | NoNotifications
    | ReceiveNotifications of receiveDeals: bool * receiveAlerts: bool

type Customer = {
    Id: int
    IsVip: bool
    Credit: decimal<USD>
    PersonalDetails: PersonalDetails option
    Notifications: Notifications
}


import React, { PropTypes } from 'react';
import Codemirror from 'react-codemirror';
import CodeMirror from 'codemirror/lib/codemirror';
import { _ } from 'meteor/underscore';
import 'codemirror/mode/sql/sql';
import 'codemirror/lib/codemirror.css';
import 'codemirror/addon/search/searchcursor';

class SQLEditor extends React.Component {
  constructor(props) {
    super(props);
    this.keywords = _.extend(CodeMirror.resolveMode('text/x-sql').keywords, {
      case: true,
      when: true,
      then: true,
      else: true,
      end: true,
      offset: true,
    });
    CodeMirror.extendMode('text/x-sql', { keywords: this.keywords });
  }
  render() {
    const codemirrorOptions = {
      mode: 'text/x-sql',
      lineWrapping: true,
      indentWithTabs: true,
      matchBrackets: true,
      lineNumbers: true,
      indentUnit: 4,
      autofocus: true,
      // readOnly: true,
    };
    const { query, onChange } = this.props;
    return (
      <Codemirror
        value={query}
        options={codemirrorOptions}
        onChange={onChange}
      />
    );
  }
}

SQLEditor.propTypes = {
  query: PropTypes.string,
  onChange: PropTypes.func,
};

export default SQLEditor;


# Python basics

Python is a nice language, you can add stuff. Bla bla bla.

Some more nice content ....

[Cool stuff](http://gitbook.io)

[Link to another Markdown file](./xyz/file.md)

And look at this pretty picture:
![Pretty](../assets/my-pretty-picture.png "Pretty")

Lets go for another exercise but this time with some context :


package api

const PluginName = "ClusterResourceOverride"
const ConfigKind = "ClusterResourceOverrideConfig"


/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(null, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define("@angular/common/locales/br", ["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    // THIS CODE IS GENERATED - DO NOT MODIFY
    // See angular/tools/gulp-tasks/cldr/extract.js
    var u = undefined;
    function plural(n) {
        if (n % 10 === 1 && !(n % 100 === 11 || n % 100 === 71 || n % 100 === 91))
            return 1;
        if (n % 10 === 2 && !(n % 100 === 12 || n % 100 === 72 || n % 100 === 92))
            return 2;
        if (n % 10 === Math.floor(n % 10) && (n % 10 >= 3 && n % 10 <= 4 || n % 10 === 9) &&
            !(n % 100 >= 10 && n % 100 <= 19 || n % 100 >= 70 && n % 100 <= 79 ||
                n % 100 >= 90 && n % 100 <= 99))
            return 3;
        if (!(n === 0) && n % 1e6 === 0)
            return 4;
        return 5;
    }
    exports.default = [
        'br', [['am', 'gm'], ['A.M.', 'G.M.'], u], [['A.M.', 'G.M.'], u, u],
        [
            ['Su', 'L', 'Mz', 'Mc', 'Y', 'G', 'Sa'], ['Sul', 'Lun', 'Meu.', 'Mer.', 'Yaou', 'Gwe.', 'Sad.'],
            ['Sul', 'Lun', 'Meurzh', 'Mercʼher', 'Yaou', 'Gwener', 'Sadorn'],
            ['Sul', 'Lun', 'Meu.', 'Mer.', 'Yaou', 'Gwe.', 'Sad.']
        ],
        u,
        [
            ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
            [
                'Gen.', 'Cʼhwe.', 'Meur.', 'Ebr.', 'Mae', 'Mezh.', 'Goue.', 'Eost', 'Gwen.', 'Here', 'Du',
                'Kzu.'
            ],
            [
                'Genver', 'Cʼhwevrer', 'Meurzh', 'Ebrel', 'Mae', 'Mezheven', 'Gouere', 'Eost', 'Gwengolo',
                'Here', 'Du', 'Kerzu'
            ]
        ],
        u, [['a-raok J.K.', 'goude J.K.'], u, ['a-raok Jezuz-Krist', 'goude Jezuz-Krist']], 1, [6, 0],
        ['dd/MM/y', 'd MMM y', 'd MMMM y', 'EEEE d MMMM y'],
        ['HH:mm', 'HH:mm:ss', 'HH:mm:ss z', 'HH:mm:ss zzzz'],
        ['{1} {0}', '{1}, {0}', '{1} \'da\' {0}', u],
        [',', ' ', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],
        ['#,##0.###', '#,##0 %', '#,##0.00 ¤', '#E0'], '€', 'euro', {
            'AUD': ['$A', '$'],
            'BRL': [u, 'R$'],
            'CAD': ['$CA', '$'],
            'CNY': [u, '¥'],
            'EGP': [u, '£ E'],
            'GBP': ['£ RU', '£'],
            'HKD': ['$ HK', '$'],
            'ILS': [u, '₪'],
            'JPY': [u, '¥'],
            'KRW': [u, '₩'],
            'LBP': [u, '£L'],
            'NZD': ['$ ZN', '$'],
            'TOP': [u, '$ T'],
            'TWD': [u, '$'],
            'USD': ['$ SU', '$'],
            'VND': [u, '₫'],
            'XCD': [u, '$']
        },
        plural
    ];
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21tb24vbG9jYWxlcy9ici50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7OztJQUVILHlDQUF5QztJQUN6QywrQ0FBK0M7SUFFL0MsSUFBTSxDQUFDLEdBQUcsU0FBUyxDQUFDO0lBRXBCLGdCQUFnQixDQUFTO1FBQ3ZCLElBQUksQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsR0FBRyxHQUFHLEtBQUssRUFBRSxJQUFJLENBQUMsR0FBRyxHQUFHLEtBQUssRUFBRSxJQUFJLENBQUMsR0FBRyxHQUFHLEtBQUssRUFBRSxDQUFDO1lBQUUsT0FBTyxDQUFDLENBQUM7UUFDcEYsSUFBSSxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxHQUFHLEdBQUcsS0FBSyxFQUFFLElBQUksQ0FBQyxHQUFHLEdBQUcsS0FBSyxFQUFFLElBQUksQ0FBQyxHQUFHLEdBQUcsS0FBSyxFQUFFLENBQUM7WUFBRSxPQUFPLENBQUMsQ0FBQztRQUNwRixJQUFJLENBQUMsR0FBRyxFQUFFLEtBQUssSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLEdBQUcsRUFBRSxDQUFDLElBQUksQ0FBQyxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsQ0FBQztZQUM3RSxDQUFDLENBQUMsQ0FBQ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+KCqyddLFxuICAgICdYQ0QnOiBbdSwgJyQnXVxuICB9LFxuICBwbHVyYWxcbl07XG4iXX0=


<?php

/**
 * MIT License. This file is part of the Propel package.
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Propel\Tests\Common\Util;

use PHPUnit\Framework\TestCase;
use Propel\Common\Util\SetColumnConverter;

/**
 * Tests for SetColumnConverter class.
 *
 * @author Moritz Schroeder <moritz.schroeder@molabs.de>
 */
class SetColumnConverterTest extends TestCase
{
    /**
     * @dataProvider convertValuesProvider
     *
     * @param array $values
     * @param string $validInteger
     *
     * @return void
     */
    public function testConvertToIntValidValues(array $values, $validInteger)
    {
        $valueSet = ['a', 'b', 'c', 'd', 'e', 'f'];
        $intValue = SetColumnConverter::convertToInt($values, $valueSet);
        $this->assertEquals($validInteger, $intValue);
    }

    /**
     * @return void
     */
    public function testConvertToIntStringValue()
    {
        $valueSet = ['a', 'b', 'c', 'd', 'e', 'f'];
        $intValue = SetColumnConverter::convertToInt('c', $valueSet);
        $this->assertEquals('4', $intValue);
    }

    /**
     * @return void
     */
    public function testConvertToIntNullValue()
    {
        $valueSet = ['a', 'b', 'c', 'd', 'e', 'f'];
        $intValue = SetColumnConverter::convertToInt(null, $valueSet);
        $this->assertEquals('0', $intValue);
    }

    /**
     * @expectedException \Propel\Common\Exception\SetColumnConverterException
     *
     * @return void
     */
    public function testConvertToIntValueNotInSet()
    {
        $valueSet = ['a', 'b', 'c', 'd', 'e', 'f'];
        SetColumnConverter::convertToInt(['g'], $valueSet);
    }

    /**
     * @dataProvider convertValuesProvider
     *
     * @param array $validArray
     * @param string $intValue
     *
     * @return void
     */
    public function testConvertIntToArrayValidValues(array $validArray, $intValue)
    {
        $valueSet = ['a', 'b', 'c', 'd', 'e', 'f'];
        $arrayValue = SetColumnConverter::convertIntToArray($intValue, $valueSet);
        $this->assertEquals($validArray, $arrayValue);
    }

    /**
     * @return void
     */
    public function testConvertIntToArrayNullValue()
    {
        $valueSet = ['a', 'b', 'c', 'd', 'e', 'f'];
        $arrayValue = SetColumnConverter::convertIntToArray(null, $valueSet);
        $this->assertEquals([], $arrayValue);
    }

    /**
     * @expectedException \Propel\Common\Exception\SetColumnConverterException
     *
     * @return void
     */
    public function testConvertIntToArrayIntOutOfRange()
    {
        $valueSet = ['a', 'b', 'c', 'd', 'e', 'f'];
        SetColumnConverter::convertIntToArray('65', $valueSet);
    }

    public function convertValuesProvider()
    {
        return [
            [['a'],             '1'],
            [['a', 'f'],        '33'],
            [['a', 'e', 'f'],   '49'],
            [['e', 'f'],        '48'],
        ];
    }
}


/*    dP   dP                                                                  dP        */
/*    88   88                                                                  88        */
/*  d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b.    88d888b. .d8888b. 88d888b. 88  .dP   */
/*    88   88'  `88 88ooood8 88'`88'`88 88ooood8    88'  `88 88'  `88 88'  `88 88888"    */
/*    88   88    88 88.  ... 88  88  88 88.  ...    88.  .88 88.  .88 88       88  `8b.  */
/*    dP   dP    dP `88888P' dP  dP  dP `88888P' 88 88Y888P' `88888P8 dP       dP   `YP  */
/*                                                  88                                   */
/*                                                  dP					 */

/*		   		        Made by @gilbN					 */
/*			      https://github.com/gilbN/theme.park			 */

/* HTML5SPEEDTEST AQUAMARINE THEME */
@import url(https://gilbn.github.io/theme.park/CSS/themes/html5speedtest/html5speedtest-base.css);
:root {
  --main-bg-color: radial-gradient(ellipse at center, #47918a 0%, #0b3161 100%) center center/cover no-repeat fixed;
  --start-button-color:  radial-gradient(ellipse at center, #3F51B5 0%, #009688 100%) center center/cover no-repeat fixed;
  --start-button-color-hover: radial-gradient(ellipse at center, #5066e0 0%, #01ccb9 100%) center center/cover no-repeat fixed;
}


<?xml version="1.0" encoding="UTF-8"?>
<searchresults total_results="1">
  <addon id="5612">
  <name>Unsigned Test XPI</name>
  <type id="1">Extension</type>
  <guid>unsigned-xpi@tests.mozilla.org</guid>
  <slug>unsigned-xpi</slug>
  <version>1.0</version>

  <compatible_applications><application>
      <name>Firefox</name>
      <application_id>1</application_id>
      <min_version>3.6</min_version>
      <max_version>*</max_version>
      <appID>{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}</appID>
    </application></compatible_applications>
  <all_compatible_os><os>ALL</os></all_compatible_os>

  <install os="ALL" size="452">http://127.0.0.1:4567/addons/unsigned.xpi</install>
    <created epoch="1252903662">
      2009-09-14T04:47:42Z
    </created>
    <last_updated epoch="1315255329">
      2011-09-05T20:42:09Z
    </last_updated>
    </addon>
</searchresults>


/****************************************************************************
 *
 * Copyright 2018 Samsung Electronics All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 *
 ****************************************************************************/
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <string>

//       reverse_iterator rbegin();
// const_reverse_iterator rbegin() const;

#include <string>
#include <cassert>
#include "test_macros.h"
#include "libcxx_tc_common.h"

template <class S>
static int
test(S s)
{
    const S& cs = s;
    typename S::reverse_iterator b = s.rbegin();
    typename S::const_reverse_iterator cb = cs.rbegin();
    if (!s.empty())
    {
        TC_ASSERT_EXPR(*b == s.back());
    }
    TC_ASSERT_EXPR(b == cb);
    return 0;
}

int tc_libcxx_strings_string_iterators_rbegin(void)
{
    {
    typedef std::string S;
    TC_ASSERT_FUNC((test(S())));
    TC_ASSERT_FUNC((test(S("123"))));
    }
    TC_SUCCESS_RESULT();
    return 0;
}