text:
NSString * const A0ErrorDomain = @"com.auth0";
NSString * const A0JSONResponseSerializerErrorDataKey = @"A0JSONResponseSerializerErrorDataKey";

@implementation A0Errors

+ (NSError *)errorWithCode:(NSInteger)code userInfo:(NSDictionary *)userInfo {
    NSError *error = [NSError errorWithDomain:A0ErrorDomain
                                         code:code
                                     userInfo:userInfo];
    return error;
}

+ (NSError *)noConnectionNameFound {
    return [self errorWithCode:A0ErrorCodeNoConnectionNameFound
                   description:A0LocalizedString(@"Authentication failed")
                 failureReason:A0LocalizedString(@"Can't find connection name to use for authentication")];
}

+ (NSError *)notConnectedToInternetError {
    return [self errorWithCode:A0ErrorCodeNotConnectedToInternet
                   description:A0LocalizedString(@"The server could not be contacted")
                 failureReason:A0LocalizedString(@"Make sure your network settings are correct and your network connection is active, or try again later.")];
}

+ (BOOL)isAuth0Error:(NSError *)error withCode:(A0ErrorCode)code {
    return [error.domain isEqualToString:A0ErrorDomain] && error.code == code;
}

+ (BOOL)isCancelledSocialAuthentication:(NSError *)error {
    return error.code == A0ErrorCodeFacebookCancelled
    || error.code == A0ErrorCodeTwitterCancelled
    || error.code == A0ErrorCodeAuth0Cancelled
    || error.code == A0ErrorCodeGooglePlusCancelled;
}

+ (NSError *)invalidUsername {
    return [self errorWithCode:A0ErrorCodeInvalidUsername
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:A0LocalizedString(@"The username you entered is invalid. Please try again.")];
}

+ (NSError *)invalidEmail {
    return [self errorWithCode:A0ErrorCodeInvalidEmail
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:A0LocalizedString(@"The email you entered is invalid. Please try again.")];
}

+ (NSError *)invalidPassword {
    return [self errorWithCode:A0ErrorCodeInvalidPassword
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:A0LocalizedString(@"The password you entered is invalid. Please try again.")];
}

+ (NSError *)invalidRepeatPassword {
    return [self errorWithCode:A0ErrorCodeInvalidRepeatPassword
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:A0LocalizedString(@"The passwords you entered must match. Please try again.")];
}

+ (NSError *)configurationLoadFailed {
    return [self errorWithCode:A0ErrorCodeConfigurationLoadFailed
                   description:A0LocalizedString(@"Failed to load Auth0 configuration")
                 failureReason:A0LocalizedString(@"Auth0 configuration for your app is not available. Please try again later.")];
}

#pragma mark - Login errors

+ (NSError *)defaultLoginErrorFor:(NSError *)error {
    return [self errorWithCode:A0ErrorCodeAuthenticationFailed
                   description:A0LocalizedString(@"There was an error logging in")
                 failureReason:[self localizedStringForLoginError:error]];
}

+ (NSError *)invalidLoginCredentialsUsingEmail:(BOOL)usesEmail {
    NSString *failureReason;
    if (usesEmail) {
        failureReason = A0LocalizedString(@"The email and password you entered are invalid. Please try again.");
    } else {
        failureReason = A0LocalizedString(@"The username and password you entered are invalid. Please try again.");
    }
    return [self errorWithCode:A0ErrorCodeInvalidCredentials
                   description:A0LocalizedString(@"Invalid login credentials")
                 failureReason:failureReason];
}

+ (NSError *)invalidLoginUsernameUsingEmail:(BOOL)usesEmail {
    NSString *failureReason;
    if (usesEmail) {
        failureReason = A0LocalizedString(@"The email you entered is invalid. Please try again.");
    } else {
        failureReason = A0LocalizedString(@"The username you entered is invalid. Please try again.");
    }
    return [self errorWithCode:A0ErrorCodeInvalidUsername
                   description:A0LocalizedString(@"Invalid login credentials")
                 failureReason:failureReason];
}

+ (NSError *)invalidLoginPassword {
    return [self errorWithCode:A0ErrorCodeInvalidPassword
                   description:A0LocalizedString(@"Invalid login credentials")
                 failureReason:A0LocalizedString(@"The password you entered is invalid. Please try again.")];
}

#pragma mark - SignUp errors

+ (NSError *)invalidSignUpCredentialsUsingEmail:(BOOL)usesEmail {
    NSString *failureReason;
    if (usesEmail) {
        failureReason = A0LocalizedString(@"The email and password you entered are invalid. Please try again.");
    } else {
        failureReason = A0LocalizedString(@"The username and password you entered are invalid. Please try again.");
    }
    return [self errorWithCode:A0ErrorCodeInvalidCredentials
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:failureReason];
}

+ (NSError *)invalidSignUpUsernameUsingEmail:(BOOL)usesEmail {
    NSString *failureReason;
    if (usesEmail) {
        failureReason = A0LocalizedString(@"The email you entered is invalid. Please try again.");
    } else {
        failureReason = A0LocalizedString(@"The username you entered is invalid. Please try again.");
    }
    return [self errorWithCode:A0ErrorCodeInvalidUsername
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:failureReason];
}

+ (NSError *)invalidSignUpPassword {
    return [self errorWithCode:A0ErrorCodeInvalidPassword
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:A0LocalizedString(@"The password you entered is invalid. Please try again.")];
}

#pragma mark - Change password errors

+ (NSError *)invalidChangePasswordCredentialsUsingEmail:(BOOL)usesEmail {
    NSString *failureReason;
    if (usesEmail) {
        failureReason = A0LocalizedString(@"The email and password you entered are invalid. Please try again.");
    } else {
        failureReason = A0LocalizedString(@"The username and password you entered are invalid. Please try again.");
    }
    return [self errorWithCode:A0ErrorCodeInvalidCredentials
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:failureReason];
}

+ (NSError *)invalidChangePasswordUsernameUsingEmail:(BOOL)usesEmail {
    NSString *failureReason;
    if (usesEmail) {
        failureReason = A0LocalizedString(@"The email you entered is invalid. Please try again.");
    } else {
        failureReason = A0LocalizedString(@"The username you entered is invalid. Please try again.");
    }
    return [self errorWithCode:A0ErrorCodeInvalidUsername
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:failureReason];
}

+ (NSError *)invalidChangePasswordPassword {
    return [self errorWithCode:A0ErrorCodeInvalidPassword
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:A0LocalizedString(@"The password you entered is invalid. Please try again.")];
}

+ (NSError *)invalidChangePasswordRepeatPassword {
    return [self errorWithCode:A0ErrorCodeInvalidRepeatPassword
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:A0LocalizedString(@"The passwords you entered must match. Please try again.")];
}

+ (NSError *)invalidChangePasswordRepeatPasswordAndPassword {
    return [self errorWithCode:A0ErrorCodeInvalidPasswordAndRepeatPassword
                   description:A0LocalizedString(@"Invalid credentials")
                 failureReason:A0LocalizedString(@"The passwords you entered must match. Please try again.")];
}

#pragma mark - Social Errors

+ (NSError *)urlSchemeNotRegistered {
    return [self errorWithCode:A0ErrorCodeAuth0NoURLSchemeFound
                   description:A0LocalizedString(@"Couldn't start authentication using Safari")
                 failureReason:A0LocalizedString(@"You need to configure your auth0 scheme in CFBundleURLTypes in your app's Info.plist file")];
}

+ (NSError *)unkownProviderForConnectionName:(NSString *)connectionName {
    return [self errorWithCode:A0ErrorCodeUknownProviderForStrategy
                   description:A0LocalizedString(@"Couldn't found authentication method for unknown connection")
                 failureReason:[NSString stringWithFormat:A0LocalizedString(@"The connection %@ has no registered authentication provider. Please register one or add 'Lock/WebView' subspec to use WebView by default."), connectionName]];
}

+ (NSError *)facebookCancelled {
    return [self errorWithCode:A0ErrorCodeFacebookCancelled
                   description:A0LocalizedString(@"There was an error contacting Facebook")
                 failureReason:A0LocalizedString(@"You need to authorize the application")];
}

+ (NSError *)twitterAppNotAuthorized {
    return [self errorWithCode:A0ErrorCodeTwitterAppNotAuthorized
                   description:A0LocalizedString(@"There was an error contacting Twitter")
                 failureReason:A0LocalizedString(@"Permissions were not granted. Please authorize the app in Settings > Twitter")];
}

+ (NSError *)twitterAppOauthNotAuthorized {
    return [self errorWithCode:A0ErrorCodeTwitterAppNotAuthorized
                   description:A0LocalizedString(@"There was an error contacting Twitter")
                 failureReason:A0LocalizedString(@"Permissions were not granted. Try again")];
}

+ (NSError *)twitterCancelled {
    return [self errorWithCode:A0ErrorCodeTwitterCancelled
                   description:A0LocalizedString(@"There was an error contacting Twitter")
                 failureReason:A0LocalizedString(@"User cancelled the login operation. Try again")];
}

+ (NSError *)twitterNotConfigured {
    return [self errorWithCode:A0ErrorCodeTwitterNotConfigured
                   description:A0LocalizedString(@"There was an error contacting Twitter")
                 failureReason:A0LocalizedString(@"The domain has not been setup for Twitter.")];
}

+ (NSError *)twitterInvalidAccount {
    return [self errorWithCode:A0ErrorCodeTwitterInvalidAccount
                   description:A0LocalizedString(@"There was an error contacting Twitter")
                 failureReason:A0LocalizedString(@"The twitter account seems to be invalid. Please check it in Settings > Twitter and re-enter them.")];
}

+ (NSError *)auth0CancelledForConnectionName:(NSString *)connectionName {
    NSString *description = [NSString stringWithFormat:@"There was an error contacting %@", connectionName];
    return [self errorWithCode:A0ErrorCodeAuth0Cancelled
                   description:A0LocalizedString(description)
                 failureReason:A0LocalizedString(@"User cancelled the login operation. Try again")];
}

+ (NSError *)auth0NotAuthorizedForConnectionName:(NSString *)connectionName {
    NSString *description = [NSString stringWithFormat:@"There was an error contacting %@", connectionName];
    return [self errorWithCode:A0ErrorCodeAuth0NotAuthorized
                   description:A0LocalizedString(description)
                 failureReason:A0LocalizedString(@"Permissions were not granted. Try again")];
}

+ (NSError *)auth0InvalidConfigurationForConnectionName:(NSString *)connectionName {
    NSString *description = [NSString stringWithFormat:@"There was an error contacting %@", connectionName];
    NSString *failureReason = [NSString stringWithFormat:@"The application isn't configured properly for %@. Please check your Auth0's application configuration", connectionName];
    return [self errorWithCode:A0ErrorCodeAuth0InvalidConfiguration
                   description:A0LocalizedString(description)
                 failureReason:A0LocalizedString(failureReason)];
}

+ (NSError *)googleplusFailed {
    return [self errorWithCode:A0ErrorCodeGooglePlusFailed
                   description:A0LocalizedString(@"There was an error contacting Google+")
                 failureReason:A0LocalizedString(@"Permissions were not granted. Try again")];
}

