text:
package com.terremark.api;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *

 * Java class for CustomizationOption complex type.
 *

 * The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="CustomizationOption">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="Type" type="{}CustomizationTypeEnum"/>
 *         <element name="CanPowerOn" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 *         <element name="PasswordRequired" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 *         <element name="SshKeyRequired" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CustomizationOption", propOrder = {"type", "canPowerOn", "passwordRequired", "sshKeyRequired"})
public class CustomizationOption extends ToStringGenerator {

    @XmlElement(name = "Type", required = true)
    protected CustomizationTypeEnum type;
    @XmlElement(name = "CanPowerOn")
    protected boolean canPowerOn;
    @XmlElement(name = "PasswordRequired")
    protected boolean passwordRequired;
    @XmlElement(name = "SshKeyRequired")
    protected boolean sshKeyRequired;

    /**
     * Gets the value of the type property.
     *
     * @return possible object is {@link CustomizationTypeEnum }
     */
    public CustomizationTypeEnum getType() {
        return type;
    }

    /**
     * Sets the value of the type property.
     *
     * @param value allowed object is {@link CustomizationTypeEnum }
     */
    public void setType(final CustomizationTypeEnum value) {
        this.type = value;
    }

    /**
     * Gets the value of the canPowerOn property.
     */
    public boolean isCanPowerOn() {
        return canPowerOn;
    }

    /**
     * Sets the value of the canPowerOn property.
     */
    public void setCanPowerOn(final boolean value) {
        this.canPowerOn = value;
    }

    /**
     * Gets the value of the passwordRequired property.
     */
    public boolean isPasswordRequired() {
        return passwordRequired;
    }

    /**
     * Sets the value of the passwordRequired property.
     */
    public void setPasswordRequired(final boolean value) {
        this.passwordRequired = value;
    }

    /**
     * Gets the value of the sshKeyRequired property.
     */
    public boolean isSshKeyRequired() {
        return sshKeyRequired;
    }

