text:
namespace cert_trans {

// Provides a fixed size thread pool to run closures on. The pool is
// sized according to the number of cores in the system.
class ThreadPool : public util::Executor {
 public:
  // Creates the threads.
  ThreadPool();

  // Creates the threads.
  ThreadPool(size_t num_threads);

  // The destructor will wait for any outstanding closures to finish.
  ~ThreadPool();

  ThreadPool(const ThreadPool&) = delete;
  ThreadPool& operator=(const ThreadPool&) = delete;

  // Arranges for "closure" to be called in the thread pool. The
  // function must not be empty.
  void Add(const std::function<void()>& closure) override;

  void Delay(const std::chrono::duration<double>& delay,
             util::Task* task) override;

 private:
  class Impl;
  const std::unique_ptr<Impl> impl_;
};

}  // namespace cert_trans

#endif  // CERT_TRANS_UTIL_THREAD_POOL_H_


text:
-	[`1.3.2`, `1.3`, `1`, `latest` (*1.3/Dockerfile*)](https://github.com/composer/docker/blob/0a198f372bd82ae7473c38b05c9ae195f9088abe/1.3/Dockerfile)
-	[`1.2.4`, `1.2` (*1.2/Dockerfile*)](https://github.com/composer/docker/blob/690f3d623ac1ba30be337a254b2126584e6e2aa5/1.2/Dockerfile)
-	[`1.1.3`, `1.1` (*1.1/Dockerfile*)](https://github.com/composer/docker/blob/be6ecf58913f704399d11a352818b22951832a60/1.1/Dockerfile)

For more information about this image and its history, please see [the relevant manifest file (`library/composer`)](https://github.com/docker-library/official-images/blob/master/library/composer). This image is updated via [pull requests to the `docker-library/official-images` GitHub repo](https://github.com/docker-library/official-images/pulls?q=label%3Alibrary%2Fcomposer).

For detailed information about the virtual/transfer sizes and individual layers of each of the above supported tags, please see [the `repos/composer/tag-details.md` file](https://github.com/docker-library/repo-info/blob/master/repos/composer/tag-details.md) in [the `docker-library/repo-info` GitHub repo](https://github.com/docker-library/repo-info).

# What is Composer?

Composer is a tool for dependency management in PHP, written in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

You can read more about Composer in our [official documentation](https://getcomposer.org/doc/).

![logo](https://raw.githubusercontent.com/docker-library/docs/58f7363e6cfa78f8cd54af16eab51c63c1232002/composer/logo.png)

# Using

Run the `composer` image:

```sh
docker run --rm --interactive --tty \
    --volume $PWD:/app \
    composer install
```

You can mount the Composer home directory from your host inside the Container to share caching and configuration files:

```sh
docker run --rm --interactive --tty \
    --volume $PWD:/app \
    --volume $COMPOSER_HOME:/composer \
    composer install
```

By default, Composer runs as root inside the container. This can lead to permission issues on your host filesystem. You can run Composer as your local user:

```sh
docker run --rm --interactive --tty \
    --volume $PWD:/app \
    --user $(id -u):$(id -g) \
    composer install
```

When you need to access private repositories, you will either need to share your configured credentials, or mount your `ssh-agent` socket inside the running container:

```sh
docker run --rm --interactive --tty \
    --volume $PWD:/app \
    --volume $SSH_AUTH_SOCK:/ssh-auth.sock \
    --env SSH_AUTH_SOCK=/ssh-auth.sock \
    composer install
```

## Suggestions

### PHP Extensions

We strive to deliver an image that is as lean as possible, aimed at running Composer only.

Sometimes dependencies or Composer [scripts](https://getcomposer.org/doc/articles/scripts.md) require the availability of certain PHP extensions. In this scenario, you have two options:

-	Pass the `--ignore-platform-reqs` and `--no-scripts` flags to `install` or `update`:

	```sh
	docker run --rm --interactive --tty \
	    --volume $PWD:/app \
	    composer install --ignore-platform-reqs --no-scripts
	```

-	Create your own image (possibly by extending `FROM composer`).

### Local runtime/binary

If you want to be able to run `composer` as if it was installed on your host locally, you can define the following function in your `~/.bashrc`, `~/.zshrc` or similar:

```sh
composer () {
    tty=
    tty -s && tty=--tty
    docker run \
        $tty \
        --interactive \
        --rm \
        --user $(id -u):$(id -g) \
        --volume $(pwd):/app \
        composer "$@"
}
```

# License

View [license information](https://github.com/composer/composer/blob/master/LICENSE) for the software contained in this image.

# Supported Docker versions

This image is officially supported on Docker version 1.13.0.

Support for older versions (down to 1.6) is provided on a best-effort basis.

Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.

# User Feedback

## Issues

If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/composer/docker/issues). If the issue is related to a CVE, please check for [a `cve-tracker` issue on the `official-images` repository first](https://github.com/docker-library/official-images/issues?q=label%3Acve-tracker).

You can also reach us through the `#composer` or `#docker-library` IRC channels on [Freenode](https://freenode.net).

## Contributing

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/composer/docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.

## Documentation

Documentation for this image is stored in the [`composer/` directory](https://github.com/docker-library/docs/tree/master/composer) of the [`docker-library/docs` GitHub repo](https://github.com/docker-library/docs). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/docker-library/docs/blob/master/README.md) before attempting a pull request.

redpajama_set_name: RedPajamaGithub


text:
var mokuaiCoffee = require('../mokuai-coffee');
var readFile = require('./utils/readFile');
var fixtures = require('./utils/fixtures');

var expected = readFile(__dirname+'/expected/custom.jollyjumper.js');

exports.testCustomJollyJumper = function(test){
    var result = mokuaiCoffee({
        JollyJumper: readFile(fixtures.modules.Horse),
        Animal: readFile(fixtures.modules.Animal)
    }, {
        exports: 'JollyJumper'
    });

    test.equals(result, expected);
    test.done();
};

exports.testCustomJollyJumperFromFiles = function(test){
    var result = mokuaiCoffee.fromFiles({
        JollyJumper: fixtures.modules.Horse,
        Animal: fixtures.modules.Animal
    }, {
        exports: 'JollyJumper'
    });

    test.equals(result, expected);
    test.done();
};


text:
namespace Codelet.Domain
{
  /// <summary>
  /// Domain model marker class.
  /// </summary>
  public abstract class DomainModel
  {
  }
}


text:
/**
 * Course 31
 * React Native API模块之AppStateIOS运行状态详解-适配iOS开发
 */
import React, { Component } from 'react';
import {
  StyleSheet,
  Text,
  View,
  AppStateIOS,
} from 'react-native';

import Util from '../utils';

export default class extends Component{
  constructor(props){
    super(props);
    this.state={
      //当前状态
      appState: AppStateIOS.currentState,
      //进行保存前一个状态
      previousAppStates: [],
      //内存警告
      memoryWarnings: 0,

    };
    this._handleAppStateChange = this.handleAppStateChange.bind(this);
    this._handleMemoryWarning = this.handleMemoryWarning.bind(this);
  }
  //添加监听事件
  componentDidMount() {
    console.log('componentDidMount invoke...');
    AppStateIOS.addEventListener('change', this._handleAppStateChange);
    AppStateIOS.addEventListener('memoryWarning', this._handleMemoryWarning);
  }
  //移除监听事件
  componentWillUnmount() {
    console.log('componentWillUnmount invoke...');
    AppStateIOS.removeEventListener('change', this._handleAppStateChange);
    AppStateIOS.addEventListener('memoryWarning', this._handleMemoryWarning);
  }
  //状态处理
  handleAppStateChange(appState) {
    var previousAppStates = this.state.previousAppStates.slice();
    previousAppStates.push(this.state.appState);
    this.setState({
      appState,
      previousAppStates,
    });
  }
  handleMemoryWarning() {
    this.setState({memoryWarnings: this.state.memoryWarnings + 1});
  }
  render() {
    return (
      <View style={styles.rootViewContainer}>
        <Text style={styles.welcome}>AppStateIOS实例</Text>
        <Text>当前的状态信息数组:{JSON.stringify(this.state.previousAppStates)}</Text>
        <Text>当前的状态信息为:{this.state.appState}</Text>
        <Text>当前的内存警告次数信息为:{this.state.memoryWarnings}</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  rootViewContainer:{
    marginTop : 70,
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    marginTop: 20,
    marginLeft:10,
  },
});


text:
"""Command-line tool to enumerate cycles in Graph structures."""

import argparse
import collections

from typing import Dict, List, Tuple

import serialization
import graph

Cycle = Tuple[graph.Node, ...]

def find_cycles_from_node(
    start_node: graph.Node,
    max_cycle_length: int,
    node_to_id: Dict[graph.Node, int],
) -> List[List[List[graph.Node]]]:
    """Finds all cycles starting at |start_node| in a subset of nodes.

    Only nodes with ID >= |start_node|'s ID will be considered. This ensures
    uniquely counting all cycles since this function is called on all nodes of
    the graph, one at a time in increasing order. Some justification: Consider
    cycle C with smallest node n. When this function is called on node n, C will
    be found since all nodes of C are >= n. After that call, C will never be
    found again since further calls are on nodes > n (n is removed from the
    search space).

    Cycles are found by recursively scanning all outbound nodes starting from
    |start_node|, up to a certain depth. Note this is the same idea, but is
    different from DFS since nodes can be visited more than once (to avoid
    missing cycles). An example of normal DFS (where nodes can only be visited
    once) missing cycles is in the following graph, starting at a:
    a <-> b <-> c
    ^           ^
    |           |
    +-----------+
    DFS(a)
        DFS(b)
            DFS(a) (cycle aba, return)
            DFS(c)
                DFS(b) (already seen, return)
                DFS(a) (cycle abca, return)
        DFS(c) (already seen, return)
    Since DFS(c) cannot proceed, we miss the cycles aca and acba.

    Args:
        start_node: The node to start the cycle search from. Only nodes with ID
          >= |start_node|'s ID will be considered.
        max_cycle_length: The maximum length of cycles to be found.
        node_to_id: A map from a Node to a generated ID.

    Returns:
        A list |cycles| of length |max_cycle_length| + 1, where cycles[i]
          contains all relevant cycles of length i.
    """
    start_node_id = node_to_id[start_node]
    cycles = [[] for _ in range(max_cycle_length + 1)]

    def edge_is_interesting(start: graph.Node, end: graph.Node) -> bool:
        if start == end:
            # Ignore self-loops.
            return False
        if node_to_id[end] < start_node_id:
            # Ignore edges ending at nodes with ID lower than the start.
            return False
        return True

    dfs_stack = collections.deque()
    on_stack: Dict[graph.Node, bool] = collections.defaultdict(bool)

    def find_cycles_dfs(cur_node: graph.Node, cur_length: int):
        for other_node in cur_node.outbound:
            if edge_is_interesting(cur_node, other_node):
                if other_node == start_node:
                    # We have found a valid cycle, add it to the list.
                    new_cycle = list(dfs_stack) + [cur_node, start_node]
                    cycles[cur_length + 1].append(new_cycle)

                elif (not on_stack[other_node]
                      and cur_length + 1 < max_cycle_length):
                    # We are only allowed to recurse into the next node if:
                    # 1) It hasn't been visited in the current cycle. This is
                    # because if the next node n _has_ been visited in the
                    # current cycle (i.e., it's on the stack), then we have
                    # found a cycle starting and ending at n. Since this
                    # function only returns cycles starting at |start_node|, we
                    # only care if |n = start_node| (which we already detect
                    # above).
                    # 2) It would not exceed the maximum depth allowed.
                    dfs_stack.append(cur_node)
                    on_stack[cur_node] = True
                    find_cycles_dfs(other_node, cur_length + 1)
                    dfs_stack.pop()
                    on_stack[cur_node] = False

    find_cycles_dfs(start_node, 0)
    return cycles

def find_cycles(base_graph: graph.Graph,
                max_cycle_length: int) -> List[List[Cycle]]:
    """Finds all cycles in the graph within a certain length.

    The algorithm is as such: Number the nodes arbitrarily. For i from 0 to
    the number of nodes, find all cycles starting and ending at node i using
    only nodes with numbers >= i (see find_cycles_from_node). Taking the union
    of the results will give all relevant cycles in the graph.

    Returns:
        A list |cycles| of length |max_cycle_length| + 1, where cycles[i]
          contains all cycles of length i.
    """
    sorted_base_graph_nodes = sorted(base_graph.nodes)
    # Some preliminary setup: map between the graph nodes' unique keys and a
    # unique number, since the algorithm needs some way to decide when a node is
    # 'bigger'. Nodes with a lower number will be processed first, which
    # influences the output cycles. For example, the cycle abca is also valid as
    # the cycle bcab or cabc. By numbering node a lower than b and c, it is
    # guaranteed that the cycle will be output as abca.
    node_to_id = {}
    for generated_node_id, node in enumerate(sorted_base_graph_nodes):
        node_to_id[node] = generated_node_id

    num_nodes = base_graph.num_nodes
    cycles = [[] for _ in range(max_cycle_length + 1)]

    for start_node in sorted_base_graph_nodes:
        start_node_cycles = find_cycles_from_node(start_node, max_cycle_length,
                                                  node_to_id)
        for cycle_length, cycle_list in enumerate(start_node_cycles):
            cycles[cycle_length].extend(cycle_list)

    # Convert cycles to be tuples of nodes, so the cycles are hashable and
    # immutable.
    immutable_cycles = []
    for cycle_list in cycles:
        immutable_cycles.append([tuple(cycle) for cycle in cycle_list])
    return immutable_cycles

def main():
    """Enumerates the cycles within a certain length in a graph."""

    arg_parser = argparse.ArgumentParser(
        description='Given a JSON dependency graph, count the number of cycles '
        'in the package graph.')
    required_arg_group = arg_parser.add_argument_group('required arguments')
    required_arg_group.add_argument(
        '-f',
        '--file',
        required=True,
        help='Path to the JSON file containing the dependency graph. '
        'See the README on how to generate this file.')
    required_arg_group.add_argument(
        '-l',
        '--cycle-length',
        type=int,
        required=True,
        help='The maximum length of cycles to find, at most 5 or 6 to keep the '
        'script runtime low.')
    arg_parser.add_argument(
        '-o',
        '--output',
        type=argparse.FileType('w'),
        help='Path to the file to write the list of cycles to.')
    args = arg_parser.parse_args()

    _, package_graph, _ = serialization.load_class_and_package_graphs_from_file(
        args.file)

    all_cycles = find_cycles(package_graph, args.cycle_length)
    # There are no cycles of length 0 or 1 (since self-loops are disallowed).
    nonzero_cycles = all_cycles[2:]

    print(f'Found {sum(len(cycles) for cycles in nonzero_cycles)} cycles.')

    for cycle_length, cycles in enumerate(nonzero_cycles, 2):
        print(f'Found {len(cycles)} cycles of length {cycle_length}.')

    if args.output is not None:
        print(f'Dumping cycles to {args.output.name}.')
        with args.output as output_file:
            for cycle_length, cycles in enumerate(nonzero_cycles, 2):
                output_file.write(f'Cycles of length {cycle_length}:\n')
                cycle_texts = []
                for cycle in cycles:
                    cycle_texts.append(' > '.join(cycle_node.name
                                                  for cycle_node in cycle))
                output_file.write('\n'.join(sorted(cycle_texts)))
                output_file.write('\n')

if __name__ == '__main__':
    main()


text:
<!DOCTYPE html>
<meta charset=utf-8>
<title>invalid multiple-img-with-script</title>
<picture></picture>


text:
We'd love to accept your patches and contributions to this project. There are
just a few small guidelines we ask you to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution,
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Reporting an Issue, Discussing Design, or Asking a Question

__IMPORTANT__: Any significant security issues should __NOT__ be reported in
the public issue tracker. Practice responsible disclosure by emailing
<joerichey@google.com> and <ebiggers@google.com> directly.

Any bugs, problems, or design discussion relating to fscrypt should be raised
in the [Github Issue Tracker](https://github.com/google/fscrypt/issues/new).

When reporting an issue or problem, be sure to give as much information as
possible. Also, make sure you are running the `fscrypt` and `pam_fscrypt.so`
built from the current `master` branch.

If reporting an issue around the fscrypt command-line tool, post the
relevant output from fscrypt, running with the `--verbose` flag. For the
`pam_fscrypt` module, use the `debug` option with the module and post the
relevant parts of the syslog (usually at `/var/log/syslog`).

Be sure to correctly tag your issue. The usage for the tags is as follows:
* `bug` - General problems with the program's behavior
	* The program crashes or hangs
	* Directories cannot be locked/unlocked
	* Metadata corruption
	* Data loss/corruption
* `documentation`
	* Typos or unclear explanations in `README.md` or man pages.
	* Outdated example output
	* Unclear or ambiguous error messages
* `enhancement` - Things you want in fscrypt
* `question` - You don't know how something works with fscrypt
	* This usually turns into a `documentation` issue.
* `testing` - Strange test failures or missing tests

## Submitting a Change to fscrypt

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

On every pull request, [GitHub
Actions](https://github.com/google/fscrypt/actions) runs tests, code formatters,
and linters. To pass these checks you should make sure that in your submission:
- `make` properly builds `fscrypt` and `pam_fscrypt.so`.
- All tests, including [integration tests](#running-integration-tests) and
  [command-line interface (CLI)
  tests](https://github.com/google/fscrypt/blob/master/cli-tests/README.md),
  should pass. If the CLI tests fail due to an expected change in output, you
  can use `make cli-test-update`.
- `make format` has been run.
- If you made any changes to files ending in `.proto`, the corresponding
  `.pb.go` files should be regenerated with `make gen`.
- Any issues found by `make lint` have been addressed.
- If any dependencies have changed, run `go mod tidy`.
- `make coverage.out` can be used to generate a coverage report for all of the
  tests, but isn't required for submission
  (ideally most code would be tested, we are far from that ideal).

Essentially, if you run:
```
make test-setup
make all
make test-teardown
make cli-test
go mod tidy
```
and everything succeeds, and no files are changed, you're good to submit.

The `Makefile` will automatically download and build any needed Go dependencies.
However, you'll also need to install some non-Go dependencies:
  - `make format` requires
    [`clang-format`](https://clang.llvm.org/docs/ClangFormat.html).
  - `make lint` requires [`shellcheck`](https://github.com/koalaman/shellcheck).
  - `make test-setup` and `make cli-test` require
    [`e2fsprogs`](https://en.wikipedia.org/wiki/E2fsprogs) version 1.43 or
    later.
  - `make cli-test` requires [`expect`](https://en.wikipedia.org/wiki/Expect)
    and
    [`keyutils`](https://manpages.debian.org/testing/keyutils/keyctl.1.en.html).

On Ubuntu, the following command installs the needed packages:
```
sudo apt-get install clang-format shellcheck e2fsprogs expect keyutils
```

### Running Integration Tests

Running `make test` will build each package and run the unit tests, but will
skip the integration tests. To run the integration tests, you will need a
filesystem that supports encryption. If you already have some empty filesystem
at `/foo/bar` that supports filesystem encryption, just run:
```bash
make test MOUNT=/foo/bar
```

Otherwise, you can use the `make test-setup`/`make test-teardown` commands to
create/destroy a test filesystem for running integration tests. By default, a
filesystem will be created (then destroyed) at `/tmp/fscrypt-mount` (using an
image file at `/tmp/fscrypt-image`). To create/test/destroy a filesystem at a
custom mountpoint `/foo/bar`, run:
```bash
make test-setup MOUNT=/foo/bar
make test MOUNT=/foo/bar
make test-teardown MOUNT=/foo/bar
```
Running the commands without `MOUNT=/foo/bar` uses the default locations.

Note that the setup/teardown commands require `sudo` to mount/unmount the
test filesystem.

### Changing dependencies

fscrypt's dependencies are managed using the
[Go module system](https://github.com/golang/go/wiki/Modules).
If you add or remove a dependency, be sure to update `go.mod` and `go.sum`.

Also, when adding a dependency, the license of the package must be compatible
with [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0). See the
[FSF's article](https://www.gnu.org/licenses/license-list.html) for more
information. This (unfortunately) means we cannot use external packages under
the [GPL](https://choosealicense.com/licenses/gpl-3.0) or
[LGPL](https://choosealicense.com/licenses/lgpl-3.0/). We also cannot use
packages with missing, misleading, or joke licenses (e.g.
[Unlicense](http://unlicense.org/), [WTFPL](http://www.wtfpl.net/),
[CC0](https://creativecommons.org/publicdomain/zero/1.0/)).

### Build System Details ###

Under the hood, the Makefile uses many go tools to generate, format, and lint
your code.

`make gen`:
  - Downloads [`protoc`](https://github.com/google/protobuf) to compile the
  `.proto` files.
  - Turns each `.proto` file into a matching `.pb.go` file using
    [`protoc-gen-go`](https://go.googlesource.com/protobuf/+/refs/heads/master/cmd/protoc-gen-go).

`make format` runs:
  - [`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports)
    on the `.go` files.
  - [`clang-format`](https://clang.llvm.org/docs/ClangFormat.html)
    on the `.c` and `.h` files.

`make lint` runs:
  - [`go vet`](https://golang.org/cmd/vet/)
  - [`golint`](https://github.com/golang/lint)
  - [`staticcheck`](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck)


text:
package storage

import (
	"encoding/binary"
	"io"

	"github.com/spf13/viper"

	"github.com/yaskoo/conteto/proto"
	"github.com/yaskoo/conteto/util"
)

func Save(r io.Reader, w io.Writer) error {
	id := util.Id()

	file, err := util.MkFile(viper.GetString("data.location"), "my_repo", id)
	if err != nil {
		return err
	}
	defer file.Close()

	fr := proto.NewReader(r)

	_, err = io.Copy(file, fr)

	println("lala copy")
	binary.Write(w, binary.BigEndian, proto.Ok)
	return err
}


text:
@interface Document : NSObject

//版本
@property (nonatomic ,copy,readonly) NSString *version;

//编码
@property (nonatomic ,copy,readonly) NSString *encoding;

//文档根结点
@property (nonatomic ,readonly,strong) Node *root;

//指定构造方法
-(id)initWithVersion:(NSString *)version encoding:(NSString *)encoding root:(Node *)root NS_DESIGNATED_INITIALIZER;

//默认版本,编码
- (instancetype)initWithRoot:(Node *)root;

@end


text:
using System;
using Newtonsoft.Json;

namespace WebExtras.JQPlot.RendererOptions
{
  /// <summary>
  /// OHLCRenderer options
  /// </summary>
  [Serializable]
  public class OHLCRendererOptions : IRendererOptions
  {
    /// <summary>
    /// Name of the associated renderer for which these options are
    /// </summary>
    [JsonIgnore]
    public string AssociatedRendererName { get { return "OHLCRenderer"; } }

    /// <summary>
    /// true to render chart as candleStick.  Must have an open
    /// price, cannot be a hlc chart.
    /// </summary>
    public bool? candleStick { get; set; }

    /// <summary>
    /// length of the line in pixels indicating open and close price.
    /// Default will auto calculate based on plot width and number
    /// of points displayed.
    /// </summary>
    public string tickLength { get; set; }

    /// <summary>
    /// width of the candlestick body in pixels. Default will auto
    /// calculate based on plot width and number of candlesticks displayed.
    /// </summary>
    public string bodyWidth { get; set; }

    /// <summary>
    /// color of the open price tick mark.  Default is series color.
    /// </summary>
    public string openColor { get; set; }

    /// <summary>
    /// color of the close price tick mark.  Default is series color.
    /// </summary>
    public string closeColor { get; set; }

    /// <summary>
    /// color of the hi-lo line thorugh the candlestick body.  Default is
    /// the series color.
    /// </summary>
    public string wickColor { get; set; }

    /// <summary>
    /// true to render an "up" day (close price greater than open price) with a filled candlestick body.
    /// </summary>
    public bool? fillUpBody { get; set; }

    /// <summary>
    /// true to render a "down" day (close price lower than open price) with a filled candlestick body.
    /// </summary>
    public bool? fillDownBody { get; set; }

    /// <summary>
    /// Color of candlestick body of an "up" day.  Default is series color.
    /// </summary>
    public string upBodyColor { get; set; }

    /// <summary>
    /// Color of candlestick body on a "down" day.  Default is series color.
    /// </summary>
    public string downBodyColor { get; set; }

    /// <summary>
    /// true if is a hi-low-close chart (no open price).  This is determined automatically from the series data.
    /// </summary>
    public bool? hlc { get; set; }

    /// <summary>
    /// Width of the hi-low line and open/close ticks.  Must be set in the rendererOptions for the series.
    /// </summary>
    public double? lineWidth { get; set; }
  }
}


text:
namespace whl{
//////////////////////////////////////////////////////////////////////////
class rmierror : public std::exception
{
public:
    rmierror( const std::string &info ) : m_info( info )
    {
    }

public:
#ifdef _MSC_VER
    virtual const char* what() const
#else
    virtual const char* what() const _GLIBCXX_USE_NOEXCEPT
#endif
    {
        return m_info.c_str();
    }

private:
    std::string m_info;
};
//////////////////////////////////////////////////////////////////////////
}// end namespace whl
//////////////////////////////////////////////////////////////////////////
#endif // WHL_RMI_ERROR_HPP_


text:
#ifndef TENSORFLOW_LITE_DELEGATES_XNNPACK_DEQUANTIZE_TESTER_H_
#define TENSORFLOW_LITE_DELEGATES_XNNPACK_DEQUANTIZE_TESTER_H_

#include <cstdint>
#include <vector>

#include <gtest/gtest.h>
#include "tensorflow/lite/core/c/common.h"
#include "tensorflow/lite/interpreter.h"
#include "tensorflow/lite/schema/schema_generated.h"

namespace tflite {
namespace xnnpack {

class DequantizeTester {
 public:
  DequantizeTester() = default;
  DequantizeTester(const DequantizeTester&) = delete;
  DequantizeTester& operator=(const DequantizeTester&) = delete;

  inline DequantizeTester& Shape(std::initializer_list<int32_t> shape) {
    for (auto it = shape.begin(); it != shape.end(); ++it) {
      EXPECT_GT(*it, 0);
    }
    shape_ = std::vector<int32_t>(shape.begin(), shape.end());
    size_ = DequantizeTester::ComputeSize(shape_);
    return *this;
  }

  const std::vector<int32_t>& Shape() const { return shape_; }

  int32_t Size() const { return size_; }

  inline DequantizeTester& InputZeroPoint(int32_t input_zero_point) {
    input_zero_point_ = input_zero_point;
    return *this;
  }

  inline int32_t InputZeroPoint() const { return input_zero_point_; }

  inline DequantizeTester& InputScale(float input_scale) {
    input_scale_ = input_scale;
    return *this;
  }

  inline float InputScale() const { return input_scale_; }

  inline DequantizeTester& Unsigned(bool is_unsigned) {
    unsigned_ = is_unsigned;
    return *this;
  }

  inline bool Unsigned() const { return unsigned_; }

  template <class T>
  void Test(Interpreter* delegate_interpreter,
            Interpreter* default_interpreter) const;

  void Test(TfLiteDelegate* delegate) const;

 private:
  std::vector<char> CreateTfLiteModel() const;

  static int32_t ComputeSize(const std::vector<int32_t>& shape);

  std::vector<int32_t> shape_;
  int32_t size_;
  int32_t input_zero_point_ = 0;
  float input_scale_ = 1.0f;
  bool unsigned_ = false;
};

}  // namespace xnnpack
}  // namespace tflite

#endif  // TENSORFLOW_LITE_DELEGATES_XNNPACK_DEQUANTIZE_TESTER_H_


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/list_view_job_full"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clickable="true"
    android:paddingBottom="10dp"
    >
	<RelativeLayout
	    android:id="@+id/list_view_job_topbar"
    	android:layout_width="match_parent"
    	android:layout_height="wrap_content"
    	android:background="@drawable/list_view_job_topbar"
    	android:layout_alignParentLeft="true"
    	android:layout_alignParentTop="true"
    	android:layout_marginLeft="10dp"
    	android:layout_marginRight="10dp"
    	>
    	<TextView
		    android:id="@+id/list_view_job_tvTitleLabel"
	        android:layout_width="wrap_content"
	        android:layout_height="wrap_content"
	        android:textSize="14sp"
	        android:text="Field Name:"
	        android:textColor="#000"
	        android:layout_centerVertical="true"
	        android:layout_alignParentLeft="true"
	        android:layout_marginLeft="7dp"
	        android:layout_marginTop="7dp"
	        android:layout_marginBottom="7dp"
		    />
		<TextView
		    android:id="@+id/list_view_job_tvTitle"
	        android:layout_width="wrap_content"
	        android:layout_height="wrap_content"
	        android:textSize="14sp"
	        android:text="Field 5 - 78 acres"
	        android:textColor="#000"
	        android:layout_centerVertical="true"
	        android:layout_toRightOf="@+id/list_view_job_tvTitleLabel"
	        android:layout_marginLeft="7dp"
	        android:layout_marginTop="7dp"
	        android:layout_marginBottom="7dp"
		    />
    </RelativeLayout>
    <RelativeLayout
        android:id="@+id/list_view_job_content"
    	android:layout_width="match_parent"
    	android:layout_height="wrap_content"
    	android:layout_below="@+id/list_view_job_topbar"
    	android:layout_alignParentLeft="true"
    	android:background="@drawable/list_view_job_content"
    	android:layout_marginLeft="10dp"
    	android:layout_marginRight="10dp"
    	>
		<ImageView
		    android:id="@+id/list_view_job_image"
	        android:layout_width="60dp"
	        android:layout_height="60dp"
	        android:layout_centerVertical="true"
	        android:layout_marginLeft="20dp"
	        android:layout_marginTop="10dp"
	        android:layout_marginBottom="10dp"
	        android:layout_alignParentLeft="true"
	        android:background="@drawable/boundary"
		    />
		<TextView
		    android:id="@+id/list_view_job_date"
	        android:layout_width="wrap_content"
	        android:layout_height="wrap_content"
	        android:textSize="14sp"
	        android:text="10/25/12"
	        android:textColor="#000"
	        android:layout_centerVertical="true"
	        android:layout_centerHorizontal="true"
	        android:layout_marginTop="7dp"
	        android:layout_marginBottom="7dp"
		    />
		<TextView
		    android:id="@+id/list_view_job_worker"
	        android:layout_width="wrap_content"
	        android:layout_height="wrap_content"
	        android:textSize="14sp"
	        android:text="Hank"
	        android:textColor="#000"
	        android:layout_centerVertical="true"
	        android:layout_marginTop="7dp"
	        android:layout_marginLeft="7dp"
	        android:layout_marginRight="20dp"
	       	android:layout_marginBottom="7dp"
	        android:layout_alignParentRight="true"
		    />
    </RelativeLayout>
</RelativeLayout>


text:
using Data_Manager;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using TUMCampusApp.Pages;
using TUMCampusAppAPI.DBTables;
using TUMCampusAppAPI.Managers;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace TUMCampusApp.Controls.Widgets
{
    public sealed partial class CanteenDummyWidgetControl : UserControl, IHideableWidget
    {
        //--------------------------------------------------------Attributes:-----------------------------------------------------------------\\
        #region --Attributes--
        public WidgetControl WidgetContainer
        {
            get { return (WidgetControl)GetValue(WidgetContainerProperty); }
            set { SetValue(WidgetContainerProperty, value); }
        }
        public static readonly DependencyProperty WidgetContainerProperty = DependencyProperty.Register("WidgetContainer", typeof(WidgetControl), typeof(NewsDummyWidgetControl), null);

        public HomePage HPage
        {
            get { return (HomePage)GetValue(HPageProperty); }
            set { SetValue(HPageProperty, value); }
        }
        public static readonly DependencyProperty HPageProperty = DependencyProperty.Register("HPage", typeof(HomePage), typeof(NewsDummyWidgetControl), null);

        private readonly List<CanteenWidgetControl> CANTEEN_WIDGETS;

        #endregion
        //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
        #region --Constructors--
        /// <summary>
        /// Basic Constructor
        /// </summary>
        /// <history>
        /// 06/04/2018 Created [Fabian Sauter]
        /// </history>
        public CanteenDummyWidgetControl()
        {
            this.CANTEEN_WIDGETS = new List<CanteenWidgetControl>();
            this.InitializeComponent();
        }

        #endregion
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--
        public string getSettingsToken()
        {
            return SettingsConsts.DISABLE_CANTEEN_WIDGET;
        }

        #endregion
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--
        public void onHiding()
        {
            hideAllCanteens();
        }

        public void disableCanteenWidgets()
        {
            Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => WidgetContainer?.disableWidget()).AsTask();
        }

        #endregion

        #region --Misc Methods (Private)--
        private void loadCanteens()
        {
            Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => WidgetContainer?.setIsLoading(true)).AsTask();
            Task.Run(async () =>
            {
                Task t2 = CanteenDBManager.INSTANCE.downloadCanteens(false);
                if (t2 != null)
                {
                    await t2;
                }
                Task t = CanteenDishDBManager.INSTANCE.downloadCanteenDishes(false);
                if (t != null)
                {
                    await t;
                }

                foreach (CanteenTable c in CanteenDBManager.INSTANCE.getFavoriteCanteens())
                {
                    t = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        CanteenWidgetControl canteenWidgetControl = new CanteenWidgetControl()
                        {
                            Canteen = c,
                            CanteenDummyWidget = this,
                            HPage = HPage
                        };

                        CANTEEN_WIDGETS.Add(canteenWidgetControl);

                        HPage.addWidget(canteenWidgetControl);
                    }).AsTask();
                }

                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    if (WidgetContainer != null)
                    {
                        WidgetContainer.Visibility = Visibility.Collapsed;
                        WidgetContainer.setIsLoading(false);
                    }
                });
            });
        }

        private void hideAllCanteens()
        {
            for (int i = 0; i < CANTEEN_WIDGETS.Count; i++)
            {
                CANTEEN_WIDGETS[i].Visibility = Visibility.Collapsed;
            }
        }

        #endregion

        #region --Misc Methods (Protected)--

        #endregion
        //--------------------------------------------------------Events:---------------------------------------------------------------------\\
        #region --Events--
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            loadCanteens();
        }

        #endregion
    }
}


text:
package com.zoctan.solar.main.widget;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.provider.CalendarContract;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.os.EnvironmentCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;

import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Switch;
import android.widget.TextView;

import com.zoctan.solar.R;
import com.zoctan.solar.about.AboutFragment;
import com.zoctan.solar.group.widget.GroupFragment;
import com.zoctan.solar.main.presenter.MainPresenter;
import com.zoctan.solar.main.view.MainView;
import com.zoctan.solar.test.widget.TestFragment;
import com.zoctan.solar.utils.ActivityCollector;
import com.zoctan.solar.utils.DataCleanManager;
import com.zoctan.solar.utils.ImageLoaderUtils;
import com.zoctan.solar.utils.LogUtils;
import com.zoctan.solar.utils.SPUtils;
import com.zoctan.solar.utils.ToastUtils;

import java.util.Objects;

import de.hdodenhof.circleimageview.CircleImageView;

/**
 * 主视图可视化界面
 */
public class MainActivity extends AppCompatActivity implements MainView,View.OnClickListener {

private DrawerLayout mDrawerLayout;
private Toolbar mToolbar;
private MainPresenter mMainPresenter;
private boolean mIsLogin;
private SPUtils mSPUtils;
private String userImg, userName;
// 保存点击的时间
private long exitTime = 0;

@Override
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // 设置主界面要显示的视图
        setContentView(R.layout.activity_main);
        // 初始化控件
        initView();
        // 主界面业务处理实体化
        mMainPresenter = new MainPresenter(this);
        // 显示Test列表
        switch2Test();
        // 将该Activity添加到ActivityCollector管理器中
        ActivityCollector.addActivity(this);
}

// 初始化控件
private void initView() {
        // 设置Toolbar
        mToolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(mToolbar);

        // 设置DrawerLayout
        mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
        // 创建侧滑键,并实现打开关/闭监听
        ActionBarDrawerToggle mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, mToolbar, R.string.drawer_open, R.string.drawer_close);
        // 自动和actionBar关联, 将开关的图片显示在了action上
        // 如果不设置,也可以有抽屉的效果,不过是默认的图标
        mDrawerToggle.syncState();
        // 给抽屉Layout绑定切换器监听
        mDrawerLayout.setDrawerListener(mDrawerToggle);

        // 设置NavigationView点击事件
        NavigationView mNavigationView = (NavigationView) findViewById(R.id.navigation_view);
        setupDrawerContent(mNavigationView);

        // 获取侧滑栏头布局文件
        View mHeaderView = mNavigationView.getHeaderView(0);
        Switch mSwitch = (Switch) mHeaderView.findViewById(R.id.switch_day_night);
        TextView mHeaderText = (TextView) mHeaderView.findViewById(R.id.header_text);
        mHeaderText.setOnClickListener(this);
        CircleImageView mHeaderImage = (CircleImageView) mHeaderView.findViewById(R.id.header_image);
        mHeaderImage.setOnClickListener(this);

        // 判断是否登陆过
        mSPUtils = new SPUtils(this);
        mIsLogin = mSPUtils.getBoolean("Login");
        if(mIsLogin) {
                //ToastUtils.showShort(this, "已登录");
                userImg = mSPUtils.getString("userImg");
                userName = mSPUtils.getString("userName");
                // 显示头像
                ImageLoaderUtils.displayUserImg(this, mHeaderImage, userImg);
                // 显示用户名
                mHeaderText.setText(userName);
        }else {
                mHeaderImage.setImageResource(R.mipmap.ic_user);
                mHeaderText.setText("未登录");
        }

        // 如果为日间模式
        if (Objects.equals(mSPUtils.getString("toggle"), "day")) {
                // 将toggle置为day
                mSPUtils.putString("toggle", "day");
                getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_NO);
                mSwitch.setChecked(false);
        } else {
                mSPUtils.putString("toggle", "night");
                getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES);
                mSwitch.setChecked(true);
        }

        mSwitch.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                                // 如果为日间模式
                                if (Objects.equals(mSPUtils.getString("toggle"), "day")) {
                                        // 将toggle置为night
                                        mSPUtils.putString("toggle", "night");
                                        getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES);
                                } else {
                                        // 将toggle置为day
                                        mSPUtils.putString("toggle", "day");
                                        getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_NO);
                                }
                                recreate();
                        }
                });

        // 接收来自用户登录/退出/修改头像广播
        IntentFilter mIntentFilter = new IntentFilter();
        mIntentFilter.addAction("userLogin");
        mIntentFilter.addAction("userLogout");
        mIntentFilter.addAction("modifyImg");
        // 动态注册广播
        registerReceiver(mBroadcastReceiver, mIntentFilter);
}

// 广播重写
BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
                if(Objects.equals(intent.getAction(), "userLogin")
                   || Objects.equals(intent.getAction(), "userLogout")
                   || Objects.equals(intent.getAction(), "modifyImg")) {
                        // 重新初始化界面
                        initView();
                }
        }
};

// 初始化菜单,其中menu参数就是即将要显示的Menu实例。
@Override
public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.navigation_menu, menu);
        return false;
}

// 菜单选项点击的事件处理
@Override
public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        return item.getItemId() == R.id.action_settings || super.onOptionsItemSelected(item);
}

// 设置NavigationView点击事件
private void setupDrawerContent(NavigationView navigationView) {
        navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
                        @Override
                        public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
                                mMainPresenter.switchNavigation(menuItem.getItemId());
                                menuItem.setChecked(true);
                                // 关闭侧滑栏
                                mDrawerLayout.closeDrawers();
                                return true;
                        }
                });
}

// 侧滑栏两个选项
@Override
public void switch2Test() {
        // 测评栏
        replaceFragment(new TestFragment(),"testFrame");
        mToolbar.setTitle(R.string.navigation_test);
}

@Override
public void switch2Group() {
        // 小组栏
        replaceFragment(new GroupFragment(),"groupFrame");
        mToolbar.setTitle(R.string.navigation_group);
}

@Override
public void switch2About() {
        // 关于栏
        replaceFragment(new AboutFragment(),"aboutFrame");
        mToolbar.setTitle(R.string.navigation_about);
}

@Override
public void switch2Clean() {
        // 清理缓存
        new AlertDialog.Builder(this)
        .setTitle("共" + DataCleanManager.getCacheSize(getApplicationContext().getCacheDir())
                  + ",确定清理吗?")
        .setIcon(android.R.drawable.ic_delete)
        .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                                // 点击"确认"后的操作
                                DataCleanManager.cleanAllData(getApplicationContext());
                                ToastUtils.showShort(getApplicationContext(), "缓存已清理");
                                // 重启APP
                                Intent i = getApplicationContext().getPackageManager()
                                           .getLaunchIntentForPackage(getApplicationContext().getPackageName());
                                i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                                startActivity(i);
                        }
                })

        .setNegativeButton("取消", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                                // 点击"返回"后的操作,这里不设置任何操作
                        }
                }).show();
}

private void replaceFragment(Fragment fragment, String tag) {
        getSupportFragmentManager()
        .beginTransaction()
        .replace(R.id.frame_content,fragment, tag)
        // 显示fragment动画
        .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
        .addToBackStack("replace")
        .commit();
}

// 侧滑栏用户
public void onClick(View view) {
        Intent intent = new Intent();
        if(mIsLogin) {
                Bundle user = new Bundle();
                user.putString("name", userName);
                user.putString("image", userImg);
                intent.putExtras(user);
                intent.setAction("userDetail");
                intent.addCategory("user");
        }else {
                intent.setAction("toLogin");
                intent.addCategory("user");
        }
        startActivity(intent);
}

// 双击退出
public boolean onKeyDown(int keyCode, KeyEvent event) {
        // 当按下返回键
        if (keyCode == KeyEvent.KEYCODE_BACK) {
                // 如果按下的时间超过2秒
                if ((System.currentTimeMillis() - exitTime) > 2000) {
                        ToastUtils.showShort(this, "再按一次退出程序");
                        // 获取当前系统时间的毫秒数
                        exitTime = System.currentTimeMillis();
                } else {
                        // 关闭所有Activity
                        ActivityCollector.finishAll();
                        // 正常退出程序
                        System.exit(0);
                }
                return false;
        }
        return super.onKeyDown(keyCode, event);
}

@Override
public void onDestroy() {
        super.onDestroy();
        // 从管理器中移除该Activity
        ActivityCollector.removeActivity(this);
        // 注销广播
        unregisterReceiver(mBroadcastReceiver);
}
}


text:
<?php
// src/AppBundle/Entity/Programa.php
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
/**
 * @ORM\Entity
 * @ORM\Table(name="programa")
 */

class Programa
{
    /**
     * @ORM\Column(name="idPrograma", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
	protected $idPrograma;

    /**
     * @ORM\Column(type="string", length=250)
     */
	protected $nombre;

	/**
     * @ORM\ManyToOne(targetEntity="Unidad")
     * @ORM\JoinColumn(name="unidad", referencedColumnName="idUnidad")
     */
	protected $unidad;

    /**
     * @ORM\Column(type="integer")
     */
    protected $grado;

    /**
     * @ORM\Column(type="integer")
     */
    protected $tipomaestria;

    /**
     * @ORM\Column(type="text")
     */
    protected $desc;

    /**
     * @ORM\Column(type="string", length=100)
     */
	protected $duracion;

    /**
     * @ORM\Column(type="string", length=100)
     */
    protected $horario;

    /**
     * Get idPrograma
     *
     * @return integer
     */
    public function getIdPrograma()
    {
        return $this->idPrograma;
    }

    /**
     * Set nombre
     *
     * @param string $nombre
     * @return Programa
     */
    public function setNombre($nombre)
    {
        $this->nombre = $nombre;

        return $this;
    }

    /**
     * Get nombre
     *
     * @return string
     */
    public function getNombre()
    {
        return $this->nombre;
    }

    /**
     * Set grado
     *
     * @param integer $grado
     * @return Programa
     */
    public function setGrado($grado)
    {
        $this->grado = $grado;

        return $this;
    }

    /**
     * Get grado
     *
     * @return integer
     */
    public function getGrado()
    {
        return $this->grado;
    }

    /**
     * Set tipomaestria
     *
     * @param integer $tipomaestria
     * @return Programa
     */
    public function setTipomaestria($tipomaestria)
    {
        $this->tipomaestria = $tipomaestria;

        return $this;
    }

    /**
     * Get tipomaestria
     *
     * @return integer
     */
    public function getTipomaestria()
    {
        return $this->tipomaestria;
    }

    /**
     * Set desc
     *
     * @param string $desc
     * @return Programa
     */
    public function setDesc($desc)
    {
        $this->desc = $desc;

        return $this;
    }

    /**
     * Get desc
     *
     * @return string
     */
    public function getDesc()
    {
        return $this->desc;
    }

    /**
     * Set duracion
     *
     * @param string $duracion
     * @return Programa
     */
    public function setDuracion($duracion)
    {
        $this->duracion = $duracion;

        return $this;
    }

    /**
     * Get duracion
     *
     * @return string
     */
    public function getDuracion()
    {
        return $this->duracion;
    }

    /**
     * Set horario
     *
     * @param string $horario
     * @return Programa
     */
    public function setHorario($horario)
    {
        $this->horario = $horario;

        return $this;
    }

    /**
     * Get horario
     *
     * @return string
     */
    public function getHorario()
    {
        return $this->horario;
    }

    /**
     * Set unidad
     *
     * @param \AppBundle\Entity\Unidad $unidad
     * @return Programa
     */
    public function setUnidad(\AppBundle\Entity\Unidad $unidad = null)
    {
        $this->unidad = $unidad;

        return $this;
    }

    /**
     * Get unidad
     *
     * @return \AppBundle\Entity\Unidad
     */
    public function getUnidad()
    {
        return $this->unidad;
    }
}


text:
package com.yungoushangcheng.yungou.model;

import org.springframework.context.annotation.Scope;

import javax.persistence.*;

/**
 * Created by bonismo@hotmail.com
 * 上午12:22 on 16/6/9.
 *
 * 云购商品信息
 */
@Entity(name = "Cart")
@Scope("prototype")
public class Cart extends BaseModel {

    private int id;

    // 商品云购价格 = 单价 * 次数
    private int total;

    // 商品云购数量
    private int num;

    // 云购金额是否满,0未完成/1完成
    private int status;

    private Goods goods;

    private Gamester gamester;

    private Issue issue;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public int getId() {
        return id;
    }

    public int getTotal() {
        return total;
    }

    public int getNum() {
        return num;
    }

    public int getStatus() {
        return status;
    }

    @OneToOne(targetEntity = Goods.class,cascade = CascadeType.REFRESH,optional = false)
    public Goods getGoods() {
        return goods;
    }

    @OneToOne(targetEntity = Gamester.class,cascade = CascadeType.REFRESH,optional = false)
    public Gamester getGamester() {
        return gamester;
    }

    @OneToOne(targetEntity = Issue.class,cascade = CascadeType.REFRESH,optional = false)
    public Issue getIssue() {
        return issue;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }

    public void setGamester(Gamester gamester) {
        this.gamester = gamester;
    }

    public void setIssue(Issue issue) {
        this.issue = issue;
    }

    @Override
    public String toString() {
        return "Cart{" +
                "id='" + id + '\'' +
                ", total=" + total +
                ", num=" + num +
                ", status=" + status +
                ", goods=" + goods +
                ", gamester=" + gamester +
                ", issue=" + issue +
                '}';
    }
}


text:
class SigninManagerWrapper;

namespace sync_driver {

class SyncPrefs;

// BackupRollbackController takes two closures for starting backup/rollback
// process. It calls the closures according to user's signin status or
// received rollback command. Backup is not run when user signed in, even when
// sync is not running.
class BackupRollbackController {
 public:
  BackupRollbackController(sync_driver::SyncPrefs* sync_prefs,
                           const SigninManagerWrapper* signin,
                           base::Closure start_backup,
                           base::Closure start_rollback);
  ~BackupRollbackController();

  // Post task to run |start_backup_| if conditions are met. Return true if
  // task is posted, false otherwise.
  bool StartBackup();

  // Post task to run |start_rollback_| if conditions are met. Return true if
  // task is posted, false otherwise.
  bool StartRollback();

  // Update rollback preference to indicate rollback is needed.
  void OnRollbackReceived();

  // Update rollback preference to indicate rollback is finished.
  void OnRollbackDone();

  // Return true if platform supports backup and backup is enabled.
  static bool IsBackupEnabled();

 private:
  sync_driver::SyncPrefs* sync_prefs_;

  // Use SigninManagerWrapper instead of SigninManagerBase so that
  // supervised users are treated like regular signed-in users.
  const SigninManagerWrapper* signin_;

  base::Closure start_backup_;
  base::Closure start_rollback_;

  DISALLOW_COPY_AND_ASSIGN(BackupRollbackController);
};

}  // namespace sync_driver

#endif  // COMPONENTS_SYNC_DRIVER_BACKUP_ROLLBACK_CONTROLLER_H_


text:
package com.fly.bmark2.urllauncher;

import android.graphics.Color;
import android.media.AudioManager;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.view.Window;
import android.view.WindowManager;

import com.fly.bmark2.augmented3.SampleCamFragment;
import com.fly.bmark2.R;

/**
 * Demo Implementation of a fragment use of the Wikitude ARchitectView.
 *
 */
public class ARchitectUrlLauncherCamActivity extends FragmentActivity {

	public static final String ARCHITECT_ACTIVITY_EXTRA_KEY_URL = "url2load";

	@Override
	protected void onCreate( final Bundle icicle ) {
		super.onCreate( icicle );

		this.requestWindowFeature( Window.FEATURE_NO_TITLE );
		this.getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN );
		this.setVolumeControlStream( AudioManager.STREAM_MUSIC );

		this.setContentView( R.layout.sample_cam_fragment_main );

		this.findViewById( R.id.mainFragementParent ).setBackgroundColor( Color.BLACK );

		if ( icicle == null ) {
			/* start transaction to set required fragments */
			final FragmentTransaction fragmentTransaction = this.getSupportFragmentManager().beginTransaction();
			fragmentTransaction.replace( R.id.mainFragement, new SampleCamFragment() );
			/* commit transaction */
			fragmentTransaction.commit();
		}

	}

}


text:
<? $this->renderPartial("/common/fixed-info"); ?>

<? $edit_page = isset($post); ?>

<form class="form-horizontal form-nodesc" method="post" style="border:0;"
	action="<?=($edit_page? "/admin/post/update/{$post->id}": '/admin/post/insert')?>">

		<input type="text" class="span9" name="post-title" id="post-title"
			check-type="required"
			required-message="<?=Yii::t('admin/post', "Title is required."); ?>"
			placeholder="<?=Yii::t('admin/post', "Type title here"); ?>"
			value="<?=($edit_page? $post->title: '')?>">

	<? $time = $edit_page? $post->created: gmtTime(); ?>

			<?=Yii::t('admin/post', "Link"); ?>http://xyzpedia.org/<?=timeFormat($time, 'path')?>/<?=($edit_page? $post->slug: '')?>
			<input type="hidden" name="post-slug" value="<?=($edit_page? $post->slug: '')?>"
				check-type="required" required-message="链接必填的哟。"/>

			<button class="btn btn-success btn-small" id="slug-confirm">检查</button><button class="btn btn-small" id="slug-cancel">取消</button>

			编号<input id="post-serial" name="post-serial" type="text" class="span2" placeholder="小百科编号" autocomplete="off" check-type="numberhyphen" numberhyphen-message="只能填数字和短横线哟,检查一下是不是有空格~" value="<?=($edit_page? $post->serial: '')?>" title="连续编号请用短横线分割,例如"12001-12002"。">

		作者<input id="post-author" name="post-author"
			type="text" class="span2" placeholder="投稿署名" autocomplete="off"
			data-provide="typeahead" data-items="4" title="请填写投稿署名,多个作者间请用"&"分割。"
			check-type="required" required-message="作者必填哟"
			value="<?

			if ( isset($post) ) {
				$author_num = 0;
				// registered
				foreach ($post->author as $author) {
					if ($author_num >= 1) {
						echo "&";
					}
					echo $author->nick_name;
					$author_num++;
				}
				// unregistered
				foreach ($post->author_no_reg as $author) {
					if ($author->author_id == 0) {
						if ($author_num >= 1) {
							echo "&";
						}
						echo $author->author_name;
						$author_num++;
					}
				}
			} ?>"
			data-source='<?=$user_list?>'>

		<textarea class="span9" id="post-content" name="post-content" rows="25" placeholder="<?=Yii::t('admin/post', "Type content here"); ?>" check-type="required" required-message="正文必填哟" ><?=($edit_page? $post->content: '')?></textarea>

		<textarea class="span9" id="post-excerpt" name="post-excerpt" rows="3" placeholder="<?=Yii::t('admin/post', "Type excerpt here"); ?>" check-type="required" required-message="摘要必填哟"><?=($edit_page? $post->excerpt: '')?></textarea>

		<div class="input-prepend input-append date inline" id="post-date" data-date="<?=timeFormat($time, 'date')?>" data-date-format="yyyy-mm-dd">
			日期<input class="span2" size="16" type="text" name="post-date" value="<?=timeFormat($time, 'date')?>" readonly>

			<input class="input-micro" type="text" name="post-hour" value="<?=timeFormat($time, 'hour')?>"> 时
			<input class="input-micro" type="text" name="post-minute" value="<?=timeFormat($time, 'minute')?>"> 分

		分类<select id="post-category" name="post-category">
			<option value="0">---- 请选择 ----</option>
			<? foreach ($cats as $cat) { ?>
			<? if (isset($post) && $post->category_id == $cat["ID"]) { ?>
			<option selected value="<?=$cat["ID"]?>">(<?=$cat["short"]?>) <?=$cat["name"]?></option>
			<? } else { ?>
			<option value="<?=$cat["ID"]?>">(<?=$cat["short"]?>) <?=$cat["name"]?></option>
			<? }} ?>
		</select>

		状态<select id="post-status" name="post-status">
			<? $draft = $edit_page && ($post->status=="draft"); ?>
			<option <?=($draft? "": "selected")?> value="publish">发布/定时</option>
			<option <?=($draft? "selected": "")?> value="draft">存为草稿</option>
		</select>

	<? $displayUrl = $edit_page? $post->thumbnail : ""; ?>

			特色图片<input type="text" class="input thumbnail"
			value="<?=$displayUrl?>" name="post-thumbnail" readonly
			check-type="required" required-message="特色图片一定要上传哟"/><input type="button"
			class="btn" id="upload-thumb-btn"
			value="<?=((!$edit_page)||(empty($post->thumbnail)) ? '上传': '修改')?>"/>

				×

上传特色图片

				<iframe id="upload-frame" src="/admin/postpic/upload/<?=($edit_page? $post->id: '0')?>">

		<? if ( !empty($post->thumbnail) ) { ?>
		<? $url = "/images/".$displayUrl; ?>
		<img class="thumbnail" title="特色图片" src="<?=$url?>"/>
		<? } else { ?>

		<? } ?>

		<button type="submit" class="btn btn-primary"> 提交</button>
		<? if ($edit_page) { ?>
		<button class="btn" href="/<?=timeFormat($time, 'path')?>/<?=$post->slug?>"> 查看文章</button>
		<button class="btn btn-danger" id="delete" href="/admin/post/delete/<?=$post->id?>"> 删除</button>
		<? } ?>

	<input type="hidden" id="post-id" name="post-id" value="<?=($edit_page? $post->id: 0)?>">
</form>

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

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


text:
<?php

declare(strict_types=1);

namespace OAuth2Framework\Component\Server\Model\ResourceOwner;

use OAuth2Framework\Component\Server\Model\Id\Id;

abstract class ResourceOwnerId extends Id implements \JsonSerializable
{
}


text:
package com.cosylab.cdb.jdal;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.logging.Logger;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.exolab.castor.net.URIException;
import org.exolab.castor.net.URILocation;
import org.exolab.castor.net.URIResolver;
import org.exolab.castor.net.util.URILocationImpl;
import org.exolab.castor.net.util.URIResolverImpl;
import org.exolab.castor.xml.XMLException;
import org.exolab.castor.xml.schema.ComplexType;
import org.exolab.castor.xml.schema.ElementDecl;
import org.exolab.castor.xml.schema.Schema;
import org.exolab.castor.xml.schema.XMLType;
import org.exolab.castor.xml.schema.reader.Sax2ComponentReader;
import org.exolab.castor.xml.schema.reader.SchemaUnmarshaller;
import org.xml.sax.InputSource;
import org.xml.sax.Parser;
import org.xml.sax.SAXException;

public class XSDElementTypeResolver {

	protected Parser parser;
	private final Logger logger;
	DALURIResolver uriResolver;
	private final String root;

	public XSDElementTypeResolver(String root, Logger logger)
		throws ParserConfigurationException, SAXException
	{
		this.root = root;
		this.logger = logger;
		initializeParser();
	}

	protected void initializeParser()
		throws ParserConfigurationException, SAXException
	{
    	SAXParserFactory factory = SAXParserFactory.newInstance();
        factory.setNamespaceAware(true);
        factory.setValidating(false);

        SAXParser saxParser = factory.newSAXParser();
        parser = saxParser.getParser();

        String schemas = DALImpl.getSchemas(root, logger);
        if (schemas == null) schemas = "";

        // do urn to file mapping for schemas
        Map<String, File> schemaName2File = new HashMap<String, File>();
        StringTokenizer tokenizer = new StringTokenizer(schemas);
        while (tokenizer.hasMoreTokens())
        {
        	String urn = tokenizer.nextToken();
        	String fileName = tokenizer.nextToken();
        	schemaName2File.put(getXSDElementName(urn) + ".xsd", new File(fileName));
        }

        uriResolver = new DALURIResolver(schemaName2File, logger);

	}

	private static class XMLNSElement
	{
		String xmlns;
		String element;

		public XMLNSElement(String xmlns, String element)
		{
			this.xmlns = xmlns;
			this.element = element;
		}

		public boolean equals(Object other) {
			if (other instanceof XMLNSElement)
			{
				XMLNSElement o = (XMLNSElement)other;
				return xmlns.equals(o.xmlns) && element.equals(o.element);
			}
			else
				return false;
		}

		public int hashCode() {
			return xmlns.hashCode() * 29 + element.hashCode();
		}
	}

	protected Map<XMLNSElement, String> cache = new HashMap<XMLNSElement, String>();

	public String[] getElementTypes(final String parentElementName, final String[] xmlns, final String[] elements)
	{
		if (xmlns.length != elements.length)
			throw new IllegalArgumentException("xmlns.length != elements.length");

		// it's up to user to
    	String[] types = new String[elements.length];
    	if (types.length == 0)
    		return types;

    	int hits = 0;
    	for (int index = 0; index < elements.length; index++)
		{
			XMLNSElement el = new XMLNSElement(xmlns[index]+parentElementName, elements[index]);
			if (cache.containsKey(el))
			{
				types[index] = cache.get(el);
				hits++;
			}
		}

    	// all found in cache
    	if (hits == elements.length)
    		return types;

    	try
    	{
    		Set<String> processedNs = new HashSet<String>();
    	 	for (String ns : xmlns)
        	{
    	 		if (processedNs.contains(ns))
    	 			continue;
        	 	processedNs.add(ns);

        	 	List<String> list = new ArrayList<String>();
        	 	for (int i = 0; i < xmlns.length; i++)
        	 		if (types[i] == null && ns.equals(xmlns[i]))
        	 			list.add(elements[i]);

        	 	if (list.size() > 0)
        	 	{
	        	 	String[] nsElements = list.toArray(new String[list.size()]);
	        	 	String[] nsTypes = internalGetElementTypes(parentElementName, ns, nsElements);

	        	 	// not very fast, but this is not critical here (also everything is cached)
        	 		for (int j = 0; j < elements.length; j++)
        	 			if (types[j] == null)
	        	 			for (int i = 0; i < nsElements.length; i++)
		        	 			if (nsElements[i].equals(elements[j]))
		        	 				types[j] = nsTypes[i];
        	 	}
        	}
    	}
    	catch (Throwable th)
    	{
    		th.printStackTrace();
    	}

    	return types;
	}

	protected Map<String, Boolean> doesExtendMap = new HashMap<String, Boolean>();

	/**
	 * @TODO: Change this method to not rely on the xsd file name to match a part of the xml namespace.
	 *        For example, all xsd files could be parsed using a xerces XMLGrammarLoader
	 *        (see http://xerces.apache.org/xerces2-j/faq-grammars.html#faq-3).
	 *        This xsd cache could then be queried here for the given namespace,
	 *        and it could also be shared with the xml parser in {@link DALImpl}.
	 */
	public boolean doesExtend(final String xmlns, final String baseTypeName)
    	throws SAXException, IOException, URIException, XMLException
    {
		final String key = xmlns + " " + baseTypeName;
		if (doesExtendMap.containsKey(key))
			return doesExtendMap.get(key);

		final String elementName = getXSDElementName(xmlns);

		Schema schema = null;
		try {
			SchemaUnmarshaller schemaUnmarshaller = new SchemaUnmarshaller();
			schemaUnmarshaller.setURIResolver(uriResolver);
			Sax2ComponentReader handler = new Sax2ComponentReader(schemaUnmarshaller);
			parser.setDocumentHandler(handler);
			parser.setErrorHandler(handler);
			parser.parse(new InputSource(uriResolver.resolve(elementName + ".xsd", null).getReader()));
			schema = schemaUnmarshaller.getSchema();
		} catch (Exception e) {
			logger.warning("Failed to locate or parse schema '" + elementName + ".xsd', continuing with the assumption that '"
					+ xmlns + "' does not extend '" + baseTypeName + "'.");
			doesExtendMap.put(key, false);
			return false;
		}

		String elementTypeName = null;

        Enumeration structures;
        for (structures = schema.getElementDecls(); structures.hasMoreElements(); )
        {
        	ElementDecl elementDecl = (ElementDecl) structures.nextElement();
        	if (elementDecl.getName().equals(elementName))
        	{
        		elementTypeName = elementDecl.getType().getName();
        		break;
        	}
        }

        if (elementTypeName != null)
        {
	        for (structures = schema.getComplexTypes(); structures.hasMoreElements(); )
	        {
	        	ComplexType complexType = (ComplexType) structures.nextElement();
	        	XMLType baseType = complexType.getBaseType();
	        	if (baseType != null)
	        	{
	        		if (baseType.getName().equals(baseTypeName))
	        		{
	        			doesExtendMap.put(key, true);
	        			return true;
	        		}
	        		else
	        		{
	        			boolean recursive = doesExtend("urn:schemas-cosylab-com:" + baseType.getName() + ":1.0", baseTypeName);
	        			if (recursive)
	        			{
		        			doesExtendMap.put(key, true);
	        				return true;
	        			}
	        		}
	        	}
	        }
	    }

		doesExtendMap.put(key, false);
        return false;
 	}

    protected String[] internalGetElementTypes(String parentElementName, final String xmlns, final String[] elements)
	throws SAXException, IOException, URIException, XMLException
{
	String[] types = new String[elements.length];
	if (types.length == 0)
		return types;

	final String elementName = getXSDElementName(xmlns);

    SchemaUnmarshaller schemaUnmarshaller = new SchemaUnmarshaller();
    schemaUnmarshaller.setURIResolver(uriResolver);
	Sax2ComponentReader handler = new Sax2ComponentReader(schemaUnmarshaller);
	parser.setDocumentHandler(handler);
	parser.setErrorHandler(handler);
	parser.parse(new InputSource(uriResolver.resolve(elementName + ".xsd", null).getReader()));
	Schema schema = schemaUnmarshaller.getSchema();

	String elementTypeName = null;

    Enumeration structures;
    for (structures = schema.getElementDecls(); structures.hasMoreElements(); )
    {
    	ElementDecl elementDecl = (ElementDecl) structures.nextElement();
    	if (elementDecl.getName().equals(elementName))
    	{
    		elementTypeName = elementDecl.getType().getName();
    		break;
    	}
    }

    // fallback: use parentName
	if (elementTypeName == null && parentElementName != null)
        for (structures = schema.getElementDecls(); structures.hasMoreElements(); )
        {
        	ElementDecl elementDecl = (ElementDecl) structures.nextElement();
        	if (elementDecl.getName().equals(parentElementName))
        	{
        		elementTypeName = elementDecl.getType().getName();
        		break;
        	}
        }

    if (elementTypeName != null)
    {
        for (structures = schema.getComplexTypes(); structures.hasMoreElements(); )
        {
        	ComplexType complexType = (ComplexType) structures.nextElement();
        	if (complexType.getName().equals(elementTypeName))
        	{
        		for (int i = 0; i < elements.length; i++)
        		{
        			ElementDecl element = complexType.getElementDecl(elements[i]);
        			if (element != null)
        			{
        				XMLType type = element.getType();
        				types[i] = type.getName();
        				if (types[i] == null)
        					types[i] = type.getBaseType().getName();
        			}

        			// fill cache, also with null
        			cache.put(new XMLNSElement(xmlns+parentElementName, elements[i]), types[i]);
        		}
        		break;
        	}
        }
    }

    return types;
	}

	protected static class DALURIResolver implements URIResolver {
		private Map<String, File> schemaName2File;
		private final Logger logger;

		public DALURIResolver(Map<String, File> schemaName2File, Logger logger) {
			this.schemaName2File = schemaName2File;
			this.logger = logger;
		}

		/**
		 * @param href
		 *            the (schema) file name etc.
		 * @param documentBase
		 *            is ignored
		 */
		public URILocation resolve(String href, String documentBase) throws URIException {
			logger.finest("DALURIResolver#resolve(" + href + ", " + documentBase + ") called.");
			File schemaFile = schemaName2File.get(href);
			if (schemaFile == null) {
				int lastSlash = href.lastIndexOf('/');
				if (lastSlash != -1) {
					return resolve(href.substring(lastSlash + 1), documentBase);
				}
				else {
					String msg = "schema file '" + href + "' not found!";
					logger.warning(msg);
					throw new URIException(msg);
				}
			}

			URILocation ret = new URILocationImpl(schemaFile.getAbsolutePath());
			logger.finest("DALURIResolver#resolve(" + href + ", " + documentBase + ") returning " + ret.getAbsoluteURI());
			return ret;
		}

		/**
		 * Returns location for URN.
		 *
		 * @see URIResolverImpl#resolveURN(String)
		 */
		public URILocation resolveURN(String urn) throws URIException {
			return resolve(getXSDElementName(urn) + ".xsd", null);
		}
	}

	/**
	 * @param xmlns
	 * @return
	 */
	private static final String getXSDElementName(final String xmlns) {
		final int endPos = xmlns.lastIndexOf(':');
		String elementName = xmlns.substring(0, endPos);
		final int pos = elementName.lastIndexOf(':');
		elementName = elementName.substring(pos+1);
		return elementName;
	}

//	public static void main(String[] args) throws Throwable {
//		XSDElementTypeResolver etr = new XSDElementTypeResolver();
//		System.out.println(etr.doesExtend("urn:schemas-cosylab-com:LO2Base:1.0", "ControlDevice"));
//		/*
//		String[] types;
//		types = etr.getElementTypes(null, new String[] {"urn:schemas-cosylab-com:RampedPowerSupply:1.0"}, new String[] { "current" });
//		for (String type : types)
//			System.out.println(type);
//		*/
//	}

	/**
	 * @return the uriResolver
	 */
	public DALURIResolver getUriResolver() {
		return uriResolver;
	}

}


text:
@interface HKImageClipperViewController ()
@property (nonatomic, strong) HKClipperVeiw *clipperView;
@end

@implementation HKImageClipperViewController

#pragma mark - Life Cycle

- (instancetype)initWithBaseImg:(UIImage *)baseImg resultImgSize:(CGSize)resultImgSize clipperType:(ClipperType)type {
    self = [super init];
    if (self) {
        _clipperView = [[HKClipperVeiw alloc]init];
        _clipperView.frame = CGRectMake(0, 64, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 64);
        _clipperView.resultImgSize = resultImgSize;
        //baseImg 的大小需依赖 resultImgSize 计算,所以 需在 resultImgSize 被赋值后才可赋值
        _clipperView.baseImg = baseImg;
        _clipperView.type = type;
        [self.view addSubview:_clipperView];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self loadSubViews];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.navigationController.navigationBarHidden = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Load
- (void)loadSubViews {
    [self loadNav];
}

-(void)loadNav {
    self.title = @"选择图片";
    self.view.backgroundColor = [UIColor blackColor];
    [self creatLeftBtnWithTitle:@"取消"];
    [self creaRightBtnWithTitle:@"确认"];
}

#pragma mark - Btn Methods
- (void)leftBtnTUI:(UIButton *)btn {
    !_cancelClippedHandler?:_cancelClippedHandler();
}

-(void)rightBtnTUI:(UIButton *)btn {
    UIImage *clippedImg = [self.clipperView clipImg];
    !_successClippedHandler?:_successClippedHandler(clippedImg);
}
@end


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.predicate.utils;

import com.google.common.net.UrlEscapers;
import com.yahoo.search.predicate.PredicateQuery;
import com.yahoo.search.predicate.serialization.PredicateQuerySerializer;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;

import static java.util.stream.Collectors.joining;

/**
 * Converts a targeting query (the format provided by targeting team) into a file of Vespa queries formatted as URLs.
 *
 * The format is the following:
 * - Each line represents one bulk query (upto 64 subqueries)
 * - Each bulk query has a set of subqueries separated by ";"
 * - Each subquery is of the format: attrName\tattrValue\tsubqueryIndex\tisRangeTerm;
 * - Some attributes have no value.
 * - Value may contain ";"
 *
 * @author bjorncs
 */
public class TargetingQueryFileConverter {

    // Subqueries having more than this value are skipped.
    private static final int MAX_NUMBER_OF_TERMS = 100;

    private enum OutputFormat {JSON, YQL}

    private TargetingQueryFileConverter() {}

    public static void main(String[] args) throws IOException {
        int nQueries = 123042;
        int batchFactor = 64;
        Subqueries subqueries = parseRiseQueries(new File("test-data/rise-query2.txt"), nQueries);
        filterOutHugeSubqueries(subqueries);
        List<Query> queries = batchSubqueries(subqueries, batchFactor);
        writeSubqueriesToFile(
                queries,
                new File("test-data/targeting-queries-json-" + batchFactor + "b-" + nQueries + "n.txt"),
                OutputFormat.JSON);
        writeSubqueriesToFile(
                queries,
                new File("test-data/targeting-queries-yql-" + batchFactor + "b-" + nQueries + "n.txt"),
                OutputFormat.YQL);
    }

    private static void writeSubqueriesToFile(List<Query> queries, File output, OutputFormat outputFormat)
            throws IOException {
        try (BufferedWriter writer = new BufferedWriter(new FileWriter(output))) {
            if (outputFormat == OutputFormat.JSON) {
                writeJSONOutput(writer, queries);
            } else {
                writeYQLOutput(writer, queries);
            }

        }
    }

    private static void writeJSONOutput(BufferedWriter writer, List<Query> queries) throws IOException {
        PredicateQuerySerializer serializer = new PredicateQuerySerializer();
        for (Query query : queries) {
            PredicateQuery predicateQuery = toPredicateQuery(query);
            String json = serializer.toJSON(predicateQuery);
            writer.append(json).append('\n');
        }
    }

    private static PredicateQuery toPredicateQuery(Query query) {
        PredicateQuery predicateQuery = new PredicateQuery();
        for (Map.Entry<Long, Set<Feature>> e : query.valuesForSubqueries.entrySet()) {
            e.getValue().forEach(f -> predicateQuery.addFeature(f.key, f.strValue, e.getKey()));
        }
        for (Map.Entry<Long, Set<Feature>> e : query.rangesForSubqueries.entrySet()) {
            e.getValue().forEach(f -> predicateQuery.addRangeFeature(f.key, f.longValue, e.getKey()));
        }
        return predicateQuery;
    }

    private static void writeYQLOutput(BufferedWriter writer, List<Query> queries) throws IOException {
        for (Query query : queries) {
            writer.append(toYqlString(query)).append('\n');
        }
    }

    private static String toYqlString(Query query)  {
        StringBuilder yqlBuilder = new StringBuilder("select * from sources * where predicate(boolean, ");
        yqlBuilder
                .append(createYqlFormatSubqueryMapString(query.valuesForSubqueries, query.isSingleQuery))
                .append(", ")
                .append(createYqlFormatSubqueryMapString(query.rangesForSubqueries, query.isSingleQuery))
                .append(");");
        return "/search/?query&nocache&yql=" + UrlEscapers.urlFormParameterEscaper().escape(yqlBuilder.toString());
    }

    /*
     * The subqueryBatchFactor determines the batch factor for each query. A maximum of 64 queries can be batched
     * into a single query (as subqueries).
     *      0 => Do not batch and output plain queries (no subquery).
     *      1 => Do not batch, but output queries with single subquery.
     */
    private static List<Query> batchSubqueries(Subqueries subqueries, int subqueryBatchFactor) {
        Iterator<Integer> iterator = subqueries.subqueries.iterator();
        List<Query> result = new ArrayList<>();
        while (iterator.hasNext()) {
            // Aggregate the subqueries that contains a given value.
            Map<Feature, Long> subqueriesForValue = new TreeMap<>();
            Map<Feature, Long> subqueriesForRange = new TreeMap<>();
            // Batch single to single subquery for batch factor 0.
            for (int i = 0; i < Math.max(1, subqueryBatchFactor) && iterator.hasNext(); ++i) {
                Integer subquery = iterator.next();
                registerSubqueryValues(i, subqueries.valuesForSubquery.get(subquery), subqueriesForValue);
                registerSubqueryValues(i, subqueries.rangesForSubquery.get(subquery), subqueriesForRange);
            }

            // Aggregate the values that are contained in a given set of subqueries.
            Query query = new Query(subqueryBatchFactor == 0);
            simplifyAndFillQueryValues(query.valuesForSubqueries, subqueriesForValue);
            simplifyAndFillQueryValues(query.rangesForSubqueries, subqueriesForRange);
            result.add(query);
        }
        return result;
    }

    private static void registerSubqueryValues(int subquery, Set<Feature> values, Map<Feature, Long> subqueriesForValue) {
        if (values != null) {
            values.forEach(value -> subqueriesForValue.merge(value, 1L << subquery, (ids1, ids2) -> ids1 | ids2));
        }
    }

    private static void simplifyAndFillQueryValues(Map<Long, Set<Feature>> queryValues, Map<Feature, Long> subqueriesForValue) {
        for (Map.Entry<Feature, Long> entry : subqueriesForValue.entrySet()) {
            Feature feature = entry.getKey();
            Long subqueryBitmap = entry.getValue();
            Set<Feature> featureSet = queryValues.computeIfAbsent(subqueryBitmap, (k) -> new HashSet<>());
            featureSet.add(feature);
        }
    }

    private static String createYqlFormatSubqueryMapString(Map<Long, Set<Feature>> subqueriesForString, boolean isSingleQuery) {
        return subqueriesForString.entrySet().stream()
                .map(e -> {
                    Stream<String> features = e.getValue().stream().map(Feature::asYqlString);
                    if (isSingleQuery) {
                        return features.collect(joining(", "));
                    } else {
                        // Note: Cannot use method reference as both method toString(int) and method toString() match.
                        String values = features.collect(joining(", ", "{", "}"));
                        return String.format("\"0x%s\":%s", Long.toHexString(e.getKey()), values);
                    }
                })
                .collect(joining(", ", "{", "}"));
    }

    private static Subqueries parseRiseQueries(File riseQueryFile, int maxQueries) throws IOException {
        try (BufferedReader reader = new BufferedReader(new FileReader(riseQueryFile))) {
            Subqueries parsedSubqueries = new Subqueries();
            AtomicInteger counter = new AtomicInteger(1);
            reader.lines()
                    .limit(maxQueries)
                    .forEach(riseQuery -> parseRiseQuery(parsedSubqueries, riseQuery, counter.getAndIncrement()));
            return parsedSubqueries;
        }
    }

    private static void filterOutHugeSubqueries(Subqueries subqueries) {
        Iterator<Integer> iterator = subqueries.subqueries.iterator();
        while (iterator.hasNext()) {
            Integer subquery = iterator.next();
            Set<Feature> values = subqueries.valuesForSubquery.get(subquery);
            Set<Feature> ranges = subqueries.rangesForSubquery.get(subquery);
            int sizeValues = values == null ? 0 : values.size();
            int sizeRanges = ranges == null ? 0 : ranges.size();
            if (sizeValues + sizeRanges > MAX_NUMBER_OF_TERMS) {
                iterator.remove();
                subqueries.valuesForSubquery.remove(subquery);
                subqueries.rangesForSubquery.remove(subquery);
            }
        }
    }

    private static void parseRiseQuery(Subqueries subqueries, String queryString, int queryId) {
        StringTokenizer subQueryTokenizer = new StringTokenizer(queryString, "\t", true);
        while (subQueryTokenizer.hasMoreTokens()) {
            String key = subQueryTokenizer.nextToken("\t");
            subQueryTokenizer.nextToken();  // Consume delimiter
            String value = subQueryTokenizer.nextToken();
            if (value.equals("\t")) {
                value = "";
            } else {
                subQueryTokenizer.nextToken();  // Consume delimiter
            }
            int subQueryIndex = Integer.parseInt(subQueryTokenizer.nextToken());
            subQueryTokenizer.nextToken();  // Consume delimiter
            boolean isRangeTerm = Boolean.parseBoolean(subQueryTokenizer.nextToken(";"));
            if (subQueryTokenizer.hasMoreTokens()) {
                subQueryTokenizer.nextToken();  // Consume delimiter
            }
            int subqueryId = subQueryIndex + 64 * queryId;
            if (isRangeTerm) {
                Set<Feature> rangeFeatures = subqueries.rangesForSubquery.computeIfAbsent(
                        subqueryId, (id) -> new HashSet<>());
                rangeFeatures.add(new Feature(key, Long.parseLong(value)));
            } else {
                Set<Feature> features = subqueries.valuesForSubquery.computeIfAbsent(subqueryId, (id) -> new HashSet<>());
                features.add(new Feature(key, value));
            }
            subqueries.subqueries.add(subqueryId);
        }
    }

    private static class Subqueries {
        public final TreeSet<Integer> subqueries = new TreeSet<>();
        public final Map<Integer, Set<Feature>> valuesForSubquery = new HashMap<>();
        public final Map<Integer, Set<Feature>> rangesForSubquery = new HashMap<>();
    }

    private static class Query {
        public final boolean isSingleQuery;
        public final Map<Long, Set<Feature>> valuesForSubqueries = new TreeMap<>();
        public final Map<Long, Set<Feature>> rangesForSubqueries = new TreeMap<>();

        public Query(boolean isSingleQuery) {
            this.isSingleQuery = isSingleQuery;
        }
    }

    private static class Feature implements Comparable<Feature> {
        public final String key;
        private final String strValue;
        private final long longValue;

        public Feature(String key, String value) {
            this.key = key;
            this.strValue = value;
            this.longValue = 0;
        }

        public Feature(String key, long value) {
            this.key = key;
            this.strValue = null;
            this.longValue = value;
        }

        public String asYqlString() {
            if (strValue != null) {
                return String.format("\"%s\":\"%s\"", key, strValue);
            } else {
                return String.format("\"%s\":%dl", key, longValue);
            }
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (!(o instanceof Feature)) return false;

            Feature feature = (Feature) o;

            if (longValue != feature.longValue) return false;
            if (!key.equals(feature.key)) return false;
            return !(strValue != null ? !strValue.equals(feature.strValue) : feature.strValue != null);

        }

        @Override
        public int hashCode() {
            int result = key.hashCode();
            result = 31 * result + (strValue != null ? strValue.hashCode() : 0);
            result = 31 * result + (int) (longValue ^ (longValue >>> 32));
            return result;
        }

        @Override
        public int compareTo(Feature o) {
            return asYqlString().compareTo(o.asYqlString());
        }
    }

}


text:
module StripAttributes
  module Matchers

    # Whitespace is stripped from the beginning and end of the attribute
    #
    # RSpec Examples:
    #
    #   it { is_expected.to strip_attribute(:first_name) }
    #   it { is_expected.not_to strip_attribute(:password) }
    #
    # Minitest Matchers Examples:
    #
    #   must { strip_attribute :first_name }
    #   wont { strip_attribute :password }
    def strip_attribute(attribute)
      StripAttributeMatcher.new(attribute)
    end

    class StripAttributeMatcher
      def initialize(attribute)
        @attribute = attribute
        @options = {}
      end

      def matches?(subject)
        subject.send("#{@attribute}=", " string ")
        subject.valid?
        subject.send(@attribute) == "string" and collapse_spaces?(subject)
      end

      def collapse_spaces
        @options[:collapse_spaces] = true
        self
      end

      def failure_message # RSpec 3.x
        "Expected whitespace to be #{expectation} from ##{@attribute}, but it was not"
      end
      alias_method :failure_message_for_should, :failure_message # RSpec 1.2, 2.x, and minitest-matchers

      def failure_message_when_negated # RSpec 3.x
        "Expected whitespace to remain on ##{@attribute}, but it was #{expectation}"
      end
      alias_method :failure_message_for_should_not, :failure_message_when_negated # RSpec 1.2, 2.x, and minitest-matchers
      alias_method :negative_failure_message,       :failure_message_when_negated # RSpec 1.1

      def description
        "#{expectation(false)} whitespace from ##{@attribute}"
      end

      private

      def collapse_spaces?(subject)
        return true if !@options[:collapse_spaces]

        subject.send("#{@attribute}=", " string    string ")
        subject.valid?
        subject.send(@attribute) == "string string"
      end

      def expectation(past = true)
        expectation = past ? "stripped" : "strip"
        expectation += past ? " and collapsed" : " and collapse" if @options[:collapse_spaces]
        expectation
      end
    end
  end
end


text:
============================
``filedb.filetables`` module
============================

.. automodule:: whoosh.filedb.filetables

Hash file
=========

.. autoclass:: HashWriter
    :members:

.. autoclass:: HashReader
    :members:

Ordered Hash file
=================

.. autoclass:: OrderedHashWriter
.. autoclass:: OrderedHashReader


text:
define(['knockout', 'durandal/app', 'services/firebase', 'models/bill', 'models/income'],
function(ko, app, firebase, Bill, income) {

	return function Bills() {
		var self = this;

		self.bills = ko.fireSet(firebase.root.child('bills'), Bill);
		self.income = income;

		self.newBill = function() {
			self.bills.push({});
		};

		self.totalAmount = ko.computed(function() {
			return self.bills().sum(function(b) {
				return b.amount().toNumber();
			});
		});
	};
});


text:
<?php

declare(strict_types=1);

/**
 * This file is part of Narrowspark Framework.
 *
 * (c) Daniel Bannert <d.bannert@anolilab.de>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Viserio\Component\Pipeline\Tests;

use Narrowspark\TestingHelper\ArrayContainer;
use PHPUnit\Framework\TestCase;
use RuntimeException;
use Viserio\Component\Pipeline\Pipeline;
use Viserio\Component\Pipeline\Tests\Fixture\PipelineInvokePipe;
use Viserio\Component\Pipeline\Tests\Fixture\PipelineTestParameterPipe;
use Viserio\Component\Pipeline\Tests\Fixture\PipelineTestPipeOne;

/**
 * @internal
 *
 * @small
 */
final class PipelineTest extends TestCase
{
    /** @var \Psr\Container\ContainerInterface */
    protected $container;

    /** @var array */
    private static $globalServer = [];

    /**
     * {@inheritdoc}
     */
    protected function setUp(): void
    {
        $this->container = new ArrayContainer([
            'PipelineTestPipeOne' => new PipelineTestPipeOne(),
            'PipelineTestParameterPipe' => new PipelineTestParameterPipe(),
        ]);
        self::$globalServer = $_SERVER;
    }

    /**
     * {@inheritdoc}
     */
    protected function tearDown(): void
    {
        parent::tearDown();

        $_SERVER = self::$globalServer;
    }

    public function testPipelineBasicUsage(): void
    {
        $pipeTwo = static function ($piped, $next) {
            $_SERVER['__test.pipe.two'] = $piped;

            return $next($piped);
        };

        $result = (new Pipeline())
            ->setContainer($this->container)
            ->send('foo')
            ->through(['PipelineTestPipeOne', $pipeTwo])
            ->then(static function ($piped) {
                return $piped;
            });

        self::assertEquals('foo', $result);
        self::assertEquals('foo', $_SERVER['__test.pipe.one']);
        self::assertEquals('foo', $_SERVER['__test.pipe.two']);

        unset($_SERVER['__test.pipe.one'], $_SERVER['__test.pipe.two']);
    }

    public function testPipelineUsageWithParameters(): void
    {
        $parameters = ['one', 'two'];

        $result = (new Pipeline())
            ->setContainer($this->container)
            ->send('foo')
            ->through('PipelineTestParameterPipe:' . \implode(',', $parameters))
            ->then(static function ($piped) {
                return $piped;
            });

        self::assertEquals('foo', $result);
        self::assertEquals($parameters, $_SERVER['__test.pipe.parameters']);

        unset($_SERVER['__test.pipe.parameters']);
    }

    public function testPipelineViaChangesTheMethodBeingCalledOnThePipes(): void
    {
        $result = (new Pipeline())
            ->setContainer($this->container)
            ->send('data')
            ->through('PipelineTestPipeOne')
            ->via('differentMethod')
            ->then(static function ($piped) {
                return $piped;
            });

        self::assertEquals('data', $result);
    }

    public function testPipelineViaContainerToThrowException(): void
    {
        $this->expectException(RuntimeException::class);
        $this->expectExceptionMessage('Class [Controller] is not being managed by the container.');

        (new Pipeline())
            ->setContainer($this->container)
            ->send('data')
            ->through('Controller')
            ->via('differentMethod')
            ->then(static function ($piped) {
                return $piped;
            });
    }

    public function testPipelineViaObject(): void
    {
        $result = (new Pipeline())
            ->send('foo')
            ->through([new PipelineTestPipeOne()])
            ->then(static function ($piped) {
                return $piped;
            });

        self::assertEquals('foo', $result);
        self::assertEquals('foo', $_SERVER['__test.pipe.one']);

        unset($_SERVER['__test.pipe.one']);
    }

    public function testPipelineInvoke(): void
    {
        $parameters = ['one', 'two'];

        $result = (new Pipeline())
            ->send('foo')
            ->through([[PipelineInvokePipe::class, $parameters]])
            ->then(static function ($piped) {
                return $piped;
            });

        self::assertEquals('foo', $result);
        self::assertEquals($parameters, $_SERVER['__test.pipe.parameters']);

        unset($_SERVER['__test.pipe.one']);
    }

    public function testPipelineUsageWithCallable(): void
    {
        $function = function ($piped, $next) {
            $_SERVER['__test.pipe.one'] = 'foo';

            return $next($piped);
        };

        $result = (new Pipeline())
            ->send('foo')
            ->through([$function])
            ->then(
                function ($piped) {
                    return $piped;
                }
            );

        self::assertEquals('foo', $result);
        self::assertEquals('foo', $_SERVER['__test.pipe.one']);

        unset($_SERVER['__test.pipe.one']);
    }
}