+ (NSError *)googleplusCancelled {
    return [self errorWithCode:A0ErrorCodeGooglePlusCancelled
                   description:A0LocalizedString(@"There was an error contacting Google+")
                 failureReason:A0LocalizedString(@"User cancelled the login operation. Try again")];
}

#pragma mark - Localized error messages

+ (NSString *)localizedStringForLoginError:(NSError *)error {
    NSDictionary *apiErrorInfo = error.userInfo[A0JSONResponseSerializerErrorDataKey];
    NSString *errorKey = apiErrorInfo[@"error"];
    NSString *localizedString;
    if ([errorKey isEqualToString:@"invalid_user_password"]) {
        localizedString = A0LocalizedString(@"Wrong email or password.");
    } if ([errorKey isEqualToString:@"unauthorized"]) {
        NSString *description = apiErrorInfo[@"error_description"];
        localizedString = description.length > 0 ? A0LocalizedString(description) : A0LocalizedString(@"There was an error processing the sign in.");
    } else {
        localizedString = A0LocalizedString(@"There was an error processing the sign in.");
    }
    return localizedString;
}

+ (NSString *)localizedStringForSMSLoginError:(NSError *)error {
    NSDictionary *apiErrorInfo = error.userInfo[A0JSONResponseSerializerErrorDataKey];
    NSString *errorKey = apiErrorInfo[@"error"];
    NSString *localizedString;
    if ([errorKey isEqualToString:@"invalid_user_password"]) {
        localizedString = A0LocalizedString(@"Wrong phone number or passcode.");
    } if ([errorKey isEqualToString:@"unauthorized"]) {
        NSString *description = apiErrorInfo[@"error_description"];
        localizedString = description.length > 0 ? A0LocalizedString(description) : A0LocalizedString(@"There was an error processing the sign in.");
    } else {
        localizedString = A0LocalizedString(@"There was an error processing the sign in.");
    }
    return localizedString;
}

+ (NSString *)localizedStringForSignUpError:(NSError *)error {
    NSDictionary *apiErrorInfo = error.userInfo[A0JSONResponseSerializerErrorDataKey];
    NSString *errorKey = apiErrorInfo[@"code"];
    NSString *localizedString;
    if ([errorKey isEqualToString:@"user_exists"] || [errorKey isEqualToString:@"username_exists"]) {
        localizedString = A0LocalizedString(@"The user already exists.");
    } else {
        localizedString = A0LocalizedString(@"There was an error processing the sign up.");
    }
    return localizedString;
}

+ (NSString *)localizedStringForChangePasswordError:(NSError *)error {
    NSDictionary *apiErrorInfo = error.userInfo[A0JSONResponseSerializerErrorDataKey];
    NSString *errorKey = apiErrorInfo[@"code"];
    NSString *localizedString;
    if ([errorKey isEqualToString:@"invalid_user"]) {
        localizedString = A0LocalizedString(@"The user does not exists. Please check the email and try again.");
    } else {
        localizedString = A0LocalizedString(@"There was an error processing the reset password.");
    }
    return localizedString;
}

+ (NSString *)localizedStringForSocialLoginError:(NSError *)error {
    NSDictionary *apiErrorInfo = error.userInfo[A0JSONResponseSerializerErrorDataKey];
    NSString *errorKey = apiErrorInfo[@"error"];
    NSString *localizedString;
    if ([errorKey isEqualToString:@"unauthorized"]) {
        NSString *description = apiErrorInfo[@"error_description"];
        localizedString = description.length > 0 ? A0LocalizedString(description) : A0LocalizedString(@"There was an error processing the sign in.");
    } else {
        localizedString = A0LocalizedString(@"There was an error processing the sign in.");
    }
    return localizedString;
}

#pragma mark - Utility methods

+ (NSError *)errorWithCode:(NSInteger)code description:(NSString *)description failureReason:(NSString *)failureReason {
    NSError *error = [NSError errorWithDomain:A0ErrorDomain
                                         code:code
                                     userInfo:@{
                                                NSLocalizedDescriptionKey: description,
                                                NSLocalizedFailureReasonErrorKey: failureReason,
                                                }];
    return error;
}

@end


text:
package raptor.action.chat;

import raptor.Raptor;
import raptor.action.AbstractRaptorAction;
import raptor.swt.chat.controller.MainController;
import raptor.swt.chat.controller.PersonController;
import raptor.swt.chat.controller.ToolBarItemKey;

public class SpeakPersonTellsAction extends AbstractRaptorAction {
	public SpeakPersonTellsAction() {
		setName("Speak Person Tells");
		setIcon("musicNote");
		setDescription("Speaks all direct tells to you within this tab. Requires sound to be setup. See Preferences->Speech.");
		setCategory(Category.ConsoleCommands);
	}