    /**
     * Sets the value of the sshKeyRequired property.
     */
    public void setSshKeyRequired(final boolean value) {
        this.sshKeyRequired = value;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.zstack.storage.primary.nfs;

import org.zstack.header.image.ImageInventory;
import org.zstack.header.storage.primary.PrimaryStorageInventory;
import org.zstack.header.storage.snapshot.VolumeSnapshotInventory;
import org.zstack.header.volume.VolumeInventory;
import org.zstack.header.volume.VolumeType;
import org.zstack.storage.primary.PrimaryStoragePathMaker;
import org.zstack.utils.path.PathUtil;

import java.io.File;

public class NfsPrimaryStorageKvmHelper {
    public static String makeRootVolumeInstallUrl(PrimaryStorageInventory pinv, VolumeInventory vol) {
        return PathUtil.join(pinv.getMountPath(), PrimaryStoragePathMaker.makeRootVolumeInstallPath(vol));
    }

    public static String makeDataVolumeInstallUrl(PrimaryStorageInventory pinv, String volUuid) {
        return PathUtil.join(pinv.getMountPath(), PrimaryStoragePathMaker.makeDataVolumeInstallPath(volUuid));
    }

    public static String makeCachedImageInstallUrl(PrimaryStorageInventory pinv, ImageInventory iminv) {
        return PathUtil.join(pinv.getMountPath(), PrimaryStoragePathMaker.makeCachedImageInstallPath(iminv));
    }

    public static String makeTemplateFromVolumeInWorkspacePath(PrimaryStorageInventory pinv, String imageUuid) {
        return PathUtil.join(pinv.getMountPath(), "templateWorkspace", String.format("image-%s", imageUuid), String.format("%s.qcow2", imageUuid));
    }

    public static String makeKvmSnapshotInstallPath(PrimaryStorageInventory pinv, VolumeInventory vol, VolumeSnapshotInventory snapshot) {
        String volPath;
        if (VolumeType.Data.toString().equals(vol.getType())) {
            volPath = makeDataVolumeInstallUrl(pinv, vol.getUuid());
        } else {
            volPath = makeRootVolumeInstallUrl(pinv, vol);
        }
        File volDir = new File(volPath).getParentFile();
        return PathUtil.join(volDir.getAbsolutePath(), "snapshots", String.format("%s.qcow2", snapshot.getUuid()));
    }

    public static String makeSnapshotWorkspacePath(PrimaryStorageInventory pinv, String imageUuid) {
        return PathUtil.join(
                pinv.getMountPath(),
                PrimaryStoragePathMaker.makeImageFromSnapshotWorkspacePath(imageUuid),
                String.format("%s.qcow2", imageUuid)
        );
    }

    public static String makeDownloadImageJobName(ImageInventory iminv, PrimaryStorageInventory pinv) {
        return String.format("download-image-%s-to-pri-%s", iminv.getUuid(), pinv.getUuid());
    }

    public static String makeJobOwnerName(PrimaryStorageInventory pinv) {
        return "NfsPrimaryStorage-" + pinv.getUuid();
    }
}


text:
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)

I think most of all developers are now working with [Sass](http://sass-lang.com/) instead of [Less](http://lesscss.org/) including myself. Thus I decided to porting Bootswatch to Sass. It was first made by [Bootstrap](http://getbootstrap.com) and now you can take advantage from it on [Bootswatch](http://bootswatch.com).

* Source: [github.com/victorpotasso/bootswatch-sass](https://github.com/victorpotasso/bootswatch-sass)
* Preview: [http://bit.ly/1LRn64p](http://bit.ly/1LRn64p)
* Home Page: [victorpotasso.com/](http://www.victorpotasso.com)
* Twitter: [@victorpotasso](https://twitter.com/victorpotasso)

## Changes

+ Ported Bootswatch from LESS to SASS.
+ Task *watch-themes* added.
+ Using [preprocess](https://github.com/jsoverson/grunt-preprocess) to provide theme's index.html
+ Created [themes.json](https://github.com/victorpotasso/bootswatch-sass/blob/master/themes.json) file to control which theme will be compiled and also its title and description.
+ Directories was rearranged.

## Getting Started

If you haven't used [grunt](https://github.com/gruntjs) before, be sure to check out the [Getting Started](https://github.com/gruntjs/grunt/wiki) guide, as it explains how to create a [gruntfile](https://github.com/gruntjs/grunt/wiki) as well as install and use grunt plugins. Once you're familiar with that process, installs the dependences with this command:

```shell
$ npm install
```

## Author

Victor Potasso

+ http://github.com/victorpotasso
+ http://victorpotasso.com
+ http://bootswatchsass.victorpotasso.com

## Thanks

+ [Mark Otto](http://github.com/markdotto) and [Jacob Thornton](http://github.com/fat) for [Bootstrap](https://github.com/twitter/bootstrap).
+ [Thomas Park](http://github.com/thomaspark) for [Bootswatch](http://bootswatch.com)
+ [jQuery Team](http://jquery.com/) for [jQuery Team](https://github.com/jquery/jquery)

## License
[MIT](http://opensource.org/licenses/MIT) © [Victor Potasso](http://victorpotasso.com)


text:
from airflow.providers.amazon.aws.hooks.sts import StsHook

class TestSTS:
    def test_get_conn_returns_a_boto3_connection(self):
        hook = StsHook(aws_conn_id="aws_default", region_name="us-east-1")
        assert hook.conn is not None


text:
/* $NetBSD: bt459reg.h,v 1.4 2005/12/11 12:21:26 christos Exp $ */

/*
 * Mach Operating System
 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
 * All Rights Reserved.
 *
 * Permission to use, copy, modify and distribute this software and its
 * documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation.
 *
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 *
 * Carnegie Mellon requests users of this software to return to
 *
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 *  School of Computer Science
 *  Carnegie Mellon University
 *  Pittsburgh PA 15213-3890
 *
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */

/*
 * Register definitions for the Brooktree Bt459 135 MHz Monolithic
 * CMOS 256x64 Color Palette RAMDAC.
 */

/*
 * Directly-accessible registers.  Note the address register is
 * auto-incrementing.
 */
#define	BT459_REG_ADDR_LOW		0x00	/* C1,C0 == 0,0 */
#define	BT459_REG_ADDR_HIGH		0x01	/* C1,C0 == 0,1 */
#define	BT459_REG_IREG_DATA		0x02	/* C1,C0 == 1,0 */
#define	BT459_REG_CMAP_DATA		0x03	/* C1,C0 == 1,1 */

#define	BT459_REG_MAX			BT459_REG_CMAP_DATA

/*
 * All internal register access to the Bt459 is done indirectly via the
 * Address Register (mapped into the host bus in a device-specific
 * fashion).  The following register definitions are in terms of
 * their address register address values.
 */

						/* 0000-00ff colormap entries */

#define	BT459_IREG_CCOLOR_1		0x0181	/* Cursor color regs */
#define	BT459_IREG_CCOLOR_2		0x0182
#define	BT459_IREG_CCOLOR_3		0x0183
#define	BT459_IREG_ID			0x0200	/* read-only, gives "4a" */
#define	BT459_IREG_COMMAND_0		0x0201
#define	BT459_IREG_COMMAND_1		0x0202
#define	BT459_IREG_COMMAND_2		0x0203
#define	BT459_IREG_PRM			0x0204
						/* 0205 reserved */
#define	BT459_IREG_PBM			0x0206
						/* 0207 reserved */
#define	BT459_IREG_ORM			0x0208
#define	BT459_IREG_OBM			0x0209
#define	BT459_IREG_ILV			0x020a
#define	BT459_IREG_TEST			0x020b
#define	BT459_IREG_RSIG			0x020c
#define	BT459_IREG_GSIG			0x020d
#define	BT459_IREG_BSIG			0x020e
						/* 020f-02ff reserved */
#define	BT459_IREG_CCR			0x0300
#define	BT459_IREG_CURSOR_X_LOW		0x0301
#define	BT459_IREG_CURSOR_X_HIGH	0x0302
#define	BT459_IREG_CURSOR_Y_LOW		0x0303
#define	BT459_IREG_CURSOR_Y_HIGH	0x0304
#define	BT459_IREG_WXLO			0x0305
#define	BT459_IREG_WXHI			0x0306
#define	BT459_IREG_WYLO			0x0307
#define	BT459_IREG_WYHI			0x0308
#define	BT459_IREG_WWLO			0x0309
#define	BT459_IREG_WWHI			0x030a
#define	BT459_IREG_WHLO			0x030b
#define	BT459_IREG_WHHI			0x030c
						/* 030d-03ff reserved */
#define BT459_IREG_CRAM_BASE		0x0400


text:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { InputComponent, InputLeftDirective } from './input.component';
import { InputStepperComponent } from './input-stepper/input-stepper.component';
import { InputResetModule } from '../../directives/input-reset/input-reset.module';
import { IconModule } from '../icon/icon.module';
import { MenuWrapperModule } from '../menu-wrapper/menu-wrapper.module';
import { InputUnitPipe, InputValuePipe } from './input.pipe';
import { InputAutoCompleteDirective } from './input.directive';
import { TooltipModule } from '../../directives/tooltip/tooltip.module';
import { DragRangeDirective } from './drag-range.directive';

@NgModule({
  declarations: [
    InputComponent,
    InputStepperComponent,
    InputUnitPipe,
    InputValuePipe,
    InputLeftDirective,
    InputAutoCompleteDirective,
    DragRangeDirective,
  ],
  imports: [CommonModule, InputResetModule, IconModule, MenuWrapperModule, TooltipModule],
  exports: [InputComponent, InputLeftDirective, InputAutoCompleteDirective],
})
export class InputModule {}


text:
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery                                    |
// | Czech language localization                                           |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2009     Pavel Budka & Petr Jirsa    http://pbudka.co.cc |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify  |
// | it under the terms of the GNU General Public License as published by  |
// | the Free Software Foundation                                          |
// |                                                                       |
// | This program is distributed in the hope that it will be useful, but   |
// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+

$lang['Upgrade'] = 'Aktualizace';
$lang['Upgrade from version %s to %s'] = 'Aktualizace z verze %s na %s';
$lang['Statistics'] = 'Statistika';
$lang['total upgrade time'] = 'celkový čas aktualizace';
$lang['total SQL time'] = 'celkový čas SQL';
$lang['SQL queries'] = 'SQL dotazy';
$lang['Upgrade informations'] = 'Informace o aktualizaci';
$lang['Perform a maintenance check in [Administration>Tools>Maintenance] if you encounter any problem.'] = 'Proveďte kontrolu údržby v [Administrace>Nástroje>Údržba] pokud dojde k problému.';
$lang['Only administrator can run upgrade: please sign in below.'] = 'Jen administrátor smí spustit aktualizaci: prosím přihlašte se níže.';
$lang['You do not have access rights to run upgrade'] = 'nemáte přístupová práva na spuštění upgrade';

// Upgrade informations from upgrade_1.3.1.php
$lang['All sub-albums of private albums become private'] = 'Všechny sub-alba privátních alb zůstanou privatní';
$lang['User permissions and group permissions have been erased'] = 'Uživatelská oprávnění a oprávnění skupin byla vymazána';
$lang['Only thumbnails prefix and webmaster mail address have been saved from previous configuration'] = 'Z předchozí konfigurace byly zachovány pouze předpony náhledů a email adresa správce.';

// missing translations 2.1.0
$lang['This page proposes to upgrade your database corresponding to your old version of Piwigo to the current version. The upgrade assistant thinks you are currently running a release %s (or equivalent).'] = 'Navrhujeme aktualizovat databázi Vaší galerie Piwigo ze starší na novou verzi.
Asistent aktualizace se domnívá, že aktuálně používáte verzi %s (nebo odpovídající).';
$lang['As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:'] = 'Jako předběžné opatření byly deaktivovány následující doplňky. Prosím zkontrolujte aktualizace těchto doplňků předtím než je znovu aktivujete:';
$lang['In %s, before ?>, insert:'] = 'V %s, před ?>, vložením:';
$lang['As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:'] = 'Jako preventivní opatření, byli náseldující šablony deaktivovány. Musíte zkontrolovat nejprve jestli není nová verze předtím než je reaktivujete:';
?>


text:
slug: cannon-zander
last_name: Cannon
first_name: Zander
---
**Zander Cannon** is a cartoonist and illustrator.


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<title>AWSCognito Class Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1333)">

				AWS Mobile SDK for iOS v2.4.1

				Amazon Web Services, Inc.

Index

Hierarchy

							On This Page

							<select id="jump-to">
	<option value="top">Jump To…</option>

	<option value="tasks">Tasks</option>

	<optgroup label="Properties">

		<option value="//api/name/configuration">configuration</option>

		<option value="//api/name/conflictHandler">conflictHandler</option>

		<option value="//api/name/datasetDeletedHandler">datasetDeletedHandler</option>

		<option value="//api/name/datasetMergedHandler">datasetMergedHandler</option>

		<option value="//api/name/deviceId">deviceId</option>

		<option value="//api/name/synchronizeOnWiFiOnly">synchronizeOnWiFiOnly</option>

		<option value="//api/name/synchronizeRetries">synchronizeRetries</option>

	</optgroup>

	<optgroup label="Class Methods">

		<option value="//api/name/CognitoForKey:">+ CognitoForKey:</option>

		<option value="//api/name/cognitoDeviceId">+ cognitoDeviceId</option>

		<option value="//api/name/defaultCognito">+ defaultCognito</option>

		<option value="//api/name/defaultConflictHandler">+ defaultConflictHandler</option>

		<option value="//api/name/pushPlatform">+ pushPlatform</option>

		<option value="//api/name/registerCognitoWithConfiguration:forKey:">+ registerCognitoWithConfiguration:forKey:</option>

		<option value="//api/name/removeCognitoForKey:">+ removeCognitoForKey:</option>

		<option value="//api/name/setPushPlatform:">+ setPushPlatform:</option>

	</optgroup>

	<optgroup label="Instance Methods">

		<option value="//api/name/listDatasets">- listDatasets</option>

		<option value="//api/name/openOrCreateDataset:">- openOrCreateDataset:</option>

		<option value="//api/name/refreshDatasetMetadata">- refreshDatasetMetadata</option>

		<option value="//api/name/registerDevice:">- registerDevice:</option>

		<option value="//api/name/subscribe:">- subscribe:</option>

		<option value="//api/name/subscribeAll">- subscribeAll</option>

		<option value="//api/name/unsubscribe:">- unsubscribe:</option>

		<option value="//api/name/unsubscribeAll">- unsubscribeAll</option>

		<option value="//api/name/wipe">- wipe</option>

	</optgroup>

</select>

AWSCognito Class Reference

	Inherits from
	AWSService : NSObject

	Declared in
	AWSCognitoService.h
AWSCognitoService.m

  configuration

The error domain for AWSCognito errors.

AWSCognitoErrorUnknown - Unknow error.

AWSCognitoErrorRemoteDataStorageFailed - The Amazon Cognito call temporarily failed.

AWSCognitoErrorInvalidDataValue - The Amazon Cognito call failed. The value for the
key is invalid and has been deleted from the local database.

AWSCognitoErrorDataSizeLimitExceeded - The Amazon Cognito call failed. A
dataset has exceeded the max dataset size.

AWSCognitoErrorLocalDataStorageFailed - The SQLite call failed.

AWSCognitoErrorIllegalArgument - The input value is invalid.

AWSCognitoErrorConflictRetriesExhausted - The number of attempts to resolve a conflict
has exceeded the max number of retries.

AWSCognitoErrorWiFiNotAvailable - WiFi is required and not currently available.

AWSCognitoErrorDeviceNotRegistered - The device has not been registered yet.

@property (nonatomic, strong, readonly) AWSServiceConfiguration *configuration

Declared In

AWSCognitoService.h

  conflictHandler

A conflict resolution handler that will receive calls when there is a
conflict during a sync operation.  A conflict will occur when both remote and
local data have been updated since the last sync time.
When not explicitly set, we will use the default conflict resolution of
‘last writer wins’, where the data most recently updated will be persisted.
This handler will be propagated to any AWSCognitoDataset opened by this client.

@property (nonatomic, strong) AWSCognitoRecordConflictHandler conflictHandler

Declared In

AWSCognitoService.h

  datasetDeletedHandler

A deleted dataset handler. This handler will be called during a synchronization
when the remote service indicates that a dataset has been deleted.
Returning YES from the handler will cause the service to recreate the dataset
on the remote on the next synchronization. Returning NO or leaving this property
nil will cause the client to delete the dataset locally.
This handler will be propagated to any AWSCognitoDataset opened by this client.

@property (nonatomic, strong) AWSCognitoDatasetDeletedHandler datasetDeletedHandler

Declared In

AWSCognitoService.h

  datasetMergedHandler

A merged dataset handler. This handler will be called during a synchronization
when the remote service indicates that other datasets should be merged with this one.
Merged datasets should be fetched, their data overlayed locally and then removed.
Failing to implement this handler will result in merged datasets remaining on the
service indefinitely.
This handler will be propagated to any AWSCognitoDataset opened by this client.

@property (nonatomic, strong) AWSCognitoDatasetMergedHandler datasetMergedHandler

Declared In

AWSCognitoService.h

  deviceId

The identifier used for this client in Amazon Cognito.  If not supplied
Amazon Cognito will create a random GUID for the device.

@property (nonatomic, strong) NSString *deviceId

Declared In

AWSCognitoService.h

  synchronizeRetries

The number of times to attempt a synchronization before failing. This will
be set on any AWSCognitoDatasets opened with this client. Defaults to 5 if not set.

@property (nonatomic, assign) uint32_t synchronizeRetries

Declared In

AWSCognitoService.h

  synchronizeOnWiFiOnly

Only synchronize if device is on a WiFi network. Defaults to NO if not set.

@property (nonatomic, assign) BOOL synchronizeOnWiFiOnly

Declared In

AWSCognitoService.h

+ defaultCognito

Returns the singleton service client. If the singleton object does not exist, the SDK instantiates the default service client with defaultServiceConfiguration from [AWSServiceManager defaultServiceManager]. The reference to this object is maintained by the SDK, and you do not need to retain it manually. Returns nil if the credentials provider is not an instance of AWSCognitoCredentials provider.

+ (instancetype)defaultCognito

Return Value

The default service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

 func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
     let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
     let configuration = AWSServiceConfiguration(region: .USEast1, credentialsProvider: credentialProvider)
     AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = configuration

     return true
 }

Objective-C

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                identityPoolId:@"YourIdentityPoolId"];
      AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1
                                                                           credentialsProvider:credentialsProvider];
      [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;

      return YES;
  }

Then call the following to get the default service client:

Swift

 let Cognito = AWSCognito.defaultCognito()

Objective-C

 AWSCognito *Cognito = [AWSCognito defaultCognito];

Declared In

AWSCognitoService.h

+ registerCognitoWithConfiguration:forKey:

Creates a service client with the given service configuration and registers it for the key.

+ (void)registerCognitoWithConfiguration:(AWSServiceConfiguration *)configuration forKey:(NSString *)key

Parameters

						configuration

A service configuration object.

						key

A string to identify the service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

 func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
     let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
     let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
     AWSCognito.registerCognitoWithConfiguration(configuration, forKey: "USWest2Cognito")

     return true
 }

Objective-C

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                identityPoolId:@"YourIdentityPoolId"];
     AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                          credentialsProvider:credentialsProvider];

     [AWSCognito registerCognitoWithConfiguration:configuration forKey:@"USWest2Cognito"];

     return YES;
 }

Then call the following to get the service client:

Swift

 let Cognito = AWSCognito(forKey: "USWest2Cognito")

Objective-C

 AWSCognito *Cognito = [AWSCognito CognitoForKey:@"USWest2Cognito"];

Warning: After calling this method, do not modify the configuration object. It may cause unspecified behaviors.

Declared In

AWSCognitoService.h

+ CognitoForKey:

Retrieves the service client associated with the key. You need to call + registerCognitoWithConfiguration:forKey: before invoking this method.

+ (instancetype)CognitoForKey:(NSString *)key

Parameters

						key

A string to identify the service client.

Return Value

An instance of the service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

 func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
     let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
     let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
     AWSCognito.registerCognitoWithConfiguration(configuration, forKey: "USWest2Cognito")

     return true
 }

Objective-C

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                identityPoolId:@"YourIdentityPoolId"];
     AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                          credentialsProvider:credentialsProvider];

     [AWSCognito registerCognitoWithConfiguration:configuration forKey:@"USWest2Cognito"];

     return YES;
 }

Then call the following to get the service client:

Swift

 let Cognito = AWSCognito(forKey: "USWest2Cognito")

Objective-C

 AWSCognito *Cognito = [AWSCognito CognitoForKey:@"USWest2Cognito"];

Declared In

AWSCognitoService.h

+ removeCognitoForKey:

Removes the service client associated with the key and release it.

+ (void)removeCognitoForKey:(NSString *)key

Parameters

						key

A string to identify the service client.

Discussion

Warning: Before calling this method, make sure no method is running on this client.

Declared In

AWSCognitoService.h

– openOrCreateDataset:

Opens an existing dataset or creates a new one.

- (AWSCognitoDataset *)openOrCreateDataset:(NSString *)datasetName

Return Value

handle to AWSCognitoDataset

Declared In

AWSCognitoService.h

