text:
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Build Status](https://travis-ci.org/libgit2/objective-git.svg?branch=master)](https://travis-ci.org/libgit2/objective-git)

ObjectiveGit provides Cocoa bindings to the
[libgit2](https://github.com/libgit2/libgit2) library, packaged as a dynamic framework for OS X and iOS 8 or better.

## Features

A brief summary of the available functionality:

* Read: log, diff, blame, reflog, status
* Write: init, checkout, commit, branch, tag, reset
* Internals: configuration, tree, blob, object database
* Network: clone, fetch, push, pull
* Transports: HTTP, HTTPS, SSH, local filesystem

Not all libgit2 features are available, but if you run across something missing, please consider [contributing a pull request](#contributing)!

Many classes in the ObjectiveGit API wrap a C struct from libgit2 and expose the underlying data and operations using Cocoa idioms. The underlying libgit2 types are prefixed with `git_` and are often accessible via a property so that your application can take advantage of the libgit2 API directly.

The ObjectiveGit API makes extensive use of the Cocoa NSError pattern. The public API is also decorated with nullability attributes so that you will get compile-time feedback of whether nil is allowed or not. This also makes the framework much nicer to use in Swift.

## Getting Started

### Xcode

ObjectiveGit requires Xcode 6.3 or greater to build the framework and run unit tests. Projects that must use an older version of Xcode can use
[Carthage](#carthage) to install pre-built binaries
or download them [manually](#manually).

### Other Tools

To start building the framework, you must install the required dependencies,
[xctool](https://github.com/facebook/xctool) and
[cmake](https://github.com/Kitware/CMake). We recommend using
[Homebrew](http://brew.sh) to install these tools.

Once you have the dependencies you should clone this repository and then run [`script/bootstrap`](script/bootstrap). This will automatically pull down and install any other
dependencies.

Note that the `bootstrap` script automatically installs some libraries that ObjectiveGit relies upon, using Homebrew. If you not want to use Homebrew, you will need to ensure these dependent libraries and their headers are installed where the build scripts [expect them to be](https://github.com/libgit2/objective-git/blob/master/script/bootstrap#L80-L99).

To develop ObjectiveGit on its own, open the `ObjectiveGitFramework.xcworkspace` file.

# Installation

There are three ways of including ObjectiveGit in a project:

1. [Carthage](#carthage) <-- recommended
1. [Manual](#manual)
1. [Subproject](#subproject)

## Carthage

1. Add ObjectiveGit to your [`Cartfile`](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile).

  ```
  github "libgit2/objective-git"
  ```

1. Run `carthage update`.
1. **Mac targets**
  * On your application targets' "General" settings tab, in the "Embedded Binaries" section, drag and drop the `ObjectiveGit.framework` from the [`Carthage/Build/Mac`](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#carthagebuild) folder on disk.

  ![Embedded Binaries](http://imgur.com/W9EVyIX.png)

1. **iOS targets**
  * On your application targets' "General" settings tab, in the "Linked Frameworks and Libraries" section, drag and drop the `ObjectiveGit.framework` from the [`Carthage/Build/iOS`](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#carthagebuild) folder on disk.
  ![Linked Frameworks](http://i.imgur.com/y4caRw0.png)

  * On your application targets' "Build Phases" settings tab, click the "+" icon and choose "New Run Script Phase". Create a Run Script with the following contents:

  ```
  /usr/local/bin/carthage copy-frameworks
  ```

  and add the paths to the frameworks you want to use under "Input Files", e.g.:

  ```
  $(SRCROOT)/Carthage/Build/iOS/ObjectiveGit.framework
  ```

  ![Carthage Copy Frameworks](http://i.imgur.com/zXai6rb.png)

1. Commit the [`Cartfile.resolved`](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfileresolved)

2. Under "Build Settings", add the following to "Header Search Paths": `$(SRCROOT)/Carthage/Build/iOS/ObjectiveGit.framework/Headers/` to avoid [`git2/filter.h file not found` errors](https://github.com/libgit2/objective-git/issues/441).

The different instructions for iOS works around an [App Store submission bug](http://www.openradar.me/radar?id=6409498411401216) triggered by universal binaries.

### Copying debug symbols for debugging and crash reporting

_dSYM files are not currently included in the GitHub release zip files. You will need to pass **--no-use-binaries** to carthage in order to build locally and generate the dSYM files alongside the framework._

1. On your application target's "Build Phases" settings tab, click the "+" icon and choose "New Copy Files Phase".
2. Click the "Destination" drop-down menu and select "Products Directory".
3. Drag and drop the `ObjectiveGit.framework.dSYM` file from `Carthage/Build/[platform]` into the list.

![Copy dSYM Files](http://i.imgur.com/WKJdHHQ.png)

## Manual

1. Download the latest `ObjectiveGit.framework.zip` from [releases](https://github.com/libgit2/objective-git/releases).
1. Unzip the file.
1. Follow the Carthage instructions #3 or #4, depending on platform.

Note that the iOS framework we release is a "fat" framework containing slices for both the iOS Simulator and devices. This makes it easy to get started with your iOS project. However, Apple does not currently allow apps containing frameworks with simulator slices to be submitted to the app store. Carthage (above) already has a solution for this. If you're looking to roll your own, take a look at Realm's [strip frameworks script](https://github.com/realm/realm-cocoa/blob/master/scripts/strip-frameworks.sh).

## Subproject

### Examples

* OS X: [CommitViewer](https://github.com/Abizern/CommitViewer)
* iOS: [ObjectiveGit iOS Example](https://github.com/Raekye/ObjectiveGit-iOS-Example)

1. Add ObjectiveGit as a submodule to your project:

  ```
  git submodule add https://github.com/libgit2/objective-git.git External/ObjectiveGit
  ```

1. Run `script/bootstrap`.
1. Drag the `ObjectiveGitFramework.xcodeproj` file into the Project Navigator pane of your project.
1. Add `ObjectiveGit-Mac` or `ObjectiveGit-iOS` as a target dependency of your application, depending on platform.
1. Link your application with `ObjectiveGit.framework`.
1. Set the "Header Search Paths" (`HEADER_SEARCH_PATHS`) build setting to the correct path for the libgit2 headers in your project. For example, if you added the submodule to your project as `External/ObjectiveGit`, you would set this build setting to `External/ObjectiveGit/External/libgit2/include`. If you see build errors saying that `git2/filter.h` cannot be found, then double-check that you set this setting correctly.
1. Add a new "Copy Files" build phase, set the destination to "Frameworks" and add `ObjectiveGit.framework` to the list. This will package the framework with your application as an embedded private framework.
  *  It's hard to tell the difference between the platforms, but the Mac framework is in `build/Debug` whereas the iOS framework is in `build/Debug-iphoneos`
1. Don't forget to `#import <ObjectiveGit/ObjectiveGit.h>` or `@import ObjectiveGit;` as you would with any other framework.

## Contributing

1. Fork this repository
1. Make it awesomer (preferably in a branch named for the topic)
1. Send a pull request

All contributions should match GitHub's [Objective-C coding
conventions](https://github.com/github/objective-c-conventions).

You can see all the amazing people that have contributed to this project
[here](https://github.com/libgit2/objective-git/contributors).

## License

ObjectiveGit is released under the MIT license. See
the [LICENSE](LICENSE) file.


text:
'use strict';

var angular = require('camunda-commons-ui/vendor/angular'),

  /* controller */
    camTasklistListCtrl = require('./controller/cam-tasklist-list-ctrl'),

  /* directives */
    camTasklistTasks = require('./directives/cam-tasklist-tasks'),

  /* plugins */
    camTasklistSearchPlugin = require('./plugins/cam-tasklist-search-plugin');

var ngModule = angular.module('cam.tasklist.tasklist', [
  'ui.bootstrap'
]);

  /* controller */
ngModule.controller('camListCtrl', camTasklistListCtrl);

  /* directives */
ngModule.directive('camTasks', camTasklistTasks);

  /* plugins */
ngModule.config(camTasklistSearchPlugin);

module.exports = ngModule;

redpajama_set_name: RedPajamaGithub


text:
FROM php:5.6-fpm-alpine

MAINTAINER Cedric Michaux <cedric@he8us.be>

ENV PHP_PORT 9000
ENV CONFD_VERSION 0.14.0
ENV IMAGICK_VERSION 3.4.3

EXPOSE $PHP_PORT

COPY entrypoint.sh /app/entrypoint.sh
COPY confd/ /etc/confd

RUN \
    curl -L -o /usr/local/bin/confd https://github.com/kelseyhightower/confd/releases/download/v${CONFD_VERSION}/confd-${CONFD_VERSION}-linux-amd64 \
    && chmod +x /usr/local/bin/confd

RUN \
    apk --no-cache add  \
        freetype-dev \
        icu-dev \
        imagemagick-dev \
        libjpeg-turbo-dev \
        libmcrypt-dev \
        libpng-dev \
        libtool \
        pcre-dev \
        wget \
        zip

RUN \
    apk --no-cache add \
        --virtual .phpize-deps \
        build-base \
        autoconf \
    && export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
    && pecl install imagick-${IMAGICK_VERSION} \
    && docker-php-ext-enable imagick \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install \
        bcmath \
        gd \
        exif \
        intl \
        mbstring \
        mcrypt \
        pdo_mysql \
        zip \
    && apk del .phpize-deps

ENTRYPOINT ["/app/entrypoint.sh"]

CMD ["php-fpm"]


text:
package sds.classfile.attributes;

import java.io.IOException;
import sds.classfile.ClassFileStream;
import sds.classfile.ConstantPool;

/**
 * This class is for
 *
 * Signature Attribute.
 * @author inagaki
 */
public class Signature extends AttributeInfo {
	private String signature;

	/**
	 * constructor.
	 */
	public Signature() {
		super(AttributeType.Signature);
	}

	/**
	 * returns signature.
	 * @return signature
	 */
	public String getSignature() {
		return signature;
	}

	@Override
	public void read(ClassFileStream data, ConstantPool pool) throws IOException {
		this.signature = extract(pool.get(data.readShort()-1), pool);
	}
}


text:
FILE_LICENCE ( GPL2_OR_LATER );

#include <ctype.h>
#include <ipxe/console.h>
#include <ipxe/process.h>
#include <ipxe/keys.h>
#include <ipxe/timer.h>

/** @file
 *
 * Special key interpretation
 *
 */

#define GETKEY_TIMEOUT ( TICKS_PER_SEC / 4 )

/**
 * Read character from console if available within timeout period
 *
 * @v timeout		Timeout period, in ticks (0=indefinite)
 * @ret character	Character read from console
 */
static int getchar_timeout ( unsigned long timeout ) {
	unsigned long start = currticks();

	while ( ( timeout == 0 ) || ( ( currticks() - start ) < timeout ) ) {
		step();
		if ( iskey() )
			return getchar();
	}

	return -1;
}

/**
 * Get single keypress
 *
 * @v timeout		Timeout period, in ticks (0=indefinite)
 * @ret key		Key pressed
 *
 * The returned key will be an ASCII value or a KEY_XXX special
 * constant.  This function differs from getchar() in that getchar()
 * will return "special" keys (e.g. cursor keys) as a series of
 * characters forming an ANSI escape sequence.
 */
int getkey ( unsigned long timeout ) {
	int character;
	unsigned int n = 0;

	character = getchar_timeout ( timeout );
	if ( character != ESC )
		return character;

	while ( ( character = getchar_timeout ( GETKEY_TIMEOUT ) ) >= 0 ) {
		if ( character == '[' )
			continue;
		if ( isdigit ( character ) ) {
			n = ( ( n * 10 ) + ( character - '0' ) );
			continue;
		}
		if ( character >= 0x40 )
			return KEY_ANSI ( n, character );
	}

	return ESC;
}


text:
define([
  'handlebars',
],
function(Handlebars) {

  function exists(val, options) {
      if (typeof val === 'undefined') {
        return options.inverse(this);
      } else {
        return options.fn(this);
      }
  }

  Handlebars.registerHelper('exists', exists);
  return exists;
});


text:
import { Server } from 'hapi'
import { main } from '../../src'
import knex from '../../src/components/knex'

import { setup, teardown } from '../common'

before(() => setup(knex))

after(() => teardown(knex))

const server = new Server({ debug: false })

before(async () => main(server))

describe('Test server routes', () => {
  const childContext = require.context('./', false, /\.inc\.js$/)

  childContext.keys().forEach(key => childContext(key)(server))
})


text:
chop.js RDFa module
===================

Dependencies
------------

None

_Used and combined [Green-Turtle](https://code.google.com/p/green-turtle/) RDFa
library._

$ch.rdfa.graph()
----------------

Analyzes and returns the RDFa graph of the HTML document in the form of
JavaScript object.

$ch.rdfa.subjects(`subject`)
----------------------------

Returns the details of the `subject` in the form of JavaScript object. If no
`subject` provided, returns all subjects in the HTML document.


text:
Tistory blog post manager

## Prerequisites

- Tistory OAuth credentials:

    client id, redirect URI

    Go http://www.tistory.com/guide/api/manage/register to create credentials.

## Install

1. With Go

        go get github.com/nullbus/story/story

1. Without Go

    TODO

You must run `story init` to setup your tistory account. It configures your environment and retrives your first access token. If the access token expires, just run `story auth` to begin reauthentication.

## Usage

### Command
```
story <command> [options...]
  story init
  story auth
  story info
  story show
  story edit
  story post
```

### Get your blog information

    story info -blog <blog name>

### Get single blog post

    story show -blog <blog name> <post id>


text:
//
//  Created by Jesse Squires
//  http://www.jessesquires.com
//
//
//  Documentation
//  http://cocoadocs.org/docsets/JSQMessagesViewController
//
//
//  GitHub
//  https://github.com/jessesquires/JSQMessagesViewController
//
//
//  License
//  Copyright (c) 2014 Jesse Squires
//  Released under an MIT license: http://opensource.org/licenses/MIT
//

#import "JSQMessagesCollectionViewCell.h"

/**
 *  A `JSQMessagesCollectionViewCellOutgoing` object is a concrete instance
 *  of `JSQMessagesCollectionViewCell` that represents an outgoing message data item.
 */
@interface JSQMessagesCollectionViewCellOutgoing : JSQMessagesCollectionViewCell

@end


text:
<?php
/**
 * Created by PhpStorm.
 * User: Pierre-Sylvain
 * Date: 30-07-17
 * Time: 22:04
 */

namespace AppBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use AppBundle\Entity\FranceRegion;
use Doctrine\Bundle\FixturesBundle\Fixture;

/**
 * Class LoadUserData
 * @package AppBundle\DataFixtures\ORM
 */
class LoadFranceRegionData extends Fixture implements FixtureInterface, ContainerAwareInterface
{

    /**
     * Create users*
     *
     * @param ObjectManager $manager
     */
    public function load(ObjectManager $manager)
    {
        // bin/console doctrine:fixtures:load

        $csv = fopen('./src/AppBundle/DataFixtures/ORM/FranceRegion.csv', 'r');
        $first = true;
        $count = 0;
        while (!feof($csv)) {
            if ($first) {
                $first = false;
                continue;
            }
            $line = fgetcsv($csv, 0, ';');
            if (empty($line)) {
                continue;
            };
            $franceRegion = new FranceRegion();
            $franceRegion->setRegion($line[0]);
            $franceRegion->setRegionCode($line[1]);
            $franceRegion->setRegionName($line[2]);
            $franceRegion->setChiefTown($line[3]);
            $franceRegion->setCountyCode($line[4]);
            $franceRegion->setCounty($line[5]);
            $franceRegion->setPrefecture($line[6]);
            $franceRegion->setDisctrictCode($line[7]);
            $franceRegion->setCity($line[8]);
            $franceRegion->setPostcode($line[9]);
            $franceRegion->setInsee($line[10]);
            $franceRegion->setLatitude($line[11]);
            $franceRegion->setLongitude($line[12]);
		if(isset($line[13]) && !empty($line[13])){
		    $franceRegion->setDistance($line[13]);
		} else {
		    $franceRegion->setDistance(0);
		}

            $manager->persist($franceRegion);
        }
        $manager->flush();
        fclose($csv);
    }
}


text:
import LingerAdapters.LingerBaseAdapter as lingerAdapters

class LogAdapter(lingerAdapters.LingerBaseAdapter):
    """LogAdapter ables logging lines to a given log"""

    def __init__(self, configuration):
        super(LogAdapter, self).__init__(configuration)
        self.logger.debug("LogAdapter started")

    def log(self, what_to_log):
        self.logger.info(what_to_log)

    def send_message(self, subject, text, **kwargs):
        self.log("Logging message. Subject: {}, text: {}".format(subject, text))

class LogAdapterFactory(lingerAdapters.LingerBaseAdapterFactory):
    """LogAdapterFactory generates LogAdapter instances"""
    def __init__(self):
        super(LogAdapterFactory, self).__init__()
        self.item = LogAdapter

    def get_instance_name(self):
        return "LogAdapter"


text:
class MakeNameGrainBelt < MongoidSilo::GrainBelt
  def generate
    {
      name: name
    }
  end
end


text:
 [](#skip-navbar_top "Skip navigation links")

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

Overview
Package
 Class
Use
Tree
Deprecated
Index
Help

 PREV CLASS   NEXT CLASS
FRAMES    NO FRAMES
All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD

------------------------------------------------------------------------

org.apache.struts.taglib.nested
 Class NestedReference
-------------------------------

    java.lang.Object
      org.apache.struts.taglib.nested.NestedReference

**All Implemented Interfaces:**
[Serializable](http://java.sun.com/j2se/1.4.2/docs/api/java/io/Serializable.html.md?is-external=true "class or interface in java.io")

------------------------------------------------------------------------

    public class NestedReference

extends [Object](http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html.md?is-external=true "class or interface in java.lang")

implements [Serializable](http://java.sun.com/j2se/1.4.2/docs/api/java/io/Serializable.html.md?is-external=true "class or interface in java.io")

So that a nested hierarchy can penetrate a dynamic JSP include, this class will hold the details of a bean name and nested property.

**Since:**
Struts 1.1

**Version:**
$Rev: 471754 $

**See Also:**
[Serialized Form](../../../../../serialized-form.html.md#org.apache.struts.taglib.nested.NestedReference)

------------------------------------------------------------------------

| **Constructor Summary**                                                       |
|-------------------------------------------------------------------------------|
| ` NestedReference()`
            Empty constructor.                                                  |
| ` NestedReference(String name, String property)`
            Constructor takes the all the relevant details to init the object.  |

**Method Summary**

` String`

` getBeanName()`
           Getter for the bean name

` String`

` getNestedProperty()`
           Getter for the nested property

` void`

` setBeanName(String newName)`
           Setter for the bean name

` void`

` setNestedProperty(String newProperty)`
           Setter for the nested property

| **Methods inherited from class java.lang.[Object](http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html.md?is-external=true "class or interface in java.lang")** |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`                                                                          |

**Constructor Detail**

### NestedReference

    public NestedReference()

Empty constructor.

------------------------------------------------------------------------

### NestedReference

    public NestedReference(String name,
                           String property)

Constructor takes the all the relevant details to init the object.

**Parameters:**
`name` - String name of the bean that the include is to reference

`property` - String nested property value that the include will be continuing on with.

**Method Detail**

### getBeanName

    public String getBeanName()

Getter for the bean name

**Returns:**
String value that will be the bean's reference

------------------------------------------------------------------------

### setBeanName

    public void setBeanName(String newName)

Setter for the bean name

**Parameters:**
`newName` - String value to set the bean reference.

------------------------------------------------------------------------

### getNestedProperty

    public String getNestedProperty()

Getter for the nested property

**Returns:**
String value that is the nested property for the current nesting

------------------------------------------------------------------------

### setNestedProperty

    public void setNestedProperty(String newProperty)

Setter for the nested property

**Parameters:**
`newProperty` - String value of the new current nesting level

------------------------------------------------------------------------

 [](#skip-navbar_bottom "Skip navigation links")

<colgroup>
<col width="50%" />
<col width="50%" />
</colgroup>

Overview
Package
 Class
Use
Tree
Deprecated
Index
Help

 PREV CLASS   NEXT CLASS
FRAMES    NO FRAMES
All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD

------------------------------------------------------------------------

Copyright © 2000-2008 [Apache Software Foundation](http://www.apache.org/). All Rights Reserved.


text:
Intel(R) Software Guard Extensions for Linux\* OS
================================================

# linux-sgx

Introduction
------------
Intel(R) Software Guard Extensions (Intel(R) SGX) is an Intel technology for application developers seeking to protect select code and data from disclosure or modification.

The Linux SGX software stack is comprised of the SGX driver, the SGX SDK, and the SGX Platform Software. The SGX SDK and SGX PSW are hosted in the [linux-sgx](https://github.com/01org/linux-sgx) project.

The [linux-sgx-driver](https://github.com/01org/linux-sgx-driver) project hosts the out-of-tree driver for the Linux SGX software stack, which will be used until the driver upstreaming process is complete.

License
-------
See License.txt for details.

Documentation
-------------
- [Intel(R) SGX for Linux\* OS][1] project home page on [01.org](http://01.org)
- [Intel(R) SGX Programming Reference][2]
[1]: https://01.org/intel-softwareguard-extensions
[2]: https://software.intel.com/sites/default/files/managed/48/88/329298-002.pdf

Build and Install the Intel(R) SGX Driver
-----------------------------------------
Follow the instructions in the [linux-sgx-driver](https://github.com/01org/linux-sgx-driver) project to build and install the SGX driver.

Build the Intel(R) SGX SDK and Intel(R) SGX PSW Package
-------------------------------------------------------
###Prerequisites:
- Ensure that you have the following required operating systems:
  Ubuntu\*-14.04-LTS 64bits
- Use the following command to install the required tools to build Intel(R) SGX SDK:
```
  $ sudo apt-get install build-essential ocaml automake autoconf libtool
```
- Use the following command to install additional required tools to build Intel(R) SGX PSW:
```
  $ sudo apt-get install libcurl4-openssl-dev protobuf-compiler protobuf-c-compiler libprotobuf-dev libprotobuf-c0-dev
```
- Use the script `download_prebuilt.sh` inside source code package to download prebuilt binaries to prebuilt folder
  You may need set http proxy for wget tool used by the script (such as `export http_proxy=http://test-proxy:test-port`)
```
  $ ./download_prebuilt.sh
```

###Build the Intel(R) SGX SDK and Intel(R) SGX PSW
The following steps describe how to build the Intel SGX SDK and PSW. You can build the project according to your requirement.
- To build both Intel SGX SDK and PSW with default configuration, enter the following command:
  You can find the tools and libraries generated in the `build/linux` directory.
  **Note**: You can also go to the sdk folder and use the `make` command to build the Intel SGX SDK component only. However, the building of PSW component is dependent on the building result of Intel SGX SDK.
```
  $ make
```

- To build Intel SGX SDK and PSW with debug information, enter the following command:
```
  $ make DEBUG=1
```
- To clean the files generated by previous `make` command, enter the following command:
```
  $ make clean
```

###Build Intel(R) SGX SDK Installer
To build Intel(R) SGX SDK installer, enter the following command:
```
$ make sdk_install_pkg
```
You can find the generated Intel SGX SDK installer `sgx_linux_x64_sdk_${version}.bin` located under `linux/installer/bin/`, where `${version}` refers to the version number.

###Build Intel(R) SGX PSW Installer
To build Intel(R) SGX PSW installer, enter the following command:
```
$ make psw_install_pkg
```
You can find the generated Intel SGX PSW installer `sgx_linux_x64_psw_${version}.bin` located under `linux/installer/bin/`, where `${version}` refers to the version number.

Install Intel(R) SGX SDK
------------------------
###Prerequisites
- Ensure that you have the following required operating systems:
  Ubuntu\*-14.04-LTS
- Use the following command to install the required tool to use Intel(R) SGX SDK:
```
  $ sudo apt-get install build-essential
```

###Install Intel(R) SGX SDK
To install Intel(R) SGX SDK, execute the installer with root privilege:
```
$ cd linux/installer/bin
$ sudo ./sgx_linux_x64_sdk_${version}.bin
```
###Test Intel(R) SGX SDK Package with the Sample Codes
- Copy the sample codes installed by Intel(R) SGX SDK package into your work folder, such as
```
  $ cp -r /opt/intel/sgxsdk/SampleCode ~
```
- Compile and run each sample codes in the simulation mode to make sure the package works well.
```
  $ cd SampleCode/LocalAttestation
  $ make
  $ ./app
```
   Use similar commands for other sample codes.

###Compile and Run the Sample Codes in the Hardware Mode
If you use an SGX hardware enabled machine, you need to run the sample codes in the hardware mode.
Ensure that you install SGX driver and Intel(R) SGX PSW installer on the machine.
See the topic, Install Intel(R) SGX PSW, on how to install the PSW package.
- Copy the sample codes installed by the Intel(R) SGX SDK package into your work folder, such as
```
  $ cp -r /opt/intel/sgxsdk/SampleCode ~
```
- Compile and run each sample codes in the debug mode.
```
  $ cd SampleCode/LocalAttestation
  $ make SGX_MODE=HW SGX_DEBUG=1
  $ ./app
```
   Use similar commands for other sample codes.

Install Intel(R) SGX PSW
------------------------
###Prerequisites
- Ensure that you have the following required operating systems:
  Ubuntu\*-14.04-LTS 64bits
- Ensure that you have the following required hardware:
  6th Generation Intel(R) Core(TM) Processor (code named Skylake)
- Configure the system with the **SGX hardware enabled** option and install SGX driver in advance.
  See the topic, Build and Install the Intel(R) SGX Driver, on how to install the SGX driver.
- Install the library using the following command:
```
  $ sudo apt-get install libcurl4-openssl-dev libprotobuf-dev libprotobuf-c0-dev
```

###Install Intel(R) SGX PSW
To install Intel(R) SGX PSW, execute the installer with root privilege:
```
$ cd linux/installer/bin
$ sudo ./sgx_linux_x64_psw_${version}.bin
```

###Start or Stop aesmd Service
The Intel(R) SGX PSW installer installs an aesmd service in your machine which is running in a special linux account aesmd.
To stop the service: `$ sudo service aesmd stop`
To start the service: `$ sudo service aesmd start`
To restart the service: `$ sudo service aesmd restart`

###Configure the Proxy for aesmd Service
The aesmd service uses HTTP protocol to initialize some services.
If proxy is required for HTTP protocol, you may need manually setup the proxy for aesmd service.
You should manually edit file `/etc/aesmd.conf` (refer the comment in the file) to set the proxy for aesmd service.
After you configure the proxy, you need to restart the service to enable the proxy.


text:
@class DBFILEPROPERTIESAddPropertiesError;
@class DBFILEPROPERTIESLookupError;

NS_ASSUME_NONNULL_BEGIN

#pragma mark - API Object

///
/// The `AddPropertiesError` union.
///
/// This class implements the `DBSerializable` protocol (serialize and
/// deserialize instance methods), which is required for all Obj-C SDK API route
/// objects.
///
@interface DBFILEPROPERTIESAddPropertiesError : NSObject <DBSerializable, NSCopying>

#pragma mark - Instance fields

/// The `DBFILEPROPERTIESAddPropertiesErrorTag` enum type represents the
/// possible tag states with which the `DBFILEPROPERTIESAddPropertiesError`
/// union can exist.
typedef NS_ENUM(NSInteger, DBFILEPROPERTIESAddPropertiesErrorTag) {
  /// Template does not exist for the given identifier.
  DBFILEPROPERTIESAddPropertiesErrorTemplateNotFound,

  /// You do not have permission to modify this template.
  DBFILEPROPERTIESAddPropertiesErrorRestrictedContent,

  /// (no description).
  DBFILEPROPERTIESAddPropertiesErrorOther,

  /// (no description).
  DBFILEPROPERTIESAddPropertiesErrorPath,

  /// This folder cannot be tagged. Tagging folders is not supported for
  /// team-owned templates.
  DBFILEPROPERTIESAddPropertiesErrorUnsupportedFolder,

  /// One or more of the supplied property field values is too large.
  DBFILEPROPERTIESAddPropertiesErrorPropertyFieldTooLarge,

  /// One or more of the supplied property fields does not conform to the
  /// template specifications.
  DBFILEPROPERTIESAddPropertiesErrorDoesNotFitTemplate,

  /// A property group associated with this template and file already exists.
  DBFILEPROPERTIESAddPropertiesErrorPropertyGroupAlreadyExists,

};

/// Represents the union's current tag state.
@property (nonatomic, readonly) DBFILEPROPERTIESAddPropertiesErrorTag tag;

/// Template does not exist for the given identifier. @note Ensure the
/// `isTemplateNotFound` method returns true before accessing, otherwise a
/// runtime exception will be raised.
@property (nonatomic, readonly, copy) NSString *templateNotFound;

/// (no description). @note Ensure the `isPath` method returns true before
/// accessing, otherwise a runtime exception will be raised.
@property (nonatomic, readonly) DBFILEPROPERTIESLookupError *path;

#pragma mark - Constructors

///
/// Initializes union class with tag state of "template_not_found".
///
/// Description of the "template_not_found" tag state: Template does not exist
/// for the given identifier.
///
/// @param templateNotFound Template does not exist for the given identifier.
///
/// @return An initialized instance.
///
- (instancetype)initWithTemplateNotFound:(NSString *)templateNotFound;

///
/// Initializes union class with tag state of "restricted_content".
///
/// Description of the "restricted_content" tag state: You do not have
/// permission to modify this template.
///
/// @return An initialized instance.
///
- (instancetype)initWithRestrictedContent;

///
/// Initializes union class with tag state of "other".
///
/// @return An initialized instance.
///
- (instancetype)initWithOther;

///
/// Initializes union class with tag state of "path".
///
/// @param path (no description).
///
/// @return An initialized instance.
///
- (instancetype)initWithPath:(DBFILEPROPERTIESLookupError *)path;

///
/// Initializes union class with tag state of "unsupported_folder".
///
/// Description of the "unsupported_folder" tag state: This folder cannot be
/// tagged. Tagging folders is not supported for team-owned templates.
///
/// @return An initialized instance.
///
- (instancetype)initWithUnsupportedFolder;

///
/// Initializes union class with tag state of "property_field_too_large".
///
/// Description of the "property_field_too_large" tag state: One or more of the
/// supplied property field values is too large.
///
/// @return An initialized instance.
///
- (instancetype)initWithPropertyFieldTooLarge;

///
/// Initializes union class with tag state of "does_not_fit_template".
///
/// Description of the "does_not_fit_template" tag state: One or more of the
/// supplied property fields does not conform to the template specifications.
///
/// @return An initialized instance.
///
- (instancetype)initWithDoesNotFitTemplate;

///
/// Initializes union class with tag state of "property_group_already_exists".
///
/// Description of the "property_group_already_exists" tag state: A property
/// group associated with this template and file already exists.
///
/// @return An initialized instance.
///
- (instancetype)initWithPropertyGroupAlreadyExists;

- (instancetype)init NS_UNAVAILABLE;

#pragma mark - Tag state methods

///
/// Retrieves whether the union's current tag state has value
/// "template_not_found".
///
/// @note Call this method and ensure it returns true before accessing the
/// `templateNotFound` property, otherwise a runtime exception will be thrown.
///
/// @return Whether the union's current tag state has value
/// "template_not_found".
///
- (BOOL)isTemplateNotFound;

///
/// Retrieves whether the union's current tag state has value
/// "restricted_content".
///
/// @return Whether the union's current tag state has value
/// "restricted_content".
///
- (BOOL)isRestrictedContent;

///
/// Retrieves whether the union's current tag state has value "other".
///
/// @return Whether the union's current tag state has value "other".
///
- (BOOL)isOther;

///
/// Retrieves whether the union's current tag state has value "path".
///
/// @note Call this method and ensure it returns true before accessing the
/// `path` property, otherwise a runtime exception will be thrown.
///
/// @return Whether the union's current tag state has value "path".
///
- (BOOL)isPath;

///
/// Retrieves whether the union's current tag state has value
/// "unsupported_folder".
///
/// @return Whether the union's current tag state has value
/// "unsupported_folder".
///
- (BOOL)isUnsupportedFolder;

///
/// Retrieves whether the union's current tag state has value
/// "property_field_too_large".
///
/// @return Whether the union's current tag state has value
/// "property_field_too_large".
///
- (BOOL)isPropertyFieldTooLarge;

///
/// Retrieves whether the union's current tag state has value
/// "does_not_fit_template".
///
/// @return Whether the union's current tag state has value
/// "does_not_fit_template".
///
- (BOOL)isDoesNotFitTemplate;

///
/// Retrieves whether the union's current tag state has value
/// "property_group_already_exists".
///
/// @return Whether the union's current tag state has value
/// "property_group_already_exists".
///
- (BOOL)isPropertyGroupAlreadyExists;

///
/// Retrieves string value of union's current tag state.
///
/// @return A human-readable string representing the union's current tag state.
///
- (NSString *)tagName;

@end

#pragma mark - Serializer Object

///
/// The serialization class for the `DBFILEPROPERTIESAddPropertiesError` union.
///
@interface DBFILEPROPERTIESAddPropertiesErrorSerializer : NSObject

///
/// Serializes `DBFILEPROPERTIESAddPropertiesError` instances.
///
/// @param instance An instance of the `DBFILEPROPERTIESAddPropertiesError` API
/// object.
///
/// @return A json-compatible dictionary representation of the
/// `DBFILEPROPERTIESAddPropertiesError` API object.
///
+ (nullable NSDictionary *)serialize:(DBFILEPROPERTIESAddPropertiesError *)instance;

///
/// Deserializes `DBFILEPROPERTIESAddPropertiesError` instances.
///
/// @param dict A json-compatible dictionary representation of the
/// `DBFILEPROPERTIESAddPropertiesError` API object.
///
/// @return An instantiation of the `DBFILEPROPERTIESAddPropertiesError` object.
///
+ (DBFILEPROPERTIESAddPropertiesError *)deserialize:(NSDictionary *)dict;

@end

NS_ASSUME_NONNULL_END


text:
package com.baidu.yun.channel.sample;

import com.baidu.yun.channel.auth.ChannelKeyPair;
import com.baidu.yun.channel.client.BaiduChannelClient;
import com.baidu.yun.channel.exception.ChannelClientException;
import com.baidu.yun.channel.exception.ChannelServerException;
import com.baidu.yun.channel.model.PushUnicastMessageRequest;
import com.baidu.yun.channel.model.PushUnicastMessageResponse;
import com.baidu.yun.core.log.YunLogEvent;
import com.baidu.yun.core.log.YunLogHandler;

public class IosPushNotificationSample {

    public static void main(String[] args) {

        /*
         * @brief 推送单播通知(IOS APNS) message_type = 1 (默认为0)
         */
        // 1. 设置developer平台的ApiKey/SecretKey
        String apiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
        String secretKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
        ChannelKeyPair pair = new ChannelKeyPair(apiKey, secretKey);

        // 2. 创建BaiduChannelClient对象实例
        BaiduChannelClient channelClient = new BaiduChannelClient(pair);

        // 3. 若要了解交互细节,请注册YunLogHandler类
        channelClient.setChannelLogHandler(new YunLogHandler() {
            @Override
            public void onHandle(YunLogEvent event) {
                System.out.println(event.getMessage());
            }
        });

        try {

            // 4. 创建请求类对象
            // 手机端的ChannelId, 手机端的UserId, 先用1111111111111代替,用户需替换为自己的
            PushUnicastMessageRequest request = new PushUnicastMessageRequest();
            request.setDeviceType(4); // device_type => 1: web 2: pc 3:android
                                      // 4:ios 5:wp
            request.setDeployStatus(2); // DeployStatus => 1: Developer 2:
                                        // Production
            request.setChannelId(11111111111L);
            request.setUserId("1111111111111");

            request.setMessageType(1);
            request.setMessage("{\"aps\":{\"alert\":\"Hello Baidu Channel\"}}");

            // 5. 调用pushMessage接口
            PushUnicastMessageResponse response = channelClient
                    .pushUnicastMessage(request);

            // 6. 认证推送成功
            System.out.println("push amount : " + response.getSuccessAmount());

        } catch (ChannelClientException e) {
            // 处理客户端错误异常
            e.printStackTrace();
        } catch (ChannelServerException e) {
            // 处理服务端错误异常
            System.out.println(String.format(
                    "request_id: %d, error_code: %d, error_message: %s",
                    e.getRequestId(), e.getErrorCode(), e.getErrorMsg()));
        }

    }

}


text:
import os
from flask.ext.testing import TestCase as FlaskTestCase

from typeseam.app import (
    create_app as _create_app,
    db
    )

from tests.utils import get_value_for_name

class BaseTestCase(FlaskTestCase):
    '''
    A base test case that boots our app
    '''
    def create_app(self):
        os.environ['CONFIG'] = 'typeseam.settings.TestConfig'
        app = _create_app()
        app.testing = True
        return app

    def get_input_value(self, name, response):
        return get_value_for_name(name, response.data.decode('utf-8'))

    def setUp(self):
        FlaskTestCase.setUp(self)
        db.create_all()

    def tearDown(self):
        db.session.remove()
        db.drop_all()
        db.get_engine(self.app).dispose()


text:
package org.jetbrains.plugins.scala
package lang
package psi
package api

import com.intellij.openapi.util.TextRange
import com.intellij.psi.impl.source.PsiFileWithStubSupport
import com.intellij.psi.{PsiClass, PsiClassOwnerEx, PsiImportHolder}
import org.jetbrains.annotations.Nullable
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.ScToplevelElement
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.packaging.ScPackaging

/**
 * @author ilyas
 */

trait ScalaFile extends ScalaPsiElement with ScToplevelElement with PsiClassOwnerEx with ScDeclarationSequenceHolder
    with PsiImportHolder with ScImportsHolder with PsiFileWithStubSupport {

  @Deprecated
  def importClass(aClass: PsiClass): Boolean = {
    addImportForClass(aClass)
    true
  }

  def getPackagings: Array[ScPackaging]

  def getPackageName: String

  @Nullable
  def packageName: String

  def packagingRanges: Seq[TextRange]

  def isCompiled: Boolean

  def sourceName: String

  def isScriptFile(withCaching: Boolean = true): Boolean

  def isWorksheetFile: Boolean
}


text:
require 'json'

module Quandl
  module Client
    module Middleware
      class ParseJSON < Faraday::Response::Middleware

        def on_complete(env)
          env[:body] = case env[:status]
          when 204
            parse('{}', env)
          else
            parse(env[:body], env)
          end
        end

        def parse(body, env)
          json = parse_json(body, env)
          json.has_key?(:docs) ? format_collection( json, env ) : format_record( json, env )
        end

        def format_record(json, env)
          errors = json.delete(:errors) || {}
          metadata = json.delete(:metadata) || {}
          # collect some response data
          metadata.merge!({
            status:                 env[:status],
            headers:                env[:response_headers],
            method:                 env[:method],
            })
          # return object
          object = {
            :data => json,
            :errors => errors,
            :metadata => metadata
          }
          env[:status] = 200
          object
        end

        def format_collection(json, env)
          errors = json.delete(:errors) || {}
          metadata = json.delete(:metadata) || {}
          docs = json.delete(:docs)
          # collect some response data
          metadata.merge!(json).merge!({
            status:                 env[:status],
            headers:                env[:response_headers],
            method:                 env[:method],
            })
          # each doc metadata references metadata
          docs.each{|d| d[:metadata] = metadata }
          # return object
          object = {
            :data => docs,
            :errors => errors,
            :metadata => metadata
          }
          env[:status] = 200
          object
        end

        def parse_json(body = nil, env)
          body ||= '{}'
          json = begin
            JSON.parse(body).symbolize_keys!
          rescue JSON::ParserError
            nil
          end
          # invalid json body?
          if json.blank?
            # fallback to error message
            json = {
              id: 1,
              errors: {
                parse_errors:  [ "Quandl::Client::ParseJSON error. status: #{env[:status]}, body: #{body.inspect}" ]
              }
            }
          end
          json
        end

      end
    end
  end
end


text: Money.default_currency = Money::Currency.new("EUR")


text:
package org.jastadd.tinytemplate;

import java.io.PrintStream;
import java.io.PrintWriter;

/**
 * Process a file as a single template declaration.
 * @author Jesper Öqvist <jesper.oqvist@cs.lth.se>
 */
public class SingleTemplateProcessor {
  static class SystemPropertyContext extends TemplateContext {

    private final TemplateContext parentContext;

    /**
     * Create a new simple context
     * @param parent parent context
     */
    public SystemPropertyContext(TemplateContext parent) {
      parentContext = parent;
    }

    @Override
    public Object evalVariable(String varName) {
      return System.getProperty(varName);
    }

    @Override
    public Object evalAttribute(String attribute) {
      return parentContext.evalAttribute(attribute);
    }

    @Override
    public String evalIndentation(int levels) {
      return parentContext.evalIndentation(levels);
    }

    @Override
    public void expand(TemplateContext tc, String templateName, PrintStream out) {
      parentContext.expand(tc, templateName, out);
    }

    @Override
    public void expand(TemplateContext tc, String templateName, PrintWriter out) {
      parentContext.expand(tc, templateName, out);
    }

    @Override
    public void expand(TemplateContext tc, String templateName, StringBuffer out) {
      parentContext.expand(tc, templateName, out);
    }

    @Override
    public void expand(TemplateContext tc, String templateName, StringBuilder out) {
      parentContext.expand(tc, templateName, out);
    }

    @Override
    public void flushVariables() {
    }

    @Override
    public void bind(String varName, Object value) {
    }
  }

  /**
   * Entry point
   * @param args
   */
  public static void main(String[] args) {
    for (String arg: args) {
      if (arg.equals("-h") || arg.equals("-help")) {
        System.out.println("usage: tinytemplate < single template declaration");
        System.exit(0);
        return;
      }
    }
    try {
      TinyTemplate tt = new TinyTemplate();
      TemplateParser parser = new TemplateParser(tt, System.in);
      Template template = parser.parseSingleTemplate();
      template.expand(new SystemPropertyContext(tt), System.out);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Picea bicolor var. reflexa Shiras.

### Remarks
null


text:
package energy.usef.core.service.helper;

import static org.mockito.Matchers.contains;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import energy.usef.core.controller.error.BaseOutgoingErrorMessageController;
import energy.usef.core.data.xml.bean.message.CommonReferenceQuery;
import energy.usef.core.util.CDIUtil;
import energy.usef.core.util.ReflectionUtil;
import energy.usef.core.util.XMLUtil;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.slf4j.Logger;

/**
 * JUnit test for the OutgoingErrorMessageDispatcherHelperService class.
 */
@RunWith(PowerMockRunner.class)
@PrepareForTest({ CDIUtil.class })
public class OutgoingErrorMessageDispatcherHelperServiceTest {

    private OutgoingErrorMessageDispatcherHelperService service;

    @Mock
    private Logger LOGGER;

    @Mock
    private BaseOutgoingErrorMessageController<?> controller;

    @Before
    public void init() throws Exception {
        service = new OutgoingErrorMessageDispatcherHelperService();
        ReflectionUtil.setFinalStatic(OutgoingErrorMessageDispatcherHelperService.class.getDeclaredField("LOGGER"), LOGGER);
    }

    /**
     * Tests DispatcherService.dispatch method.
     *
     * @throws Exception
     */
    @Test
    public void dispatchWithErrorTest() throws Exception {
        CommonReferenceQuery message = new CommonReferenceQuery();
        String xml = XMLUtil.messageObjectToXml(message);

        service.dispatch(xml);

        verify(LOGGER, times(1)).debug(contains("Can not find the corresponding message error controller for the class"),
                Matchers.any(Class.class));
    }
}


text:
package ch.tkuhn.nanopub.server;

import java.io.File;

import org.nanopub.MultiNanopubRdfHandler;
import org.nanopub.MultiNanopubRdfHandler.NanopubHandler;
import org.nanopub.extra.server.NanopubSurfacePattern;
import org.nanopub.Nanopub;
import org.eclipse.rdf4j.rio.RDFFormat;
import org.eclipse.rdf4j.rio.Rio;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LoadFiles implements Runnable {

	private static LoadFiles running;
	private static Thread thread;

	private static NanopubDb db = NanopubDb.get();
	private static NanopubSurfacePattern ourPattern = ServerConf.getInfo().getNanopubSurfacePattern();

	public static synchronized void check() {
		if (running != null) {
//			if (running.aliveAtTime + 60 * 60 * 1000 < System.currentTimeMillis()) {
//				running.logger.info("No sign of life of the daemon for 60 minutes... (the starting of a new one is disabled)");
//				running.aliveAtTime = System.currentTimeMillis();
//				return;
			if (running.aliveAtTime + 7 * 24 * 60 * 60 * 1000 < System.currentTimeMillis()) {
				running.logger.info("No sign of life of the daemon for 7 days. Starting a new one...");
				running.aliveAtTime = System.currentTimeMillis();
				running = null;
				thread.interrupt();
			} else {
				return;
			}
		}
		if (ServerConf.get().getLoadDir() == null) return;
		try {
			running = new LoadFiles();
			thread = new Thread(running);
			thread.setDaemon(true);
			thread.start();
		} catch (Exception ex) {
			LoggerFactory.getLogger(LoadFiles.class).error(ex.getMessage(), ex);
		}
	}

	private Logger logger = LoggerFactory.getLogger(this.getClass());
	private long aliveAtTime;

	private final File loadDir, processingDir, doneDir;

	private LoadFiles() {
		stillAlive();
		loadDir = new File(ServerConf.get().getLoadDir());
		processingDir = new File(loadDir, "processing");
		if (!processingDir.exists()) processingDir.mkdir();
		doneDir = new File(loadDir, "done");
		if (!doneDir.exists()) doneDir.mkdir();
	}

	@Override
	public void run() {
		stillAlive();
		logger.info("Start file loading thread");
		try {
			try {
				int ms = 30000;
				logger.info("Wait " + ms + "ms...");
				Thread.sleep(ms);
			} catch(InterruptedException ex) {
				Thread.currentThread().interrupt();
			}
			checkFilesToLoad();
		} finally {
			running = null;
		}
	}

	private void checkFilesToLoad() {
		logger.info("Check whether there are files to load...");
		for (File f : loadDir.listFiles()) {
			stillAlive();
			if (f.isDirectory()) continue;
			logger.info("Try to load file: " + f);
			try {
				final File processingFile = new File(processingDir, f.getName());
				f.renameTo(processingFile);
				RDFFormat format = Rio.getParserFormatForFileName(processingFile.getName()).orElse(null);
				MultiNanopubRdfHandler.process(format, processingFile, new NanopubHandler() {
					@Override
					public void handleNanopub(Nanopub np) {
						if (!ourPattern.matchesUri(np.getUri().toString())) return;
						try {
							db.loadNanopub(np);
						} catch (Exception ex) {
							logger.error("Failed to load nanopublication", ex);
						}
						stillAlive();
					}
				});
				processingFile.renameTo(new File(doneDir, f.getName()));
				logger.info("File loaded: " + processingFile);
			} catch (Exception ex) {
				logger.error("Failed to load file: " + f, ex);
			}
		}
	}

	private void stillAlive() {
		aliveAtTime = System.currentTimeMillis();
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

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

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

<!--
The distribution.
Assumes jar made and onejar has been assembled.
-->

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">

  <id>distribution</id>

  <formats>
    <format>zip</format>
  </formats>

  <baseDirectory>apache-${project.artifactId}-${project.version}</baseDirectory>

  <files>
    <file>
      <source>${project.build.directory}/${server.jar.name}.jar</source>
      <outputDirectory></outputDirectory>
      <destName>fuseki-server.jar</destName>
    </file>
  </files>

  <fileSets>
    <fileSet>
      <outputDirectory></outputDirectory>
      <includes>
	<include>README*</include>
	<include>DISCLAIMER*</include>
	<include>LICENSE*</include>
	<include>NOTICE*</include>
	<include>ChangeLog.txt</include>
	<include>pom.xml</include>
      </includes>
    </fileSet>

    <fileSet>
      <outputDirectory></outputDirectory>
      <includes>
	<include>log4j.properties</include>
	<include>fuseki-server</include>
	<include>tdb.ttl</include>
	<include>s-*</include>
	<include>pages-update/*</include>
	<include>pages-publish/*</include>
      </includes>
    </fileSet>
  </fileSets>
</assembly>


text:
namespace OpenStack.Services.Identity.V2
{
    using Newtonsoft.Json;
    using OpenStack.ObjectModel;

    /// <summary>
    /// This class models the JSON representation of an HTTP API response containing an <see cref="V2.Extension"/>
    /// object.
    /// </summary>
    /// <threadsafety static="true" instance="false"/>
    /// <preliminary/>
    [JsonObject(MemberSerialization.OptIn)]
    public class ExtensionResponse : ExtensibleJsonObject
    {
#pragma warning disable 649 // Field 'fieldName' is never assigned to, and will always have its default value {value}
        /// <summary>
        /// This is the backing field for the <see cref="Extension"/> property.
        /// </summary>
        [JsonProperty("extension", DefaultValueHandling = DefaultValueHandling.Ignore)]
        private Extension _extension;
#pragma warning restore 649

        /// <summary>
        /// Initializes a new instance of the <see cref="ExtensionResponse"/> class
        /// during JSON deserialization.
        /// </summary>
        [JsonConstructor]
        protected ExtensionResponse()
        {
        }

        /// <summary>
        /// Gets the <see cref="V2.Extension"/> object.
        /// </summary>
        /// <value>
        /// <para>The <see cref="V2.Extension"/> object</para>
        /// <token>NullIfNotIncluded</token>
        /// </value>
        public Extension Extension
        {
            get
            {
                return _extension;
            }
        }
    }
}


text:
var body = document.createElement('div', {
  classStyle: { alignItems: 'center', marginTop: 120 }
})

var image = document.createElement('image', {
  attr: { src: 'http://alibaba.github.io/weex/img/weex_logo_blue@3x.png' },
  classStyle: { width: 360, height: 82 }
})

var text = document.createElement('text', {
  attr: { value: 'Hello World' },
  classStyle: { fontSize: 48 }
})

body.appendChild(image)
body.appendChild(text)
document.documentElement.appendChild(body)

body.addEvent('click', function () {
  text.setAttr('value', 'Hello Weex')
})

sendTasks(id, [{ module: 'dom', method: 'createFinish', args: []}])


text:
#ifndef TENSORFLOW_COMPILER_XLA_PJRT_C_PJRT_C_API_WRAPPER_IMPL_H_
#define TENSORFLOW_COMPILER_XLA_PJRT_C_PJRT_C_API_WRAPPER_IMPL_H_

#include <memory>
#include <optional>
#include <string>
#include <vector>

#include "tensorflow/compiler/xla/pjrt/c/pjrt_c_api.h"
#include "tensorflow/compiler/xla/pjrt/pjrt_client.h"
#include "tensorflow/compiler/xla/pjrt/pjrt_future.h"

struct PJRT_Error {
  xla::Status status;
};

struct PJRT_Client {
  std::unique_ptr<xla::PjRtClient> client;
  std::vector<PJRT_Device> owned_devices;
  // `devices` contains the addresses of the contents of `owned_devices`.
  std::vector<PJRT_Device*> devices;
  // `addressable_devices` contains pointers to the `owned_devices` that the
  // client can issue commands to.
  std::vector<PJRT_Device*> addressable_devices;
  // Map from wrapped C++ devices to C devices. The values are the same as
  // `owned_devices`.
  absl::flat_hash_map<xla::PjRtDevice*, PJRT_Device*> c_device_from_cpp_device;
};

// PJRT_Devices are owned by their corresponding PJRT_Client.
struct PJRT_Device {
  // The xla::PjRtDevice* is owned by the corresponding xla::PjRtClient.
  xla::PjRtDevice* device;
  // The device specific attributes which are initialized once per device.
  std::vector<PJRT_Device_Attribute> attributes;
};

struct PJRT_Executable {
  std::unique_ptr<xla::PjRtLoadedExecutable> executable;
  PJRT_Client* client;
  // These pointers are a subset of `client`'s `addressable_devices`, i.e. those
  // addressed by the compiled executable program. `client` owns the objects
  // these point to.
  std::vector<PJRT_Device*> addressable_devices;
  // TODO(b/237545405): Remove `populated` once we implement creation methods
  // for PJRT_Executable that can populate addressable_devices on instantiation.
  bool populated = false;
};

struct PJRT_Buffer {
  std::unique_ptr<xla::PjRtBuffer> buffer;
  PJRT_Client* client;
};

struct PJRT_Event {
  xla::PjRtFuture<xla::Status> future;
  // Set and stored upon future.Await(), as PjRtFuture only allows its result to
  // be queried through Await() and Await() can only safely be called once. This
  // variable allows C API users to check for error status any time after
  // Await() has been called.
  std::optional<xla::Status> status;
};

namespace pjrt {

// C API definitions

void PJRT_Error_Destroy(PJRT_Error_Destroy_Args* args);
void PJRT_Error_Message(PJRT_Error_Message_Args* args);
PJRT_Error* PJRT_Error_GetCode(PJRT_Error_GetCode_Args* args);

PJRT_Error* PJRT_Event_Destroy(PJRT_Event_Destroy_Args* args);
PJRT_Error* PJRT_Event_IsReady(PJRT_Event_IsReady_Args* args);
PJRT_Error* PJRT_Event_Error(PJRT_Event_Error_Args* args);
PJRT_Error* PJRT_Event_Await(PJRT_Event_Await_Args* args);
PJRT_Error* PJRT_Event_OnReady(PJRT_Event_OnReady_Args* args);

PJRT_Error* PJRT_Client_Destroy(PJRT_Client_Destroy_Args* args);
PJRT_Error* PJRT_Client_PlatformName(PJRT_Client_PlatformName_Args* args);
PJRT_Error* PJRT_Client_ProcessIndex(PJRT_Client_ProcessIndex_Args* args);
PJRT_Error* PJRT_Client_PlatformVersion(PJRT_Client_PlatformVersion_Args* args);
PJRT_Error* PJRT_Client_Devices(PJRT_Client_Devices_Args* args);
PJRT_Error* PJRT_Client_AddressableDevices(
    PJRT_Client_AddressableDevices_Args* args);
PJRT_Error* PJRT_Client_LookupDevice(PJRT_Client_LookupDevice_Args* args);
PJRT_Error* PJRT_Client_Compile(PJRT_Client_Compile_Args* args);
PJRT_Error* PJRT_Client_DefaultDeviceAssignment(
    PJRT_Client_DefaultDeviceAssignment_Args* args);
PJRT_Error* PJRT_Client_BufferFromHostBuffer(
    PJRT_Client_BufferFromHostBuffer_Args* args);

PJRT_Error* PJRT_Device_Id(PJRT_Device_Id_Args* args);
PJRT_Error* PJRT_Device_ProcessIndex(PJRT_Device_ProcessIndex_Args* args);
PJRT_Error* PJRT_Device_IsAddressable(PJRT_Device_IsAddressable_Args* args);
PJRT_Error* PJRT_Device_Attributes(PJRT_Device_Attributes_Args* args);
PJRT_Error* PJRT_Device_Kind(PJRT_Device_Kind_Args* args);
PJRT_Error* PJRT_Device_LocalHardwareId(PJRT_Device_LocalHardwareId_Args* args);
PJRT_Error* PJRT_Device_DebugString(PJRT_Device_DebugString_Args* args);
PJRT_Error* PJRT_Device_ToString(PJRT_Device_ToString_Args* args);

PJRT_Error* PJRT_Executable_Destroy(PJRT_Executable_Destroy_Args* args);
PJRT_Error* PJRT_Executable_Name(PJRT_Executable_Name_Args* args);
PJRT_Error* PJRT_Executable_AddressableDevices(
    PJRT_Executable_AddressableDevices_Args* args);
PJRT_Error* PJRT_Executable_NumOutputs(PJRT_Executable_NumOutputs_Args* args);
PJRT_Error* PJRT_Executable_SizeOfGeneratedCodeInBytes(
    PJRT_Executable_SizeOfGeneratedCodeInBytes_Args* args);
PJRT_Error* PJRT_Executable_Delete(PJRT_Executable_Delete_Args* args);
PJRT_Error* PJRT_Executable_IsDeleted(PJRT_Executable_IsDeleted_Args* args);
PJRT_Error* PJRT_Executable_Execute(PJRT_Executable_Execute_Args* args);

PJRT_Error* PJRT_Buffer_Destroy(PJRT_Buffer_Destroy_Args* args);
PJRT_Error* PJRT_Buffer_OnDeviceTrimmedShape(
    PJRT_Buffer_OnDeviceTrimmedShape_Args* args);
PJRT_Error* PJRT_Buffer_OnDeviceSizeInBytes(
    PJRT_Buffer_OnDeviceSizeInBytes_Args* args);
PJRT_Error* PJRT_Buffer_Device(PJRT_Buffer_Device_Args* args);
PJRT_Error* PJRT_Buffer_Delete(PJRT_Buffer_Delete_Args* args);
PJRT_Error* PJRT_Buffer_IsDeleted(PJRT_Buffer_IsDeleted_Args* args);
PJRT_Error* PJRT_Buffer_CopyToDevice(PJRT_Buffer_CopyToDevice_Args* args);
PJRT_Error* PJRT_Buffer_ToHostBuffer(PJRT_Buffer_ToHostBuffer_Args* args);
PJRT_Error* PJRT_Buffer_IsOnCpu(PJRT_Buffer_IsOnCpu_Args* args);
PJRT_Error* PJRT_Buffer_ReadyEvent(PJRT_Buffer_ReadyEvent_Args* args);
PJRT_Error* PJRT_Buffer_UnsafePointer(PJRT_Buffer_UnsafePointer_Args* args);

// Helper macros and functions

#define PJRT_RETURN_IF_ERROR(expr)                                \
  do {                                                            \
    xla::Status _status = (expr);                                 \
    if (!_status.ok()) {                                          \
      PJRT_Error* _c_status = new PJRT_Error{std::move(_status)}; \
      return _c_status;                                           \
    }                                                             \
  } while (false)

#define PJRT_ASSIGN_OR_RETURN(lhs, rexpr)                                  \
  _PJRT_ASSIGN_OR_RETURN_IMPL(_PJRT_CONCAT(_status_or_value, __COUNTER__), \
                              lhs, rexpr,                                  \
                              _PJRT_CONCAT(_c_status, __COUNTER__));

#define _PJRT_ASSIGN_OR_RETURN_IMPL(statusor, lhs, rexpr, c_status) \
  auto statusor = (rexpr);                                          \
  if (!statusor.ok()) {                                             \
    PJRT_Error* c_status = new PJRT_Error();                        \
    c_status->status = statusor.status();                           \
    return c_status;                                                \
  }                                                                 \
  lhs = std::move(*statusor)

#define _PJRT_CONCAT(x, y) _PJRT_CONCAT_IMPL(x, y)
#define _PJRT_CONCAT_IMPL(x, y) x##y

// Helper function for checking C API argument struct sizes. Returns a non-OK
// status if the expected and actual sizes aren't equal (i.e. no ABI
// compatibility guarantees).
xla::Status CheckMatchingStructSizes(absl::string_view struct_name,
                                     size_t expected_size, size_t actual_size);

// Helper function
std::string StructSizeErrorMsg(absl::string_view struct_name,
                               size_t expected_size, size_t actual_size);

// Returns a specific error message when the program format is unknown.
// Does not check the program format itself.
std::string ProgramFormatErrorMsg(absl::string_view program_format);
}  // namespace pjrt

#endif  // TENSORFLOW_COMPILER_XLA_PJRT_C_PJRT_C_API_WRAPPER_IMPL_H_


text:
import { Injectable } from '@angular/core';
import { GithubService } from '../../../services/github.service';
import { Subject } from 'rxjs/Subject';

@Injectable()
export class UserSearchService {
  userSubject = new Subject<UserDetail>();
  user$ = this.userSubject.asObservable();
  selectedUser: UserDetail;

  constructor(private gitHubService: GithubService) { }

  searchUsers(searchTerm: string) {
    return this.gitHubService.getSearchUsers(searchTerm);
  }

  getUser(user: string) {
    return this.gitHubService.getUser(user)
      .subscribe(user => {
        if(user) {
          this.userSubject.next(user);
          this.selectedUser = user;
        }
      });
  }

}


text:
<?php declare(strict_types=1);

namespace SebastianBergmann\Diff\Output;

/**
 * Defines how an output builder should take a generated
 * diff array and return a string representation of that diff.
 */
interface DiffOutputBuilderInterface
{
    public function getDiff(array $diff): string;
}


text:
define(function(require) {
  var css3 = {};

  // get transform style prefix based on defined vendor prefixes
  css3.transformStylePrefix = (function(){
    var prefix = 'transform';

    if (! (prefix in document.body.style)) {
      var v = ['ms', 'Khtml', 'O', 'moz', 'Moz', 'webkit', 'Webkit'];

      while (v.length) {
        var prop = v.pop() + 'Transform';
        if (prop in document.body.style) {
          prefix = prop;
        }
      }
    }

    return prefix;
  })();

  // get css filter style property based on defined vendor prefixes
  css3.filterStylePrefix = (function(){
    var prefix = 'unknownFilter';

    if (! (prefix in document.body.style)) {
      var v = ['ms', 'Khtml', 'O', 'moz', 'Moz', 'webkit', 'Webkit'];

      while (v.length) {
        var prop = v.pop() + 'Filter';
        if (prop in document.body.style) {
          prefix = prop;
        }
      }
    }

    if (prefix === 'unknownFilter') {
      prefix = 'filter';
    }

    return prefix;
  })();

  // extracts css3 transform rotation based on an html dom element
  css3.getRotation = function(domElement){
    // TODO: make simpler
    //var matrix = domElement.style[css3.transformStylePrefix];

    var obj = $(domElement);
    var matrix = obj.css('-webkit-transform') ||
                 obj.css('-moz-transform')    ||
                 obj.css('-ms-transform')     ||
                 obj.css('-o-transform')      ||
                 obj.css('transform');

    var angle = 0;

    if (matrix !== 'none') {
      var values = matrix.split('(')[1].split(')')[0].split(',');
      var a = values[0];
      var b = values[1];
      angle = Math.round(Math.atan2(b, a) * (180 / Math.PI));
    } else {
      angle = 0;
    }

    return (angle < 0) ? angle + 360 : angle;
  };

  return css3;
});


text:
<?php

declare(strict_types=1);

namespace Metadata\Driver;

interface TraceableFileLocatorInterface extends FileLocatorInterface
{
    /**
     * Finds all possible metadata files for a class
     *
     * @return string[]
     */
    public function getPossibleFilesForClass(\ReflectionClass $class, string $extension): array;
}


text:
class Utils:
    def __init__(self):
        pass

    def minutes_to_hour_and_minutes(minutes):
        return '{:02d}h{:02d}m'.format(*divmod(minutes, 60))


text:
""" Test for assert_deallocated context manager and gc utilities
"""
import gc

from scipy._lib._gcutils import set_gc_state, gc_state, assert_deallocated, ReferenceError

from nose.tools import assert_equal, raises

def test_set_gc_state():
    gc_status = gc.isenabled()
    try:
        for state in (True, False):
            gc.enable()
            set_gc_state(state)
            assert_equal(gc.isenabled(), state)
            gc.disable()
            set_gc_state(state)
            assert_equal(gc.isenabled(), state)
    finally:
        if gc_status:
            gc.enable()

def test_gc_state():
    # Test gc_state context manager
    gc_status = gc.isenabled()
    try:
        for pre_state in (True, False):
            set_gc_state(pre_state)
            for with_state in (True, False):
                # Check the gc state is with_state in with block
                with gc_state(with_state):
                    assert_equal(gc.isenabled(), with_state)
                # And returns to previous state outside block
                assert_equal(gc.isenabled(), pre_state)
                # Even if the gc state is set explicitly within the block
                with gc_state(with_state):
                    assert_equal(gc.isenabled(), with_state)
                    set_gc_state(not with_state)
                assert_equal(gc.isenabled(), pre_state)
    finally:
        if gc_status:
            gc.enable()

def test_assert_deallocated():
    # Ordinary use
    class C(object):
        def __init__(self, arg0, arg1, name='myname'):
            self.name = name
    for gc_current in (True, False):
        with gc_state(gc_current):
            # We are deleting from with-block context, so that's OK
            with assert_deallocated(C, 0, 2, 'another name') as c:
                assert_equal(c.name, 'another name')
                del c
            # Or not using the thing in with-block context, also OK
            with assert_deallocated(C, 0, 2, name='third name'):
                pass
            assert_equal(gc.isenabled(), gc_current)

@raises(ReferenceError)
def test_assert_deallocated_nodel():
    class C(object):
        pass
    # Need to delete after using if in with-block context
    with assert_deallocated(C) as c:
        pass

@raises(ReferenceError)
def test_assert_deallocated_circular():
    class C(object):
        def __init__(self):
            self._circular = self
    # Circular reference, no automatic garbage collection
    with assert_deallocated(C) as c:
        del c

@raises(ReferenceError)
def test_assert_deallocated_circular2():
    class C(object):
        def __init__(self):
            self._circular = self
    # Still circular reference, no automatic garbage collection
    with assert_deallocated(C):
        pass


text:
'use strict';

const ColorPropType = require('ColorPropType');
const EdgeInsetsPropType = require('EdgeInsetsPropType');
const Image = require('Image');
const NativeMethodsMixin = require('NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');

const deprecatedPropType = require('deprecatedPropType');
const processColor = require('processColor');
const resolveAssetSource = require('resolveAssetSource');
const requireNativeComponent = require('requireNativeComponent');

type Event = Object;

/**
 * State an annotation on the map.
 */
export type AnnotationDragState = $Enum<{
  /**
   * Annotation is not being touched.
   */
  idle: string;
  /**
   * Annotation dragging has began.
   */
  starting: string;
  /**
   * Annotation is being dragged.
   */
  dragging: string;
  /**
   * Annotation dragging is being canceled.
   */
  canceling: string;
  /**
   * Annotation dragging has ended.
   */
  ending: string;
}>;

/**
 * **This component is only supported on iOS.**
 *
 * `MapView` is used to display embeddable maps and annotations using
 * `MKMapView`.
 *
 * For a cross-platform solution, check out
 * [react-native-maps](https://github.com/lelandrichardson/react-native-maps)
 * by Leland Richardson.
 *
 * ```
 * import React, { Component } from 'react';
 * import { MapView } from 'react-native';
 *
 * class MapMyRide extends Component {
 *   render() {
 *     return (
 *       <MapView
 *         style={{height: 200, margin: 40}}
 *         showsUserLocation={true}
 *       />
 *     );
 *   }
 * }
 * ```
 *
 */

const MapView = React.createClass({

  mixins: [NativeMethodsMixin],

  propTypes: {
    ...View.propTypes,
    /**
     * Used to style and layout the `MapView`.
     */
    style: View.propTypes.style,

    /**
     * If `true` the app will ask for the user's location and display it on
     * the map. Default value is `false`.
     *
     * **NOTE**: You'll need to add the `NSLocationWhenInUseUsageDescription`
     * key in Info.plist to enable geolocation, otherwise it will fail silently.
     */
    showsUserLocation: React.PropTypes.bool,

    /**
     * If `true` the map will follow the user's location whenever it changes.
     * Note that this has no effect unless `showsUserLocation` is enabled.
     * Default value is `true`.
     */
    followUserLocation: React.PropTypes.bool,

    /**
     * If `false` points of interest won't be displayed on the map.
     * Default value is `true`.
     */
    showsPointsOfInterest: React.PropTypes.bool,

    /**
     * If `false`, compass won't be displayed on the map.
     * Default value is `true`.
     */
    showsCompass: React.PropTypes.bool,

    /**
     * If `false` the user won't be able to pinch/zoom the map.
     * Default value is `true`.
     */
    zoomEnabled: React.PropTypes.bool,

    /**
     * When this property is set to `true` and a valid camera is associated with
     * the map, the camera's heading angle is used to rotate the plane of the
     * map around its center point.
     *
     * When this property is set to `false`, the
     * camera's heading angle is ignored and the map is always oriented so
     * that true north is situated at the top of the map view
     */
    rotateEnabled: React.PropTypes.bool,

    /**
     * When this property is set to `true` and a valid camera is associated
     * with the map, the camera's pitch angle is used to tilt the plane
     * of the map.
     *
     * When this property is set to `false`, the camera's pitch
     * angle is ignored and the map is always displayed as if the user
     * is looking straight down onto it.
     */
    pitchEnabled: React.PropTypes.bool,

    /**
     * If `false` the user won't be able to change the map region being displayed.
     * Default value is `true`.
     */
    scrollEnabled: React.PropTypes.bool,

    /**
     * The map type to be displayed.
     *
     * - `standard`: Standard road map (default).
     * - `satellite`: Satellite view.
     * - `hybrid`: Satellite view with roads and points of interest overlaid.
     */
    mapType: React.PropTypes.oneOf([
      'standard',
      'satellite',
      'hybrid',
    ]),

    /**
     * The region to be displayed by the map.
     *
     * The region is defined by the center coordinates and the span of
     * coordinates to display.
     */
    region: React.PropTypes.shape({
      /**
       * Coordinates for the center of the map.
       */
      latitude: React.PropTypes.number.isRequired,
      longitude: React.PropTypes.number.isRequired,

      /**
       * Distance between the minimum and the maximum latitude/longitude
       * to be displayed.
       */
      latitudeDelta: React.PropTypes.number,
      longitudeDelta: React.PropTypes.number,
    }),

    /**
     * Map annotations with title and subtitle.
     */
    annotations: React.PropTypes.arrayOf(React.PropTypes.shape({
      /**
       * The location of the annotation.
       */
      latitude: React.PropTypes.number.isRequired,
      longitude: React.PropTypes.number.isRequired,

      /**
       * Whether the pin drop should be animated or not
       */
      animateDrop: React.PropTypes.bool,

      /**
       * Whether the pin should be draggable or not
       */
      draggable: React.PropTypes.bool,

      /**
       * Event that fires when the annotation drag state changes.
       */
      onDragStateChange: React.PropTypes.func,

      /**
       * Event that fires when the annotation gets was tapped by the user
       * and the callout view was displayed.
       */
      onFocus: React.PropTypes.func,

      /**
       * Event that fires when another annotation or the mapview itself
       * was tapped and a previously shown annotation will be closed.
       */
      onBlur: React.PropTypes.func,

      /**
       * Annotation title and subtile.
       */
      title: React.PropTypes.string,
      subtitle: React.PropTypes.string,

      /**
       * Callout views.
       */
      leftCalloutView: React.PropTypes.element,
      rightCalloutView: React.PropTypes.element,
      detailCalloutView: React.PropTypes.element,

      /**
       * The pin color. This can be any valid color string, or you can use one
       * of the predefined PinColors constants. Applies to both standard pins
       * and custom pin images.
       *
       * Note that on iOS 8 and earlier, only the standard PinColor constants
       * are supported for regular pins. For custom pin images, any tintColor
       * value is supported on all iOS versions.
       */
      tintColor: ColorPropType,

      /**
       * Custom pin image. This must be a static image resource inside the app.
       */
      image: Image.propTypes.source,

      /**
       * Custom pin view. If set, this replaces the pin or custom pin image.
       */
      view: React.PropTypes.element,

      /**
       * annotation id
       */
      id: React.PropTypes.string,

      /**
       * Deprecated. Use the left/right/detailsCalloutView props instead.
       */
      hasLeftCallout: deprecatedPropType(
        React.PropTypes.bool,
        'Use `leftCalloutView` instead.'
      ),
      hasRightCallout: deprecatedPropType(
        React.PropTypes.bool,
        'Use `rightCalloutView` instead.'
      ),
      onLeftCalloutPress: deprecatedPropType(
        React.PropTypes.func,
        'Use `leftCalloutView` instead.'
      ),
      onRightCalloutPress: deprecatedPropType(
        React.PropTypes.func,
        'Use `rightCalloutView` instead.'
      ),
    })),

    /**
     * Map overlays
     */
    overlays: React.PropTypes.arrayOf(React.PropTypes.shape({
      /**
       * Polyline coordinates
       */
      coordinates: React.PropTypes.arrayOf(React.PropTypes.shape({
        latitude: React.PropTypes.number.isRequired,
        longitude: React.PropTypes.number.isRequired
      })),

      /**
       * Line attributes
       */
      lineWidth: React.PropTypes.number,
      strokeColor: ColorPropType,
      fillColor: ColorPropType,

      /**
       * Overlay id
       */
      id: React.PropTypes.string
    })),

    /**
     * Maximum size of the area that can be displayed.
     */
    maxDelta: React.PropTypes.number,

    /**
     * Minimum size of the area that can be displayed.
     */
    minDelta: React.PropTypes.number,

    /**
     * Insets for the map's legal label, originally at bottom left of the map.
     */
    legalLabelInsets: EdgeInsetsPropType,

    /**
     * Callback that is called continuously when the user is dragging the map.
     */
    onRegionChange: React.PropTypes.func,

    /**
     * Callback that is called once, when the user is done moving the map.
     */
    onRegionChangeComplete: React.PropTypes.func,

    /**
     * Deprecated. Use annotation `onFocus` and `onBlur` instead.
     */
    onAnnotationPress: React.PropTypes.func,

    /**
     * @platform android
     */
    active: React.PropTypes.bool,
  },

  statics: {
    /**
     * Standard iOS MapView pin color constants, to be used with the
     * `annotation.tintColor` property. On iOS 8 and earlier these are the
     * only supported values when using regular pins. On iOS 9 and later
     * you are not obliged to use these, but they are useful for matching
     * the standard iOS look and feel.
     */
    PinColors: {
      RED: '#ff3b30',
      GREEN: '#4cd964',
      PURPLE: '#c969e0',
    },
  },

  render: function() {
    let children = [], {annotations, overlays, followUserLocation} = this.props;
    annotations = annotations && annotations.map((annotation: Object) => {
      let {
        id,
        image,
        tintColor,
        view,
        leftCalloutView,
        rightCalloutView,
        detailCalloutView,
      } = annotation;

      if (!view && image && tintColor) {
        view = <Image
          style={{
            tintColor: processColor(tintColor),
          }}
          source={image}
        />;
        image = undefined;
      }
      if (view) {
        if (image) {
          console.warn('`image` and `view` both set on annotation. Image will be ignored.');
        }
        var viewIndex = children.length;
        children.push(React.cloneElement(view, {
          // $FlowFixMe - An array of styles should be fine
          style: [styles.annotationView, view.props.style || {}]
        }));
      }
      if (leftCalloutView) {
        var leftCalloutViewIndex = children.length;
        children.push(React.cloneElement(leftCalloutView, {
          style: [styles.calloutView, leftCalloutView.props.style || {}]
        }));
      }
      if (rightCalloutView) {
        var rightCalloutViewIndex = children.length;
        children.push(React.cloneElement(rightCalloutView, {
          style: [styles.calloutView, rightCalloutView.props.style || {}]
        }));
      }
      if (detailCalloutView) {
        var detailCalloutViewIndex = children.length;
        children.push(React.cloneElement(detailCalloutView, {
          style: [styles.calloutView, detailCalloutView.props.style || {}]
        }));
      }

      let result = {
        ...annotation,
        tintColor: tintColor && processColor(tintColor),
        image,
        viewIndex,
        leftCalloutViewIndex,
        rightCalloutViewIndex,
        detailCalloutViewIndex,
        view: undefined,
        leftCalloutView: undefined,
        rightCalloutView: undefined,
        detailCalloutView: undefined,
      };
      result.id = id || encodeURIComponent(JSON.stringify(result));
      result.image = image && resolveAssetSource(image);
      return result;
    });
    overlays = overlays && overlays.map((overlay: Object) => {
      let {id, fillColor, strokeColor} = overlay;
      let result = {
        ...overlay,
        strokeColor: strokeColor && processColor(strokeColor),
        fillColor: fillColor && processColor(fillColor),
      };
      result.id = id || encodeURIComponent(JSON.stringify(result));
      return result;
    });

    const findByAnnotationId = (annotationId: string) => {
      if (!annotations) {
        return null;
      }
      for (let i = 0, l = annotations.length; i < l; i++) {
        if (annotations[i].id === annotationId) {
          return annotations[i];
        }
      }
      return null;
    };

    // TODO: these should be separate events, to reduce bridge traffic
    let onPress, onAnnotationDragStateChange, onAnnotationFocus, onAnnotationBlur;
    if (annotations) {
      onPress = (event: Event) => {
        if (event.nativeEvent.action === 'annotation-click') {
          // TODO: Remove deprecated onAnnotationPress API call later.
          this.props.onAnnotationPress &&
            this.props.onAnnotationPress(event.nativeEvent.annotation);
        } else if (event.nativeEvent.action === 'callout-click') {
          const annotation = findByAnnotationId(event.nativeEvent.annotationId);
          if (annotation) {
            // Pass the right function
            if (event.nativeEvent.side === 'left' && annotation.onLeftCalloutPress) {
              annotation.onLeftCalloutPress(event.nativeEvent);
            } else if (event.nativeEvent.side === 'right' && annotation.onRightCalloutPress) {
              annotation.onRightCalloutPress(event.nativeEvent);
            }
          }
        }
      };
      onAnnotationDragStateChange = (event: Event) => {
        const annotation = findByAnnotationId(event.nativeEvent.annotationId);
        if (annotation) {
          // Call callback
          annotation.onDragStateChange &&
            annotation.onDragStateChange(event.nativeEvent);
        }
      };
      onAnnotationFocus = (event: Event) => {
        const annotation = findByAnnotationId(event.nativeEvent.annotationId);
        if (annotation && annotation.onFocus) {
          annotation.onFocus(event.nativeEvent);
        }
      };
      onAnnotationBlur = (event: Event) => {
        const annotation = findByAnnotationId(event.nativeEvent.annotationId);
        if (annotation && annotation.onBlur) {
          annotation.onBlur(event.nativeEvent);
        }
      };
    }

    // TODO: these should be separate events, to reduce bridge traffic
    if (this.props.onRegionChange || this.props.onRegionChangeComplete) {
      var onChange = (event: Event) => {
        if (event.nativeEvent.continuous) {
          this.props.onRegionChange &&
            this.props.onRegionChange(event.nativeEvent.region);
        } else {
          this.props.onRegionChangeComplete &&
            this.props.onRegionChangeComplete(event.nativeEvent.region);
        }
      };
    }

    // followUserLocation defaults to true if showUserLocation is set
    if (followUserLocation === undefined) {
      followUserLocation = this.props.showUserLocation;
    }

    return (
      <RCTMap
        {...this.props}
        annotations={annotations}
        children={children}
        followUserLocation={followUserLocation}
        overlays={overlays}
        onPress={onPress}
        onChange={onChange}
        onAnnotationDragStateChange={onAnnotationDragStateChange}
        onAnnotationFocus={onAnnotationFocus}
        onAnnotationBlur={onAnnotationBlur}
      />
    );
  },
});

const styles = StyleSheet.create({
  annotationView: {
    position: 'absolute',
    backgroundColor: 'transparent',
  },
  calloutView: {
    position: 'absolute',
    backgroundColor: 'white',
  },
});

const RCTMap = requireNativeComponent('RCTMap', MapView, {
  nativeOnly: {
    onAnnotationDragStateChange: true,
    onAnnotationFocus: true,
    onAnnotationBlur: true,
    onChange: true,
    onPress: true
  }
});

module.exports = MapView;


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyDb.Model
{
    public class Template
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public bool IsStandard { get; set; }
        public LanguageType Type { get; set; }
        public RulesTemplate RulesTemplate { get; set; }
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: yidashi
 * Date: 16/7/21
 * Time: 下午11:28
 */

namespace common\actions;

use Yii;
use yii\base\Action;
use yii\base\DynamicModel;
use yii\base\Exception;

class AjaxUpdateFieldAction extends \yii2tech\admin\actions\Action
{
    public $allowFields = [];

    public $findModel;

    public function run()
    {
        Yii::$app->response->format = 'json';
        $pk = Yii::$app->request->post('pk');
        $id = unserialize(base64_decode($pk));
        $post = Yii::$app->request->post();
        $formModel = DynamicModel::validateData(['id' => $id, 'name' => $post['name'], 'value' => $post['value']], [
            [['id'], 'required'],
            ['name', 'in', 'range' => $this->allowFields]
        ]);
        if ($formModel->hasErrors()) {
            throw new Exception(current($formModel->getFirstErrors()));
        }
        $model = $this->findModel($id);
        $model->updateAll([$post['name'] => $post['value']], ['id' => $id]);
        return ['status' => 1];
    }
}


text:
<Record>
<Term>Creutzfeldt-Jacob Disease</Term>
<SemanticType>Disease or Syndrome</SemanticType>
<ParentTerm>Spongiform Encephalopathy</ParentTerm>
<ClassificationPath>Findings_and_Disorders_Kind/Disease, Disorder or Finding/Disease or Disorder/Non-Neoplastic Disorder/Non-Neoplastic Disorder by Site/Non-Neoplastic Nervous System Disorder/Non-Neoplastic Central Nervous System Disorder/Central Nervous System Infectious Disorder/Spongiform Encephalopathy/Creutzfeldt-Jacob Disease</ClassificationPath>
<BroaderTerm>Creutzfeldt-Jacob Disease</BroaderTerm>
<BroaderTerm>Non-Neoplastic Nervous System Disorder</BroaderTerm>
<BroaderTerm>Non-Neoplastic Disorder by Site</BroaderTerm>
<BroaderTerm>Non-Neoplastic Disorder</BroaderTerm>
<BroaderTerm>Disease or Disorder</BroaderTerm>
<BroaderTerm>Central Nervous System Infectious Disorder</BroaderTerm>
<BroaderTerm>Non-Neoplastic Central Nervous System Disorder</BroaderTerm>
<BroaderTerm>Spongiform Encephalopathy</BroaderTerm>
<BroaderTerm>Disease, Disorder or Finding</BroaderTerm>
<BroaderTerm>Findings_and_Disorders_Kind</BroaderTerm>
<Synonym>CJD</Synonym>
<Synonym>Creutzfeldt-Jacob Disease</Synonym>
<Source>NCI Thesaurus</Source>
</Record>


text:
id: 5e7b9f0b0b6c005b0e76f070
title: 'Regular Expressions: Practical Applications'
challengeType: 11
videoId: xCjFU9G6x48
dashedName: regular-expressions-practical-applications
---

# --question--

## --text--

What will search for a "$" in a regular expression?

## --answers--

$

---

\\dollar\\

---

\\$

---

!$

## --video-solution--

3


text:
/*
 * jQuery plugin that provides hooks for making more usable + stylable
 * <input type="file" />s.
 *
 * Usage:
 *
 * <div class="filefield">
 *   <input type="file" />
 *   <button data-fileinput-fake>Choose Image</button>
 * </div>
 *
 * $('.filefield').fakeFileField();
 *
 * Anything matching input[type="file"] is hidden, and when anything marked
 * with data-fileinput-fake (or its children) is interacted with, the default
 * event is prevented and the true file input is clicked.
 *
 * If data-fileinput-fake or any of its children are a text input, the value
 * of the real input is copied to that input on load/change.
 */

(function($) {

$.fn.fakeFileField = function() {

    return $.each(this, function(index, element){

        var $this = $(this),
            $parent = $this.parent(),
            $fake = $this.children('[data-fileinput-fake]'),
            $fakeText = $fake.find('input[type="text"]'),
            $real = $this.children('input[type="file"]'),
            realValue = $real.val();

        // Hide the real, show the fake.
        $fake.show();
        $real.hide();

        // When clicking on any of the fake elements, pretend like
        // the real input was clicked.
        $fake.find('*').add($fake).on('click', function(evt){
            evt.preventDefault();
            evt.stopPropagation();
            $real.click();
            $(this).blur();
        });

        // Copy the value from the real input to the fake one,
        // for visual consistency.
        if (realValue){
            $fakeText.val(realValue);
        }
        $real.on('change', function(evt) {
            $fakeText.val($(this).val());
        });

    });

};

})(jQuery);


text:
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
                        unicode_literals, with_statement)

import itertools
import logging
from collections import defaultdict

from pants.base.specs import DescendantAddresses
from pants.build_graph.address import Address
from pants.engine.legacy.graph import HydratedTargets
from pants.engine.legacy.source_mapper import EngineSourceMapper, resolve_and_parse_specs
from pants.scm.change_calculator import ChangeCalculator

logger = logging.getLogger(__name__)

class _HydratedTargetDependentGraph(object):
  """A graph for walking dependent addresses of HydratedTarget objects."""

  @classmethod
  def from_iterable(cls, iterable):
    """Create a new HydratedTargetDependentGraph from an iterable of HydratedTarget instances."""
    inst = cls()
    for hydrated_target in iterable:
      inst.inject_target(hydrated_target)
    return inst

  def __init__(self):
    self._dependent_address_map = defaultdict(set)

  def _resources_addresses(self, hydrated_target):
    """Yields fully qualified string addresses of resources for a given `HydratedTarget`."""
    kwargs = hydrated_target.adaptor.kwargs()

    # TODO: Figure out a better way to filter these.
    # Python targets `resources` are lists of files, not addresses - short circuit for them.
    if kwargs.get('type_alias', '').startswith('python_'):
      return

    resource_specs = kwargs.get('resources', [])
    if not resource_specs:
      return

    parsed_resource_specs = resolve_and_parse_specs(hydrated_target.adaptor.address.spec_path,
                                                    resource_specs)
    for spec in parsed_resource_specs:
      yield Address.parse(spec.to_spec_string())

  def inject_target(self, hydrated_target):
    """Inject a target, respecting both its direct dependencies and its resources targets."""
    for dep in itertools.chain(hydrated_target.dependencies, self._resources_addresses(hydrated_target)):
      self._dependent_address_map[dep].add(hydrated_target.adaptor.address)

  def dependents_of_addresses(self, addresses):
    """Given an iterable of addresses, yield all of those addresses dependents."""
    seen = set(addresses)
    for address in addresses:
      for dependent_address in self._dependent_address_map[address]:
        if dependent_address not in seen:
          seen.add(dependent_address)
          yield dependent_address

  def transitive_dependents_of_addresses(self, addresses):
    """Given an iterable of addresses, yield all of those addresses dependents, transitively."""
    addresses_to_visit = set(addresses)
    while 1:
      dependents = set(self.dependents_of_addresses(addresses))
      # If we've exhausted all dependencies or visited all remaining nodes, break.
      if (not dependents) or dependents.issubset(addresses_to_visit):
        break
      addresses = dependents.difference(addresses_to_visit)
      addresses_to_visit.update(dependents)

    transitive_set = itertools.chain(
      *(self._dependent_address_map[address] for address in addresses_to_visit)
    )
    for dep in transitive_set:
      yield dep

class EngineChangeCalculator(ChangeCalculator):
  """A ChangeCalculator variant that uses the v2 engine for source mapping."""

  def __init__(self, engine, scm):
    """
    :param Engine engine: The `Engine` instance to use for computing file to target mappings.
    :param Scm engine: The `Scm` instance to use for computing changes.
    """
    super(EngineChangeCalculator, self).__init__(scm)
    self._engine = engine
    self._mapper = EngineSourceMapper(engine)

  def iter_changed_target_addresses(self, changed_request):
    """Given a `ChangedRequest`, compute and yield all affected target addresses."""
    changed_files = self.changed_files(changed_request.changes_since, changed_request.diffspec)
    logger.debug('changed files: %s', changed_files)
    if not changed_files:
      return

    changed_addresses = set(address
                            for address
                            in self._mapper.iter_target_addresses_for_sources(changed_files))
    for address in changed_addresses:
      yield address

    if changed_request.include_dependees not in ('direct', 'transitive'):
      return

    # For dependee finding, we need to parse all build files.
    product_iter = (t
                    for targets in self._engine.product_request(HydratedTargets, [DescendantAddresses('')])
                    for t in targets.dependencies)
    graph = _HydratedTargetDependentGraph.from_iterable(product_iter)

    if changed_request.include_dependees == 'direct':
      for address in graph.dependents_of_addresses(changed_addresses):
        yield address
    elif changed_request.include_dependees == 'transitive':
      for address in graph.transitive_dependents_of_addresses(changed_addresses):
        yield address

  def changed_target_addresses(self, changed_request):
    return list(self.iter_changed_target_addresses(changed_request))


text:
using namespace llvm;

namespace {

TEST(IntegerDivision, SDiv) {
  LLVMContext &C(getGlobalContext());
  Module M("test division", C);
  IRBuilder<> Builder(C);

  SmallVector<Type*, 2> ArgTys(2, Builder.getInt32Ty());
  Function *F = Function::Create(FunctionType::get(Builder.getInt32Ty(),
                                                   ArgTys, false),
                                 GlobalValue::ExternalLinkage, "F", &M);
  assert(F->getArgumentList().size() == 2);

  BasicBlock *BB = BasicBlock::Create(C, "", F);
  Builder.SetInsertPoint(BB);

  Function::arg_iterator AI = F->arg_begin();
  Value *A = AI++;
  Value *B = AI++;

  Value *Div = Builder.CreateSDiv(A, B);
  EXPECT_TRUE(BB->front().getOpcode() == Instruction::SDiv);

  Value *Ret = Builder.CreateRet(Div);

  expandDivision(cast<BinaryOperator>(Div));
  EXPECT_TRUE(BB->front().getOpcode() == Instruction::AShr);

  Instruction* Quotient = dyn_cast<Instruction>(cast<User>(Ret)->getOperand(0));
  EXPECT_TRUE(Quotient && Quotient->getOpcode() == Instruction::Sub);
}

TEST(IntegerDivision, UDiv) {
  LLVMContext &C(getGlobalContext());
  Module M("test division", C);
  IRBuilder<> Builder(C);

  SmallVector<Type*, 2> ArgTys(2, Builder.getInt32Ty());
  Function *F = Function::Create(FunctionType::get(Builder.getInt32Ty(),
                                                   ArgTys, false),
                                 GlobalValue::ExternalLinkage, "F", &M);
  assert(F->getArgumentList().size() == 2);

  BasicBlock *BB = BasicBlock::Create(C, "", F);
  Builder.SetInsertPoint(BB);

  Function::arg_iterator AI = F->arg_begin();
  Value *A = AI++;
  Value *B = AI++;

  Value *Div = Builder.CreateUDiv(A, B);
  EXPECT_TRUE(BB->front().getOpcode() == Instruction::UDiv);

  Value *Ret = Builder.CreateRet(Div);

  expandDivision(cast<BinaryOperator>(Div));
  EXPECT_TRUE(BB->front().getOpcode() == Instruction::ICmp);

  Instruction* Quotient = dyn_cast<Instruction>(cast<User>(Ret)->getOperand(0));
  EXPECT_TRUE(Quotient && Quotient->getOpcode() == Instruction::PHI);
}

TEST(IntegerDivision, SRem) {
  LLVMContext &C(getGlobalContext());
  Module M("test remainder", C);
  IRBuilder<> Builder(C);

  SmallVector<Type*, 2> ArgTys(2, Builder.getInt32Ty());
  Function *F = Function::Create(FunctionType::get(Builder.getInt32Ty(),
                                                   ArgTys, false),
                                 GlobalValue::ExternalLinkage, "F", &M);
  assert(F->getArgumentList().size() == 2);

  BasicBlock *BB = BasicBlock::Create(C, "", F);
  Builder.SetInsertPoint(BB);

  Function::arg_iterator AI = F->arg_begin();
  Value *A = AI++;
  Value *B = AI++;

  Value *Rem = Builder.CreateSRem(A, B);
  EXPECT_TRUE(BB->front().getOpcode() == Instruction::SRem);

  Value *Ret = Builder.CreateRet(Rem);

  expandRemainder(cast<BinaryOperator>(Rem));
  EXPECT_TRUE(BB->front().getOpcode() == Instruction::AShr);

  Instruction* Remainder = dyn_cast<Instruction>(cast<User>(Ret)->getOperand(0));
  EXPECT_TRUE(Remainder && Remainder->getOpcode() == Instruction::Sub);
}

TEST(IntegerDivision, URem) {
  LLVMContext &C(getGlobalContext());
  Module M("test remainder", C);
  IRBuilder<> Builder(C);

  SmallVector<Type*, 2> ArgTys(2, Builder.getInt32Ty());
  Function *F = Function::Create(FunctionType::get(Builder.getInt32Ty(),
                                                   ArgTys, false),
                                 GlobalValue::ExternalLinkage, "F", &M);
  assert(F->getArgumentList().size() == 2);

  BasicBlock *BB = BasicBlock::Create(C, "", F);
  Builder.SetInsertPoint(BB);

  Function::arg_iterator AI = F->arg_begin();
  Value *A = AI++;
  Value *B = AI++;

  Value *Rem = Builder.CreateURem(A, B);
  EXPECT_TRUE(BB->front().getOpcode() == Instruction::URem);

  Value *Ret = Builder.CreateRet(Rem);

  expandRemainder(cast<BinaryOperator>(Rem));
  EXPECT_TRUE(BB->front().getOpcode() == Instruction::ICmp);

  Instruction* Remainder = dyn_cast<Instruction>(cast<User>(Ret)->getOperand(0));
  EXPECT_TRUE(Remainder && Remainder->getOpcode() == Instruction::Sub);
}

}


text:
@interface PeopleBaseViewController : UIViewController

@end