	public void run() {
		boolean wasHandled = false;
		if (getChatConsoleControllerSource() != null
				&& getChatConsoleControllerSource() instanceof MainController) {
			getChatConsoleControllerSource().getConnector()
					.setSpeakingAllPersonTells(
							getChatConsoleControllerSource()
									.isToolItemSelected(
											ToolBarItemKey.SPEAK_TELLS));
			wasHandled = true;
		} else if (getChatConsoleControllerSource() != null
				&& getChatConsoleControllerSource() instanceof PersonController) {
			getChatConsoleControllerSource()
					.getConnector()
					.setSpeakingPersonTells(
							((PersonController) getChatConsoleControllerSource())
									.getPerson(),
							getChatConsoleControllerSource()
									.isToolItemSelected(
											ToolBarItemKey.SPEAK_TELLS));
			wasHandled = true;
		}

		if (!wasHandled) {
			Raptor
					.getInstance()
					.alert(
							getName()
									+ " is only avalible from main and person console sources.");
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>RangeFeatureDetector</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="date" content="2017-06-07">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

SEARCH:
<input type="text" id="search" value=" " disabled="disabled">
<input type="reset" id="reset" value=" " disabled="disabled">

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Package lejos.robotics.objectdetection

Class RangeFeatureDetector

<map id="G" name="G">
<area shape="rect" id="node1_0" href="../localization/PoseProvider.html" title="lejos.robotics.localization.PoseProvider" alt="" coords="121,518,404,629"/>
<area shape="rect" id="node1" href="../localization/PoseProvider.html" title="<TABLE>" alt="" coords="111,513,415,634"/>
<area shape="rect" id="node2_1" href="./FeatureDetectorAdapter.html" title="lejos.robotics.objectdetection.FeatureDetectorAdapter" alt="" coords="150,11,375,213"/>
<area shape="rect" id="node2" href="./FeatureDetectorAdapter.html" title="<TABLE>" alt="" coords="139,6,386,218"/>
<area shape="rect" id="node3_2" href="./RangeFeatureDetector.html" title="lejos.robotics.objectdetection.RangeFeatureDetector" alt="" coords="16,272,509,459"/>
<area shape="rect" id="node3" href="./RangeFeatureDetector.html" title="<TABLE>" alt="" coords="5,267,520,464"/>
</map>

java.lang.Object

lejos.robotics.objectdetection.FeatureDetectorAdapter

lejos.robotics.objectdetection.RangeFeatureDetector

All Implemented Interfaces:

FeatureDetector

public class RangeFeatureDetector
extends FeatureDetectorAdapter

The RangeFeatureDetector used a RangeFinder to locate objects (known as features when mapping). This class is
 unable to identify the feature and merely reports the range and angle to the object.

You can also have the scan identify the object (such as a camera using facial recognition to identify a person).
  One possibility to implement this is to extend RangeFeatureDetector and add a camera to the constructor. When the
  FeatureDetector range scanner detects an object, take a picture and look for a face in the image. This is then
  reported as an extended class of RangeFeature called PersonFeature, which has a getPerson() method containing
  information on the object that was detected.

To create a more complex FeatureDetector, extend this class and override the FeatureDetector.scan() method.
 It is possible to add more complex functionality in this method, such as only returning a "hit" if the scanner detects
 an object in the same location twice in a row. This type of filtering could also take place in the FeatureListener
 method, although then single FeatureDetector.scan() calls will not contain the filtering.

Field Summary

Fields

Modifier and Type
Field and Description

private float
angle

private float
max_dist

private PoseProvider
pp

private RangeFinder
range_finder

Constructor Summary

Constructors

Constructor and Description

RangeFeatureDetector(RangeFinder rf,
                    float maxDistance,
                    int delay)

This constructor allows you to specify the sensor, the maximum distance to report a
 detection, and the delay between scanning the sensor.

RangeFeatureDetector(RangeFinder rf,
                    float maxDistance,
                    int delay,
                    double angle)

This constructor allows you to specify the sensor, the maximum distance to report a
 detection, the delay between scanning the sensor, and the angle the sensor is pointed.

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

float
getMaxDistance()

Returns the maximum distance the FeatureDetector will return for detected objects.

Feature
scan()

Performs a single scan for an object and returns the results.

void
setMaxDistance(float distance)

Sets the maximum distance to register detected objects from the range finder.

void
setPoseProvider(PoseProvider pp)

Methods inherited from class lejos.robotics.objectdetection.FeatureDetectorAdapter

addListener, enableDetection, getDelay, isEnabled, notifyListeners, setDelay

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

range_finder

private RangeFinder range_finder

max_dist

private float max_dist

angle

private float angle

pp

private PoseProvider pp

Constructor Detail

RangeFeatureDetector

public RangeFeatureDetector(RangeFinder rf,
                            float maxDistance,
                            int delay)

This constructor allows you to specify the sensor, the maximum distance to report a
 detection, and the delay between scanning the sensor. It assumes the range sensor is
 pointed straight ahead, so heading is always 0 for the returned RangeReading.

Parameters:

rf - The range finder sensor. e.g. UltrasonicSensor

maxDistance - The upper limit of distance it will report. e.g. 40 cm.

delay - The interval range finder checks for objects. e.g. 250 ms.

RangeFeatureDetector

public RangeFeatureDetector(RangeFinder rf,
                            float maxDistance,
                            int delay,
                            double angle)

This constructor allows you to specify the sensor, the maximum distance to report a
 detection, the delay between scanning the sensor, and the angle the sensor is pointed.

Parameters:

rf - The range finder sensor. e.g. UltrasonicSensor

maxDistance - The upper limit of distance it will report. e.g. 40 cm.

delay - The interval range finder checks for objects. e.g. 250 ms.

angle - The angle, in degrees, the range sensor is pointed. (0 = forward, +ve = left, -ve = right)

Method Detail

setPoseProvider

public void setPoseProvider(PoseProvider pp)

setMaxDistance

public void setMaxDistance(float distance)

Sets the maximum distance to register detected objects from the range finder.

Parameters:

distance - The maximum distance. e.g. 40 cm.

getMaxDistance

public float getMaxDistance()

Returns the maximum distance the FeatureDetector will return for detected objects.

Returns:

The maximum distance. e.g. 40 cm.

scan

public Feature scan()

Description copied from interface: FeatureDetector

Performs a single scan for an object and returns the results. If an object is not detected, this
 method returns null.

Warning: Make sure to check for a null object before trying to read data from the returned
 Feature object, otherwise your code will throw a null pointer exception.

Specified by:

scan in interface FeatureDetector

Specified by:

scan in class FeatureDetectorAdapter

Returns:

A feature it has detected. null if nothing found.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package org.andengine;

import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;

import org.andengine.opengl.view.ConfigChooser;
import org.andengine.util.exception.DeviceNotSupportedException;
import org.andengine.util.exception.DeviceNotSupportedException.DeviceNotSupportedCause;
import org.andengine.util.system.SystemUtils;

import android.os.Build;

/**
 * (c) Zynga 2012
 *
 * @author Nicolas Gramlich <ngramlich@zynga.com>
 * @since 14:03:59 - 19.03.2012
 */
public class AndEngine {
	// ===========================================================
	// Constants
	// ===========================================================

	// ===========================================================
	// Fields
	// ===========================================================

	// ===========================================================
	// Constructors
	// ===========================================================

	// ===========================================================
	// Getter & Setter
	// ===========================================================

	// ===========================================================
	// Methods for/from SuperClass/Interfaces
	// ===========================================================

	// ===========================================================
	// Methods
	// ===========================================================

	public static boolean isDeviceSupported() {
		try {
			AndEngine.checkDeviceSupported();
			return true;
		} catch (final DeviceNotSupportedException e) {
			return false;
		}
	}

	public static void checkDeviceSupported() throws DeviceNotSupportedException {
		AndEngine.checkCodePathSupport();

		AndEngine.checkOpenGLSupport();
	}

	private static void checkCodePathSupport() throws DeviceNotSupportedException {
		if (SystemUtils.isAndroidVersionOrLower(Build.VERSION_CODES.FROYO)) {
			try {
				System.loadLibrary("andengine");
			} catch (final UnsatisfiedLinkError e) {
				throw new DeviceNotSupportedException(DeviceNotSupportedCause.CODEPATH_INCOMPLETE, e);
			}
		}
	}

	private static void checkOpenGLSupport() throws DeviceNotSupportedException {
		AndEngine.checkEGLConfigChooserSupport();
	}

	private static void checkEGLConfigChooserSupport() throws DeviceNotSupportedException {
		/* Get an EGL instance. */
		final EGL10 egl = (EGL10) EGLContext.getEGL();

		/* Get to the default display. */
		final EGLDisplay eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);

		/* We can now initialize EGL for that display. */
		final int[] version = new int[2];
		egl.eglInitialize(eglDisplay, version);

		final ConfigChooser configChooser = new ConfigChooser(false); // TODO
																		// Doesn't
																		// correlate
																		// to
																		// possible
																		// multisampling
																		// request
																		// in
																		// EngineOptions...

		try {
			configChooser.chooseConfig(egl, eglDisplay);
		} catch (final IllegalArgumentException e) {
			throw new DeviceNotSupportedException(DeviceNotSupportedCause.EGLCONFIG_NOT_FOUND, e);
		}
	}

	// ===========================================================
	// Inner and Anonymous Classes
	// ===========================================================
}


text:
<?php

/**
 * PHP version 7.0
 *
 * Class WC_Retailcrm_Uploader_Test - Testing WC_Retailcrm_Uploader.
 *
 * @category Integration
 * @author   RetailCRM <integration@retailcrm.ru>
 * @license  http://retailcrm.ru Proprietary
 * @link     http://retailcrm.ru
 * @see      http://help.retailcrm.ru
 */
class WC_Retailcrm_Uploader_Test extends WC_Retailcrm_Test_Case_Helper
{
    protected $apiMock;
    protected $responseMock;
    protected $customer;
    private $order;

    public function setUp()
    {
        $this->responseMock = $this->getMockBuilder('\WC_Retailcrm_Response')
                                   ->disableOriginalConstructor()
                                   ->setMethods(array('isSuccessful'))
                                   ->getMock();

        $this->apiMock = $this->getMockBuilder('\WC_Retailcrm_Proxy')
                              ->disableOriginalConstructor()
                              ->setMethods(array(
                                  'customersUpload',
                                  'customersCreate',
                                  'uploadArchiveCustomers',
                                  'uploadArchiveOrders',
                                  'getCountUsers',
                                  'getCountOrders',
                                  'customersGet',
                                  'customersList',
                                  'ordersCreate'
                              ))
                              ->getMock();

        $this->setMockResponse($this->responseMock, 'isSuccessful', true);
        $this->setMockResponse(
            $this->apiMock,
            'customersList',
            array('success' => true, 'customers' => array(array('externalId' => 1)))
        );
        $this->setMockResponse($this->apiMock, 'customersCreate', $this->responseMock);

        $this->customer = new WC_Customer();
        $this->customer->set_first_name('Tester');
        $this->customer->set_last_name('Tester');
        $this->customer->set_email(uniqid(md5(date('Y-m-d H:i:s'))) . '@mail.com');
        $this->customer->set_billing_email($this->customer->get_email());
        $this->customer->set_password('password');
        $this->customer->set_billing_phone('89000000000');
        $this->customer->set_date_created(date('Y-m-d H:i:s'));
        $this->customer->save();

        $this->order = WC_Helper_Order::create_order();
    }

    /**
     * @param retailcrm
     * @dataProvider dataProviderApiClient
     */
    public function test_customers_upload($retailcrm)
    {
        $retailcrm_uploader = $this->getRetailcrmUploader($retailcrm);
        $data = $retailcrm_uploader->uploadArchiveCustomers(0);

        if ($retailcrm) {
            $this->assertInternalType('array', $data);
            $this->assertInternalType('array', $data[0]);
            $this->assertArrayHasKey('externalId', $data[0]);
        } else {
            $this->assertEquals(null, $data);
        }
    }

    /**
     * @param $retailcrm
     * @dataProvider dataProviderApiClient
     */
    public function test_order_upload($retailcrm)
    {
        $retailcrm_uploader = $this->getRetailcrmUploader($retailcrm);
        $data = $retailcrm_uploader->uploadArchiveOrders(0);

        $this->assertEquals(null, $data);
    }

    /**
     * @param $retailcrm
     * @dataProvider dataProviderApiClient
     */
    public function test_upload_selected_orders()
    {
        $_GET['order_ids_retailcrm'] = '123, 345, 456';
        $retailcrm_uploader = $this->getRetailcrmUploader($this->apiMock);
        $uploadSelectedOrders = $retailcrm_uploader->uploadSelectedOrders();

        $this->assertEquals(null, $uploadSelectedOrders);
    }

    public function test_get_count_orders_upload()
    {
        $retailcrm_uploader = $this->getRetailcrmUploader($this->apiMock);
        $count_orders = $retailcrm_uploader->getCountOrders();

        $this->assertInternalType('int', $count_orders);
    }

    public function test_get_count_users_upload()
    {
        $retailcrm_uploader = $this->getRetailcrmUploader($this->apiMock);
        $count_users = $retailcrm_uploader->getCountUsers();

        $this->assertInternalType('int', $count_users);
    }

    public function dataProviderApiClient()
    {
        $this->setUp();

        return array(
            array(
                'retailcrm' => $this->apiMock
            ),
            array(
                'retailcrm' => false
            )
        );
    }

    /**
     * @param $retailcrm
     *
     * @return WC_Retailcrm_Customers
     */
    private function getRetailcrmUploader($retailcrm)
    {
        $customer = new WC_Retailcrm_Customers(
            $retailcrm,
            $this->getOptions(),
            new WC_Retailcrm_Customer_Address()
        );

        $order = new WC_Retailcrm_Orders(
            $retailcrm,
            $this->getOptions(),
            new WC_Retailcrm_Order_Item($this->getOptions()),
            new WC_Retailcrm_Order_Address(),
            new WC_Retailcrm_Customers($retailcrm, $this->getOptions(), new WC_Retailcrm_Customer_Address()),
            new WC_Retailcrm_Order($this->getOptions()),
            new WC_Retailcrm_Order_Payment($this->getOptions())
        );

        return new WC_Retailcrm_Uploader($retailcrm, $order, $customer);
    }
}


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Keys on zerodivisible.io</title>
    <link>https://zerodivisible.io/tags/keys/</link>
    <description>Recent content in Keys on zerodivisible.io</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Tue, 07 Jan 2014 09:46:37 +0000</lastBuildDate>

	<atom:link href="https://zerodivisible.io/tags/keys/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>GPG Keys</title>
      <link>https://zerodivisible.io/blog/gpg-keys/</link>
      <pubDate>Tue, 07 Jan 2014 09:46:37 +0000</pubDate>

      <guid>https://zerodivisible.io/blog/gpg-keys/</guid>
      <description>I didn&rsquo;t have much chances to work with GPG - and when I usually do, it&rsquo;s to communicate with third-party services, when exchanging encrypted files. Usually keys which I&rsquo;m using are being delivered to me - but especially when developing (&amp; testing), I have a need to get back to the command line and somehow generate a key for myself. Each time when doing this, instead of reaching to man, I thought that I may document the command on this blog:</description>
    </item>

  </channel>
</rss>


text:
var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function (req, res, next) {
  res.sendfile('./views/index.html');
});
router.get('/main/*', function (req, res, next) {
  res.sendfile('./views/index.html');
})

module.exports = router;


text:
package fr.atelechev.chess.fen2cb.style

import org.scalatest.FlatSpec
import org.scalatest.Matchers.be
import org.scalatest.Matchers.not
import org.scalatest.Matchers.convertToAnyShouldWrapper
import fr.atelechev.util.ExpectedExceptionCatcher
import java.nio.file.Paths

class DiagramStyleFactoryTestSuite extends FlatSpec
									  with ExpectedExceptionCatcher
									  with StyleFolderAccessor {

  private val testResourcesPath = getFolderForStyle(null)

  "buildStyle(String, Path)" should "throw IllegalArgumentException if the String arg is null" in {
    catchExpected(classOf[IllegalArgumentException], () => {
      DiagramStyleFactory.buildStyle(null, testResourcesPath);
    })
  }

  it should "throw IllegalArgumentException if the String arg is empty" in {
    catchExpected(classOf[IllegalArgumentException], () => {
      DiagramStyleFactory.buildStyle("   ", testResourcesPath);
    })
  }

  it should "throw IllegalArgumentException if the style name does not respect the naming convention" in {
    catchExpected(classOf[IllegalArgumentException], () => {
      DiagramStyleFactory.buildStyle("- what a style! :)", testResourcesPath);
    })
  }

  it should "throw IllegalArgumentException if the style data folder does not exist" in {
    catchExpected(classOf[IllegalArgumentException], () => {
      DiagramStyleFactory.buildStyle("inexistent", testResourcesPath);
    })
  }

  it should "throw IllegalArgumentException if the style name refers to a file" in {
    catchExpected(classOf[IllegalArgumentException], () => {
      DiagramStyleFactory.buildStyle("not_a_folder", testResourcesPath);
    })
  }

  it should "throw IllegalStateException if the diagram.properties file was not found" in {
    catchExpected(classOf[IllegalStateException], () => {
      DiagramStyleFactory.buildStyle("no_properties", testResourcesPath);
    })
  }

  it should "throw UnsupportedOperationException if render.type is not 'raster' in diagram.properties" in {
    catchExpected(classOf[UnsupportedOperationException], () => {
      DiagramStyleFactory.buildStyle("custom_properties", testResourcesPath);
    })
  }

  it should "return a RasterStyle for 'default' style name" in {
    val style = DiagramStyleFactory.buildStyle("default", testResourcesPath);
    style should not be (null)
    style.getClass should be (classOf[RasterStyle])
    val rasterStyle = style.asInstanceOf[RasterStyle]
    rasterStyle.getName should be ("default")
    rasterStyle.getCellsOrigin should be (new Point(0, 0))
    rasterStyle.getOverlayOrigin should be (null)
    rasterStyle.getBoard should not be (null)
    Piece.values.foreach(piece => {
      rasterStyle.getPiece(piece) should not be (null)
    })
  }

}


text:
using System;
using System.Collections.Generic;
using System.Text;
using DCalcCore.Algorithm;
using DCalcCore.Assemblers;
using DCalcCore.Remoting;
using DCalcCore.Utilities;

namespace DCalcCore.Runners
{
    /// <summary>
    /// Base for all remote based evaluation. This class is thread-safe.
    /// </summary>
    public sealed class RemoteMachineRunner : IRunner
    {
        #region Private Fields