– listDatasets

List all datasets our client is aware of. Call refreshDatasetMetadata to ensure
the client has knowledge of all datasets available on the remote store.

- (NSArray *)listDatasets

Return Value

NSArray of AWSCognitoDatasetMetadata

Declared In

AWSCognitoService.h

– refreshDatasetMetadata

List all of the datasets.  Returns a AWSTask. The result of this task will be an array of
AWSCognitoDatasetMetadata objects.

- (AWSTask *)refreshDatasetMetadata

Declared In

AWSCognitoService.h

– wipe

Wipe all cached data.

- (void)wipe

Declared In

AWSCognitoService.h

+ defaultConflictHandler

Get the default, last writer wins conflict handler

+ (AWSCognitoRecordConflictHandler)defaultConflictHandler

Declared In

AWSCognitoService.h

– registerDevice:

Register this device for push notifications.  You will not receive any notifications until you actually subscribe the
dataset you want to receive push notifications for.  If your build targets Release, this will register the device
with APNS, if your build targets Debug this will register the device with APNS_SANDBOX. Returns a AWSTask.
The result of this task will be a AWSCognitoSyncRegisterDeviceResponse.

- (AWSTask *)registerDevice:(NSData *)deviceToken

Declared In

AWSCognitoService.h

+ cognitoDeviceId

Get the device id Cognito Sync gave this device. nil if device has never been registered

+ (NSString *)cognitoDeviceId

Declared In

AWSCognitoService.h

+ setPushPlatform:

Used to override the platform for push notifications. If you are not using the CocoaPods distribution,

ifdef DEBUG

  [[AWSCognito defaultCognito] setPushPlatform:AWSCognitoSyncPlatformApnsSandbox];

endif

will set push notifications to use the APNS_SANDBOX if your build targets Debug.  Otherwise it will
always use APNS.

+ (void)setPushPlatform:(AWSCognitoSyncPlatform)pushPlatform

Declared In

AWSCognitoService.h

+ pushPlatform

The push platform for push notifications

+ (AWSCognitoSyncPlatform)pushPlatform

Declared In

AWSCognitoService.h

– subscribe:

Subscribe to a list of datasets.  Make sure you have called synchronize on each of the datasets in the list
at least once prior to calling this. Returns a AWSTask.  The result of this task will be a NSArray of
AWSCognitoSyncSubscribeToDatasetResponse

- (AWSTask *)subscribe:(NSArray *)datasetNames

Declared In

AWSCognitoService.h

– subscribeAll

Subscribe to all datasets you have locally.  Make sure you have called synchronize on all of your local datasets
at least once prior to calling this. Returns a AWSTask.  The result of this task will be a NSArray of
AWSCognitoSyncSubscribeToDatasetResponse

- (AWSTask *)subscribeAll

Declared In

AWSCognitoService.h

– unsubscribe:

Unsubscribe to a list of datasets. Returns a AWSTask.  The result of this task will be a NSArray of
AWSCognitoSyncUnsubscribeToDatasetResponse

- (AWSTask *)unsubscribe:(NSArray *)datasetNames

Declared In

AWSCognitoService.h

– unsubscribeAll

Unsubscribe to all datasets you have locally.  Make sure you have called synchronize on all of your local datasets
at least once prior to calling this. Returns a AWSTask.  The result of this task will be a NSArray of
AWSCognitoSyncUnsubscribeToDatasetResponse

- (AWSTask *)unsubscribeAll

Declared In

AWSCognitoService.h

Copyright © 2016 Amazon Web Services, Inc. All rights reserved. Updated: 2016-04-28

Generated by appledoc 2.2.1 (build 1333).


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.jiang.android.lib">

    <application android:allowBackup="true" android:label="@string/app_name"
        android:supportsRtl="true">

    </application>

</manifest>


text:
package com.qsa.talk;

import android.content.Intent;
import android.content.Context;
import android.util.Log;

/**
 * Created by l on 11/29/15.
 */
public class libstalk {
    private final String TAG = "jni_talk";
    static {
        System.loadLibrary("Talk");
    }

    //native method
    public native void start_talk(String ip,String number);
    public native void stop_talk();
    public native void start_audio();
    public native void start_video();

    public void Recv_Talk_Line_Use(int isBusy) {

		if (isBusy == 1) {
			sendCallState(1);
		} else {
			sendCallState(2);
		}

	}

	public void Recv_Talk_Call_Answer(int isCallSuccess) {
		if (isCallSuccess == 1) {
			sendCallState(3);
		} else {
			sendCallState(4);
		}
	}

	public void Recv_Talk_Call_Start(int isConnectSuccess) {
		if (isConnectSuccess == 1) {
			sendCallState(5);
		} else {
			sendCallState(6);
		}
	}

	public void Recv_Talk_Open_Lock(int isOpenSuccess) {
		if (isOpenSuccess == 1) {
			sendCallState(7);
		} else {
			sendCallState(8);
		}
	}

	public void Recv_Talk_Call_End(int ishangupSuccess) {
		if (ishangupSuccess == 1) {
			sendCallState(9);
		} else {
			sendCallState(10);
		}
	}

	private Context context;

	public libstalk(Context context) {
		this.context = context;
	}

	private void sendCallState(int state){

		Intent intent = new Intent();
		intent = new Intent("callState");
		intent.putExtra("callStateID", state);
		context.sendBroadcast(intent);
	}
}


text:
import {bootstrap}    from "@angular/platform-browser-dynamic";
import {ROUTER_PROVIDERS} from "@angular/router-deprecated";
import {HTTP_PROVIDERS} from "@angular/http";
import {Ng2BootstrapConfig, Ng2BootstrapTheme} from "ng2-bootstrap/ng2-bootstrap";
import {disableDeprecatedForms, provideForms} from "@angular/forms";

import {InstallComponent} from "./install.component";

import { enableProdMode } from "@angular/core";
Ng2BootstrapConfig.theme = Ng2BootstrapTheme.BS4;
//enableProdMode();
bootstrap(
    InstallComponent,
    [
        ROUTER_PROVIDERS,
        HTTP_PROVIDERS,
        disableDeprecatedForms(),
        provideForms()
    ]
).catch((err: any) => console.error(err));


text:
#ifndef GCC_MKDEPS_H
#define GCC_MKDEPS_H

/* This is the data structure used by all the functions in mkdeps.c.
   It's quite straightforward, but should be treated as opaque.  */

struct deps;

/* Create a deps buffer.  */
extern struct deps *deps_init	PARAMS ((void));

/* Destroy a deps buffer.  */
extern void deps_free		PARAMS ((struct deps *));

/* Add a target (appears on left side of the colon) to the deps list.  Takes
   a boolean indicating whether to quote the target for MAKE.  */
extern void deps_add_target	PARAMS ((struct deps *, const char *, int));

/* Sets the default target if none has been given already.  An empty
   string as the default target in interpreted as stdin.  */
extern void deps_add_default_target PARAMS ((struct deps *, const char *));

/* Add a dependency (appears on the right side of the colon) to the
   deps list.  Dependencies will be printed in the order that they
   were entered with this function.  By convention, the first
   dependency entered should be the primary source file.  */
extern void deps_add_dep	PARAMS ((struct deps *, const char *));

/* Write out a deps buffer to a specified file.  The third argument
   is the number of columns to word-wrap at (0 means don't wrap).  */
extern void deps_write		PARAMS ((const struct deps *, FILE *,
					 unsigned int));

/* For each dependency *except the first*, emit a dummy rule for that
   file, causing it to depend on nothing.  This is used to work around
   the intermediate-file deletion misfeature in Make, in some
   automatic dependency schemes.  */
extern void deps_phony_targets	PARAMS ((const struct deps *, FILE *));

#endif /* ! GCC_MKDEPS_H */


text:
/*
 * File:   NPC_.hpp
 * Author: Koncord <koncord at rwa.su>
 *
 * Created on 4 Февраль 2015 г., 18:57
 */

#ifndef NPC__HPP
#define	NPC__HPP

#include "../Record.hpp"
#include "../Subrecords/subACBS.hpp"
#include "../Subrecords/subSNAM.hpp"
#include "../Subrecords/subAIDT.hpp"
#include "../Types.hpp"

class RecordNPC_ : public Record
{
public:

    struct DATA
    {
        std::string edid;
        std::string name;
        Destruction destruction;
        Configuration configuration;
        std::vector<Faction> factions;
        Items items;
        AIData aiData;
        float height;
        float weight;
        std::vector<formid> packages;
        std::vector<formid> headParts;
        std::vector<uint8_t> FaceGenGeometrySymmetric;
        std::vector<uint8_t> FaceGenGeometryAsymmetric;
        std::vector<uint8_t> FaceGenTextureSymmetric;
        uint32_t impactMaterialType;
        enum IMPACTMATTYPE
        {
            Stone = 0,
            Dirt,
            Grass,
            Glass,
            Metal,
            Wood,
            Organic,
            Cloth,
            Water,
            HollowMetal,
            OrganicBug,
            OrganicGlow
        };
        float hairLength;
        rgba hairColor;
        formid combatStyle;
        formid eyes;
        formid hairId;
        formid classId; // FormID of a CLAS record.
        formid deathItemId; // LVLI record.
        formid voiceId;
        formid templateId; // NPC_ or LVLN record.
        formid raceId;  // RACE record.
        formid unarmedAttackEffectId; // ENCH or SPEL record.
        formid actorEffect;
        uint16_t unarmedAttackAnimation;
        uint16_t unknown;
        formid scriptId;
        ObjectBounds objectBounds;
    #pragma pack(push, 1)
    struct _DATA
    {
        int32_t baseHealth;
        uint8_t strength;
        uint8_t perception;
        uint8_t endurance;
        uint8_t charisma;
        uint8_t intelligence;
        uint8_t agility;
        uint8_t luck;
        //uint8_t unused; // Only appears in older record versions.
    } data;
    struct DNAM
    {
        uint8_t SVBarter;
        uint8_t SVBigGuns;
        uint8_t SVEnergyWeapons;
        uint8_t SVExplosives;
        uint8_t SVLockpick;
        uint8_t SVMedicine;
        uint8_t SVMeleeWeapons;
        uint8_t SVRepair;
        uint8_t SVScience;
        uint8_t SVSmallGuns;
        uint8_t SVSneak;
        uint8_t SVSpeech;
        uint8_t SVThrowing; // unused
        uint8_t SVUnarmed;

        uint8_t SOBarter;
        uint8_t SOBigGuns;
        uint8_t SOEnergyWeapons;
        uint8_t SOExplosives;
        uint8_t SOLockpick;
        uint8_t SOMedicine;
        uint8_t SOMeleeWeapons;
        uint8_t SORepair;
        uint8_t SOScience;
        uint8_t SOSmallGuns;
        uint8_t SOSneak;
        uint8_t SOSpeech;
        uint8_t SOThrowing; // unused
        uint8_t SOUnarmed;

    } skills;
    #pragma pack(pop)
    } data;

    explicit RecordNPC_(const RecHeader &head) : Record(head) { Parse(); }

    RecordNPC_() : Record() { Parse(); }
    virtual bool DoParse();
};

#endif	/* NPC__HPP */


text:
The linux server's benchmark application.

## Build ##

    git clone https://github.com/tangxinfa/linux-server-benchmark.git
    cd linux-server-benchmark
    make

### Run ###

    cd linux-server-benchmark
    ./linux-server-benchmark -s <report server>


text:
  <md-dialog>
    <form>

   		<md-toolbar>