        private IRemoteGateClient m_Gate;
        private String m_SyncRoot = "RemoteMachineRunner Sync";

        #endregion

        #region Private Methods

        /// <summary>
        /// Initializes a gate client.
        /// </summary>
        /// <param name="client">The gate client.</param>
        private void InitializeGate(IRemoteGateClient client)
        {
            client.SetCompleted -= m_gate_SetCompleted;
            client.SetCompleted += m_gate_SetCompleted;
            client.AsyncOpen();
        }

        /// <summary>
        /// Handles the SetCompleted event of the m_gate control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="DCalcCore.Utilities.QueueEventArgs"/> instance containing the event data.</param>
        private void m_gate_SetCompleted(Object sender, QueueEventArgs e)
        {
            /* Forward the set to the user */
            if (QueuedWorkCompleted != null)
            {
                QueuedWorkCompleted(this, new ScriptQueueEventArgs((IScript)sender, e.OutputSet, e.SetId));
            }
        }

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="RemoteMachineRunner"/> class.
        /// </summary>
        /// <param name="gate">The gate.</param>
        public RemoteMachineRunner(IRemoteGateClient gate)
        {
            if (gate == null)
                throw new ArgumentNullException("gate");

            m_Gate = gate;
            InitializeGate(m_Gate);
        }

        #endregion

        #region RemoteMachineRunner Public Members

        /// <summary>
        /// Gets the gate attached to this runner.
        /// </summary>
        /// <value>The gate.</value>
        public IRemoteGateClient Gate
        {
            get
            {
                lock (m_SyncRoot)
                {
                    return m_Gate;
                }
            }
        }

        #endregion

        #region IRunner Members

        /// <summary>
        /// Loads the script.
        /// </summary>
        /// <param name="script">The script.</param>
        /// <returns></returns>
        public Boolean LoadScript(IScript script)
        {
            if (script == null)
                throw new ArgumentNullException("script");

            lock (m_SyncRoot)
            {
                m_Gate.AsyncRegisterScript(script);
                return true;
            }
        }

        /// <summary>
        /// Removes the script.
        /// </summary>
        /// <param name="script">The script.</param>
        /// <returns></returns>
        public Boolean RemoveScript(IScript script)
        {
            if (script == null)
                throw new ArgumentNullException("script");

            lock (m_SyncRoot)
            {
                m_Gate.AsyncCancelScript(script);
                return true;
            }
        }

        /// <summary>
        /// Queues work to be done.
        /// </summary>
        /// <param name="script">The script.</param>
        /// <param name="inputSet">The input set.</param>
        /// <returns></returns>
        public Boolean QueueWork(IScript script, ScalarSet inputSet)
        {
            if (script == null)
                throw new ArgumentNullException("script");

            if (inputSet == null)
                throw new ArgumentNullException("inputSet");

            lock (m_SyncRoot)
            {
                return m_Gate.AsyncQueueWork(script, inputSet);
            }
        }

        /// <summary>
        /// Occurs when queued work completed (a set has been evaluated).
        /// </summary>
        public event ScriptQueueEventHandler QueuedWorkCompleted;

        #endregion

        #region IDisposable Members

        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            lock (m_SyncRoot)
            {
                /* Close the gate */
                m_Gate.AsyncClose();
            }
        }

        #endregion
    }
}


text:
using Windows.Foundation;
using Windows.Foundation.Collections;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using gatherteamproject.Views;

namespace gatherteamproject.ViewModels
{
    class UserViewModel : BaseViewModel
    {
        public event OpenPageDelegate OpenCreateGamePage;
        public event OpenPageDelegate OpenSettingsPage;
        public event OpenPageDelegate OpenCreateTournamentPage;
        private DelegateCommand _createGame;
        private DelegateCommand _openSettings;
        private DelegateCommand _createTournament;

        public event OpenPageDelegate OpenSelectGamePage;
        private DelegateCommand _openSelectGamePage;

        public DelegateCommand CreateGameCommand
        {
            get
            {
                if (_createGame == null)
                {
                    _createGame = new DelegateCommand(o => CreateGame());
                }

                return _createGame;
            }
        }

        public DelegateCommand SelectGameCommand
        {
            get
            {
                if (_openSelectGamePage == null)
                {
                    _openSelectGamePage = new DelegateCommand(o => OpenSelectGame());
                }

                return _openSelectGamePage;
            }

        }

        public DelegateCommand SettingsCommand
        {
            get
            {
                if (_openSettings == null)
                {
                    _openSettings = new DelegateCommand(o => OpenSettings());
                }

                return _openSettings;
            }
        }

        public DelegateCommand CreateTournamentCommand
        {
            get
            {
                if (_createTournament == null)
                {
                    _createTournament = new DelegateCommand(o => CreateTournament());
                }

                return _createTournament;
            }
        }

        private void CreateGame()
        {
            if (OpenCreateGamePage != null) OpenCreateGamePage();
        }

        private void OpenSettings()
        {
            if (OpenSettingsPage != null) OpenSettingsPage();
        }

        public void OpenSelectGame() {
            if (OpenSelectGamePage != null) OpenSelectGamePage();
        }
        /*public IEnumerable<DataGroup> OpenSelectGame()
        {
            IEnumerable<DataGroup> groups =
                from item in FakeSourceData.GetData()
                group item by item.Data
                    into dataGroup
                    let dataGroupItems =
                        from item2 in dataGroup
                        group item2 by item2.Time
                            into timeGroup
                            select new TimeGroup(timeGroup)
                            {
                                Time = timeGroup.Key
                            }
                    select new DataGroup(dataGroupItems)
                    {
                        Data = dataGroup.Key
                    };

            return groups;
        }*/

        private void CreateTournament()
        {
            //if (OpenCreateTournamentPage != null) OpenCreateTournamentPage();
        }
    }
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-792
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.04.07 at 12:06:52 PM GMT+05:30
//

package com.ebay.marketplace.search.v1.services;

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

/**
 *
 * 						This is the abstract type for field value.
 *
 *
 *
Java class for FieldValue complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="FieldValue">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <choice>
 *         <element name="shippingCostFieldValue" type="{http://www.ebay.com/marketplace/search/v1/services}ShippingCostFieldValue"/>
 *         <element name="traitFieldValue" type="{http://www.ebay.com/marketplace/search/v1/services}TraitFieldValue"/>
 *         <element name="sellerLogoFieldValue" type="{http://www.ebay.com/marketplace/search/v1/services}SellerLogoFieldValue"/>
 *         <element name="booleanFieldValue" type="{http://www.ebay.com/marketplace/search/v1/services}BooleanFieldValue"/>
 *         <element name="dateFieldValue" type="{http://www.ebay.com/marketplace/search/v1/services}DateFieldValue"/>
 *         <element name="doubleFieldValue" type="{http://www.ebay.com/marketplace/search/v1/services}DoubleFieldValue"/>
 *         <element name="longFieldValue" type="{http://www.ebay.com/marketplace/search/v1/services}LongFieldValue"/>
 *         <element name="moneyFieldValue" type="{http://www.ebay.com/marketplace/search/v1/services}MoneyFieldValue"/>
 *         <element name="stringFieldValue" type="{http://www.ebay.com/marketplace/search/v1/services}StringFieldValue"/>
 *         <element name="fitmentFieldValue" type="{http://www.ebay.com/marketplace/search/v1/services}FitmentFieldValue"/>
 *       </choice>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FieldValue", propOrder = {
    "shippingCostFieldValue",
    "traitFieldValue",
    "sellerLogoFieldValue",
    "booleanFieldValue",
    "dateFieldValue",
    "doubleFieldValue",
    "longFieldValue",
    "moneyFieldValue",
    "stringFieldValue",
    "fitmentFieldValue"
})
public class FieldValue {

    protected ShippingCostFieldValue shippingCostFieldValue;
    protected TraitFieldValue traitFieldValue;
    protected SellerLogoFieldValue sellerLogoFieldValue;
    protected BooleanFieldValue booleanFieldValue;
    protected DateFieldValue dateFieldValue;
    protected DoubleFieldValue doubleFieldValue;
    protected LongFieldValue longFieldValue;
    protected MoneyFieldValue moneyFieldValue;
    protected StringFieldValue stringFieldValue;
    protected FitmentFieldValue fitmentFieldValue;

    /**
     * Gets the value of the shippingCostFieldValue property.
     *
     * @return
     *     possible object is
     *     {@link ShippingCostFieldValue }
     *
     */
    public ShippingCostFieldValue getShippingCostFieldValue() {
        return shippingCostFieldValue;
    }

    /**
     * Sets the value of the shippingCostFieldValue property.
     *
     * @param value
     *     allowed object is
     *     {@link ShippingCostFieldValue }
     *
     */
    public void setShippingCostFieldValue(ShippingCostFieldValue value) {
        this.shippingCostFieldValue = value;
    }

    /**
     * Gets the value of the traitFieldValue property.
     *
     * @return
     *     possible object is
     *     {@link TraitFieldValue }
     *
     */
    public TraitFieldValue getTraitFieldValue() {
        return traitFieldValue;
    }

    /**
     * Sets the value of the traitFieldValue property.
     *
     * @param value
     *     allowed object is
     *     {@link TraitFieldValue }
     *
     */
    public void setTraitFieldValue(TraitFieldValue value) {
        this.traitFieldValue = value;
    }

    /**
     * Gets the value of the sellerLogoFieldValue property.
     *
     * @return
     *     possible object is
     *     {@link SellerLogoFieldValue }
     *
     */
    public SellerLogoFieldValue getSellerLogoFieldValue() {
        return sellerLogoFieldValue;
    }

    /**
     * Sets the value of the sellerLogoFieldValue property.
     *
     * @param value
     *     allowed object is
     *     {@link SellerLogoFieldValue }
     *
     */
    public void setSellerLogoFieldValue(SellerLogoFieldValue value) {
        this.sellerLogoFieldValue = value;
    }

    /**
     * Gets the value of the booleanFieldValue property.
     *
     * @return
     *     possible object is
     *     {@link BooleanFieldValue }
     *
     */
    public BooleanFieldValue getBooleanFieldValue() {
        return booleanFieldValue;
    }

    /**
     * Sets the value of the booleanFieldValue property.
     *
     * @param value
     *     allowed object is
     *     {@link BooleanFieldValue }
     *
     */
    public void setBooleanFieldValue(BooleanFieldValue value) {
        this.booleanFieldValue = value;
    }

    /**
     * Gets the value of the dateFieldValue property.
     *
     * @return
     *     possible object is
     *     {@link DateFieldValue }
     *
     */
    public DateFieldValue getDateFieldValue() {
        return dateFieldValue;
    }

    /**
     * Sets the value of the dateFieldValue property.
     *
     * @param value
     *     allowed object is
     *     {@link DateFieldValue }
     *
     */
    public void setDateFieldValue(DateFieldValue value) {
        this.dateFieldValue = value;
    }

    /**
     * Gets the value of the doubleFieldValue property.
     *
     * @return
     *     possible object is
     *     {@link DoubleFieldValue }
     *
     */
    public DoubleFieldValue getDoubleFieldValue() {
        return doubleFieldValue;
    }

    /**
     * Sets the value of the doubleFieldValue property.
     *
     * @param value
     *     allowed object is
     *     {@link DoubleFieldValue }
     *
     */
    public void setDoubleFieldValue(DoubleFieldValue value) {
        this.doubleFieldValue = value;
    }

    /**
     * Gets the value of the longFieldValue property.
     *
     * @return
     *     possible object is
     *     {@link LongFieldValue }
     *
     */
    public LongFieldValue getLongFieldValue() {
        return longFieldValue;
    }

    /**
     * Sets the value of the longFieldValue property.
     *
     * @param value
     *     allowed object is
     *     {@link LongFieldValue }
     *
     */
    public void setLongFieldValue(LongFieldValue value) {
        this.longFieldValue = value;
    }

    /**
     * Gets the value of the moneyFieldValue property.
     *
     * @return
     *     possible object is
     *     {@link MoneyFieldValue }
     *
     */
    public MoneyFieldValue getMoneyFieldValue() {
        return moneyFieldValue;
    }

    /**
     * Sets the value of the moneyFieldValue property.
     *
     * @param value
     *     allowed object is
     *     {@link MoneyFieldValue }
     *
     */
    public void setMoneyFieldValue(MoneyFieldValue value) {
        this.moneyFieldValue = value;
    }

    /**
     * Gets the value of the stringFieldValue property.
     *
     * @return
     *     possible object is
     *     {@link StringFieldValue }
     *
     */
    public StringFieldValue getStringFieldValue() {
        return stringFieldValue;
    }

    /**
     * Sets the value of the stringFieldValue property.
     *
     * @param value
     *     allowed object is
     *     {@link StringFieldValue }
     *
     */
    public void setStringFieldValue(StringFieldValue value) {
        this.stringFieldValue = value;
    }

    /**
     * Gets the value of the fitmentFieldValue property.
     *
     * @return
     *     possible object is
     *     {@link FitmentFieldValue }
     *
     */
    public FitmentFieldValue getFitmentFieldValue() {
        return fitmentFieldValue;
    }

    /**
     * Sets the value of the fitmentFieldValue property.
     *
     * @param value
     *     allowed object is
     *     {@link FitmentFieldValue }
     *
     */
    public void setFitmentFieldValue(FitmentFieldValue value) {
        this.fitmentFieldValue = value;
    }

}


text:
import numpy as np
from open3d import *

if __name__ == "__main__":

    print("Load a ply point cloud, print it, and render it")
    pcd = read_point_cloud("tree815.pcd")
    print(pcd)
    print(np.asarray(pcd.points))
    draw_geometries([pcd])

   # print("Downsample the point cloud with a voxel of 0.05")
   # downpcd = voxel_down_sample(pcd, voxel_size = 0.05)
   # draw_geometries([downpcd])

    print("Recompute the normal of the downsampled point cloud")
    estimate_normals(pcd, search_param = KDTreeSearchParamHybrid(
            radius = 0.05, max_nn = 9))
    draw_geometries([pcd])

    write_point_cloud("copy_of_tree.pcd", pcd)

    #print("Print a normal vector of the 0th point")
    #print(pcd.normals[0])
    #print("Print the normal vectors of the first 10 points")
    #print(np.asarray(pcd.normals)[:10,:])
    #print("")
'''
    print("Load a polygon volume and use it to crop the original point cloud")
    vol = read_selection_polygon_volume("../../TestData/Crop/cropped.json")
    chair = vol.crop_point_cloud(pcd)
    draw_geometries([chair])
    print("")

    print("Paint chair")
    chair.paint_uniform_color([1, 0.706, 0])
    draw_geometries([chair])
    print("")
'''


text:
// This file Takes a PN Input, Sends it to EH1's input.  Then, anything that arrives on EH2's output is sent back out
// via PN Publish.  User-defined magic should happen between EH1 -> EH2, such as Stream Analytics, etc.

'use strict';

// PN Vars

var PNSubChannel = process.env['CUSTOMCONNSTR_PNSubChannel'];
var PNPubChannel = process.env['CUSTOMCONNSTR_PNPubChannel'];
var PNAnnounceChannel = process.env['CUSTOMCONNSTR_PNAnnounceChannel'];
var PNPublishKey = process.env['CUSTOMCONNSTR_PNPublishKey'];
var PNSubscribeKey = process.env['CUSTOMCONNSTR_PNSubscribeKey'];

// Azure Vars

var EHInConnectionString = process.env['CUSTOMCONNSTR_EHInConnectionString'];
var EHOutConnectionString = process.env['CUSTOMCONNSTR_EHOutConnectionString'];

if (!PNSubChannel || !PNPubChannel || !PNAnnounceChannel || !PNPublishKey || !PNSubscribeKey) {

    console.log("Error: Missing required vars!");
    dumpVars();
    process.exit();
}

function dumpVars() {
    console.log("PNSubChannel: ", PNSubChannel);
    console.log("PNPubChannel: ", PNPubChannel);
    console.log("PNPublishKey: ", PNPublishKey);
    console.log("PNSubscribeKey: ", PNSubscribeKey);
    console.log("EHInConnectionString: ", EHInConnectionString);
    console.log("EHOutConnectionString: ", EHOutConnectionString);
    console.log();
    console.log("Env Process Dump:");
    console.log();
    console.log(process.env);
}
dumpVars();

var uuid = "webjob-" + (Math.random() * 1000);
console.log("Setting UUID to " + uuid);

var pubnub = require("pubnub")({
    ssl: true,
    publishKey: PNPublishKey,
    subscribeKey: PNSubscribeKey,
    uuid: uuid
});

var PNPublish = function (ehEvent) {
    // console.log('Event Received from Egress EH, Publishing to PN: ');
    // console.log(JSON.stringify(ehEvent.body));
    // console.log("");

    if (Array.isArray(ehEvent.body)){

        ehEvent.body.forEach(function(element){

            pubnub.publish({
                channel: PNPubChannel,
                message: element
            },
            function(status, response) {
                if (status.error) {
                    console.log("PN Array Element Publish Error: ", status);
                    console.log("Message causing error: ", element);
                }
                else {
                    console.log("message published with server response: ", response);
                    console.log("Message published successfully: ", element);
                }
            });
        });

    } else {

        console.log("No array detected.");
        pubnub.publish({
            channel: PNPubChannel,
            message: ehEvent.body
        },
        function(status, response) {
            if (status.error) {
                console.log("PN Array Element Publish Error: ", status);
                console.log("Message causing error: ", ehEvent.body);
            }
            else {
                console.log("message published with server response: ", response);
                console.log("Message published successfully: ", ehEvent.body);
            }
        });
    }
};

var receiveAfterTime = Date.now() - 0;

var EventHubClient = require('azure-event-hubs').Client;
var Promise = require('bluebird');

var printError = function (err) {
    console.log("Event Hub Error: " + err.message);
};

/**************                                 Create the Ingress Path                                 */

var EHInClient = EventHubClient.fromConnectionString(EHInConnectionString);

// Create the EH Client
EHInClient.open()
    .then(EHInClient.getPartitionIds.bind(EHInClient))
    .catch(printError);

// Create the sender, and then, subscribe via PN, forwarding all messages to this new subscriber to the sender.

EHInClient.createSender().then(function (sender) {
    pubnub.addListener({
        message: function(message) {
            console.log("Received Message: ", JSON.stringify(message, null, 4));
            // console.log("Forwarding from PN Subscriber to Ingress EH: " + JSON.stringify(message, null, 4));
            sender.send(message);
        },
        status: function(message) {
            printError(message); // this is more than just errors - all PN status events
        },
        //,presence: function(message) {
        //     // optionally, handle presence
        // }
    });

    pubnub.subscribe({
        channels: [PNSubChannel]
    });

    if (PNAnnounceChannel && PNAnnounceChannel != "disabled") {
        pubnub.setState({
            channels: [PNAnnounceChannel],
            state: {
                EHInConnectionString: EHInConnectionString,
                EHOutConnectionString: EHOutConnectionString
            }
        },
        function (message) {
            // optionally, handle status, response
        });
    }
});

/**************                                 Create the Egress Path                                 */

var EHOutClient = EventHubClient.fromConnectionString(EHOutConnectionString);

EHOutClient.open()
    .then(EHOutClient.getPartitionIds.bind(EHOutClient))
    .then(function (partitionIds) {
        return Promise.map(partitionIds, function (partitionId) {
            return EHOutClient.createReceiver('$Default', partitionId, {'startAfterTime': receiveAfterTime}).then(function (receiver) {
                receiver.on('errorReceived', printError);
                receiver.on('message', PNPublish);
            });
        });
    })
    .catch(printError);


text:
.class Lcom/android/vcard/VCardEntry$InsertOperationConstrutor;
.super Ljava/lang/Object;
.source "VCardEntry.java"

# interfaces
.implements Lcom/android/vcard/VCardEntry$EntryElementIterator;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/vcard/VCardEntry;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "InsertOperationConstrutor"
.end annotation

# instance fields
.field private final mBackReferenceIndex:I

.field private final mOperationList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Landroid/content/ContentProviderOperation;",
            ">;"
        }
    .end annotation
.end field

.field final synthetic this$0:Lcom/android/vcard/VCardEntry;