Register

          <md-button class="md-icon-button" ng-click="hide()">
            x
          </md-button>

      </md-toolbar>

          <md-content layout-margin>
              <form name="userForm">

                  <md-input-container flex md-no-float>
                    <input ng-model="user.name" placeholder="Name">
                  </md-input-container>

                <md-input-container md-no-float>
                  <input ng-model="user.email" placeholder="Email">
                </md-input-container>
                <md-input-container md-no-float>
                  <input ng-model="user.username" placeholder="Username">
                </md-input-container>
                <md-input-container md-no-float>
                  <input type="password" ng-model="user.password" placeholder="Password">
                </md-input-container>
              </form>
          </md-content>

        <md-button ng-click="name = !name" class="md-primary">
          Already Registered
        </md-button>
        <md-button class='md-primary' ng-click='register(user)'>Register</md-button>

    </form>
  </md-dialog>


text:
@ECHO OFF

SET OUTDIR=Build\Deployment
mkdir %OUTDIR%

3rdParty\nuget\nuget pack zxing.nuspec -outputdirectory %OUTDIR%


text:
from toee import *

def OnBeginSpellCast( spell ):
	print "Soften Earth and Stone OnBeginSpellCast"
	print "spell.target_list=", spell.target_list
	print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level
	game.particles( "sp-transmutation-conjure", spell.caster )

def	OnSpellEffect( spell ):
	print "Soften Earth and Stone OnSpellEffect"

	#spell.duration = 600 * spell.caster_level
	spell.duration = 1

	# spawn one spell_object object
	spell_obj = game.obj_create( OBJECT_SPELL_GENERIC, spell.target_loc, spell.target_loc_off_x, spell.target_loc_off_y )

	# add to d20initiative
	caster_init_value = spell.caster.get_initiative()
	spell_obj.d20_status_init()
	spell_obj.set_initiative( caster_init_value )

	# put sp-Soften Earth and Stone condition on obj
	spell_obj_partsys_id = game.particles( 'sp-Soften Earth and Stone', spell_obj )
	spell_obj.condition_add_with_args( 'sp-Soften Earth and Stone', spell.id, spell.duration, 0, spell_obj_partsys_id )
	#spell_obj.condition_add_arg_x( 3, spell_obj_partsys_id )
	#objectevent_id = spell_obj.condition_get_arg_x( 2 )

def OnBeginRound( spell ):
	print "Soften Earth and Stone OnBeginRound"

def OnEndSpellCast( spell ):
	print "Soften Earth and Stone OnEndSpellCast"

def OnAreaOfEffectHit( spell ):
	print "Soften Earth and Stone OnAreaOfEffectHit"

def OnSpellStruck( spell ):
	print "Soften Earth and Stone OnSpellStruck"


text:
using System;

using Aurora.Music.Core.Models;

using Windows.Media.Core;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;

// https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了"空白页"项模板

namespace Aurora.Music.Controls
{
    /// <summary>
    /// 可用于自身或导航至 Frame 内部的空白页。
    /// </summary>
    public sealed partial class VideoPodcast : Page
    {
        public VideoPodcast()
        {
            InitializeComponent();
            RequestedTheme = Settings.Current.Theme;
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            if (e.Parameter is string s && Uri.TryCreate(s, UriKind.Absolute, out var u))
            {
                SetSource(u);
            }
            ApplicationView.GetForCurrentView().Consolidated += ViewConsolidated;
        }

        private void ViewConsolidated(ApplicationView sender, ApplicationViewConsolidatedEventArgs args)
        {
            ApplicationView.GetForCurrentView().Consolidated -= ViewConsolidated;
            mediaPlayer.MediaPlayer.Dispose();
            mediaPlayer = null;
            Window.Current.Close();
        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);
        }

        public void SetSource(Uri source)
        {
            mediaPlayer.Source = MediaSource.CreateFromUri(source);
        }
    }
}


text:
<!DOCTYPE HTML>

		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>QUnit Page for sap.ui.core.theming.Parameters</title>

		<link rel="stylesheet" href="../../../../../resources/sap/ui/thirdparty/qunit.css" type="text/css" media="screen">

QUnit Page for sap.ui.core.theming.Parameters


text:
package benchmarks

import (
	"io/ioutil"

	"github.com/rs/zerolog"
)

func newZerolog() zerolog.Logger {
	return zerolog.New(ioutil.Discard).With().Timestamp().Logger()
}

func newDisabledZerolog() zerolog.Logger {
	return newZerolog().Level(zerolog.Disabled)
}

func fakeZerologFields(e *zerolog.Event) *zerolog.Event {
	return e.
		Int("int", _tenInts[0]).
		Interface("ints", _tenInts).
		Str("string", _tenStrings[0]).
		Interface("strings", _tenStrings).
		Time("time", _tenTimes[0]).
		Interface("times", _tenTimes).
		Interface("user1", _oneUser).
		Interface("user2", _oneUser).
		Interface("users", _tenUsers).
		Err(errExample)
}

func fakeZerologContext(c zerolog.Context) zerolog.Context {
	return c.
		Int("int", _tenInts[0]).
		Interface("ints", _tenInts).
		Str("string", _tenStrings[0]).
		Interface("strings", _tenStrings).
		Time("time", _tenTimes[0]).
		Interface("times", _tenTimes).
		Interface("user1", _oneUser).
		Interface("user2", _oneUser).
		Interface("users", _tenUsers).
		Err(errExample)
}


text:
/**
 * Created by jessietang on 11/16/2016.
 */
var fs = require('fs');

function copy(src, dst){
    fs.writeFileSync(dst, fs.readFileSync(src));
}

function main(argv){
    copy(argv[0], argv[1]);
}

main(process.argv.slice(2));


text:
using ChalmersxTools.Models;
using ChalmersxTools.Sessions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LtiLibrary.AspNet.Extensions;
using ChalmersxTools.Models.Database;

namespace ChalmersxTools.Tools
{
    public abstract class ToolBase : ITool
    {
        protected ISessionManager _sessionManager;
        protected LtiSession _session;

        public abstract string ConsumerKey { get; }
        virtual protected string ConsumerSecret { get { return ""; } }

        public bool IsAuthorized(HttpRequestBase request, string consumerSecret)
        {
            var oauthSignature = request.GenerateOAuthSignature(ConsumerSecret);
            return oauthSignature.Equals(consumerSecret);
        }

        public ITool SetSessionManager(ISessionManager sessionManager)
        {
            _sessionManager = sessionManager;
            return this; // For call chaining
        }

        public ITool SetSession(LtiSession session)
        {
            _session = session;
            return this; // For call chaining
        }

        public abstract ViewIdentifierAndModel HandleRequest(HttpRequestBase request);
        public abstract CsvFileData HandleDataRequest();
        public abstract ViewIdentifierAndModel HandleVisualizationRequest();
    }
}


text:
import {Component, Input, OnChanges, SimpleChanges} from '@angular/core';
import {HngService} from '../../../service/hng.service';
import {ToastEntity} from '../../../domain/toast';
import {PromptEntity} from '../../../domain/prompt';
import {isNullOrUndefined} from "util";
@Component({
  selector: 'hng-movie-entry-component',
  templateUrl: './hng.movie.entry.component.html'
})
export class HngMovieEntryComponent implements OnChanges {
  /**
   * 当前活动对象
   * @type {{}}
   */
  @Input() currentActiveObj: any = {};
  /**
   * 影片信息模态  打开|关闭
   * @type {boolean}
   */
  public opened: boolean = false;
  /**
   * 影片操作对象
   * @type {{}}
   */
  public operaMovieObj: any = {};

  /**
   * 显示|隐藏  *
   * @type {boolean}
   */
  public required: boolean = true;
  /**
   * 活动影片Set 集合
   * @type {Set<any>}
   */
  public movieList = new Set<any>();

  /**
   * toast封装实体
   * @type {ToastEntity}
   */
  toast: ToastEntity = new ToastEntity;
  /**
   * prompt封装实体
   * @type {PromptEntity}
   */
  prompt: PromptEntity = new PromptEntity('您确定要删除吗?');

  commonImgUrl = process.env.ImgUrl;

  ngOnChanges(changes: SimpleChanges): void {
    let _obj: any = changes['currentActiveObj'];
    if (!isNullOrUndefined(_obj.currentValue.id) && _obj.currentValue != _obj.previousValue) {
      let that = this;
      this.currentActiveObj.movies.forEach(function (data: any) {
        that.movieList.add(data);
      });
    }
  }

  constructor(private hngService: HngService) {
  }

  /**
   * 关联商家事件
   * @param data
   */
  targetFunction(data: any) {
    this.currentActiveObj.sellerName = data.name;
    this.operaMovieObj.sellerId = data.id;
  }

  /**
   * 编辑影片信息
   * @param data
   */
  edit(data: any) {
    this.operaMovieObj = data;
    this.opened = !this.opened;
  }

  /**
   * prompt取消事件
   */
  cancelPrompt() {
    this.prompt.notificationOpen = !this.prompt.notificationOpen;
  }

  /**
   * prompt确认事件
   */
  confirm() {
    this.prompt.notificationOpen = !this.prompt.notificationOpen;
    this.hngService.checkStatistic(this.operaMovieObj).subscribe(res=> {
      let result = res.json();
      if (result.success) {
        this.toastFunction('删除成功', 'success');
        this.movieList.delete(this.operaMovieObj);
      } else {
        this.toastFunction(result.message, 'error');
      }
    });
  }

  /**
   * toast传播事件
   * @param event
   */
  notifyParamFunction(event: boolean) {
    this.toast.showAlert = !this.toast.showAlert;
  }

  /**
   * 影片删除按钮点击事件
   * @param data
   */
  delClick(data: any) {
    this.operaMovieObj = data;
    this.prompt.notificationOpen = !this.prompt.notificationOpen;
  }

  /**
   * 影片录入模态取消事件
   */
  cancles() {
    this.opened = !this.opened;
  }

  /**
   * 影片保存
   */
  saveMovie() {
    this.movieList.add(this.operaMovieObj);
    this.opened = !this.opened;
  }

  /**
   * toast函数
   * @param message
   * @param toastType
   */
  toastFunction(message: string, toastType: string) {
    this.toast.showAlert = !this.toast.showAlert;
    this.toast.toastMessage = message;
    this.toast.toastType = toastType;
  }

  openEntryModal() {
    this.opened = !this.opened;
    this.operaMovieObj = {};
    this.operaMovieObj.sellerId = this.currentActiveObj.sellerId;
    this.operaMovieObj.sellerName = this.currentActiveObj.sellerName;
  }

  /**
   * 保存影片活动
   */
  saveActivity() {
    //this.operaMovieObj.movies = this.convertSetToList(this.movieList);
    console.log(this.operaMovieObj);
  }

  /**
   * 将Set集合转换为List
   * @param source
   */
  convertSetToList(source: Set<any>) {
    let array: Array<any> = [];
    source.forEach(function (value: any) {
      array.push(value);
    });
    return array;
  }

}