# direct methods
.method public constructor <init>(Lcom/android/vcard/VCardEntry;Ljava/util/List;I)V
    .locals 0
    .parameter
    .parameter
    .parameter "backReferenceIndex"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Landroid/content/ContentProviderOperation;",
            ">;I)V"
        }
    .end annotation

    .prologue
    .line 1713
    .local p2, operationList:Ljava/util/List;,"Ljava/util/List<Landroid/content/ContentProviderOperation;>;"
    iput-object p1, p0, Lcom/android/vcard/VCardEntry$InsertOperationConstrutor;->this$0:Lcom/android/vcard/VCardEntry;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 1714
    iput-object p2, p0, Lcom/android/vcard/VCardEntry$InsertOperationConstrutor;->mOperationList:Ljava/util/List;

    .line 1715
    iput p3, p0, Lcom/android/vcard/VCardEntry$InsertOperationConstrutor;->mBackReferenceIndex:I

    .line 1716
    return-void
.end method

# virtual methods
.method public onElement(Lcom/android/vcard/VCardEntry$EntryElement;)Z
    .locals 2
    .parameter "elem"

    .prologue
    .line 1736
    invoke-interface {p1}, Lcom/android/vcard/VCardEntry$EntryElement;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_0

    .line 1737
    iget-object v0, p0, Lcom/android/vcard/VCardEntry$InsertOperationConstrutor;->mOperationList:Ljava/util/List;

    iget v1, p0, Lcom/android/vcard/VCardEntry$InsertOperationConstrutor;->mBackReferenceIndex:I

    invoke-interface {p1, v0, v1}, Lcom/android/vcard/VCardEntry$EntryElement;->constructInsertOperation(Ljava/util/List;I)V

    .line 1739
    :cond_0
    const/4 v0, 0x1

    return v0
.end method

.method public onElementGroupEnded()V
    .locals 0

    .prologue
    .line 1732
    return-void
.end method

.method public onElementGroupStarted(Lcom/android/vcard/VCardEntry$EntryLabel;)V
    .locals 0
    .parameter "label"

    .prologue
    .line 1728
    return-void
.end method

.method public onIterationEnded()V
    .locals 0

    .prologue
    .line 1724
    return-void
.end method

.method public onIterationStarted()V
    .locals 0

    .prologue
    .line 1720
    return-void
.end method


text:
namespace io = boost::iostreams;
typedef io::stream_buffer<io::file_descriptor_sink> boost_ofdstream;
typedef io::stream_buffer<io::file_descriptor_source> boost_ifdstream;


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = require('babel-runtime/helpers/extends');

var _extends3 = _interopRequireDefault(_extends2);

var _get2 = require('lodash/get');

var _get3 = _interopRequireDefault(_get2);

var _isNil2 = require('lodash/isNil');

var _isNil3 = _interopRequireDefault(_isNil2);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _lib = require('../../lib');

var _Checkbox = require('../../modules/Checkbox');

var _Checkbox2 = _interopRequireDefault(_Checkbox);

var _Radio = require('../../addons/Radio');

var _Radio2 = _interopRequireDefault(_Radio);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * A field is a form element containing a label and an input.
 * @see Form
 * @see Button
 * @see Checkbox
 * @see Dropdown
 * @see Input
 * @see Radio
 * @see Select
 * @see Visibility
 */
function FormField(props) {
  var children = props.children,
      className = props.className,
      control = props.control,
      disabled = props.disabled,
      error = props.error,
      inline = props.inline,
      label = props.label,
      required = props.required,
      type = props.type,
      width = props.width;

  var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(error, 'error'), (0, _lib.useKeyOnly)(inline, 'inline'), (0, _lib.useKeyOnly)(required, 'required'), (0, _lib.useWidthProp)(width, 'wide'), 'field', className);
  var rest = (0, _lib.getUnhandledProps)(FormField, props);
  var ElementType = (0, _lib.getElementType)(FormField, props);

  // ----------------------------------------
  // No Control
  // ----------------------------------------

  if ((0, _isNil3.default)(control)) {
    if ((0, _isNil3.default)(label)) return _react2.default.createElement(
      ElementType,
      (0, _extends3.default)({}, rest, { className: classes }),
      children
    );

    return _react2.default.createElement(
      ElementType,
      (0, _extends3.default)({}, rest, { className: classes }),
      (0, _lib.createHTMLLabel)(label)
    );
  }

  // ----------------------------------------
  // Checkbox/Radio Control
  // ----------------------------------------
  var controlProps = (0, _extends3.default)({}, rest, { children: children, disabled: disabled, required: required, type: type

    // wrap HTML checkboxes/radios in the label
  });if (control === 'input' && (type === 'checkbox' || type === 'radio')) {
    return _react2.default.createElement(
      ElementType,
      { className: classes },
      _react2.default.createElement(
        'label',
        null,
        (0, _react.createElement)(control, controlProps),
        ' ',
        label
      )
    );
  }

  // pass label prop to controls that support it
  if (control === _Checkbox2.default || control === _Radio2.default) {
    return _react2.default.createElement(
      ElementType,
      { className: classes },
      (0, _react.createElement)(control, (0, _extends3.default)({}, controlProps, { label: label }))
    );
  }

  // ----------------------------------------
  // Other Control
  // ----------------------------------------

  return _react2.default.createElement(
    ElementType,
    { className: classes },
    (0, _lib.createHTMLLabel)(label, { defaultProps: {
        htmlFor: (0, _get3.default)(controlProps, 'id') }
    }),
    (0, _react.createElement)(control, controlProps)
  );
}

FormField.handledProps = ['as', 'children', 'className', 'control', 'disabled', 'error', 'inline', 'label', 'required', 'type', 'width'];
FormField._meta = {
  name: 'FormField',
  parent: 'Form',
  type: _lib.META.TYPES.COLLECTION
};

FormField.propTypes = process.env.NODE_ENV !== "production" ? {
  /** An element type to render as (string or function). */
  as: _lib.customPropTypes.as,

  /** Primary content. */
  children: _propTypes2.default.node,

  /** Additional classes. */
  className: _propTypes2.default.string,

  /**
   * A form control component (i.e. Dropdown) or HTML tagName (i.e. 'input').
   * Extra FormField props are passed to the control component.
   * Mutually exclusive with children.
   */
  control: _lib.customPropTypes.some([_propTypes2.default.func, _propTypes2.default.oneOf(['button', 'input', 'select', 'textarea'])]),

  /** Individual fields may be disabled. */
  disabled: _propTypes2.default.bool,

  /** Individual fields may display an error state. */
  error: _propTypes2.default.bool,

  /** A field can have its label next to instead of above it. */
  inline: _propTypes2.default.bool,

  // Heads Up!
  // Do not disallow children with `label` shorthand
  // The `control` might accept a `label` prop and `children`
  /** Mutually exclusive with children. */
  label: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.object]),

  /** A field can show that input is mandatory. */
  required: _propTypes2.default.bool,

  /** Passed to the control component (i.e. <input type='password' />) */
  type: _lib.customPropTypes.every([_lib.customPropTypes.demand(['control'])]
  // don't strictly validate HTML types
  // a control might be passed that uses a `type` prop with unknown values
  // let the control validate if for us
  ),

  /** A field can specify its width in grid columns */
  width: _propTypes2.default.oneOf(_lib.SUI.WIDTHS)
} : {};

exports.default = FormField;


text:
import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
  location: config.locationType,
  rootURL: config.rootURL
});

Router.map(function() {
  this.route('ui-button');
  this.route('demo-toggle-button');
  this.route('demo-button');
  this.route('demo-buttons');
});

export default Router;


text:
<title>Escape double quotes util</title>

Escape double quotes util

<form id="go" method="post" action="">

Input

    <textarea id="in"></textarea>

    <input type="submit" value="Escape !!"/>

Output

    <textarea type="textarea" id="out"></textarea>

</form>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>The GNU C Library: String/Array Conventions</title>

<meta name="description" content="The GNU C Library: String/Array Conventions">
<meta name="keywords" content="The GNU C Library: String/Array Conventions">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="String-and-Array-Utilities.html#String-and-Array-Utilities" rel="up" title="String and Array Utilities">
<link href="String-Length.html#String-Length" rel="next" title="String Length">
<link href="Representation-of-Strings.html#Representation-of-Strings" rel="prev" title="Representation of Strings">

Next: String Length, Previous: Representation of Strings, Up: String and Array Utilities   [Contents][Index]

5.2 String and Array Conventions

This chapter describes both functions that work on arbitrary arrays or
blocks of memory, and functions that are specific to null-terminated
arrays of characters and wide characters.

Functions that operate on arbitrary blocks of memory have names
beginning with ‘<samp>mem</samp>’ and ‘<samp>wmem</samp>’ (such as memcpy and
wmemcpy) and invariably take an argument which specifies the size
(in bytes and wide characters respectively) of the block of memory to
operate on.  The array arguments and return values for these functions
have type void * or wchar_t.  As a matter of style, the
elements of the arrays used with the ‘<samp>mem</samp>’ functions are referred
to as “bytes”.  You can pass any kind of pointer to these functions,
and the sizeof operator is useful in computing the value for the
size argument.  Parameters to the ‘<samp>wmem</samp>’ functions must be of type
wchar_t *.  These functions are not really usable with anything
but arrays of this type.

In contrast, functions that operate specifically on strings and wide
character strings have names beginning with ‘<samp>str</samp>’ and ‘<samp>wcs</samp>’
respectively (such as strcpy and wcscpy) and look for a
null character to terminate the string instead of requiring an explicit
size argument to be passed.  (Some of these functions accept a specified
maximum length, but they also check for premature termination with a
null character.)  The array arguments and return values for these
functions have type char * and wchar_t * respectively, and
the array elements are referred to as “characters” and “wide
characters”.

In many cases, there are both ‘<samp>mem</samp>’ and ‘<samp>str</samp>’/‘<samp>wcs</samp>’
versions of a function.  The one that is more appropriate to use depends
on the exact situation.  When your program is manipulating arbitrary
arrays or blocks of storage, then you should always use the ‘<samp>mem</samp>’
functions.  On the other hand, when you are manipulating null-terminated
strings it is usually more convenient to use the ‘<samp>str</samp>’/‘<samp>wcs</samp>’
functions, unless you already know the length of the string in advance.
The ‘<samp>wmem</samp>’ functions should be used for wide character arrays with
known size.

Some of the memory and string functions take single characters as
arguments.  Since a value of type char is automatically promoted
into a value of type int when used as a parameter, the functions
are declared with int as the type of the parameter in question.
In case of the wide character function the situation is similarly: the
parameter type for a single wide character is wint_t and not
wchar_t.  This would for many implementations not be necessary
since the wchar_t is large enough to not be automatically
promoted, but since the ISO C standard does not require such a
choice of types the wint_t type is used.

Next: String Length, Previous: Representation of Strings, Up: String and Array Utilities   [Contents][Index]


text:
/* @source acdtable application
**
** Generate HTML table version of help from acd files
**
** @author Peter Rice
** @@
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
**
** 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.
******************************************************************************/

#include "emboss.h"

/* @prog acdtable *************************************************************
**
** Generate HTML table version of help from acd files
**
******************************************************************************/

int main(int argc, char **argv)
{
    if(argc < 2)
	ajFatal("Error - must specify an application to compile\n");

    ajAcdSetControl("acdhelp");
    ajAcdSetControl("acdtable");
    ajAcdSetControl("acdnocommandline");
    embInit(argv[1], argc-1, &argv[1]);

    ajAcdExit(ajTrue);		/* turn off the 'never used' ACD warnings */

    embExit();

    return 0;
}


text:
namespace extensions {
namespace image_writer {

namespace {

// https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
constexpr char kExpectedMagic[4] = {'P', 'K', 0x03, 0x04};

}  // namespace

// static
bool ZipExtractor::IsZipFile(const base::FilePath& image_path) {
  base::File infile(image_path, base::File::FLAG_OPEN | base::File::FLAG_READ |
                                    base::File::FLAG_WIN_EXCLUSIVE_WRITE |
                                    base::File::FLAG_WIN_SHARE_DELETE);
  if (!infile.IsValid())
    return false;

  constexpr size_t kExpectedSize = sizeof(kExpectedMagic);
  char actual_magic[kExpectedSize] = {};
  if (infile.ReadAtCurrentPos(actual_magic, kExpectedSize) != kExpectedSize)
    return false;

  return std::equal(kExpectedMagic, kExpectedMagic + kExpectedSize,
                    actual_magic);
}

// static
void ZipExtractor::Extract(ExtractionProperties properties) {
  // ZipExtractor manages its own lifetime, and will delete itself when it
  // completes.
  ZipExtractor* extractor = new ZipExtractor(std::move(properties));
  extractor->ExtractImpl();
}

ZipExtractor::ZipExtractor(ExtractionProperties properties)
    : properties_(std::move(properties)) {}

ZipExtractor::~ZipExtractor() = default;

void ZipExtractor::ExtractImpl() {
  if (!zip_reader_.Open(properties_.image_path) ||
      !zip_reader_.AdvanceToNextEntry() ||
      !zip_reader_.OpenCurrentEntryInZip()) {
    // |this| will be deleted inside.
    OnError(error::kUnzipGenericError);
    return;
  }

  if (zip_reader_.HasMore()) {
    // |this| will be deleted inside.
    OnError(error::kUnzipInvalidArchive);
    return;
  }

  // Create a new target to unzip to.  The original file is opened by
  // |zip_reader_|.
  zip::ZipReader::EntryInfo* entry_info = zip_reader_.current_entry_info();

  if (!entry_info) {
    // |this| will be deleted inside.
    OnError(error::kTempDirError);
    return;
  }

  base::FilePath out_image_path =
      properties_.temp_dir_path.Append(entry_info->file_path().BaseName());
  std::move(properties_.open_callback).Run(out_image_path);

  // |this| will be deleted when OnComplete or OnError is called.
  zip_reader_.ExtractCurrentEntryToFilePathAsync(
      out_image_path,
      base::BindOnce(&ZipExtractor::OnComplete, weak_ptr_factory_.GetWeakPtr()),
      base::BindOnce(&ZipExtractor::OnError, weak_ptr_factory_.GetWeakPtr(),
                     error::kUnzipGenericError),
      base::BindRepeating(properties_.progress_callback,
                          entry_info->original_size()));
}

void ZipExtractor::OnError(const std::string& error) {
  std::move(properties_.failure_callback).Run(error);
  delete this;
}

void ZipExtractor::OnComplete() {
  std::move(properties_.complete_callback).Run();
  delete this;
}

}  // namespace image_writer
}  // namespace extensions


text:
var factories = function (collections) {

  return {

    clear: function (instance) {

      collections.clipboard.forEach(function (instance, i) {
        if (collections.clipboard[i].path === instance.path) {
          collections.clipboard.splice(i, 1);
        }
      });

    }

  };

};

module.exports = factories;


text:
require 'rubygems'
require 'active_support'
require 'iconv'
require 'builder'
require 'yaml'

if RUBY_VERSION.to_f < 1.9
  require 'parsedate'
else
  require 'parsedate_patch'
end

module ActiveForm

  BASE_PATH = ::File.expand_path(File.join(File.dirname(__FILE__), 'active_form'))

  def self.compose(*args, &block)
    ActiveForm::Definition.new(*args, &block)
  end

  def self.create(definition_name, &block)
    ActiveForm::Definition::create(definition_name, &block)
  end

  def self.get(definition_name, &block)
    ActiveForm::Definition::get(definition_name, &block)
  end

  def self.build(definition_name, *args, &block)
    ActiveForm::Definition::build(definition_name, *args, &block)
  end

  def self.use_european_formatting
    ActiveForm::Element::SelectDate.default_format = [:day, :month, :year]
    ActiveForm::Element::SelectDatetime.default_format = [:day, :month, :year, :hour, :minute]
  end

  def self.use_american_formatting
    ActiveForm::Element::SelectDate.default_format = [:month, :day, :year]
    ActiveForm::Element::SelectDatetime.default_format = [:month, :day, :year, :hour, :minute]
  end

  module Element
  end

  module Mixins
  end

  class StubException < StandardError #:nodoc:
  end

  class ValidationException < StandardError #:nodoc:
  end

  class Values < ::HashWithIndifferentAccess
  end

  def self.symbolize_name(name)
    return name if name.kind_of?(Symbol)
    name.to_s.downcase.strip.gsub(/[^-_\s[:alnum:]]/, '').squeeze(' ').tr(' ', '_').to_sym
  end

end

require File.join(File.dirname(__FILE__), 'active_form', 'core_extensions')

require File.join(File.dirname(__FILE__), 'active_form', 'mixins', 'common_methods')
require File.join(File.dirname(__FILE__), 'active_form', 'mixins', 'element_methods')
require File.join(File.dirname(__FILE__), 'active_form', 'mixins', 'collection_element_methods.rb')
require File.join(File.dirname(__FILE__), 'active_form', 'mixins', 'option_element_methods.rb')
require File.join(File.dirname(__FILE__), 'active_form', 'mixins', 'attribute_methods')
require File.join(File.dirname(__FILE__), 'active_form', 'mixins', 'container_methods')
require File.join(File.dirname(__FILE__), 'active_form', 'mixins', 'loader_methods')
require File.join(File.dirname(__FILE__), 'active_form', 'mixins', 'casting')

require File.join(File.dirname(__FILE__), 'active_form', 'mixins', 'javascript_methods')
require File.join(File.dirname(__FILE__), 'active_form', 'mixins', 'css_methods')

require File.join(File.dirname(__FILE__), 'active_form', 'errors')
require File.join(File.dirname(__FILE__), 'active_form', 'validator')
require File.join(File.dirname(__FILE__), 'active_form', 'validators', 'base')
require File.join(File.dirname(__FILE__), 'active_form', 'mixins', 'validation_methods')

require File.join(File.dirname(__FILE__), 'active_form', 'definition')

require File.join(File.dirname(__FILE__), 'active_form', 'element')
require File.join(File.dirname(__FILE__), 'active_form', 'elements', 'base')
require File.join(File.dirname(__FILE__), 'active_form', 'elements', 'section')

require File.join(File.dirname(__FILE__), 'active_form', 'widget')
require File.join(File.dirname(__FILE__), 'active_form', 'widgets', 'base')

if defined?(Merb::Plugins)

  Merb::Plugins.config[:active_form] = { } if Merb::Plugins.config[:active_form].nil?

  require File.join(File.dirname(__FILE__), 'merb', 'support')
  Merb::Plugins.add_rakefiles(File.join(File.dirname(__FILE__), 'merb',  'merbtasks'))

  Merb.push_path(:form,             Merb.root_path("app/forms"), nil)
  Merb.push_path(:form_view,        Merb.root_path("app/forms/views"), nil)

  Merb.push_path(:form_definition,  Merb.root_path("app/forms/definitions"))
  Merb.push_path(:form_section,     Merb.root_path("app/forms/sections"))
  Merb.push_path(:form_widget,      Merb.root_path("app/forms/widgets"))
  Merb.push_path(:form_element,     Merb.root_path("app/forms/elements"))
  Merb.push_path(:form_validator,   Merb.root_path("app/forms/validators"))

  class Merb::ActiveFormSetup < Merb::BootLoader

    after Merb::BootLoader::BeforeAppLoads

    def self.run
      ActiveForm::Definition.load_paths << Merb.dir_for(:form_definition)
      ActiveForm::Definition.load_paths << Merb.dir_for(:form_section)
      ActiveForm::Widget.load_paths     << Merb.dir_for(:form_widget)
      ActiveForm::Element.load_paths    << Merb.dir_for(:form_element)
      ActiveForm::Validator.load_paths  << Merb.dir_for(:form_validator)
    end

  end

end


text:
package com.screenshot;

import java.awt.Desktop;
import java.awt.Toolkit;
import java.awt.datatransfer.StringSelection;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URI;
import java.util.UUID;

import com.screenshot.gui.ScreenshotApp;
import com.screenshot.upload.FtpClient;
import com.screenshot.upload.PicasaClient;
import com.screenshot.util.Messenger;

public class ScreenshotTaker implements ScreenshotListener {

    private Messenger messenger;
    private ScreenshotApp app;

    public ScreenshotTaker(Messenger messenger) {
        this.messenger = messenger;
    }

    public void start(){
        if (app != null) {
            app.close("Start new", true, false);
        }
        app = new ScreenshotApp(this, messenger);
    }

    @Override
    public void screenshotSelected(BufferedImage img) {
        try {
            app.close("snapshot is took", false, false);
            String url;
            if (Settings.getInstance().isPicasawebMode()) {
                url = postToPicasaweb(img);
            } else {
                url = sendToFtp(img);
            }

            if (url != null) {
                Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(url), null);
                try {
                    Desktop.getDesktop().browse(new URI(url));
                } catch (Exception e) {
                    messenger.error("Can't open URL " + url + ". Error message: " + e.getMessage(), e);
                }
            }
        } finally {
            if (!Settings.getInstance().isSystemTrayMode()) {
                System.exit(0);
            }
        }
    }

    private String postToPicasaweb(BufferedImage img) {
        try {
            return new PicasaClient().upload(img);
        } catch (Exception e) {
            messenger.error("Can't send screenshot.\nReason: '" + e.getMessage() + "'.\nCheck google account settings or internet access.", e);
            return null;
        } catch (NoClassDefFoundError error){
            messenger.error("Can't send screenshot.\nReason: '" + error.getMessage() + "'.\nCheck google account settings or internet access.", error);
            return null;
        }
    }

    private String sendToFtp(BufferedImage img) {
        String fileName = UUID.randomUUID().toString() + ".png";
        String url = Settings.getInstance().getHttpBaseUrl() + "/" + fileName;
        try {
            new FtpClient().upload(fileName, img);
            return url;
        } catch (IOException e) {
            messenger.error("Can't send screenshot.\nReason: '" + e.getMessage() + "'.\nCheck FTP settings or internet connection.", e);
            return null;
        }
    }

    @Override
    public void screenshotCancelled() {
        app.close("screenshot is cancelled", false, true);
    }

}


text:
FROM lxps/centos7-git:latest

LABEL name="CentOS7 Base Image for dev" \
    license="MIT" \
    build-date="20170912"

MAINTAINER Li Xipeng <lixipeng@prophetech.cn>

# Install epel-release
RUN yum install -y epel-release
# Install pip and gcc
RUN yum install -y gcc python-devel python-pip