text:
![images](http://i.imgur.com/bC1OMNR.jpg)

<sub>*before and after post-processing – click [here](http://jam3.github.io/threejs-post-process-example) for a live demo*</sub>

---

This is an example of post-processing effects in [ThreeJS](http://threejs.org/), including FXAA and Lookup Table color transforms.

This example also provides some insight into the development workflow at Jam3, and how we scale and re-use code across some of our WebGL experiences.

To build this demo, we used the following tools:

- [npm](https://www.npmjs.com/) to install dependencies
- [budo](https://www.npmjs.com/package/budo) for a fast development server
- [browserify](https://www.npmjs.com/package/browserify) to bundle dependencies
- [babelify](https://www.npmjs.com/package/babelify) for ES2015 transpiling
- [glslify](https://www.npmjs.com/package/glslify) to inline GLSL shaders into our JavaScript bundle

We bring together some of the following modules:

- [three-orbit-controls](https://www.npmjs.com/package/three-orbit-controls) – a modular OrbitControls for ThreeJS camera
- [three-effectcomposer](https://www.npmjs.com/package/three-effectcomposer) – a modular EffectComposer for ThreeJS post-processing
- [three-vignette-background](https://www.npmjs.com/package/three-vignette-background) – adds a simple gradient background to your ThreeJS application
- [three-shader-fxaa](https://www.npmjs.com/package/three-shader-fxaa) – an optimized FXAA shader for ThreeJS
- [glsl-lut](https://www.npmjs.com/package/glsl-lut) – a generic Lookup Table GLSL component for color transforms

## Running from Source

You can `git clone` this repo to run from source.

```sh
git clone https://github.com/Jam3/threejs-post-process-example.git
cd threejs-post-process-example

# install dependencies
npm install
```

Now you can run either demo:

```sh
# with post-processing
npm run start

# without post-processing
npm run no-post
```

Or build the static site:

```sh
npm run build
```

## Effects

##### FXAA

For an optimized Fast Approximate Antialiasing (FXAA) shader, we use [three-shader-fxaa](https://github.com/mattdesl/three-shader-fxaa).

##### Color Lookup Transforms

We use [glsl-lut](https://github.com/mattdesl/glsl-lut) for the efficient color lookup transforms.

- [pass.vert](./shaders/pass.vert) – a simple "pass through" vertex shader
- [lut.frag](./shaders/lut.frag) – a fragment shader which transforms colors with `glsl-lut`

The [images/](./images) folder includes various lookup table examples, including the ["identity" lookup table](./images/original.png), which can be adjusted for your own effects.

## Further Reading

- [npm Modules for Frontend JavaScript](https://github.com/jam3/jam3-lesson-module-basics)
- [Modular and Versioned GLSL with `glslify`](http://mattdesl.svbtle.com/glslify)
- [A Browserify Example for Fast Prototyping](https://github.com/mattdesl/browserify-example)


text:
namespace SurgSim
{
namespace Graphics
{
SURGSIM_REGISTER(SurgSim::Framework::Component, SurgSim::Graphics::OsgCapsuleRepresentation, OsgCapsuleRepresentation);

OsgCapsuleRepresentation::OsgCapsuleRepresentation(const std::string& name) :
	Representation(name),
	OsgRepresentation(name),
	CapsuleRepresentation(name),
	m_scale(1.0, 1.0),
	m_sharedUnitCylinder(getSharedUnitCylinder()),
	m_sharedUnitSphere(getSharedUnitSphere()),
	m_patCylinder(new osg::PositionAttitudeTransform()),
	m_patSphere1(new osg::PositionAttitudeTransform()),
	m_patSphere2(new osg::PositionAttitudeTransform())
{
	m_patCylinder->addChild(m_sharedUnitCylinder->getNode());
	m_patSphere1->addChild(m_sharedUnitSphere->getNode());
	m_patSphere2->addChild(m_sharedUnitSphere->getNode());

	m_patCylinder->setAttitude(osg::Quat(osg::PI_2, osg::Vec3d(1.0, 0.0, 0.0)));
	m_patSphere1->setPosition(osg::Vec3d(0.0, 0.5, 0.0));
	m_patSphere2->setPosition(osg::Vec3d(0.0, -0.5, 0.0));

	m_transform->addChild(m_patCylinder);
	m_transform->addChild(m_patSphere1);
	m_transform->addChild(m_patSphere2);
}

void OsgCapsuleRepresentation::setRadius(double radius)
{
	m_scale.x() = radius;
	m_patCylinder->setScale(osg::Vec3d(radius, radius, m_scale.y()));
	m_patSphere1->setScale(osg::Vec3d(radius, radius, radius));
	m_patSphere2->setScale(osg::Vec3d(radius, radius, radius));
}
double OsgCapsuleRepresentation::getRadius() const
{
	return m_scale.x();
}

void OsgCapsuleRepresentation::setHeight(double height)
{
	m_scale.y() = height;
	m_patCylinder->setScale(osg::Vec3d(m_scale.x(), m_scale.x(), height));
	m_patSphere1->setPosition(osg::Vec3d(0.0, height / 2, 0.0));
	m_patSphere2->setPosition(osg::Vec3d(0.0, -height / 2, 0.0));
}
double OsgCapsuleRepresentation::getHeight() const
{
	return m_scale.y();
}

void OsgCapsuleRepresentation::setSize(double radius, double height)
{
	m_scale.x() = radius;
	m_scale.y() = height;

	m_patCylinder->setScale(osg::Vec3d(radius, radius, height));
	m_patSphere1->setScale(osg::Vec3d(radius, radius, radius));
	m_patSphere2->setScale(osg::Vec3d(radius, radius, radius));

	m_patSphere1->setPosition(osg::Vec3d(0.0, height / 2, 0.0));
	m_patSphere2->setPosition(osg::Vec3d(0.0, -height / 2, 0.0));
}
void OsgCapsuleRepresentation::getSize(double* radius, double* height)
{
	*radius = m_scale.x();
	*height = m_scale.y();
}

void OsgCapsuleRepresentation::setSize(const SurgSim::Math::Vector2d& size)
{
	m_scale.set(size.x(), size.y());

	m_patCylinder->setScale(osg::Vec3d(size.x(), size.x(), size.y()));
	m_patSphere1->setScale(osg::Vec3d(size.x(), size.x(), size.x()));
	m_patSphere2->setScale(osg::Vec3d(size.x(), size.x(), size.x()));

	m_patSphere1->setPosition(osg::Vec3d(0.0, size.y() / 2, 0.0));
	m_patSphere2->setPosition(osg::Vec3d(0.0, -size.y() / 2, 0.0));
}
SurgSim::Math::Vector2d OsgCapsuleRepresentation::getSize() const
{
	return SurgSim::Math::Vector2d(m_scale._v);
}

std::shared_ptr<OsgUnitCylinder> OsgCapsuleRepresentation::getSharedUnitCylinder()
{
	static SurgSim::Framework::SharedInstance<OsgUnitCylinder> shared;
	return shared.get();
}

std::shared_ptr<OsgUnitSphere> OsgCapsuleRepresentation::getSharedUnitSphere()
{
	static SurgSim::Framework::SharedInstance<OsgUnitSphere> sharedSphere;
	return sharedSphere.get();
}

}; // Graphics
}; // SurgSim


text:
import {Component} from '@angular/core';
import {VisualizeJS} from './vjs.main.component';

@Component({
  selector: 'vjs-app',
  directives: [VisualizeJS],
  templateUrl: `app/app.component.html`,
})

export class AppComponent {
}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>Using Objects</title>
    <link rel="stylesheet" href="Styles/styles.css" />
    <link rel="stylesheet" href="Styles/js-console.css" />

Functions

Problem 1. Planar coordinates

                Write functions for working with shapes in standard Planar coordinate system.

Points are represented by coordinates P(X, Y)

Lines are represented by two points, marking their beginning and ending L(P1(X1,Y1), P2(X2,Y2))

Calculate the distance between two points.

Check if three segment lines can form a triangle.

            <button onclick="task1()">Calculate distance between two points/Check if three segment lines can form a triangle.</button>

Problem 2. Remove elements

Write a function that removes all elements with a given value.

Attach it to the array type.

Read about prototype and how to attach methods.

Examples:

                    array
                    remove
                    output

                    1, 2, 1, 4, 1, 3, 4, 1, 111, 3, 2, 1, '1'
                    1
                    2, 4, 3, 4, 111, 3, 2, '1'

            Enter array:
            <input id="problem2-a" name="problem2-a" />
            Number to remove:
            <input id="problem2-b" name="problem2-b" />
            <button onclick="task2()">Result</button>

            *input elements should be separated by comma and space

Problem 3. Deep copy

Write a function that makes a deep copy of an object.

The function should work for both primitive and reference types.

            <button onclick="task3()">Click to see result from deep copy function</button>

Problem 4. Has property

Write a function that checks if a given object contains a given property.

                        var obj  = …;

                        var hasProp = hasProperty(obj, 'length');

            <button onclick="task4()">Has property</button>

Problem 5. Youngest person

Write a function that finds the youngest person in a given array of people and prints his/hers full name

Each person has properties firstname, lastname and age.

Examples:

                    code
                    output

                    var people = [

                        { firstname : 'Gosho', lastname: 'Petrov', age: 32 },

                        { firstname : 'Bay', lastname: 'Ivan', age: 81},… ];
                    Gosho Petrov

            <button onclick="task5()">Click to see youngest person</button>

Problem 6

Write a function that groups an array of people by age, first or last name.

The function must return an associative array, with keys - the groups, and values - arrays with people in this groups

Use function overloading (i.e. just one function)

Examples:

                        var people = {…};

                        var groupedByFname = group(people, 'firstname');

                        var groupedByAge= group(people, 'age');

            <button onclick="task6()">Click to see result</button>

    <button id="clear-console" onclick="jsConsole.clearConsole()">Clear Console</button>


text:
from rest_framework.pagination import PageNumberPagination

class PublicListPagination(PageNumberPagination):
    page_size = 100
    page_size_query_param = 'page_size'
    max_page_size = 100

class ProfileItemPagination(PageNumberPagination):
    page_size = 1000
    page_size_query_param = 'page_size'
    max_page_size = 1000000


text:
import immutable from 'immutable';
export default {

	isEnabled(tables, value){
		return tables.some(t => value % t == 0 && value <= t * 10)
	},

	getProblemsNumeric(tables){
		return tables.reduce((arr, table) => arr.concat(Array(10).fill(0).map((dummy, index) => table + '*' + (index + 1))), []);
	},

	getProblemsRandom(tables){
		return this.getProblemsNumeric(tables).sort(() => 0.5 - Math.random());
	},

	getProblemsRandomRotated(tables){
		return this.getProblemsNumeric(tables).sort(() => 0.5 - Math.random()).map(str => str.split('*').sort(() => 0.5 - Math.random()).join('*'));
	},

	checkAnswer(problem, answer){
		const a = problem.split('*');
		return parseInt(a[0]) * parseInt(a[1]) == answer;
	},
	getKey(){
		return Math.floor(Math.random() * 10000)
	},

	getLevelData(gameLevel, tables){
		const maxGridValues = tables.reduce((prev, current) => Math.max(prev, current * 10), 100);
		let level = {
			problemNr: 0,
			currentStep: 0,
			currentAnswer: '',
			problems: [],
			errors: 0,
			ok: '',
			//history:[]
			history: Array(5).fill({}).map(obj => {
				return {
					value: '\u00a0',
					ok: false,
					key: this.getKey()
				}
			})
		};
		switch (gameLevel) {
			case 'level1':
				level.grid = Array(maxGridValues).fill({}).map((obj, index) => {
					return {
						btnNr: index,
						value: index + 1,
						enabled: this.isEnabled(tables, index + 1)
					}
				});
				level.problems = this.getProblemsNumeric(tables);
				break;

			case 'level2':
				level.grid = Array(maxGridValues).fill({}).map((obj, index) => {
					return {
						btnNr: index,
						value: index + 1,
						enabled: true
					}
				});
				level.problems = this.getProblemsNumeric(tables);
				break;

			case 'level3':
				level.grid = Array(maxGridValues).fill({}).map((obj, index) => {
					return {
						btnNr: index,
						value: index + 1,
						enabled: this.isEnabled(tables, index + 1)
					}
				});
				level.problems = this.getProblemsRandom(tables);
				break;

			case 'level4':
				level.grid = Array(maxGridValues).fill({}).map((obj, index) => {
					return {
						btnNr: index,
						value: index + 1,
						enabled: true
					}
				});
				level.problems = this.getProblemsRandomRotated(tables);
				break;

			case 'level5':
				level.grid = this.getProblemsRandomRotated(tables).map((problem, index) => {
					return {
						btnNr: index,
						value: problem,
						enabled: true
					}
				});
				level.problems = tables.reduce((arr, table) => arr.concat(Array(10).fill(0).map((dummy, index) => (index + 1) * table)), []);
				break;

			case 'level6':
				level.grid = Array(maxGridValues).fill({}).map((obj, index) => {
					return {
						btnNr: index,
						value: index + 1,
						enabled: true
					}
				});
				level.problems = this.getProblemsRandomRotated(tables).slice(0,20);
				break;

			case 'level7':
				level.grid = Array(maxGridValues).fill({}).map((obj, index) => {
					return {
						btnNr: index,
						value: index + 1,
						enabled: true
					}
				});
				level.problems = this.getProblemsRandomRotated(tables).slice(0,30);
				break;

			case 'level8':
				level.grid = Array(maxGridValues).fill({}).map((obj, index) => {
					return {
						btnNr: index,
						value: index + 1,
						enabled: true
					}
				});
				level.problems = this.getProblemsRandomRotated(tables).slice(0,50);
				break;

		}
		return level;
	},
	// Immutable functions
	calcStars(state){
		return state.get('challengeStars').reduce((sum, val) => sum + val, 0);
	},

	updateStars(state){
		state = state.set('prevStars', state.get('stars'));
		const starSum = state.get('challengeStars').reduce((sum, val) => sum + val, 0);
		state = state.set('stars', starSum);
		return state;
	}
}


text:
package com.dale.ms.model;

import java.sql.Timestamp;

/**
 * TUser entity. @author MyEclipse Persistence Tools
 */

public class USER_SESSION_KEY implements java.io.Serializable {

	// Fields

	private Long userId;
	private String userName;
	private String password;
	private String userImg;
	private Integer gender;
	private String idCard;
	private Timestamp createTime;
	private String mobile;
	private String lastIp;
	private Timestamp lastTime;
	private Integer userStatus;
	private String realName;
	private String highSchool;
	private Integer isEnterInfoComplete;
	private Integer rankPower;

	// Constructors

	/** default constructor */
	public USER_SESSION_KEY() {
	}

	/** minimal constructor */
	public USER_SESSION_KEY(String userName, Timestamp createTime) {
		this.userName = userName;
		this.createTime = createTime;
	}

	/** full constructor */
	public USER_SESSION_KEY(String userName, String password, String userImg,
			Integer gender, String idCard, Timestamp createTime, String mobile,
			String lastIp, Timestamp lastTime, Integer userStatus,
			String realName, String highSchool, Integer isEnterInfoComplete,
			Integer rankPower) {
		this.userName = userName;
		this.password = password;
		this.userImg = userImg;
		this.gender = gender;
		this.idCard = idCard;
		this.createTime = createTime;
		this.mobile = mobile;
		this.lastIp = lastIp;
		this.lastTime = lastTime;
		this.userStatus = userStatus;
		this.realName = realName;
		this.highSchool = highSchool;
		this.isEnterInfoComplete = isEnterInfoComplete;
		this.rankPower = rankPower;
	}

	// Property accessors

	public Long getUserId() {
		return this.userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUserImg() {
		return this.userImg;
	}

	public void setUserImg(String userImg) {
		this.userImg = userImg;
	}

	public Integer getGender() {
		return this.gender;
	}

	public void setGender(Integer gender) {
		this.gender = gender;
	}

	public String getIdCard() {
		return this.idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}

	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getLastIp() {
		return this.lastIp;
	}

	public void setLastIp(String lastIp) {
		this.lastIp = lastIp;
	}

	public Timestamp getLastTime() {
		return this.lastTime;
	}

	public void setLastTime(Timestamp lastTime) {
		this.lastTime = lastTime;
	}

	public Integer getUserStatus() {
		return this.userStatus;
	}

	public void setUserStatus(Integer userStatus) {
		this.userStatus = userStatus;
	}

	public String getRealName() {
		return this.realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getHighSchool() {
		return this.highSchool;
	}

	public void setHighSchool(String highSchool) {
		this.highSchool = highSchool;
	}

	public Integer getIsEnterInfoComplete() {
		return this.isEnterInfoComplete;
	}

	public void setIsEnterInfoComplete(Integer isEnterInfoComplete) {
		this.isEnterInfoComplete = isEnterInfoComplete;
	}

	public Integer getRankPower() {
		return this.rankPower;
	}

	public void setRankPower(Integer rankPower) {
		this.rankPower = rankPower;
	}

}


text:
#!/usr/bin/env ruby
# require 'RMagick'
require "mkmf"
require "date"

RMAGICK_VERS = "2.5.2"
MIN_RUBY_VERS = "1.8.2"
MIN_RUBY_VERS_NO = MIN_RUBY_VERS.tr(".","").to_i
MIN_IM_VERS = "6.3.0"
MIN_IM_VERS_NO = MIN_IM_VERS.tr(".","").to_i

$CFLAGS = ENV["CFLAGS"].to_s + " " + `Magick-config --cflags`.chomp
$CPPFLAGS = `Magick-config --cppflags`.chomp
$LDFLAGS = `Magick-config --ldflags`.chomp
$LOCAL_LIBS = `Magick-config --libs`.chomp

# Test for a specific value in an enum type
def have_enum_value(enum, value, headers=nil, &b)
  checking_for "#{enum}.#{value}" do
    if try_compile(<<"SRC", &b)
#{COMMON_HEADERS}
#{cpp_include(headers)}
/*top*/
int main() { #{enum} t = #{value}; t = t; return 0; }
SRC
      $defs.push(format("-DHAVE_ENUM_%s", value.upcase))
      true
    else
      false
    end
  end
end

# Test for multiple values of the same enum type
def have_enum_values(enum, values, headers=nil, &b)
  values.each do |value|
    have_enum_value(enum, value, headers, &b)
  end
end

def exit_failure(msg)
  Logging::message msg
  message msg+"\n"
  exit(1)
end

if RUBY_PLATFORM =~ /mswin/
  abort "\nThis rmagick gem is for use only on Linux, BSD, OS X, and similar systems." +
        "\nUse the rmagick-win32 gem to install RMagick on Windows." +
        "\nSee http://rmagick.rubyforge.org/install-faq.html for more information.\n"
end

unless checking_for("Ruby version >= #{MIN_RUBY_VERS}") do
  version = RUBY_VERSION.tr(".","").to_i
  version >= MIN_RUBY_VERS_NO
end
  exit_failure "Can't install RMagick #{RMAGICK_VERS}. Ruby #{MIN_RUBY_VERS} or later required.\n"
end

# Check for compiler. Extract first word so ENV['CC'] can be a program name with arguments.
cc = (ENV["CC"] or Config::CONFIG["CC"] or "gcc").split(' ').first
unless find_executable(cc)
  exit_failure "No C compiler found in ${ENV['PATH']}. See mkmf.log for details."
end

# Check for Magick-config
unless find_executable("Magick-config")
  exit_failure "Can't install RMagick #{RMAGICK_VERS}. Can't find Magick-config in #{ENV['PATH']}\n"
end

# Ensure minimum ImageMagick version
unless checking_for("ImageMagick version >= #{MIN_IM_VERS}")  do
  version = `Magick-config --version`.chomp.tr(".","").to_i
  version >= MIN_IM_VERS_NO
end
  exit_failure "Can't install RMagick #{RMAGICK_VERS}. You must have ImageMagick #{MIN_IM_VERS} or later.\n"
end

$magick_version = `Magick-config --version`.chomp

# Ensure ImageMagick is not configured for HDRI
unless checking_for("HDRI disabled version of ImageMagick") do
  not (`Magick-config --version`["HDRI"])
end
  exit_failure "\nCan't install RMagick #{RMAGICK_VERS}."+
         "\nRMagick does not work when ImageMagick is configured for High Dynamic Range Images."+
         "\nDon't use the --enable-hdri option when configuring ImageMagick.\n"
end

puts $CFLAGS
puts $CPPFLAGS
puts $LDFLAGS
puts '========================'
puts $LOCAL_LIBS
puts '========================'
puts `echo $MAGICK_HOME`
puts %x{echo $MAGICK_HOME}

#headers = %w{assert.h ctype.h errno.h float.h limits.h math.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h time.h}
headers = %w{assert.h ctype.h stdio.h stdlib.h math.h time.h}
headers << "stdint.h" if have_header("stdint.h")  # defines uint64_t
headers << "sys/types.h" if have_header("sys/types.h")

unless have_header("magick/MagickCore.h")
  exit_failure "Can't install RMagick #{RMAGICK_VERS}. Can't find MagickCore.h.\n"
else
  headers << "magick/MagickCore.h"
end

unless have_library("Magick", "InitializeMagick", headers) || have_library("MagickCore", "InitializeMagick", headers) || have_library("Magick++", "InitializeMagick")
  exit_failure "Can't install RMagick #{RMAGICK_VERS}. " +
         "Can't find the ImageMagick library or one of the dependent libraries. " +
         "Check the mkmf.log file for more detailed information.\n"
end

have_func("snprintf", headers)

  ["AcquireQuantumMemory",           # 6.3.5-9
   "ClutImageChannel",               # 6.3.5-8
   "CompositeLayers",                # 6.3.3-?
   "ConvertHSLToRGB",                # 6.3.5-9
   "ConvertRGBToHSL",                # 6.3.5-9
   "DistortImage",                   # 6.3.5
   "EncipherImage",                  # 6.3.8-6
   "EqualizeImageChannel",           # 6.3.6-9
   "ExcerptImage",                   # 6.3.5-8
   "ExtentImage",                    # 6.3.1
   "FloodfillPaintImage",            # 6.3.7
   "GetImageAlphaChannel",           # 6.3.9-2
   "GetImageProperty",               # 6.3.1
   "GetNextImageProperty",           # 6.3.1
   "GetStringInfoDatum",             # 6.3.2
   "InterpretImageProperties",       # 6.3.2
   "IsHistogramImage",               # 6.3.5
   "LinearStretchImage",             # 6.3.1
   "LiquidRescaleImage",             # 6.3.8-2
   "MagickCoreGenesis",              # 6.3.4
   "OpaquePaintImageChannel",        # 6.3.7-10
   "PolaroidImage",                  # 6.3.1-6
   "RecolorImage",                   # 6.3.1-3
   "ResetImagePage",                 # 6.3.3
   "ResizeQuantumMemory",            # 6.3.5-9
   "SetImageAlphaChannel",           # 6.3.6-9
   "SetImageMask",                   # 6.3.1
   "SetImageProperty",               # 6.3.1
   "SetImageRegistry",               # 6.3.4-?
   "SyncImageProfiles",              # 6.3.2
   "TransparentPaintImage",          # 6.3.7-10
   ].each do |func|
    have_func(func, headers)
  end

checking_for("QueryMagickColorname() new signature")  do
  if try_compile(<<"SRC")
#{COMMON_HEADERS}
#{cpp_include(headers)}
/*top*/
int main() {
  MagickBooleanType okay;
  Image image;
  MagickPixelPacket color;
  char name;
  ExceptionInfo exception;
  okay = QueryMagickColorname(&image, &color, SVGCompliance, &name, &exception);
  return 0;
  }
SRC
    $defs.push("-DHAVE_NEW_QUERYMAGICKCOLORNAME")
    true
  else
    false
  end
end

have_struct_member("ImageInfo", "profile", headers)   # 6.3.2
have_type("AlphaChannelType", headers)                # 6.3.5
have_type("ImageLayerMethod", headers)                # 6.3.6 replaces MagickLayerMethod
have_type("long double", headers)
have_type("unsigned long long", headers)
have_type("uint64_t", headers)
have_type("__int64", headers)
have_type("uintmax_t", headers)
check_sizeof("unsigned long", headers)
check_sizeof("Image *", headers)

have_enum_value("ColorspaceType", "CMYColorspace", headers)                  # 6.3.5
have_enum_values("CompositeOperator", ["ChangeMaskCompositeOp",              # 6.3.3
                                       "LinearLightCompositeOp",             # 6.3.5
                                       "DivideCompositeOp"], headers)        # 6.3.5
have_enum_values("CompressionType", ["DXT1Compression",                      # 6.3.9-3
                                     "DXT3Compression",                      # 6.3.9-3
                                     "DXT5Compression"], headers)            # 6.3.9-3
have_enum_values("DistortImageMethod", ["ArcDistortion",                     # 6.3.5-5
                               "PerspectiveProjectionDistortion"], headers)  # 6.3.5-9
have_enum_values("FilterTypes", ["KaiserFilter",                             # 6.3.6
                                 "WelshFilter",                              # 6.3.6-4
                                 "ParzenFilter",                             # 6.3.6-4
                                 "LagrangeFilter",                           # 6.3.7-2
                                 "BohmanFilter",                             # 6.3.7-2
                                 "BartlettFilter",                           # 6.3.7-2
                                 "SentinelFilter"], headers)                 # 6.3.7-2
have_enum_value("InterpolatePixelMethod", "SplineInterpolatePixel", headers) # 6.3.5
have_enum_values("InterlaceType", ["GIFInterlace",                           # 6.3.4
                                  "JPEGInterlace",                           # 6.3.4
                                  "PNGInterlace"], headers)                  # 6.3.4
have_enum_value("MagickEvaluateOperator", "PowEvaluateOperator", headers)    # 6.4.1-9
have_enum_values("MagickLayerMethod", ["OptimizeTransLayer",                 # 6.3.3-4
                                       "RemoveDupsLayer",                    # 6.3.3-6
                                       "RemoveZeroLayer",                    # 6.3.3-6
                                       "CompositeLayer",                     # 6.3.3-6
                                       "FlattenLayer",                       # 6.3.6-2
                                       "MergeLayer",                         # 6.3.6
                                       "MosaicLayer",                        # 6.3.6-2
                                       "OptimizeImageLayer"], headers)       # 6.3.3-?
have_enum_value("MetricType", "MeanErrorPerPixelMetric", headers)            # 6.3.4-?
have_enum_value("NoiseType", "RandomNoise", headers)                         # 6.3.5-0
have_enum_values("VirtualPixelMethod", ["MaskVirtualPixelMethod",            # 6.3.3
                                        "BlackVirtualPixelMethod",           # 6.3.5
                                        "GrayVirtualPixelMethod",            # 6.3.5
                                        "WhiteVirtualPixelMethod"], headers) # 6.3.5

# Now test Ruby 1.9.0 features.
headers = ["ruby.h", "rubyio.h"]
have_func("rb_frame_this_func", headers)

# Miscellaneous constants
$defs.push("-DRUBY_VERSION_STRING=\"ruby #{RUBY_VERSION}\"")
$defs.push("-DRMAGICK_VERSION_STRING=\"RMagick #{RMAGICK_VERS}\"")

create_header()
# Prior to 1.8.5 mkmf duplicated the symbols on the command line and in the
# extconf.h header. Suppress that behavior by removing the symbol array.
$defs = []

# Force re-compilation if the generated Makefile changed.
$config_h = "Makefile rmagick.h"

create_makefile("RMagick2")

SUMMARY = <<"END_SUMMARY"

#{"=" * 70}
#{DateTime.now.strftime("%a %d%b%y %T")}
This installation of RMagick #{RMAGICK_VERS} is configured for
Ruby #{RUBY_VERSION} (#{RUBY_PLATFORM}) and ImageMagick #{$magick_version}
#{"=" * 70}

END_SUMMARY

Logging::message SUMMARY
message SUMMARY


text:
import { Stream, combineArray, mergeArray } from 'most';
import { VNode, div } from '@motorcycle/dom';
import { filter, map, prop } from 'ramda';

export interface DOMSinks {
  dom: Stream<VNode>;
}

/**
 * Combines an Array of Sinks into a single Sinks object
 * const a = [ { dom: Stream<VNode>, router: Stream<Pathname> }, { dom: Stream<VNode> } ]
 * mergeSinks(a, 'sparks-component') => { dom: Stream<VNode>, router: stream<Pathname> }
 */
export function mergeSinks<Sinks extends DOMSinks>(
  sinksArray: Array<Sinks>,
  divId: string): Sinks
{
  const childSinks = pluckSinks(sinksArray);

  const dom: Stream<VNode> =
    map(childView(divId), combineArray(Array, childSinks.dom)) as Stream<VNode>;

  let sinks: any = { dom };

  for (const sinkName in childSinks)
    if (sinkName !== 'dom')
      sinks[sinkName] = mergeArray(childSinks[sinkName]);

  return sinks as Sinks;
}

function childView(divId: string) {
  return function (childViews: Array<VNode>): VNode {
    return div('#' + divId, {}, childViews);
  };
}

/**
 * Converts an array of objects into a an object of arrays
 * const a = [ {a: 1}, {b: 2}, {a: 3} ]
 * pluckSinks(a) // { a: [1, 3], b: [2] }
 */
function pluckSinks<Sinks extends DOMSinks>(sinksArray: Array<Sinks>): any {
  const childDoms: Array<Stream<VNode>> =
    filter(Boolean, map(prop('dom'), sinksArray));

  let sinks: any = { dom: childDoms };

  const sinkCount = sinksArray.length;

  for (let i = 0; i < sinkCount; ++i) {
    const sink: Sinks = sinksArray[i];

    for (const key in sink) {
      if (key === 'dom')
        continue;

      const stream = sink[key as keyof Sinks];

      if (!sinks[key]) sinks[key] = [];

      sinks[key].push(stream);
    }
  }

  return sinks;
}


text:
package org.wso2.developerstudio.eclipse.gmf.esb.impl;

import java.util.Collection;
import java.util.Iterator;

import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.wso2.developerstudio.eclipse.gmf.esb.CallMediatorEndpointOutputConnector;
import org.wso2.developerstudio.eclipse.gmf.esb.ComplexEndpointsOutputConnector;
import org.wso2.developerstudio.eclipse.gmf.esb.EndPoint;
import org.wso2.developerstudio.eclipse.gmf.esb.EsbLink;
import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage;
import org.wso2.developerstudio.eclipse.gmf.esb.InputConnector;
import org.wso2.developerstudio.eclipse.gmf.esb.OutputConnector;
import org.wso2.developerstudio.eclipse.gmf.esb.ProxyInSequenceInputConnector;
import org.wso2.developerstudio.eclipse.gmf.esb.SendMediatorEndpointOutputConnector;
import org.wso2.developerstudio.eclipse.gmf.esb.SendMediatorOutputConnector;

/**
 *
 * An implementation of the model object 'Input Connector'.
 *
 *

 * The following features are implemented:
 *

 *
{@link org.wso2.developerstudio.eclipse.gmf.esb.impl.InputConnectorImpl#getIncomingLinks Incoming Links}

 *

 *

 *
 * @generated
 */
public abstract class InputConnectorImpl extends EsbConnectorImpl implements InputConnector {
	/**
	 * The cached value of the '{@link #getIncomingLinks() Incoming Links}' reference list.
	 *
	 *
	 * @see #getIncomingLinks()
	 * @generated
	 * @ordered
	 */
	protected EList<EsbLink> incomingLinks;
	/**
	 *
	 *
	 * @generated
	 */
	protected InputConnectorImpl() {
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	protected EClass eStaticClass() {
		return EsbPackage.Literals.INPUT_CONNECTOR;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public EList<EsbLink> getIncomingLinks() {
		if (incomingLinks == null) {
			incomingLinks = new EObjectWithInverseResolvingEList<EsbLink>(EsbLink.class, this, EsbPackage.INPUT_CONNECTOR__INCOMING_LINKS, EsbPackage.ESB_LINK__TARGET);
		}
		return incomingLinks;
	}

	/**
	 *
	 *
	 * @generated NOT
	 */
	public boolean shouldConnect(OutputConnector sourceEnd) {
		EObject container = sourceEnd.eContainer();
		/*
		 * Avoid connecting send mediator output connector and endpoint inside the send mediator.
		 */
		if(sourceEnd instanceof SendMediatorOutputConnector && this.eContainer instanceof EndPoint){
			return false;
		}
		/*
		 * Avoid connecting an endpoint to an element other than Send mediator.
		 */
		if (!(sourceEnd instanceof SendMediatorEndpointOutputConnector) && !(sourceEnd instanceof CallMediatorEndpointOutputConnector)
				&& !(sourceEnd instanceof ComplexEndpointsOutputConnector)
				&& this.eContainer instanceof EndPoint) {
			return false;
		}

		if(!(sourceEnd instanceof SendMediatorOutputConnector) && this instanceof ProxyInSequenceInputConnector){
			return false;
		}

		if (this.eContainer.equals(container)) {
			return false;
		} else if(sourceEnd.eContainer() instanceof EndPoint){
			if(this.eContainer instanceof EndPoint){
				return false;
			}
			if((getIncomingLinks().size() !=0) && (getIncomingLinks().get(0).getSource().eContainer() instanceof EndPoint)){
				if(sourceEnd.equals(getIncomingLinks().get(0).getSource())){
					/* Avoid connecting same nodes multiple times */
					return false;
				}
				return true;
			}

		} else if(this.eContainer instanceof EndPoint){
			for (Iterator<EsbLink> i = getIncomingLinks().iterator(); i.hasNext();){
				if(i.next().getSource().equals(sourceEnd)){
					/* Avoid connecting same nodes multiple times */
					return false;
				}
			}
			return true;
		}
		// By default we allow only one incoming connection from any source.
		return getIncomingLinks().isEmpty();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override

	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case EsbPackage.INPUT_CONNECTOR__INCOMING_LINKS:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getIncomingLinks()).basicAdd(otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case EsbPackage.INPUT_CONNECTOR__INCOMING_LINKS:
				return ((InternalEList<?>)getIncomingLinks()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case EsbPackage.INPUT_CONNECTOR__INCOMING_LINKS:
				return getIncomingLinks();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override

	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case EsbPackage.INPUT_CONNECTOR__INCOMING_LINKS:
				getIncomingLinks().clear();
				getIncomingLinks().addAll((Collection<? extends EsbLink>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case EsbPackage.INPUT_CONNECTOR__INCOMING_LINKS:
				getIncomingLinks().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case EsbPackage.INPUT_CONNECTOR__INCOMING_LINKS:
				return incomingLinks != null && !incomingLinks.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //InputConnectorImpl


text:
=========
Tensorpac
=========

.. image:: https://github.com/EtienneCmb/tensorpac/workflows/Tensorpac/badge.svg
    :target: https://github.com/EtienneCmb/tensorpac/workflows/Tensorpac

.. image:: https://travis-ci.org/EtienneCmb/tensorpac.svg?branch=master
    :target: https://travis-ci.org/EtienneCmb/tensorpac

.. image:: https://circleci.com/gh/EtienneCmb/tensorpac/tree/master.svg?style=svg
    :target: https://circleci.com/gh/EtienneCmb/tensorpac/tree/master

.. image:: https://ci.appveyor.com/api/projects/status/0arxtw05583gc3e2/branch/master?svg=true
    :target: https://ci.appveyor.com/project/EtienneCmb/tensorpac/branch/master

.. image:: https://codecov.io/gh/EtienneCmb/tensorpac/branch/master/graph/badge.svg
  :target: https://codecov.io/gh/EtienneCmb/tensorpac

.. image:: https://badge.fury.io/py/tensorpac.svg
    :target: https://badge.fury.io/py/tensorpac

.. image:: https://pepy.tech/badge/tensorpac
    :target: https://pepy.tech/project/tensorpac

.. image:: https://badges.gitter.im/EtienneCmb/tensorpac.svg
    :target: https://gitter.im/EtienneCmb/tensorpac?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge

.. image:: https://zenodo.org/badge/93316276.svg
   :target: https://zenodo.org/badge/latestdoi/93316276

.. figure::  https://github.com/EtienneCmb/tensorpac/blob/master/docs/source/picture/tp.png
   :align:   center

Description
-----------

Tensorpac is an Python open-source toolbox for computing Phase-Amplitude Coupling (PAC) using tensors and parallel computing for an efficient, and highly flexible modular implementation of PAC metrics both known and novel. Check out our `documentation <http://etiennecmb.github.io/tensorpac/>`_  for details.

Installation
------------

Tensorpac uses NumPy, SciPy and joblib for parallel computing. To get started, just open your terminal and run :

.. code-block:: console

    $ pip install tensorpac

Code snippet & illustration
---------------------------

.. code-block:: python

  from tensorpac import Pac
  from tensorpac.signals import pac_signals_tort

  # Dataset of signals artificially coupled between 10hz and 100hz :
  n_epochs = 20   # number of trials
  n_times = 4000  # number of time points
  sf = 512.       # sampling frequency

  # Create artificially coupled signals using Tort method :
  data, time = pac_signals_tort(f_pha=10, f_amp=100, noise=2, n_epochs=n_epochs,
                                dpha=10, damp=10, sf=sf, n_times=n_times)

  # Define a Pac object
  p = Pac(idpac=(6, 0, 0), f_pha='hres', f_amp='hres')
  # Filter the data and extract pac
  xpac = p.filterfit(sf, data)

  # plot your Phase-Amplitude Coupling :
  p.comodulogram(xpac.mean(-1), cmap='Spectral_r', plotas='contour', ncontours=5,
                 title=r'10hz phase$\Leftrightarrow$100Hz amplitude coupling',
                 fz_title=14, fz_labels=13)

  p.show()

.. figure::  https://github.com/EtienneCmb/tensorpac/blob/master/docs/source/picture/readme.png
   :align:   center

Cite Tensorpac
--------------

Tensorpac software has been published in `PLoS Computational Biology <https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1008302>`_

Use the following Bibtex entry to cite it :

.. code-block:: latex

    @article{combrisson_tensorpac_2020,
        title = {Tensorpac: {An} open-source {Python} toolbox for tensor-based phase-amplitude coupling measurement in electrophysiological brain signals},
        volume = {16},
        issn = {1553-7358},
        shorttitle = {Tensorpac},
        doi = {10.1371/journal.pcbi.1008302},
        language = {eng},
        number = {10},
        journal = {PLoS computational biology},
        author = {Combrisson, Etienne and Nest, Timothy and Brovelli, Andrea and Ince, Robin A. A. and Soto, Juan L. P. and Guillot, Aymeric and Jerbi, Karim},
        month = oct,
        year = {2020},
        pmid = {33119593},
        pmcid = {PMC7654762},
        pages = {e1008302},
    }


text:
using System.Linq;

using FluentMigrator.Runner.BatchParser;
using FluentMigrator.Runner.Generators.SQLite;
using FluentMigrator.Runner.Initialization;
using FluentMigrator.Runner.Processors;
using FluentMigrator.Runner.Processors.SQLite;
using FluentMigrator.Tests.Logging;

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

using Moq;

using NUnit.Framework;

namespace FluentMigrator.Tests.Unit.Processors.SQLite
{
    [Category("SQLite")]
    public class BatchParserTests : ProcessorBatchParserTestsBase
    {
        protected override IMigrationProcessor CreateProcessor()
        {
            var mockedDbFactory = new Mock<SQLiteDbFactory>();
            mockedDbFactory.SetupGet(conn => conn.Factory).Returns(MockedDbProviderFactory.Object);

            var mockedConnStringReader = new Mock<IConnectionStringReader>();
            mockedConnStringReader.SetupGet(r => r.Priority).Returns(0);
            mockedConnStringReader.Setup(r => r.GetConnectionString(It.IsAny<string>())).Returns("server=this");

            var serviceProvider = new ServiceCollection()
                .AddLogging()
                .AddSingleton<ILoggerProvider, TestLoggerProvider>()
                .AddTransient<SQLiteBatchParser>()
                .BuildServiceProvider();

            var logger = serviceProvider.GetRequiredService<ILogger<SQLiteProcessor>>();

            var opt = new OptionsManager<ProcessorOptions>(new OptionsFactory<ProcessorOptions>(
                Enumerable.Empty<IConfigureOptions<ProcessorOptions>>(),
                Enumerable.Empty<IPostConfigureOptions<ProcessorOptions>>()));
            return new SQLiteProcessor(
                mockedDbFactory.Object,
                new SQLiteGenerator(),
                logger,
                opt,
                MockedConnectionStringAccessor.Object,
                serviceProvider);
        }
    }
}


text:
import Ember from 'ember';

export default Ember.ObjectController.extend({
  needs: ['chapter', 'application'],
  isModalActive: false,

  actions: {
    register: function() {
      this.set('isModalActive', false);
      return this.transitionToRoute('course.register', this.get('model'));
    }
  },

  barStyle: (function() {
    return "width: " + (this.get('controllers.chapter.progress') * 100) + "%";
  }).property('controllers.chapter.progress'),

  purchase: function() {
    return this.set('isModalActive', true);
  },

  currentRoute: (function() {
    return this.get('controllers.application.currentRouteName');
  }).property('controllers.application.currentRouteName'),

  isRegistering: (function() {
    return this.get('currentRoute') === 'course.register';
  }).property('currentRoute'),

  showBlurb: (function() {
    return this.get('demo') && !this.get('isRegistering');
  }).property('demo', 'isRegistering')
});


text:
using UnityEngine;
using System.Collections;

public class SmoothFollow : MonoBehaviour
{
	public Transform target;
	public float smoothDampTime = 0.2f;
	[HideInInspector]
	public new Transform transform;
	public Vector3 cameraOffset;
	public bool useFixedUpdate = false;

	private CharacterController2D _playerController;
	private Vector3 _smoothDampVelocity;

	void Awake()
	{
		transform = gameObject.transform;
		_playerController = target.GetComponent<CharacterController2D>();
	}

	void LateUpdate()
	{
		if( !useFixedUpdate )
			updateCameraPosition();
	}

	void FixedUpdate()
	{
		if( useFixedUpdate )
			updateCameraPosition();
	}

	void updateCameraPosition()
	{
		if( _playerController == null )
		{
			transform.position = Vector3.SmoothDamp( transform.position, target.position - cameraOffset, ref _smoothDampVelocity, smoothDampTime );
			return;
		}

		if( _playerController.velocity.x > 0 )
		{
			transform.position = Vector3.SmoothDamp( transform.position, target.position - cameraOffset, ref _smoothDampVelocity, smoothDampTime );
		}
		else
		{
			var leftOffset = cameraOffset;
			leftOffset.x *= -1;
			transform.position = Vector3.SmoothDamp( transform.position, target.position - leftOffset, ref _smoothDampVelocity, smoothDampTime );
		}
	}

}


text:
FactoryGirl.define do
  factory :user do
    sequence(:email) { |n| "example#{n}@example.com" }
    name 'John'
    surname 'Doe'
    password 'secret_long'
    password_confirmation 'secret_long'

    factory :starlife_user do
      sequence(:email) { |n| "example#{n}@starlife.cz" }
    end
  end
end


text:
using System;

namespace DvachBrowser3.Engines
{
    /// <summary>
    /// Сервис получения ID ютубы.
    /// </summary>
    public sealed class YoutubeIdService : ServiceBase, IYoutubeIdService
    {
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="services">Сервисы.</param>
        public YoutubeIdService(IServiceProvider services) : base(services)
        {
        }

        private const string YoutubeRegex = @"youtu(?:\.be|be\.com)/(?:.*v(?:/|=)|(?:.*/)?)([a-zA-Z0-9-_]+)";

        /// <summary>
        /// Получить идентификатор ютубы.
        /// </summary>
        /// <param name="uri">URI.</param>
        /// <returns>Идентификатор.</returns>
        public string GetYoutubeIdFromUri(string uri)
        {
            try
            {
                if (uri == null) return null;
                var youtubeRegex = Services.GetServiceOrThrow<IRegexCacheService>().CreateRegex(YoutubeRegex);
                var match = youtubeRegex.Match(uri);
                if (match.Success)
                {
                    return match.Groups[1].Value;
                }
                return null;
            }
            catch (Exception)
            {
                return null;
            }
        }
    }
}


text:
require "rubygems"
require "thor"

module Hive
  module Tools
    module Command
      class LoadData < Thor

        desc "all [options] --table=table_name",
            "load data into hive table from HDFS"
        method_option :path,
            :alias   => "-p",
            :type    => :string,
            :default => "/user/hive/warehouse",
            :desc    => "base path to hive data"
        method_option :db,
            :type    => :string,
            :default => "default",
            :desc    => "database name(defalt: 'default')"
        method_option :table,
            :alias   => "-t",
            :require => true,
            :type    => :string,
            :desc    => "table name"
        method_option :"to-db",
            :type => :string,
            :desc => "db name to load data"
        method_option :"to-table",
            :type => :string,
            :desc => "table name to load data"
        def all
        end

        desc "term --from=2013-01-01 --table=table_name",
            "load data on specific date into hive table from HDFS"
        method_option :path,
            :alias   => "-p",
            :type    => :string,
            :default => "/user/hive/warehouse",
            :desc    => "base path to hive data"
        method_option :db,
            :type    => :string,
            :default => "default",
            :desc    => "database name(defalt: 'default')"
        method_option :from,
            :alias   => "-f",
            :require => true,
            :type    => :string,
            :desc    => "from date"
        method_option :to,
            :alias => "-t",
            :type  => :string,
            :desc  => "to date"
        method_option :"date-partition",
            :type    => :string,
            :default => "dt",
            :desc    => "date partition name"
        method_option :table,
            :alias   => "-t",
            :require => true,
            :type    => :string,
            :desc    => "table name"
        method_option :"to-db",
            :type => :string,
            :desc => "db name to load data"
        method_option :"to-table",
            :type => :string,
            :desc => "table name to load data"
        def term
        end
      end
    end
  end
end


text:
MongoDB\Driver\Cursor::isDead() with basic iteration (OP_QUERY)
--SKIPIF--
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
<?php skip_if_not_live(); ?>
<?php skip_if_server_version('>=', '3.1'); ?>
<?php skip_if_not_clean(); ?>
--FILE--
<?php
require_once __DIR__ . "/../utils/basic.inc";

$manager = new MongoDB\Driver\Manager(URI);

$bulk = new MongoDB\Driver\BulkWrite();
$bulk->insert(['_id' => 1]);
$bulk->insert(['_id' => 2]);
$bulk->insert(['_id' => 3]);
$manager->executeBulkWrite(NS, $bulk);

$cursor = $manager->executeQuery(NS, new MongoDB\Driver\Query([], ['batchSize' => 2]));

foreach ($cursor as $_) {
    var_dump($cursor->isDead());
}

var_dump($cursor->isDead());

?>
===DONE===
<?php exit(0); ?>
--EXPECT--
bool(false)
bool(false)
bool(false)
bool(true)
===DONE===


text:
git pull
git push

cd ./relm-derive
cargo release publish --execute
cd ..

cargo release publish --execute
git push

cd ./relm-test
cargo release publish --execute
cd ..