RUN pip install -U pip

RUN pip install -U setuptools

CMD ["/bin/bash"]


text:
from delegate.geni.v3.rm_adaptor import AdaptorFactory
from rspecs.crm.manifest_parser import CRMv3ManifestParser
from rspecs.crm.request_formatter import CRMv3RequestFormatter
from db.db_manager import db_sync_manager
from commons import CommonUtils
from delegate.geni.v3 import exceptions as delegate_ex

import core
logger = core.log.getLogger("com-utils")

class COMUtils(CommonUtils):
    def __init__(self):
        super(COMUtils, self).__init__()

    def manage_describe(self, peer, urns, creds):
        try:
            adaptor, uri = AdaptorFactory.create_from_db(peer)
            logger.debug("Adaptor=%s, uri=%s" % (adaptor, uri))
            m, urn, ss = adaptor.describe(urns, creds[0]["geni_value"])

            manifest = CRMv3ManifestParser(from_string=m)
            logger.debug("CRMv3ManifestParser=%s" % (manifest,))
            self.validate_rspec(manifest.get_rspec())

            nodes = manifest.nodes()
            logger.info("Nodes(%d)=%s" % (len(nodes), nodes,))

            return ({"nodes": nodes}, urn, ss)
        except Exception as e:
            logger.critical("manage_describe exception: %s", e)
            raise e

    def manage_provision(self, peer, urns, creds, beffort, etime, gusers):
        try:
            adaptor, uri = AdaptorFactory.create_from_db(peer)
            logger.debug("Adaptor=%s, uri=%s" % (adaptor, uri))
            m, urn = adaptor.provision(
                urns, creds[0]["geni_value"], beffort, etime, gusers)

            manifest = CRMv3ManifestParser(from_string=m)
            logger.debug("CRMv3ManifestParser=%s" % (manifest,))
            self.validate_rspec(manifest.get_rspec())

            nodes = manifest.nodes()
            logger.info("Nodes(%d)=%s" % (len(nodes), nodes,))

            # XXX Begin: temporal correction (defaul: geni_best_effort)
            # TODO Remove after CRM-KVM returns proper structure
            #  with geni_slivers
            # XXX End: temporal hack
            urn = urn or []
            # XXX End: temporal correction
            return ({"nodes": nodes}, urn)
        except Exception as e:
            # It is possible that CRM does not implement this method!
            if beffort:
                logger.error("manage_provision exception: %s", e)
                return ({"nodes": []}, [])
            else:
                logger.critical("manage_provision exception: %s", e)
                raise e

    def __update_route(self, route, values):
        for v in values:
            cid = v.get("component_id")
            k = db_sync_manager.get_com_node_routing_key(cid)
            v["routing_key"] = k
            if k not in route:
                route[k] = CRMv3RequestFormatter()

    def __update_route_rspec(self, route, slivers):
        for key, rspec in route.iteritems():
            for s in slivers:
                if s.get("routing_key") == key:
                    rspec.node(s)

    def manage_allocate(self, slice_urn, credentials, slice_expiration,
                        slivers, parser):
        route = {}
        self.__update_route(route, slivers)
        logger.debug("Slivers=%s" % (slivers,))

        self.__update_route_rspec(route, slivers)
        logger.info("Route=%s" % (route,))
        manifests, slivers, db_slivers = [], [], []

        for k, v in route.iteritems():
            try:
                (m, ss) = self.send_request_allocate_rspec(
                    k, v, slice_urn, credentials, slice_expiration)
                manifest = CRMv3ManifestParser(from_string=m)
                logger.debug("CRMv3ManifestParser=%s" % (manifest,))

                nodes = manifest.nodes()
                logger.info("Nodes(%d)=%s" % (len(nodes), nodes,))
                manifests.append({"nodes": nodes})

                self.extend_slivers(ss, k, slivers, db_slivers)
            except Exception as e:
                logger.critical("manage_allocate exception: %s", e)
                raise delegate_ex.AllocationError(
                    str(e), slice_urn, slivers, db_slivers)

        return (manifests, slivers, db_slivers)


text:
/* A basic exponential moving average filter.
 * See InfiniteImpulseResponse.h for more info on IIR filters.
 * http://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average
 */

#pragma once

#include "InfiniteImpulseResponse.h"
#include "../../core/DeviceListenerWrapper.h"

namespace features {
namespace filters {
class ExponentialMovingAverage : public InfiniteImpulseResponse {
 public:
  explicit ExponentialMovingAverage(core::DeviceListenerWrapper& parent_feature,
                                    DataFlags flags, float alpha);

 private:
  virtual float Update(float new_value, float old_value) override;

  const float alpha_;
};

ExponentialMovingAverage::ExponentialMovingAverage(
    core::DeviceListenerWrapper& parent_feature, DataFlags flags, float alpha)
    : InfiniteImpulseResponse(parent_feature, flags), alpha_(alpha) {}

float ExponentialMovingAverage::Update(float new_value, float old_value) {
  return (alpha_ * new_value) + ((1 - alpha_) * old_value);
}
}
}


text:
var path = require("path");
var fs = require("fs");
var vfs = require("vinyl-fs");
var acorn = require("acorn");
var SandBoxr = require("../dist/sandboxr");
var through = require("through2");
var gutil = require("gulp-util");
var yargs = require("yargs");

var args = 	yargs.default("verbose", false)
	.alias("v", "verbose")
	.default("in", "**/*.js")
	.alias("i", "in")
	.argv;

var infoBlock = /\/\*---([\s\S]*)---\*\//;
var infoSelector = /(\w+):\s*>?(.*)\s*/;

var failed = gutil.colors.bold.red("failed:");
var passed = gutil.colors.green("passed:");
var skipped = gutil.colors.blue("skipped:");

var harness = acorn.parse(fs.readFileSync(path.join(__dirname, "harness-es6.js")), { ecmaVersion: 6 });

var root = path.join(__dirname, "../../test262/test/");
var results = [];
var verbose = args.verbose;

// array -8
// weakmap -10
// object -25
// set -7
// number -1
// date -16
// symbol -4
// string -9
// boolean +
// reflect +

function getInfo (file) {
	var info = {
		src: file.contents.toString(),
		filename: path.basename(file.path)
	};

	var block = infoBlock.exec(info.src);
	if (block) {
		var lines = block[1].split(/\n/);
		var current;

		lines.forEach(function (line) {
			var match = infoSelector.exec(line);
			if (match) {
				current = match[1].toLowerCase();
				info[current] = match[2];
			} else if (current) {
				info[current] += " " + line.trim();
			}
		});
	}

	return info;
}

vfs.src(args.in, { cwd: root, verbose: true })
	.pipe(through.obj(function (file, enc, cb) {
		var info = getInfo(file);
		var useStrict = info.flags && info.flags.indexOf("onlyStrict") !== -1;
		var current = { file: file, info: info };

    if (!("es5id" in info || "es6id" in info)) {
      if (verbose) {
        gutil.log("skipping:", info.filename, "-", info.description);
      }

      current.skipped = true;
      cb(null, current);
      return;
    }

		if (verbose) {
			gutil.log("starting:", info.filename, "-", info.description);
		}

		var ast;
		try {
			ast = acorn.parse(info.src, { ecmaVersion: 6 });
		} catch (err) {
			current.passed = String(info.negative || "").trim() === String(err.name).trim();

			current.err = err;
			cb(null, current);
			return;
		}

		var parser = function (text) { return acorn.parse(text, { ecmaVersion: 6 }); };
		var sandbox = SandBoxr.create(ast, { ecmaVersion: 6, parser: parser, useStrict: useStrict, imports: [{ ast: harness }]});

		try {
			sandbox.execute();
			current.passed = !info.negative;
			cb(null, current);
		} catch (err) {
			if ("toNative" in err) {
				err = err.toNative();
			}

			current.passed = info.negative === err.name;
			current.err = err;
			cb(null, current);
		}
	}))
	.pipe(through.obj(function (result, enc, cb) {
		if (!result.passed && !result.skipped) {
			gutil.log(failed, result.info.filename, result.info.description);

			if (result.info.negative) {
				gutil.log("expected:", result.info.negative);
				gutil.log("actual:", result.err && result.err.name);
			}

			gutil.log("path:", result.file.path);
			gutil.log(result.err);
		} else if (verbose) {
			var status = result.passed ? passed : skipped;
			gutil.log(status, result.info.filename, result.info.description);
		}

		results.push(result);
		cb();
	}))
	.on("finish", function () {
		var totalPassed = results.filter(function (o) { return o.passed; }).length;
		var totalSkipped = results.filter(function (o) { return o.skipped; }).length;

		gutil.log("TOTALS ==============================");
		gutil.log(passed, totalPassed);
		gutil.log(skipped, totalSkipped);
		gutil.log(failed, results.length - totalPassed - totalSkipped);
	});

	// .pipe(through.obj(function (file, enc, done) {
	// 	processFile(file, harness, done);
	// 	// if (!harness) {
	// 	// 	loadHarness(function (src) {
	// 	// 		harness = src;
	// 	// 		processFile(file, harness, done);
	// 	// 	});
	// 	// } else {
	// 	// 	processFile(file, harness, done);
	// 	// }
	// }));

// glob("**/*.js", {cwd: root}, function (err, files) {
// 	gutil.log(files);
// });


text:
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Manatee.Trello.Internal.DataAccess;
using Manatee.Trello.Json;

namespace Manatee.Trello
{
	/// <summary>
	/// A collection of power-ups.
	/// </summary>
	public class PowerUpCollection : ReadOnlyPowerUpCollection, IPowerUpCollection
	{
		internal PowerUpCollection(Func<string> getOwnerId, TrelloAuthorization auth)
			: base(getOwnerId, auth)
		{
		}

		/// <summary>
		/// Enables a power-up for a board.
		/// </summary>
		/// <param name="powerUp">The power-up to enable.</param>
		/// <param name="ct">(Optional) A cancellation token for async processing.</param>
		public async Task EnablePowerUp(IPowerUp powerUp, CancellationToken ct = default)
		{
			var json = TrelloConfiguration.JsonFactory.Create<IJsonPowerUp>();
			json.Id = powerUp.Id;

			var endpoint = EndpointFactory.Build(EntityRequestType.Board_Write_EnablePowerUp,
			                                     new Dictionary<string, object>
				                                     {
					                                     {"_id", OwnerId}
				                                     });
			await JsonRepository.Execute(Auth, endpoint, json, ct);
		}

		/// <summary>
		/// Disables a power-up for a board.
		/// </summary>
		/// <param name="powerUp">The power-up to disble.</param>
		/// <param name="ct">(Optional) A cancellation token for async processing.</param>
		public async Task DisablePowerUp(IPowerUp powerUp, CancellationToken ct = default)
		{
			var endpoint = EndpointFactory.Build(EntityRequestType.Board_Write_DisablePowerUp,
			                                     new Dictionary<string, object>
				                                     {
					                                     {"_boardId", OwnerId},
					                                     {"_id", OwnerId}
				                                     });
			await JsonRepository.Execute(Auth, endpoint, ct, AdditionalParameters);
		}
	}
}