text:
@interface MSALGuestUserTests : MSALADFSBaseUITest

@property (nonatomic) NSString *testEnvironment;

@end

@implementation MSALGuestUserTests

- (void)setUp
{
    [super setUp];

    self.testEnvironment = self.class.confProvider.wwEnvironment;

    MSIDTestAutomationAppConfigurationRequest *appConfigurationRequest = [MSIDTestAutomationAppConfigurationRequest new];
    appConfigurationRequest.testAppAudience = MSIDTestAppAudienceMultipleOrgs;
    appConfigurationRequest.testAppEnvironment = self.testEnvironment;

    [self loadTestApp:appConfigurationRequest];

    MSIDTestAutomationAccountConfigurationRequest *accountConfigurationRequest = [MSIDTestAutomationAccountConfigurationRequest new];
    accountConfigurationRequest.environmentType = self.testEnvironment;
    accountConfigurationRequest.accountType = MSIDTestAccountTypeGuest;
    accountConfigurationRequest.federationProviderType = MSIDTestAccountFederationProviderTypeADFSV4;

    [self loadTestAccount:accountConfigurationRequest];
}

// #347620
- (void)testInteractiveAndSilentAADLogin_withNonConvergedApp_withPromptAlways_noLoginHint_SystemWebView_signinIntoGuestTenantFirst
{
    MSIDAutomationTestRequest *request = [self.class.confProvider defaultAppRequest:self.testEnvironment targetTenantId:self.primaryAccount.targetTenantId];
    request.promptBehavior = @"force";
    request.testAccount = self.primaryAccount;
    request.requestScopes = [self.class.confProvider scopesForEnvironment:self.testEnvironment type:@"ms_graph"];
    request.expectedResultScopes = [NSString msidCombinedScopes:request.requestScopes withScopes:self.class.confProvider.oidcScopes];
    request.configurationAuthority = [self.class.confProvider defaultAuthorityForIdentifier:self.testEnvironment tenantId:self.primaryAccount.targetTenantId];

    // 1. Run interactive in the guest tenant
    NSString *homeAccountId = [self runSharedGuestInteractiveLoginWithRequest:request closeResultView:NO];
    NSString *resultTenantId = [self automationSuccessResult:self.testApp].userInformation.tenantId;
    XCTAssertEqualObjects(resultTenantId, self.primaryAccount.targetTenantId);
    XCTAssertNotNil(homeAccountId);
    XCTAssertTrue([homeAccountId hasSuffix:self.primaryAccount.homeTenantId]);
    [self closeResultPipeline:self.testApp];

    // 2. Run silent for the guest tenant
    request.homeAccountIdentifier = homeAccountId;

    [self runSharedSilentAADLoginWithTestRequest:request];

    // 3. Run silent for the home tenant
    request.configurationAuthority = [self.class.confProvider defaultAuthorityForIdentifier:self.testEnvironment tenantId:self.primaryAccount.homeTenantId];
    request.expectedResultAuthority = request.configurationAuthority;
    request.cacheAuthority = request.configurationAuthority;
    request.targetTenantId = self.primaryAccount.homeTenantId;
    [self runSharedSilentAADLoginWithTestRequest:request];
}

- (void)testInteractiveAndSilentAADLogin_withNonConvergedApp_withPromptAlways_noLoginHint_EmbeddedWebView_signinIntoHomeTenantFirst
{
    MSIDAutomationTestRequest *homeRequest = [self.class.confProvider defaultAppRequest:self.testEnvironment targetTenantId:self.primaryAccount.targetTenantId];
    homeRequest.promptBehavior = @"force";
    homeRequest.requestScopes = [self.class.confProvider scopesForEnvironment:self.testEnvironment type:@"ms_graph"];
    homeRequest.expectedResultScopes = [NSString msidCombinedScopes:homeRequest.requestScopes withScopes:self.class.confProvider.oidcScopes];
    homeRequest.configurationAuthority = [self.class.confProvider defaultAuthorityForIdentifier:self.testEnvironment tenantId:self.primaryAccount.homeTenantId];
    homeRequest.expectedResultAuthority = homeRequest.configurationAuthority;
    homeRequest.cacheAuthority = homeRequest.configurationAuthority;
    homeRequest.webViewType = MSIDWebviewTypeWKWebView;
    homeRequest.testAccount = self.primaryAccount;
    homeRequest.targetTenantId = self.primaryAccount.homeTenantId;

    // 1. Run interactive in the home tenant
    NSString *homeAccountId = [self runSharedGuestInteractiveLoginWithRequest:homeRequest closeResultView:NO];
    NSString *resultTenantId = [self automationSuccessResult:self.testApp].userInformation.tenantId;
    XCTAssertEqualObjects(resultTenantId, self.primaryAccount.homeTenantId);
    XCTAssertNotNil(homeAccountId);
    XCTAssertTrue([homeAccountId hasSuffix:self.primaryAccount.homeTenantId]);
    [self closeResultPipeline:self.testApp];

    // 2. Run silent for the home tenant
    homeRequest.homeAccountIdentifier = homeAccountId;
    [self runSharedSilentAADLoginWithTestRequest:homeRequest];

    // 3. Run silent for the guest tenant
    MSIDAutomationTestRequest *guestRequest = [self.class.confProvider defaultAppRequest:self.testEnvironment targetTenantId:self.primaryAccount.targetTenantId];
    guestRequest.promptBehavior = @"force";
    guestRequest.testAccount = self.primaryAccount;
    guestRequest.requestScopes = [self.class.confProvider scopesForEnvironment:self.testEnvironment type:@"ms_graph"];
    guestRequest.expectedResultScopes = [NSString msidCombinedScopes:guestRequest.requestScopes withScopes:self.class.confProvider.oidcScopes];
    guestRequest.configurationAuthority = [self.class.confProvider defaultAuthorityForIdentifier:self.testEnvironment tenantId:self.primaryAccount.targetTenantId];
    guestRequest.homeAccountIdentifier = homeAccountId;
    guestRequest.webViewType = MSIDWebviewTypeWKWebView;
    guestRequest.targetTenantId = self.primaryAccount.targetTenantId;
    [self runSharedSilentAADLoginWithTestRequest:guestRequest];
}

// Test #347622
- (void)testInteractiveAndSilentAADLogin_withConvergedApp_withPromptAlways_noLoginHint_SystemWebView_andGuestUserInHomeAndGuestTenant
{
    MSIDAutomationTestRequest *guestRequest = [self.class.confProvider defaultAppRequest:self.testEnvironment targetTenantId:self.primaryAccount.targetTenantId];
    guestRequest.promptBehavior = @"force";
    guestRequest.configurationAuthority = [self.class.confProvider defaultAuthorityForIdentifier:self.testEnvironment tenantId:self.primaryAccount.targetTenantId];
    guestRequest.expectedResultAuthority = guestRequest.configurationAuthority;
    guestRequest.cacheAuthority = guestRequest.configurationAuthority;
    guestRequest.targetTenantId = self.primaryAccount.targetTenantId;

    // 1. Run interactive in the guest tenant
    NSString *homeAccountId = [self runSharedGuestInteractiveLoginWithRequest:guestRequest closeResultView:NO];
    NSString *resultTenantId = [self automationSuccessResult:self.testApp].userInformation.tenantId;
    XCTAssertEqualObjects(resultTenantId, self.primaryAccount.targetTenantId);
    XCTAssertNotNil(homeAccountId);
    XCTAssertTrue([homeAccountId hasSuffix:self.primaryAccount.homeTenantId]);
    [self closeResultPipeline:self.testApp];

    // 2. Run interactive in the home tenant
    MSIDAutomationTestRequest *homeRequest = [self.class.confProvider defaultAppRequest:self.testEnvironment targetTenantId:self.primaryAccount.homeTenantId];
    homeRequest.promptBehavior = @"force";
    homeRequest.configurationAuthority = [self.class.confProvider defaultAuthorityForIdentifier:self.testEnvironment tenantId:self.primaryAccount.homeTenantId];
    homeRequest.testAccount = self.primaryAccount;
    homeRequest.targetTenantId = self.primaryAccount.homeTenantId;
    [self runSharedGuestInteractiveLoginWithRequest:homeRequest closeResultView:YES];

    // 3. Run silent for the guest tenant
    guestRequest.homeAccountIdentifier = homeAccountId;
    [self runSharedSilentAADLoginWithTestRequest:guestRequest];

    // 4. Run silent for the home tenant
    homeRequest.homeAccountIdentifier = homeAccountId;
    [self runSharedSilentAADLoginWithTestRequest:homeRequest];
}

- (NSString *)runSharedGuestInteractiveLoginWithRequest:(MSIDAutomationTestRequest *)request
                                        closeResultView:(BOOL)closeResultView
{
    // 1. Do interactive login
    NSDictionary *config = [self configWithTestRequest:request];
    [self acquireToken:config];

    [self acceptAuthSessionDialogIfNecessary:request];

    if (!request.loginHint)
    {
        [self aadEnterEmail:self.testApp];
    }

    [self enterGuestPassword];
    [self acceptMSSTSConsentIfNecessary:@"Accept" embeddedWebView:request.usesEmbeddedWebView];

    if (!request.usesEmbeddedWebView)
    {
        [self acceptSpeedBump];
    }

    NSString *homeAccountId = [self runSharedResultAssertionWithTestRequest:request];

    if (closeResultView)
    {
        [self closeResultPipeline:self.testApp];
    }

    return homeAccountId;
}

- (void)enterGuestUsername
{
    XCUIElement *emailTextField = [self.testApp.textFields elementBoundByIndex:0];
    [self waitForElement:emailTextField];
    [emailTextField msidTap];
    [emailTextField typeText:[NSString stringWithFormat:@"%@\n", self.primaryAccount.upn]];
}

- (void)enterGuestPassword
{
    XCUIElement *passwordTextField = [self.testApp.secureTextFields elementBoundByIndex:0];
    [self waitForElement:passwordTextField];
    [passwordTextField msidTap];
    [passwordTextField typeText:[NSString stringWithFormat:@"%@\n", self.primaryAccount.password]];
}

@end


text:
<?php

 /**
 * Build a new Careerjet_API interface
 *
 * Usage:
 *  $cjapi = new Careerjet_API(<locale>) ;
 *
 *  Available locales:
 *      LOCALE     LANGUAGE         DEFAULT LOCATION     CAREERJET SITE

    cs_CZ      Czech            Czech Republic       http://www.careerjet.cz
    da_DK      Danish           Denmark              http://www.careerjet.dk
    de_AT      German           Austria              http://www.careerjet.at
    de_CH      German           Switzerland          http://www.careerjet.ch
    de_DE      German           Germany              http://www.careerjet.de
    en_AE      English          United Arab Emirates http://www.careerjet.ae
    en_AU      English          Australia            http://www.careerjet.com.au
    en_CA      English          Canada               http://www.careerjet.ca
    en_CN      English          China                http://en.careerjet.cn
    en_HK      English          Hong Kong            http://www.careerjet.hk
    en_IE      English          Ireland              http://www.careerjet.ie
    en_IN      English          India                http://www.careerjet.co.in
    en_MY      English          Malaysia             http://www.careerjet.com.my
    en_NZ      English          New Zealand          http://www.careerjet.co.nz
    en_OM      English          Oman                 http://www.careerjet.com.om
    en_PH      English          Philippines          http://www.careerjet.ph
    en_PK      English          Pakistan             http://www.careerjet.com.pk
    en_QA      English          Qatar                http://www.careerjet.com.qa
    en_SG      English          Singapore            http://www.careerjet.sg
    en_GB      English          United Kingdom       http://www.careerjet.co.uk
    en_US      English          United States        http://www.careerjet.com
    en_ZA      English          South Africa         http://www.careerjet.co.za
    en_TW      English          Taiwan               http://www.careerjet.com.tw
    en_VN      English          Vietnam              http://www.careerjet.vn
    es_AR      Spanish          Argentina            http://www.opcionempleo.com.ar
    es_BO      Spanish          Bolivia              http://www.opcionempleo.com.bo
    es_CL      Spanish          Chile                http://www.opcionempleo.cl
    es_CR      Spanish          Costa Rica           http://www.opcionempleo.co.cr
    es_DO      Spanish          Dominican Republic   http://www.opcionempleo.com.do
    es_EC      Spanish          Ecuador              http://www.opcionempleo.ec
    es_ES      Spanish          Spain                http://www.opcionempleo.com
    es_GT      Spanish          Guatemala            http://www.opcionempleo.com.gt
    es_MX      Spanish          Mexico               http://www.opcionempleo.com.mx
    es_PA      Spanish          Panama               http://www.opcionempleo.com.pa
    es_PE      Spanish          Peru                 http://www.opcionempleo.com.pe
    es_PR      Spanish          Puerto Rico          http://www.opcionempleo.com.pr
    es_PY      Spanish          Paraguay             http://www.opcionempleo.com.py
    es_UY      Spanish          Uruguay              http://www.opcionempleo.com.uy
    es_VE      Spanish          Venezuela            http://www.opcionempleo.com.ve
    fi_FI      Finnish          Finland              http://www.careerjet.fi
    fr_CA      French           Canada               http://fr.careerjet.ca
    fr_BE      French           Belgium              http://www.optioncarriere.be
    fr_CH      French           Switzerland          http://www.optioncarriere.ch
    fr_FR      French           France               http://www.optioncarriere.com
    fr_LU      French           Luxembourg           http://www.optioncarriere.lu
    fr_MA      French           Morocco              http://www.optioncarriere.ma
    hu_HU      Hungarian        Hungary              http://www.careerjet.hu
    it_IT      Italian          Italy                http://www.careerjet.it
    ja_JP      Japanese         Japan                http://www.careerjet.jp
    ko_KR      Korean           Korea                http://www.careerjet.co.kr
    nl_BE      Dutch            Belgium              http://www.careerjet.be
    nl_NL      Dutch            Netherlands          http://www.careerjet.nl
    no_NO      Norwegian        Norway               http://www.careerjet.no
    pl_PL      Polish           Poland               http://www.careerjet.pl
    pt_PT      Portuguese       Portugal             http://www.careerjet.pt
    pt_BR      Portuguese       Brazil               http://www.careerjet.com.br
    ru_RU      Russian          Russia               http://www.careerjet.ru
    ru_UA      Russian          Ukraine              http://www.careerjet.com.ua
    sv_SE      Swedish          Sweden               http://www.careerjet.se
    sk_SK      Slovak           Slovakia             http://www.careerjet.sk
    tr_TR      Turkish          Turkey               http://www.careerjet.com.tr
    uk_UA      Ukrainian        Ukraine              http://www.careerjet.ua
    vi_VN      Vietnamese       Vietnam              http://www.careerjet.com.vn
    zh_CN      Chinese          China                http://www.careerjet.cn

 *
 *
 *
 *
 *  require_once "Careerjet_API.php" ;
 *
 *  // Create a new instance of the interface for UK job offers
 *  $cjapi = new Careerjet_API('en_GB') ;
 *
 *
 *
 *  // Then call api methods (see methods doc for details)
 *  $result = $cjapi->search( array ( 'keywords' => 'java manager',
 *                                    'location' => 'London' )
 *                           );
 *
 *  if ( $result->type == 'JOBS' ){
 *      echo "Got ".$result->hits." jobs: \n\n" ;
 *      $jobs = $result->jobs ;
 *
 *      foreach( $jobs as &$job ){
 *          echo " URL: ".$job->url."\n" ;
 *          echo " TITLE: ".$job->title."\n" ;
 *          echo " LOC:   ".$job->locations."\n";
 *          echo " COMPANY: ".$job->company."\n" ;
 *          echo " SALARY: ".$job->salary."\n" ;
 *          echo " DATE:   ".$job->date."\n" ;
 *          echo " DESC:   ".$job->description."\n" ;
 *          echo "\n" ;
 *       }
 *
 *   }
 *
 *
 *
 *
 * @package    Careerjet_API
 * @author     Thomas Busch <api@careerjet.com>
 * @copyright  2007-2011 Careerjet Limited
 * @link       http://www.careerjet.co.uk/partners/api/
 */
class Careerjet_API{
  var $locale = '' ;

  function Careerjet_API( $locale = 'en_GB' )
  {
    $this->locale = $locale;
  }

  function call($fname , $args)
  {
    $url = 'http://public.api.careerjet.net/'.$fname.'?locale_code='.$this->locale;
    foreach ($args as $key => $value) {
      $url .= '&'. $key . '='. urlencode($value);
    }

    $response = file_get_contents($url);
    return json_decode($response);
  }

  /**
   * Do a search in Careerjet job database
   *
   * Call exemple:
   *
   *
   * $result = $cjapi->search(array( 'keywords' => 'java',
   *                               'location' => 'London',
   *                               'pagesize' => 2 )
   *                        );
   *
   *
   *
   * @param   array  $args   map of search options
   *                         exemple : array( 'keywords' => 'java manager',
   *                                          'location' => 'london' );
   *                         See OPTIONS for details about available options.
   *
   *                         Values of keys MUST be in ASCII or unicode (utf8)
   *                         If you use this API within a webpage, make sure:
   *                           - That your pages are served in utf-8 encoding OR
   *                           - Your job search form begins like that :
   *                              <form accept-charset="UTF-8"
   *
   *
   * @return object(stdClass)  An object containing results
   *                           If the given location is not ambiguous, you can use this
   *                           object like that:
   *
   *                           if ( $result->type == 'JOBS' ){
   *                              echo "Got ".$result->hits." jobs: \n" ;
   *                              echo " On ".$result->pages." pages \n" ;
   *                              $jobs = $result->jobs ;
   *
   *                              foreach( $jobs as &$job ){
   *                                  echo " URL: ".$job->url."\n" ;
   *                                  echo " TITLE: ".$job->title."\n" ;
   *                                  echo " LOC:   ".$job->locations."\n";
   *                                  echo " COMPANY: ".$job->company."\n" ;
   *                                  echo " SALARY: ".$job->salary."\n" ;
   *                                  echo " DATE:   ".$job->date."\n" ;
   *                                  echo " DESC:   ".$job->description."\n" ;
   *                                  echo " SITE:   ".$job->site."\n" ;
   *                                  echo "\n" ;
   *                               }
   *
   *                             }
   *
   *
   *                           If the given location is ambiguous, result contains
   *                           a list of suggested locations:
   *
   *
   *                           if ( $result->type == 'LOCATIONS' ){
   *                               echo "Suggested locations:\n" ;
   *                               $locations = $result->locations ;
   *
   *                               foreach ( $locations as &$loc ){
   *                                   echo $loc."\n" ;
   *                               }
   *
   *                            }
   *
   *
   *
   * OPTIONS
   *   All options have default values and are not mandatory
   *
   *     keywords     : Keywords to search in job offers. Example: 'java manager'
   *                    Default : none (All offers in the api country)
   *
   *     location     : Location to search job offers in. Examples: 'London' , 'Yorkshire' ..
   *                    Default: none ( All offers in the api country)
   *
   *     sort         : Type of sort. Can be:
   *                     'relevance' (default) - most relevant first
   *                     'date'                - freshest offer first
   *                     'salary'              - biggest salary first
   *
   *     start_num    : Num of first offer returned in entire result space
   *                    should be >= 1 and <= Number of hits
   *                    Default : 1
   *
   *     pagesize     : Number of offers returned in one call
   *                    Default : 20
   *
   *     page         : Number of the asked page.
   *                    should be >=1
   *                    The max number of page is given by $result->pages
   *                    If this value is set, the eventually given start_num is overrided
   *
   *     contracttype : Character code for contract type
   *                     'p'    - permanent job
   *                     'c'    - contract
   *                     't'    - temporary
   *                     'i'    - training
   *                     'v'    - voluntary
   *                    Default: none (all contract types)
   *
   *     contractperiod : Character code for contract work period:
   *                       'f'     - Full time
   *                       'p'     - Part time
   *                      Default: none (all work period)
   *
   */
  function search($args)
  {
    $result =  $this->call('search' , $args);
    if ( $result->type == 'ERROR' ){
      trigger_error( $result->error );
    }
    return $result ;
  }
}

?>

redpajama_set_name: RedPajamaGithub


text:
import Phaser from 'phaser'
import { centerGameObjects } from '../utils'
import Level1 from '../config/level1config'

export default class extends Phaser.State {
	init() {}

	preload() {
		this.loaderBg = this.add.sprite(this.game.world.centerX, this.game.world.centerY, 'loaderBg')
		this.loaderBar = this.add.sprite(this.game.world.centerX, this.game.world.centerY, 'loaderBar')
		centerGameObjects([this.loaderBg, this.loaderBar])

		this.load.setPreloadSprite(this.loaderBar, 0)

		this.assetLoop()
		this.load.tilemap('level1', null, Level1, Phaser.Tilemap.TILED_JSON)
	}

	create() {
		this.state.start('Game')
	}

	assetLoop() {
		let assets, asset_loader, asset_key, asset
		assets = this.cache.getJSON('level1').assets
		for (asset_key in assets) {
			if (assets.hasOwnProperty(asset_key)) {
				asset = assets[asset_key]
				switch (asset.type) {
					case 'image':
						this.load.image(asset_key, asset.source)
						break
					case 'spritesheet':
						this.load.spritesheet(
							asset_key,
							asset.source,
							asset.frame_width,
							asset.frame_height,
							asset.frames,
							asset.margin,
							asset.spacing
						)
						break
					case 'tilemap':
						console.log(assets)
						this.load.tilemap(asset_key, asset.source, null, Phaser.Tilemap.TILED_JSON)
						break
					case 'atlasXML':
						this.load.atlasXML(asset_key, asset.image, asset.xml)
						break
					case 'atlas':
						this.load.atlas(asset_key, asset.image, asset.json)
						break
				}
			}
		}
	}
}


text:
// Provides control sap.m.LightBoxItem
sap.ui.define([
	"./library",
	"sap/ui/core/library",
	"sap/ui/core/Element",
	"sap/m/Image",
	"sap/m/Title",
	"sap/m/Label"
], function (
	library,
	coreLibrary,
	Element,
	Image,
	Title,
	Label
) {
	"use strict";

	// shortcut for sap.m.LightBoxLoadingStates
	var LightBoxLoadingStates = library.LightBoxLoadingStates;

	// shortcut for sap.ui.core.OpenState
	var OpenState = coreLibrary.OpenState;

	// shortcut for sap.ui.core.TitleLevel
	var TitleLevel = coreLibrary.TitleLevel;

	/**
	 * Constructor for a new LightBoxItem.
	 *
	 * @param {string} [sId] ID for the new control, generated automatically if no ID is given
	 * @param {object} [mSettings] Initial settings for the new control
	 *
	 * @class
	 * Represents an item which is displayed within an sap.m.LightBox. This item holds all properties of the image as
	 * well as the title and subtitle.
	 * @extends sap.ui.core.Element
	 *
	 * @author SAP SE
	 * @version ${version}
	 *
	 * @constructor
	 * @public
	 * @since 1.42
	 * @alias sap.m.LightBoxItem
	 */
	var LightBoxItem = Element.extend("sap.m.LightBoxItem", /** @lends sap.m.LightBoxItem.prototype */ {
		metadata: {
			library: "sap.m",
			properties: {
				/**
				 * Source for the image. This property is mandatory. If not set the popup will not open.
				 */
				imageSrc: { type: "sap.ui.core.URI", group: "Appearance", multiple: false, defaultValue: "" },

				/**
				 * Alt value for the image.
				 */
				alt: { type: "string", group: "Appearance", multiple: false, defaultValue: "" },

				/**
				 * Title text for the image. This property is mandatory.
				 */
				title: { type: "string", group: "Appearance", multiple: false, defaultValue: "" },

				/**
				 * Subtitle text for the image.
				 */
				subtitle: { type: "string", group: "Appearance", multiple: false, defaultValue: "" }
			},

			aggregations: {
				/**
				 * The image aggregation inside the LightBoxItem control.
				 * @private
				 */
				_image: { type: "sap.m.Image", multiple: false, visibility: "hidden" },

				/**
				 * The title aggregation inside the LightBoxItem control.
				 * @private
				 */
				_title: { type: "sap.m.Title", multiple: false, visibility: "hidden" },

				/**
				 * The subtitle aggregation inside the LightBoxItem control.
				 * @private
				 */
				_subtitle: { type: "sap.m.Label", multiple: false, visibility: "hidden" }
			}
		}
	});

	LightBoxItem.prototype.init = function () {
		this._createNativeImage();

		this.setAggregation("_image", new Image({
			decorative: false,
			densityAware: false
		}), true);

		this.setAggregation("_title", new Title({
			level: TitleLevel.H2,
			wrapping: false
		}), true);

		this.setAggregation("_subtitle", new Label({
			wrapping: false
		}), true);
	};

	/**
	 * Creates a native JavaScript Image object.
	 * @private
	 */
	LightBoxItem.prototype._createNativeImage = function () {
		var that = this;

		this._sImageState = LightBoxLoadingStates.Loading;
		this._oImage = new window.Image();
		this._oImage.onload = function () {
			if (this.complete && that._sImageState === LightBoxLoadingStates.Loading) {
				that._setImageState(LightBoxLoadingStates.Loaded);
			}
		};

		this._oImage.onerror = function () {
			that._setImageState(LightBoxLoadingStates.Error);
		};
	};

	LightBoxItem.prototype.exit = function () {
		this._oImage = null;
	};

	/**
	 * Sets the state of the image. Possible values are "LOADING", "LOADED" and "ERROR"
	 * @private
	 * @param {sap.m.LightBoxLoadingStates} sImageState Current image state
	 */
	LightBoxItem.prototype._setImageState = function (sImageState) {
		if (sImageState !== this._sImageState) {
			this._sImageState = sImageState;
			if (this.getParent()) {
				this.getParent()._imageStateChanged(sImageState);
			}
		}
	};

	/**
	 * Returns the state of the image.
	 * @private
	 * @returns {string} State of the image
	 */
	LightBoxItem.prototype._getImageState = function () {
		return this._sImageState;
	};

	/**
	 * Returns the native JavaScript Image object.
	 * @private
	 * @method
	 * @returns {window.Image} The native window.Image object
	 */
	LightBoxItem.prototype._getNativeImage = function () {
		return this._oImage;
	};

	/**
	 * Sets the source of the image.
	 * @public
	 * @param {sap.ui.core.URI} sImageSrc The image URI
	 * @returns {this} Pointer to the control instance for chaining.
	 */
	LightBoxItem.prototype.setImageSrc = function (sImageSrc) {
		var oImage = this.getAggregation("_image"),
			oLightBox = this.getParent();

		if (this.getImageSrc() === sImageSrc) {
			return this;
		}

		this._sImageState = LightBoxLoadingStates.Loading;

		if (oLightBox && oLightBox._oPopup.getOpenState() === OpenState.OPEN) {
			this._oImage.src = sImageSrc;
		}

		this.setProperty("imageSrc", sImageSrc, false);
		oImage.setSrc(sImageSrc);

		return this;
	};

	/**
	 * Sets the alt text of the image.
	 * @public
	 * @param {string} alt The alt text
	 * @method
	 * @returns {this} Pointer to the control instance for chaining.
	 */
	LightBoxItem.prototype.setAlt = function (alt) {
		var oImage = this.getAggregation("_image");

		this.setProperty("alt", alt, false);
		oImage.setAlt(alt);

		return this;
	};

	/**
	 * Sets the title of the image.
	 * @public
	 * @param {string} title The image title
	 * @method
	 * @returns {this} Pointer to the control instance for chaining.
	 */
	LightBoxItem.prototype.setTitle = function (title) {
		var oTitle = this.getAggregation("_title");

		this.setProperty("title", title, false);
		oTitle.setText(title);

		return this;
	};

	/**
	 * Sets the subtitle of the image.
	 * @public
	 * @param {string} sSubtitleText The image subtitle
	 * @returns {this} Pointer to the control instance for chaining.
	 */
	LightBoxItem.prototype.setSubtitle = function (sSubtitleText) {
		var oSubtitle = this.getAggregation("_subtitle");

		this.setProperty("subtitle", sSubtitleText, false);
		oSubtitle.setText(sSubtitleText);

		return this;
	};

	return LightBoxItem;
});


text:
"""
Transform DescriptorFileElement instances into Postgres version
"""

import cPickle
import logging
import multiprocessing
import os
import re

from smqtk.representation import DescriptorElementFactory
from smqtk.representation.descriptor_element.local_elements import DescriptorFileElement
from smqtk.representation.descriptor_element.postgres_element import PostgresDescriptorElement
from smqtk.utils import bin_utils
from smqtk.utils import file_utils

ROOT_DIR = "/data/kitware/smqtk/image_cache_cnn_compute/descriptors"

file_element_config = {
    'save_dir': ROOT_DIR,
    'subdir_split': 10,
}

psql_element_config = {
    'db_name': 'smqtk',
    'db_host': 'localhost',
    'db_port': 6432,  # PgBouncer port
    'db_user': 'smqtk',
    'db_pass': 'some-password',
}

file_element_factory = DescriptorElementFactory(
    DescriptorFileElement,
    file_element_config,
)

psql_element_factory = DescriptorElementFactory(
    PostgresDescriptorElement,
    psql_element_config,
)

fname_re = re.compile('(\w+)\.(\w+)\.vector\.npy')

def transfer_vector(type_str, uuid_str):
    pd = psql_element_factory(type_str, uuid_str)
    if not pd.has_vector():
        fd = file_element_factory(type_str, uuid_str)
        # removing the "-0" artifacts
        pd.set_vector( fd.vector() + 0 )

def proc_transfer(in_queue):
    running = True
    while running:
        packet = in_queue.get()
        if packet:
            type_str, uuid_str = packet
            transfer_vector(type_str, uuid_str)
        else:
            running = False

def main():
    bin_utils.initialize_logging(logging.getLogger(), logging.DEBUG)
    log = logging.getLogger(__name__)

    # For each file in descriptor vector file tree, load from file
    # [type, uuid, vector] and insert into PSQL element.

    log.info("Setting up parallel environment")
    in_queue = multiprocessing.Queue()
    workers = []
    for i in xrange(multiprocessing.cpu_count()):
        p = multiprocessing.Process(
            target=proc_transfer,
            args=(in_queue,)
        )
        workers.append(p)
        p.start()

    try:
        log.info("Loading filename list")
        with open("descriptor_file_names.5.3mil.pickle") as f:
            fname_list = cPickle.load(f)

        log.info("Running through filename list")
        for n in fname_list:
            m = fname_re.match(n)
            assert m

            type_str = m.group(1)
            uuid_str = m.group(2)

            #print type_str, uuid_str
            #break
            in_queue.put( (type_str, uuid_str) )

        log.info("Sending worker terminal packets")
        for w in workers:
            in_queue.put(None)

    except:
        log.info("Terminating workers")
        for w in workers:
            w.terminate()

    finally:
        log.info("Waiting for workers to complete")
        for w in workers:
            w.join()
        log.info("Workers joined")

if __name__ == '__main__':
    main()


text:
pagerdash
========

A pagerduty dashboard, for viewing pagerduty alerts in a different way. In particular, the current
implementation focuses on visualizing how much pagerduty interrupts us. The hope is to refactor the metadash
project such that this can feel like a natural extension of metadash - ideally this would become metadash-pagerduty at some point.

Here's a sample screenshot, but be warned, much of the functionality is incomplete (i.e. the entire top navbar)

![ScreenShot](https://raw.githubusercontent.com/anowell/pagerdash/master/pagerdash-screenshot.png)

setup
=====

Create config.js in the root directory. For better or worse, this is currently an exported js object.

    (function(exports){

        'use strict';
        exports.access = {
            authToken: "<PAGERDUTY_AUTHTOKEN>",
            subdomain: "<PAGERDUTY_SUBDOMAIN>"
        };

        exports.links = {
            weekly : [
                {
                    label: 'All Engineering',
                    query: '?service=<SERVICEID1>|<SERVICEID2>|<SERVICEID3>'
                },
                {
                    label: 'Engineering Subset',
                    query: '?service=<SERVICEID1>'
                },
                {
                    label: 'Non Engineering',
                    query: '?service=<SERVICEID4>'
                },
                {
                    label: 'Everything',
                    query: ''
                }
            ]
        }

    })(typeof exports === 'undefined'? this.pagerduty={} : exports);

Test the config with grunt dev server:

    npm install grunt-cli -g
    npm install bower -g
    npm install
    bower install
    grunt server

Or to build a production release (not yet tested) to the dist folder:

    grunt build

For production, drop the config.js into the dist directory,
and configure a webserver to serve it statically and proxy api requests with the pagerduty auth token.

I'll add a sample nginx config when I get to that point.


text:
        <meta charset="utf-8">

        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="stylesheet" href="lib/reset.css" />

dynamic data update tooltip content and keep show

dynamicData.html

dynamicData2.html

dynamicData3.html

triggerOn: click, setOption when trigger axis (keep show)

tooltip should auto show and auto disappear when setOption(..., {notMerge: true})


text:
namespace exotica
{
/// \brief Arbitrarily constrained end-pose problem implementation
class EndPoseProblem : public PlanningProblem, public Instantiable<EndPoseProblemInitializer>
{
public:
    EndPoseProblem();
    virtual ~EndPoseProblem();

    void Instantiate(const EndPoseProblemInitializer& init) override;
    void Update(Eigen::VectorXdRefConst x);
    bool IsValid() override;

    void SetGoal(const std::string& task_name, Eigen::VectorXdRefConst goal);
    void SetRho(const std::string& task_name, const double& rho);
    Eigen::VectorXd GetGoal(const std::string& task_name);
    double GetRho(const std::string& task_name);
    void SetGoalEQ(const std::string& task_name, Eigen::VectorXdRefConst goal);
    void SetRhoEQ(const std::string& task_name, const double& rho);
    Eigen::VectorXd GetGoalEQ(const std::string& task_name);
    double GetRhoEQ(const std::string& task_name);
    void SetGoalNEQ(const std::string& task_name, Eigen::VectorXdRefConst goal);
    void SetRhoNEQ(const std::string& task_name, const double& rho);
    Eigen::VectorXd GetGoalNEQ(const std::string& task_name);
    double GetRhoNEQ(const std::string& task_name);
    void PreUpdate() override;
    Eigen::MatrixXd GetBounds() const;

    double GetScalarCost();
    Eigen::RowVectorXd GetScalarJacobian();
    double GetScalarTaskCost(const std::string& task_name) const;
    Eigen::VectorXd GetEquality();
    Eigen::MatrixXd GetEqualityJacobian();
    Eigen::VectorXd GetInequality();
    Eigen::MatrixXd GetInequalityJacobian();

    EndPoseTask cost;
    EndPoseTask inequality;
    EndPoseTask equality;

    Eigen::MatrixXd W;
    TaskSpaceVector Phi;
    Eigen::MatrixXd jacobian;
    Hessian hessian;

    int length_Phi;
    int length_jacobian;
    int num_tasks;
    bool use_bounds;
};
typedef std::shared_ptr<exotica::EndPoseProblem> EndPoseProblemPtr;
}  // namespace exotica

#endif  // EXOTICA_CORE_END_POSE_PROBLEM_H_


text:
layout: post
title:  "Revivify"
date:   2015-01-02
sources: [PHB.272, SRD.175]
tags: [artificer, cleric, druid, paladin, ranger, level3, action, necromancy]
subtags: [warlock: celestial]
---

**3rd-level necromancy**

**Casting Time**: 1 action

**Range**: Touch

**Components**: V, S, M (diamonds worth 300 gp, which the spell consumes)

**Duration**: Instantaneous

You touch a creature that has died within the last minute. That creature returns to life with 1 hit point. This spell can't return to life a creature that has died of old age, nor can it restore any missing body parts.


text:
using System;
using NPoco;

namespace Xpressive.Home.Contracts.Rooms
{
    [TableName("Room")]
    [PrimaryKey("Id", AutoIncrement = false)]
    public class Room
    {
        public Guid Id { get; set; }
        public string Name { get; set; }
        public int SortOrder { get; set; }
        public string Icon { get; set; }
    }
}


text:
use futures::compat::Future01CompatExt;
use futures::prelude::*;
use std::time::Instant;
use tokio::runtime::Runtime;
use tokio::timer::Delay;

#[test]
fn can_use_01_futures_in_a_03_future_running_on_a_01_executor() {
    let f = async { Delay::new(Instant::now()).compat().await };

    let mut runtime = Runtime::new().unwrap();
    runtime.block_on(f.boxed().compat()).unwrap();
}


text:
package com.query.mongomath.test;

import java.util.ArrayList;
import java.util.List;

import org.bson.Document;
import org.junit.Test;

import com.query.mongomath.DBQueryBuilder;
import com.query.mongomath.WrongFormatException;

public class QueryBuilderTester
{

	@Test
	public void test() throws WrongFormatException{

		List<String> list = new ArrayList<String>();

		list.add("key1=value1");
		list.add("key2>value2");
		list.add("key3!=value3");
		list.add("key4.metric.name = %abc , key5.metric.avg > 34.56");
		list.add("key4.metric.count>100");

		System.out.println("Input: " + list);
		Document doc = DBQueryBuilder.createQuery(list);
		System.out.println("Output: " + doc.toJson());
	}

}


text:
package edu.vt.cbil.visda.data;

import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;

/**
 * Created with Eclipse
 * Author: Huai Li
 * Date: July 14, 2005
 *
 */

/**
 * A dataset to represent raw experimental expression values, or otherwise
 * calculated double values.
 */
public class FloatDataSet implements RawDataSet {

	// added by JJW;  Sep 29, 2005
    /**
     * the name of the dataset file
     */
    private String dataSetName;

	// added by JJW;  Sep 12, 2005
    /**
     * the complete list of user defined label types in the data
     */
    private ArrayList labelKeyNames;

    /**
     * the complete list of user defined attributes in the data
     */
    private ArrayList attributeNames;

	/**
	 * a placeholder for calls to #nextRow
	 * @see #nextRow
	 */
	private int currentRow;

    /**
     * a Collection of Gene objects representing the data
     */
    private ArrayList genes;

    /**
     * number of columns
     */
    private int nColumns;

    /**
     * number of rows
     */
    private int nRows;

    /**
     * our superset, if any
     */
    private RawDataSet parent;

    /**
     * a Collection of Sample objects representing the data
     */
    private ArrayList samples;

    /**
     * the location from which we came.
     */
    private File file;

    /**
     * the matrix of ternary expression values.
     */
    private double[][] values;

    /**
     * True, iff init() has been called and postParsingInit() has not.
     *
     */
	private boolean isPopulating;

	/**
	 * the highest expression value in the data
	 */
	private double highest;

	/**
	 * the lowest expression value in the data
	 */
	private double lowest;

    public FloatDataSet() {
    	parent = null;
    	isPopulating = true;
    	attributeNames = new ArrayList();
    	labelKeyNames = new ArrayList();  // added by JJW; Sep 12, 2005
    	genes = new ArrayList();
    	samples = new ArrayList();
    	highest = -100;
    	lowest = 100;

    }

    /**
     * Create a new dataset by copying the genes, samples, and
     * attribute names passed in.
     * @param someGenes
     * @param someSamples
     * @param someValues
     * @param someAttributeNames
     * @param someParent
     */
    public FloatDataSet( ArrayList someGenes,
                            ArrayList someSamples,
                            double[][] someValues,
                            ArrayList someAttributeNames,
                            RawDataSet someParent ) {
    	genes = new ArrayList();
    	Iterator i = someGenes.iterator();
    	while (i.hasNext()) {
    		DefaultGene someGene = (DefaultGene)i.next();
    		genes.add( someGene.deepCopyFor( this ) );

    	}

    	samples = new ArrayList();
    	i = someSamples.iterator();
    	while ( i.hasNext() ) {
    		DefaultSample someSample = (DefaultSample)i.next();
    		samples.add( someSample.deepCopy() );

    	}
        nRows = genes.size();
        nColumns = samples.size();
        values = someValues;

        attributeNames = new ArrayList();
        i = someAttributeNames.iterator();
        while (i.hasNext()) {
        	attributeNames.add( new String( (String)i.next() ));

        }
        attributeNames = someAttributeNames;
        parent = someParent;
        findMaxAndMin();

    }

    /**
     * finds and sets the values of lowest and highest
     * @see #postParsingInit()
     *
     */
    private void findMaxAndMin() {
    	for( int i = values.length - 1; i >= 0; --i ) {
    		for ( int j = values[0].length - 1; j >=0; --j ) {
    			if ( values[i][j] < lowest )
    				lowest = values[i][j];
    			if ( values[i][j] > highest )
    				highest = values[i][j];

    		}

    	}

    }

    /**
     * Keep track of this new attribute ( non data column ) name
     */
    public void addAttributeName( String attName ) {
    	attributeNames.add( attName );
    }

    /**
     * answer a Collection of all Genes
     * @return a List of all genes in the order they are found in the file
     */
    public List getAllGenes() {
        return genes;
    }

    /**
     * answer a Collection of all Samples.
     * @return a List of all samples in the order they are found in the file
     */
    public List getAllSamples() {
        return samples;
    }
    /**
     * The Collection of Strings that the user has choosen to name the
     * columns in the data preceding sample names.
     *
     * @return a List of attributes names for the gene related data preceding
     * the expression values.
     */
    public List getAttributeNames() {
        return attributeNames;

    }

    /**
     * returns an entire column of expression values.  this method
     * must copy data to perform and is therefore inherently slow.
     *
     * @param col
     * @return a byte array copied from the matrix of data values
     */
    public double[] getColumn( int col ) {
        int rows = genes.size();
        double copy[] = new double[ rows ];
        for ( int i = 0; i < copy.length; ++i )
            copy[i] = values[i][col];

        return copy;

    }

    /**
     * returns an entire column of expression values.  this method
     * must copy data to perform and is therefore inherently slow.
     *
     * @param sample
     * @return a byte array copied from the matrix of data values
     */
    public double[] getColumn( Sample sample ) {
        return getColumn( samples.indexOf( sample ) );

    }

    /**
     * answer the Gene at the given, zero-indexed row
     * @param index
     * @return the Gene at index
     */
    public Gene getGene( int index ) {
        return (Gene)genes.get( index );
    }

    /**
     * returns an entire row of expression values
     *
     * @param gene
     * @return a byte array copied from the matrix of data values
     */
    public double[] getRow( Gene gene ) {
        return getRow( genes.indexOf( gene ) );

    }

    /**
     * returns an entire row of expressin values
     *
     * @param row
     * @return a byte array copied from the matrix of data values
     */
    public double[] getRow( int row ) {
        double[] copy = new double[ samples.size()];
        System.arraycopy( values[row], 0, copy, 0, samples.size() );
        return copy;

    }

    /**
     * answer the Sample at the given, zero-indexed col
     * @param index
     * @return the Gene at index
     */
    public Sample getSample( int index ) {
        return (Sample)samples.get( index );
    }

    /**
     * Answers a List of all DefaultSamples
     */
    public List getDataColumns() {
    	return samples;

    }

    /**
     * Answer the indexed DataRow instance
     */
    public DataRow getDataRow(int index) {
    	return (DataRow)genes.get(index);
    }

    /**
     * Answers a List of all DataRow instances
     */
    public List getDataRows() {
    	return genes;

    }

    /**
     * get the file
     * @return the File containing this dataSet
     */
    public File getFile() {
        return file;

    }

    public Object getValue( int row, int col ) {
    	return new Double( values[row][col] );

    }

    /**
     * return a single expersion value from the data
     *
     * @param geneIndex
     * @param sampleIndex
     * @return a single double denoting the value of the given gene
     * for the given sample
     */
    public double getDouble( int geneIndex, int sampleIndex ) {
        return values[geneIndex][sampleIndex];

    }

    /**
     * Allocate a byte array of the given size, and save the size
     * in nRow + nColumns
     */
    public void init( int rows, int cols ) {
    	nRows = rows;
    	nColumns = cols;
    	values = new double[nRows][nColumns];

    }

    /**
     * true iff the dataset has zero rows
     */
    public boolean isEmpty() {
    	return genes.size() == 0;

    }

    /**
     * Create the next QDataColumn from the given id.
     */
    public void nextColumn( String id ) {
    	if ( isPopulating ) {
    		DefaultSample sample = new DefaultSample( id );
    		samples.add( sample );

    	}

    }

    /**
     * Create the next QDataColumn from the given id.
     */
    public void nextColumn( int index, String id ) {
    	if ( isPopulating ) {
    		DefaultSample sample = new DefaultSample( index, id );
    		samples.add( sample );

    	}

    }

    /**
     * Answer the next DataRow to be populated by the parser.
     */
    public DataRow nextRow() {
    	DefaultGene gene;
    	if ( isPopulating ) {
	    	gene = new DefaultGene( this, currentRow );
	    	currentRow++;
	    	genes.add( gene );

    	} else
    		gene = null;

    	return gene;

    }

	/**
	 * Note that parsing is complete
	 */
	public void postParsingInit() {
		isPopulating = false;
		findMaxAndMin();
        nRows = genes.size();
        nColumns = samples.size();

	}

    /**
     * Set the file
     * @param aFile the File containing this dataSet
     */
    public void setFile( File aFile ) {
        file = aFile;

    }

    /**
     * Answer a snapshot of the data
     * @return a multiline, tab delimited string representing the data set.
     */
    public String toString() {
        StringBuffer buf =
                new StringBuffer( "FloatDataSet " + nRows + " " + nColumns + DataManager.eol);
        for ( int i = 0; i < nRows; ++i ) {
            for ( int j = 0; j < nColumns; ++j ) {
                buf.append( values[i][j] + "\t" );
            }
            buf.append( DataManager.eol );

        }
        return buf.toString();

    }

    /**
     * accessor for lowest value in dataset.
     */
	public double getLowest() {
		return lowest;
	}

	/**
	 * accessor for highest value in dataset.
	 */
	public double getHighest() {
		return highest;
	}

	public void addDataValue(String data, int row, int column) {
		Double doubleObject = new Double(data);
    	values[row][column] = doubleObject.doubleValue();

	}

	public String getEmptyDataValue() {
		return "0.0";
	}

	// added by JJW; Sep 12, 2005
	/**
     * Keep track of this new label key ( non data column ) name
     */
    public void addLabelKeyName( String keyName ) {
    	labelKeyNames.add( keyName );
    }

    /**
     * The Collection of Strings that the user has choosen to name the
     * rows preceding the expression values.
     *
     * @return a List of label key names for the sample related data preceding
     * the expression values.
     */
    public List getLabelKeyNames() {
        return labelKeyNames;
    }

    // added by JJW; Sep 29, 2005
    /**
     * Set the name of this Dataset
     */
    public void setDatasetName( String name ) {
    	dataSetName = name;
    }

    /**
     * Get the name of this Dataset
     */
    public String getDatasetName() {
    	return dataSetName;
    }

}


text:
F.ModelComponent = new PseudoClass(/** @lends F.ModelComponent# */{
	toString: 'ModelComponent',
	extend: F.Component,
	/**
		A component that can load and render a model

		@constructs
		@extends F.Component

		@param {Object}		options			Options for this component
		@param {Object}		options.Model	Model class this component will be operating on. Sets this.Model

		@property {Backbone.Model}	Model	The model class to operate on. Not an instance of a model, but the model class itself.
	*/
	construct: function(options) {
		this.Model = this.Model || options.Model;
	},

	Model: Backbone.Model,

	/**
		Refresh the model

		@param {Function}	callback	Callback to call after successful refresh

		@returns {F.ModelComponent}	this, chainable
	*/
	refresh: function(callback) {
		this.trigger('model:loading', {
			model: this.model
		});

		this.model.fetch({
			success: function(model, response) {
				// Allow handleLoadSuccess to cancel triggers
				var trigger = true;
				if (typeof this.handleLoadSuccess === 'function')
					trigger = (this.handleLoadSuccess(this.model, response) === false) ? false : true;

				if (trigger) {
					// Trigger model event
					this.model.trigger('loaded');

					// Trigger component event
					this.trigger('model:loaded', {
						model: this.model
					});

					// Call callback
					if (typeof callback === 'function')
						callback.call(this, this.model);
				}
			}.bind(this),
			error: function(model, response) {
				console.warn('%s: Error loading model', this.toString());

				this.trigger('model:loadFailed', {
					model: this.model,
					response: response
				});

				if (typeof this.handleLoadError === 'function')
					this.handleLoadError(this.model, response);
			}.bind(this)
		});

		return this;
	},

	/**
		Use a different item model

		@param {Backbone.Model}		model	The model to use

		@returns {F.ModelComponent}	this, chainable
	*/
	_setModel: function(model) {
		this.model = model;

		if (this.model && this.model.off && this.view) {
			this.view.setModel(model);
		}

		// Emit an event when the model changes
		if (this.model && this.model.on) {
			this.listenTo(this.model, 'change', this._triggerChange);
		}

		return this;
	},

	/** @ignore */
	_triggerChange: function() {
		this.trigger('model:changed', {
			model: this.model
		});
	},

	/**
		Fetch a model with the given ID

		@param {String}		itemId		ID of the item to fetch
		@param {Function}	[callback]	Callback to execute on successful fetch

		@returns {F.ModelComponent}	this, chainable
	*/
	fetch: function(itemId, callback) {
		var data = {};
		if (itemId !== undefined) { // add the ID passed to the model data
			data[this.Model.prototype.idAttribute] = itemId;
		}

		this.trigger('model:loading', {
			model: this.model
		});

		// Create a blank model
		var model = new this.Model(data);

		// Fetch model contents
		model.fetch({
			// TBD: add fetch options?
			success: function(model, response) {
				// Assign the model to the view
				this._setModel(model);

				var trigger = this._handleLoadComplete(response);
				if (trigger) {
					// Only callback of handleLoadSuccess didn't return false
					if (typeof callback === 'function') {
						callback.call(this, this.model);
					}
				}
			}.bind(this),
			error: function(model, response) {
				console.warn('%s: Error loading model', this.toString());

				this.trigger('model:loadFailed', {
					model: this.model,
					response: response
				});

				if (typeof this.handleLoadError === 'function')
					this.handleLoadError(this.model, response);
			}.bind(this)
		});

		return this;
	},

	/** @ignore */
	_handleLoadComplete: function(response) {
		// Allow handleLoadSuccess to cancel triggers
		var trigger = true;
		if (typeof this.handleLoadSuccess === 'function') {
			trigger = (this.handleLoadSuccess(this.model, response || { local: true }) === false) ? false : true;
		}

		if (trigger) {
			// Notify
			this.trigger('model:loaded', {
				model: this.model
			});
		}

		return trigger;
	},

	/**
		Load a Backbone.Model directly or create a model from data

		@param {mixed}	modelOrData		Backbone.Model to load or Object with data to create model from

		@returns {F.ModelComponent}	this, chainable
	*/
	load: function(modelOrData) {
		if (modelOrData instanceof Backbone.Model)
			this._setModel(modelOrData);
		else
			this._setModel(new this.Model(modelOrData));

		this._handleLoadComplete();

		return this;
	},

	/**
		Save a model to the server

		@param {Object}		data		Data to apply to model before performing save
		@param {Function}	callback	Callback to execute on success/failure. Passed an error, the model, and the response from the server
		@param {Object}		options		Options to pass when calling model.save

		@returns {F.ModelComponent}	this, chainable
	*/
	save: function(data, callback, options) {
		if (this.model) {
			if (this.inDebugMode())
				console.log('%s: Saving...', this.toString());

			this.trigger('model:saving', {
				model: this.model
			});

			this.model.save(data || {}, _.extend({
				success: function(model, response) {
					if (this.inDebugMode())
						console.log('%s: Save successful', this.toString());

					if (typeof callback === 'function')
						callback.call(this, null, this.model, response);

					if (typeof this.handleSaveSuccess === 'function')
						this.handleSaveSuccess(this.model, response);

					this.trigger('model:saved', {
						model: this.model,
						response: response
					});
				}.bind(this),
				error: function(model, response) {
					console.warn('%s: Error saving model', this.toString());

					if (typeof callback === 'function')
						callback.call(this, new Error('Error saving model'), this.model, response);

					if (typeof this.handleSaveError === 'function')
						this.handleSaveError(this.model, response);

					this.trigger('model:saveFailed', {
						model: this.model,
						response: response
					});
				}.bind(this)
			}, options));
		}
		else {
			console.warn('%s: Cannot save, model is not truthy', this.toString());
		}
		return this;
	},

	/**
		Show this component, optionally fetching an item by ID or assigning a new model before render

		@param {Object}			options			Show options
		@param {String}			options.id		ID of model to fetch from the server before showing
		@param {Backbone.Model}	options.model	Model to use directly (don't fetch)

		@returns {F.ModelComponent}	this, chainable
	*/
	show: function(options) {
		options = options || {};

		if (options.id) {
			if (this.inDebugMode()) {
				console.log('%s: fetching item with ID %s', this.toString(), options.id);
			}

			// Load the model by itemId, then show
			this.fetch(options.id, function(model) {
				if (this.inDebugMode()) {
					console.log('%s: fetch complete!', this.toString());
				}
				this.show({
					silent: options.silent
				}); // pass nothing to show and the view will re-render
			});
		}
		else if (options.model) {
			if (this.inDebugMode()) {
				console.log('%s: showing with new model', this.toString(), options.model);
			}

			this.load(options.model);
			this.show({
				silent: options.silent
			});
		}
		else {
			this._super.apply(this, arguments);
		}

		return this;
	}

	/**
		Called when a model has been loaded successfully

		@param {Backbone.Model}	model		The model that was to loaded
		@param {Object}			response	The response from Backbone

		@returns {Boolean}	If false is returned, events will not be triggered and the callback will not be called

		@name handleLoadSuccess
		@memberOf F.ModelComponent.prototype
		@function
	*/

	/**
		Called when a model fails to load

		@param {Backbone.Model}	model		The model that failed to load
		@param {Object}			response	The response from Backbone

		@name handleLoadError
		@memberOf F.ModelComponent.prototype
		@function
	*/

	/**
		Called when a model has been saved successfully

		@param {Backbone.Model}	model		The model that was saved
		@param {Object}			response	The response from Backbone

		@name handleSaveSuccess
		@memberOf F.ModelComponent.prototype
		@function
	*/

	/**
		Called when a model fails to save

		@param {Backbone.Model}	model		The model that failed to save
		@param {Object}			response	The response from Backbone

		@name handleSaveError
		@memberOf F.ModelComponent.prototype
		@function
	*/

	/**
		Triggered when a model is saving

		@name F.ModelComponent#model:saving
		@event

		@param {Object}			evt			Event object
		@param {Backbone.Model}	evt.model	The model that was saved
	*/

	/**
		Triggered when save is unsuccessful

		@name F.ModelComponent#model:saveFailed
		@event

		@param {Object}			evt				Event object
		@param {Backbone.Model}	evt.model		The model that failed to save
		@param {Object}			evt.response	Response from the server
	*/

	/**
		Triggered after a successful save

		@name F.ModelComponent#model:saved
		@event

		@param {Object}			evt				Event object
		@param {Backbone.Model}	evt.model		The model that was saved
		@param {Object}			evt.response	Response from the server
	*/

	/**
		Triggered when the model is being loaded from the server

		@name F.ModelComponent#model:loading
		@event

		@param {Object}			evt			Event object
		@param {Backbone.Model}	evt.model	The model that was loaded
	*/

	/**
		Triggered when load is unsuccessful

		@name F.ModelComponent#model:loadFailed
		@event

		@param {Object}			evt				Event object
		@param {Backbone.Model}	evt.model		The model that failed to load
		@param {Object}			evt.response	Response from the server
	*/

	/**
		Triggered when the model is loaded from the server or passed to load()

		@name F.ModelComponent#model:loaded
		@event

		@param {Object}			evt			Event object
		@param {Backbone.Model}	evt.model	The model that was loaded
	*/

	/**
		Triggered when the model is changed locally

		@name F.ModelComponent#model:changed
		@event

		@param {Object}			evt			Event object
		@param {Backbone.Model}	evt.model	The model that was loaded
	*/
});


text:
import { moduleForModel, test } from 'ember-qunit';

moduleForModel('app', 'Unit | Model | app', {
  // Specify the other units that are required for this test.
  needs: []
});

test('Basic creation test', function(assert) {
  let model = this.subject();

  assert.ok(model);
  assert.ok(model.needs);
  assert.ok(model.appID);
});

test('appID test', function(assert) {
  let model = this.subject({
        entityID: "tez_1_2_3",
      });

  assert.equal(model.get("appID"), "1_2_3");
});


text:
package org.codehaus.mojo.natives.plugin;

import java.io.File;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProjectHelper;
import org.codehaus.mojo.natives.NativeSources;
import org.codehaus.plexus.archiver.util.DefaultFileSet;
import org.codehaus.plexus.archiver.zip.ZipArchiver;

/**
 * Prepare include file bundle to be attached to maven for deployment purpose
 * @since 1.0-alpha-4
 */
@Mojo(name = "inczip", defaultPhase = LifecyclePhase.PACKAGE)
public class NativeBundleIncludeFilesMojo
    extends AbstractNativeMojo
{

    /**
     * Array of NativeSources containing include directories and source files.
     * @since 1.0-alpha-4
     */
    @Parameter
    private NativeSources[] sources = new NativeSources[0];

    /**
     * Archive file to bundle all enable NativeSources
     * @since 1.0-alpha-4
     */
    @Parameter(defaultValue = "${project.build.directory}/${project.build.finalName}.inczip", required = true)
    private File incZipFile;

    /**
     * Option to skip include source bundle deployment
     * @since 1.0-alpha-4
     */
    @Parameter(defaultValue = "false")
    private boolean skipIncludeDeployment;

    /**
     * Maven ProjectHelper.
     * @since 1.0-alpha-4
     */
    @Component
    private MavenProjectHelper projectHelper;

    public void execute()
        throws MojoExecutionException
    {
        if ( skipIncludeDeployment )
        {
            return;
        }

        if ( this.sources.length != 0 )
        {
            try
            {
                ZipArchiver archiver = new ZipArchiver();

                boolean zipIt = false;
                for ( int i = 0; i < sources.length; ++i )
                {
                    if ( sources[i].isDeployable() )
                    {
                        DefaultFileSet fileSet = new DefaultFileSet();
                        fileSet.setUsingDefaultExcludes( true );
                        fileSet.setDirectory( sources[i].getDirectory() );
                        fileSet.setIncludes( sources[i].getIncludes() );
                        fileSet.setExcludes( sources[i].getExcludes() );
                        archiver.addFileSet( fileSet );
                        zipIt = true;
                    }
                }

                if ( zipIt )
                {
                    archiver.setDestFile( this.incZipFile );
                    archiver.createArchive();
                    projectHelper.attachArtifact( this.project, INCZIP_TYPE, null, this.incZipFile );
                }
            }
            catch ( Exception e )
            {
                throw new MojoExecutionException( e.getMessage(), e );
            }
        }
    }

}


text:
/*
 |  _   ____   ____   _
 | ⎛ |‾|  ⚈ |-| ⚈  |‾| ⎞
 | ⎝ |  ‾‾‾‾| |‾‾‾‾  | ⎠
 |  ‾        ‾        ‾
 */

#import <UIKit/UIKit.h>

//! Project version number for SharedHelpers.
FOUNDATION_EXPORT double SharedHelpersVersionNumber;

//! Project version string for SharedHelpers.
FOUNDATION_EXPORT const unsigned char SharedHelpersVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <SharedHelpers/PublicHeader.h>


text:
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/net/cross_origin_opener_policy_reporter.h"

#include "base/memory/raw_ptr.h"
#include "base/values.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/render_frame_host_delegate.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_frame_proxy_host.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/storage_partition.h"
#include "net/base/network_anonymization_key.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/source_location.mojom.h"
#include "url/origin.h"

namespace content {

namespace {

// Report attribute names (camelCase):
constexpr char kColumnNumber[] = "columnNumber";
constexpr char kDisposition[] = "disposition";
constexpr char kEffectivePolicy[] = "effectivePolicy";
constexpr char kInitialPopupURL[] = "initialPopupURL";
constexpr char kLineNumber[] = "lineNumber";
constexpr char kNextURL[] = "nextResponseURL";
constexpr char kOpeneeURL[] = "openeeURL";
constexpr char kOpenerURL[] = "openerURL";
constexpr char kOtherDocumentURL[] = "otherDocumentURL";
constexpr char kPreviousURL[] = "previousResponseURL";
constexpr char kProperty[] = "property";
constexpr char kReferrer[] = "referrer";
constexpr char kSourceFile[] = "sourceFile";
constexpr char kType[] = "type";

// Report attribute values:
constexpr char kDispositionEnforce[] = "enforce";
constexpr char kDispositionReporting[] = "reporting";
constexpr char kTypeFromResponse[] = "navigation-from-response";
constexpr char kTypeToResponse[] = "navigation-to-response";

std::string ToString(network::mojom::CrossOriginOpenerPolicyValue coop_value) {
  switch (coop_value) {
    case network::mojom::CrossOriginOpenerPolicyValue::kUnsafeNone:
      return "unsafe-none";
    case network::mojom::CrossOriginOpenerPolicyValue::kSameOrigin:
      return "same-origin";
    case network::mojom::CrossOriginOpenerPolicyValue::kSameOriginAllowPopups:
      return "same-origin-allow-popups";
    case network::mojom::CrossOriginOpenerPolicyValue::kRestrictProperties:
      return "restrict-properties";
    case network::mojom::CrossOriginOpenerPolicyValue::kSameOriginPlusCoep:
      return "same-origin-plus-coep";
    case network::mojom::CrossOriginOpenerPolicyValue::
        kRestrictPropertiesPlusCoep:
      return "restrict-properties-plus-coep";
  }
}

FrameTreeNode* TopLevelOpener(FrameTreeNode* frame) {
  FrameTreeNode* opener =
      frame->first_live_main_frame_in_original_opener_chain();
  return opener ? opener->frame_tree()->root() : nullptr;
}

// Remove sensitive data from URL used in reports.
std::string SanitizedURL(const GURL& url) {
  // Strip username, password and ref fragment from the URL.
  // Keep only the valid http/https ones.
  //
  // Note: This is the exact same operation used in
  // ReportingServiceImpl::QueueReport() for the |url|.
  return url.GetAsReferrer().spec();
}

class Receiver final : public network::mojom::CrossOriginOpenerPolicyReporter {
 public:
  Receiver(content::CrossOriginOpenerPolicyReporter* reporter,
           std::string initial_popup_url)
      : reporter_(reporter), initial_popup_url_(initial_popup_url) {}
  ~Receiver() final = default;
  Receiver(const Receiver&) = delete;
  Receiver& operator=(const Receiver&) = delete;

 private:
  void QueueAccessReport(network::mojom::CoopAccessReportType report_type,
                         const std::string& property,
                         network::mojom::SourceLocationPtr source_location,
                         const std::string& reported_window_url) final {
    reporter_->QueueAccessReport(report_type, property,
                                 std::move(source_location),
                                 reported_window_url, initial_popup_url_);
  }

  // |reporter_| is always valid, because it owns |this|.
  raw_ptr<const content::CrossOriginOpenerPolicyReporter> reporter_;
  const std::string initial_popup_url_;
};

}  // namespace

CrossOriginOpenerPolicyReporter::CrossOriginOpenerPolicyReporter(
    StoragePartition* storage_partition,
    const GURL& context_url,
    const GURL& context_referrer_url,
    const network::CrossOriginOpenerPolicy& coop,
    const base::UnguessableToken& reporting_source,
    const net::NetworkAnonymizationKey& network_anonymization_key)
    : storage_partition_(storage_partition),
      reporting_source_(reporting_source),
      context_url_(context_url),
      context_referrer_url_(SanitizedURL(context_referrer_url)),
      coop_(coop),
      network_anonymization_key_(network_anonymization_key) {
  DCHECK(!reporting_source_.is_empty());
}

CrossOriginOpenerPolicyReporter::~CrossOriginOpenerPolicyReporter() = default;

network::mojom::CrossOriginOpenerPolicyReporterParamsPtr
CrossOriginOpenerPolicyReporter::CreateReporterParams(
    bool access_from_coop_page,
    FrameTreeNode* accessing_node,
    FrameTreeNode* accessed_node) {
  bool endpoint_defined =
      coop_.report_only_reporting_endpoint || coop_.reporting_endpoint;

  using network::mojom::CoopAccessReportType;
  CoopAccessReportType report_type;
  if (access_from_coop_page) {
    if (accessing_node == TopLevelOpener(accessed_node))
      report_type = CoopAccessReportType::kAccessFromCoopPageToOpenee;
    else if (accessed_node == TopLevelOpener(accessing_node))
      report_type = CoopAccessReportType::kAccessFromCoopPageToOpener;
    else
      report_type = CoopAccessReportType::kAccessFromCoopPageToOther;
  } else {
    if (accessed_node == TopLevelOpener(accessing_node))
      report_type = CoopAccessReportType::kAccessToCoopPageFromOpenee;
    else if (accessing_node == TopLevelOpener(accessed_node))
      report_type = CoopAccessReportType::kAccessToCoopPageFromOpener;
    else
      report_type = CoopAccessReportType::kAccessToCoopPageFromOther;
  }

  RenderFrameHostImpl* accessing_rfh = accessing_node->current_frame_host();
  RenderFrameHostImpl* accessed_rfh = accessed_node->current_frame_host();
  bool same_origin = accessing_rfh->GetLastCommittedOrigin().IsSameOriginWith(
      accessed_rfh->GetLastCommittedOrigin());
  RenderFrameHostImpl* reported_rfh =
      access_from_coop_page ? accessed_rfh : accessing_rfh;
  RenderFrameHostImpl* reporting_rfh =
      access_from_coop_page ? accessing_rfh : accessed_rfh;
  std::string reported_window_url =
      same_origin ? SanitizedURL(reported_rfh->GetLastCommittedURL()) : "";

  // If the COOP window is the opener, and the other window's popup creator is
  // same-origin with the COOP document, the openee' initial popup URL is
  // reported.
  std::string reported_initial_popup_url;
  if (report_type == CoopAccessReportType::kAccessFromCoopPageToOpenee ||
      report_type == CoopAccessReportType::kAccessToCoopPageFromOpenee) {
    if (reporting_rfh->GetLastCommittedOrigin().IsSameOriginWith(
            reported_rfh->frame_tree_node()->popup_creator_origin())) {
      reported_initial_popup_url =
          SanitizedURL(reported_rfh->frame_tree_node()->initial_popup_url());
    }
  }

  // Warning: Do not send cross-origin sensitive data. They will be read from:
  // 1) A potentially compromised renderer (the accessing window).
  // 2) A network server (defined from the reporter).
  mojo::PendingRemote<network::mojom::CrossOriginOpenerPolicyReporter>
      remote_reporter;
  receiver_set_.Add(
      std::make_unique<Receiver>(this, reported_initial_popup_url),
      remote_reporter.InitWithNewPipeAndPassReceiver());

  return network::mojom::CrossOriginOpenerPolicyReporterParams::New(
      report_type, std::move(remote_reporter), endpoint_defined,
      reported_window_url);
}

void CrossOriginOpenerPolicyReporter::QueueNavigationToCOOPReport(
    const GURL& previous_url,
    bool same_origin_with_previous,
    bool is_report_only) {
  const absl::optional<std::string>& endpoint =
      is_report_only ? coop_.report_only_reporting_endpoint
                     : coop_.reporting_endpoint;
  if (!endpoint)
    return;

  base::Value::Dict body;
  body.Set(kDisposition,
           is_report_only ? kDispositionReporting : kDispositionEnforce);
  body.Set(kPreviousURL,
           same_origin_with_previous ? SanitizedURL(previous_url) : "");
  body.Set(kReferrer, context_referrer_url_);
  body.Set(kType, kTypeToResponse);
  QueueNavigationReport(std::move(body), *endpoint, is_report_only);
}

void CrossOriginOpenerPolicyReporter::QueueNavigationAwayFromCOOPReport(
    const GURL& next_url,
    bool is_current_source,
    bool same_origin_with_next,
    bool is_report_only) {
  const absl::optional<std::string>& endpoint =
      is_report_only ? coop_.report_only_reporting_endpoint
                     : coop_.reporting_endpoint;
  if (!endpoint)
    return;

  std::string sanitized_next_url;
  if (is_current_source || same_origin_with_next)
    sanitized_next_url = SanitizedURL(next_url);
  base::Value::Dict body;
  body.Set(kNextURL, sanitized_next_url);
  body.Set(kType, kTypeFromResponse);
  QueueNavigationReport(std::move(body), *endpoint, is_report_only);
}

void CrossOriginOpenerPolicyReporter::QueueAccessReport(
    network::mojom::CoopAccessReportType report_type,
    const std::string& property,
    network::mojom::SourceLocationPtr source_location,
    const std::string& reported_window_url,
    const std::string& initial_popup_url) const {
  // Cross-Origin-Opener-Policy-Report-Only is not required to provide
  // endpoints.
  if (!coop_.report_only_reporting_endpoint)
    return;

  const std::string& endpoint = coop_.report_only_reporting_endpoint.value();

  DCHECK(base::FeatureList::IsEnabled(
      network::features::kCrossOriginOpenerPolicy));

  base::Value::Dict body;
  body.Set(kType, network::CoopAccessReportTypeToString(report_type));
  body.Set(kDisposition, kDispositionReporting);
  body.Set(kEffectivePolicy, ToString(coop_.report_only_value));
  body.Set(kProperty, property);
  if (network::IsAccessFromCoopPage(report_type) &&
      source_location->url != "") {
    body.Set(kSourceFile, source_location->url);
    body.Set(kLineNumber, static_cast<int>(source_location->line));
    body.Set(kColumnNumber, static_cast<int>(source_location->column));
  }

  switch (report_type) {
    // Reporter is the openee:
    case network::mojom::CoopAccessReportType::kAccessFromCoopPageToOpener:
    case network::mojom::CoopAccessReportType::kAccessToCoopPageFromOpener:
      body.Set(kOpenerURL, reported_window_url);
      body.Set(kReferrer, context_referrer_url_);
      break;

    // Reporter is the opener:
    case network::mojom::CoopAccessReportType::kAccessFromCoopPageToOpenee:
    case network::mojom::CoopAccessReportType::kAccessToCoopPageFromOpenee:
      body.Set(kOpeneeURL, reported_window_url);
      body.Set(kInitialPopupURL, initial_popup_url);
      break;

    // Other:
    case network::mojom::CoopAccessReportType::kAccessFromCoopPageToOther:
    case network::mojom::CoopAccessReportType::kAccessToCoopPageFromOther:
      body.Set(kOtherDocumentURL, reported_window_url);
      break;
  }

  storage_partition_->GetNetworkContext()->QueueReport(
      "coop", endpoint, context_url_, reporting_source_,
      network_anonymization_key_, absl::nullopt, std::move(body));
}

void CrossOriginOpenerPolicyReporter::QueueNavigationReport(
    base::Value::Dict body,
    const std::string& endpoint,
    bool is_report_only) {
  body.Set(kDisposition,
           is_report_only ? kDispositionReporting : kDispositionEnforce);
  body.Set(kEffectivePolicy,
           ToString(is_report_only ? coop_.report_only_value : coop_.value));
  storage_partition_->GetNetworkContext()->QueueReport(
      "coop", endpoint, context_url_, reporting_source_,
      network_anonymization_key_,
      /*user_agent=*/absl::nullopt, std::move(body));
}

}  // namespace content


text:
from django.conf import settings
from django_mako_plus.controller import view_function
from .. import dmp_render, dmp_render_to_response
from django import forms
from lib.custform import CustomForm
from lib.custform import DataStoreForm
from django.http import HttpResponse
from homepage import models as hmod
import os.path
from lib.uploadWidget import FileUploader

# function to upload files
def handle_uploaded_file(file_request_object, file_path):
    with open(file_path, 'wb+') as destination:
        for chunk in file_request_object.chunks():
            destination.write(chunk)

@view_function
def process_request(request):
	template_vars = {}

	form = UploaderForm()
	if request.method == 'POST':
		form = UploaderForm(request.POST)
		if form.is_valid():
			print('>>>>> main form', form.cleaned_data['upload_fullname'])
			form = UploaderForm()

	template_vars['form'] = form
	return dmp_render_to_response(request, 'uploader.html', template_vars)

class UploaderForm(forms.Form):
	name = forms.CharField()
	upload_fullname = forms.CharField(widget=forms.HiddenInput)
	upload_file = forms.FileField(required=False, widget=FileUploader)

@view_function
def upload(request):
	# take request.FILES and save the bytes to disk somewhere
	filename = request.FILES['upload'].name
	fullname = os.path.join('homepage/media/files', filename)

	# use function to upload file
	handle_uploaded_file(request.FILES['upload'], fullname)

	# return
	return HttpResponse(filename)


text:
package Paws::Pinpoint::UpdateSmsChannel;
  use Moose;
  has ApplicationId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'application-id', required => 1);
  has SMSChannelRequest => (is => 'ro', isa => 'Paws::Pinpoint::SMSChannelRequest', required => 1);

  use MooseX::ClassAttribute;
  class_has _stream_param => (is => 'ro', default => 'SMSChannelRequest');
  class_has _api_call => (isa => 'Str', is => 'ro', default => 'UpdateSmsChannel');
  class_has _api_uri  => (isa => 'Str', is => 'ro', default => '/v1/apps/{application-id}/channels/sms');
  class_has _api_method  => (isa => 'Str', is => 'ro', default => 'PUT');
  class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::Pinpoint::UpdateSmsChannelResponse');
  class_has _result_key => (isa => 'Str', is => 'ro');
1;

### main pod documentation begin ###

=head1 NAME

Paws::Pinpoint::UpdateSmsChannel - Arguments for method UpdateSmsChannel on Paws::Pinpoint

=head1 DESCRIPTION

This class represents the parameters used for calling the method UpdateSmsChannel on the
Amazon Pinpoint service. Use the attributes of this class
as arguments to method UpdateSmsChannel.

You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to UpdateSmsChannel.

As an example:

  $service_obj->UpdateSmsChannel(Att1 => $value1, Att2 => $value2, ...);

Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.

=head1 ATTRIBUTES

=head2 B<REQUIRED> ApplicationId => Str

=head2 B<REQUIRED> SMSChannelRequest => L<Paws::Pinpoint::SMSChannelRequest>

=head1 SEE ALSO

This class forms part of L<Paws>, documenting arguments for method UpdateSmsChannel in L<Paws::Pinpoint>

=head1 BUGS and CONTRIBUTIONS

The source code is located here: https://github.com/pplu/aws-sdk-perl

Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues

=cut


text:
package org.apache.cloudstack.api.response;

import java.util.Date;

import com.google.gson.annotations.SerializedName;

import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;

import com.cloud.alert.Alert;
import com.cloud.serializer.Param;

@EntityReference(value = Alert.class)
@SuppressWarnings("unused")
public class AlertResponse extends BaseResponse {
    @SerializedName(ApiConstants.ID)
    @Param(description = "the id of the alert")
    private String id;

    @SerializedName(ApiConstants.TYPE)
    @Param(description = "One of the following alert types: "
        + "MEMORY = 0, CPU = 1, STORAGE = 2, STORAGE_ALLOCATED = 3, PUBLIC_IP = 4, PRIVATE_IP = 5, SECONDARY_STORAGE = 6, "
        + "HOST = 7, USERVM = 8, DOMAIN_ROUTER = 9, CONSOLE_PROXY = 10, "
        + "ROUTING = 11: lost connection to default route (to the gateway), "
        + "STORAGE_MISC = 12, USAGE_SERVER = 13, MANAGMENT_NODE = 14, DOMAIN_ROUTER_MIGRATE = 15, CONSOLE_PROXY_MIGRATE = 16, "
        + "USERVM_MIGRATE = 17, VLAN = 18, SSVM = 19, USAGE_SERVER_RESULT = 20, STORAGE_DELETE = 21, UPDATE_RESOURCE_COUNT = 22, "
        + "USAGE_SANITY_RESULT = 23, DIRECT_ATTACHED_PUBLIC_IP = 24, LOCAL_STORAGE = 25, RESOURCE_LIMIT_EXCEEDED = 26, "
        + "SYNC = 27, UPLOAD_FAILED = 28, OOBM_AUTH_ERROR = 29")
    private Short alertType;

    @SerializedName(ApiConstants.NAME)
    @Param(description = "the name of the alert", since = "4.3")
    private String alertName;

    @SerializedName(ApiConstants.DESCRIPTION)
    @Param(description = "description of the alert")
    private String description;

    @SerializedName(ApiConstants.SENT)
    @Param(description = "the date and time the alert was sent")
    private Date lastSent;

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

    public void setAlertType(Short alertType) {
        this.alertType = alertType;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setLastSent(Date lastSent) {
        this.lastSent = lastSent;
    }

    public void setName(String name) {
        this.alertName = name;
    }
}


text:
echo "Enter a folder name, no spaces, no dashes, underscore allowed, for your app. example: helloCordova"
read wow4

cordova create $wow4 --name $wow4 --id com.$wow4.$wow4

cd $wow4

phonegap platform add android

echo "Changing default Phonegap index.html to simple webpage index.html"

cd ..
cd temp-files

cp index.html /home/ubuntu/workspace/$wow4/www/index.html

cd ..

cd $wow4

phonegap build android

cd platforms/android/build/outputs/apk/

printf "\n\n$wow4/platforms/android/build/outputs/apk/android-debug.apk
"  >> /home/ubuntu/workspace/index.html

ls -l

cd ~/workspace/$wow4/platforms/android/assets/www

echo "Here is your index.html main webpage in the $wow4/platforms/android/assets/www folder"

ls -l

cd ~/workspace

echo "Look for your new android $wow4/bin/$wow4-debug.apk"
echo "right-click run index.html, then preview-preview running application to view webpage with your apk file"

echo "Or just click this link and open the web page"
echo ""
echo ""
echo ""

echo "http://$C9_HOSTNAME"


text:
@define backgroundColor: #292e2e;
@define backgroundGradient: gradient( linear, 0% 0%, 0% 100%, from( #292e2e ), to( #191e1e ) );

.ActionBar {
  width: 100%;
  height: 300px;
  vertical-align: bottom;
  flow-children: right;
}

#ActionBarContainer {
  width: 1630px;
  height: 180px;
  vertical-align: bottom;
  flow-children: right;
  background-color: backgroundColor;
  background-color: backgroundGradient;
}

.ActionBar #ActionMinimap {
  width: 289px;
  border: 10px solid #222;
  height: 289px;
  vertical-align: bottom;
  overflow: clip;
}

.AspectRatio4x3 .ActionBar #ActionMinimap,
.AspectRatio5x4 .ActionBar #ActionMinimap {
  width: 270px;
  height: 270px;
}

.ActionBar #UnitPortrait {
  width: 15%;
  height: 100%;
  overflow: clip;
  padding: 5px;
  flow-children: down;
  border-right: 1px solid #111;
}

.ActionBar #UnitPortrait #UnitPortraitImage {
  margin-top: 10px;
  width: 85%;
  horizontal-align: center;
  height: width-percentage(56.25%);
  saturation: 0.4;
  border-radius: 4px;
  box-shadow: 0 0 20px black;
}

.ActionBar #UnitPortrait #UnitPortraitLabel {
  text-align: center;
  width: 100%;
  color: white;
  font-weight: bold;
  font-size: 22px;
  background-color: #222;
  overflow: clip;
  line-height: 30px;
  height: 30px;
}

.ActionBar #UnitInfo {
  width: 35%;
  height: 100%;
  overflow: clip;
  flow-children: right-wrap;
}

.ActionBar #GameInfo {
  border-left: 1px solid #111;
  width: 15%;
  height: 100%;
  overflow: clip;
  flow-children: down;
}

#GameInfo .StatusRow {
  margin-top: 8px;
  padding: 5px 10px 5px 10px;
  width: 100%;
  flow-children: right;
  text-align: center;
  vertical-align: middle;
  height: 36px;
}

#GameInfo .StatusRow Label.Description {
  margin-left: 8px;
}

#GameInfo .StatusRow Image,
#GameInfo .StatusRow Label {
  horizontal-align: right;
}

#GameInfo #GoldBar #PlayerGold {
  color: white;
}

.ActionBar #BuildMenu {
  border-left: 1px solid #111;
  width: 35%;
  overflow: clip;
  background-color: backgroundColor;
  background-color: backgroundGradient;
}

.ActionBar #UnitInfo .UnitInfoContainer {
  width: 100%;
  height: 100%;
  padding: 5px 10px 5px 10px;
}

.ActionBar #BuildMenu {
  width: 35%;
  height: 100%;
  overflow: clip;
  horizontal-align: right;
}

.UnitInfoContainer #UnitHealthBar {
  width: 100%;
  height: 30px;

  background-color: #454545;
  background-color: gradient( linear, 0% 0%, 0% 100%, from( #454545 ), to( #363636 ) );

  horizontal-align: center;
  box-shadow: 4px 4px 0 #222;
}

.UnitInfoContainer #UnitHealthBarPercentage {
  height: 100%;
  background-color: #ade55c;
  background-color: gradient( linear, 0% 0%, 0% 100%, from( #ade55c ), to( #98c952 ) );
}

.UnitInfoContainer #UnitHealthBarPercentage.unfriendly {
  background-color: #ade55c;
  background-color: gradient( linear, 0% 0%, 0% 100%, from( #f14f4f ), to( #be3c3c ) );
}

.UnitInfoContainer #UnitHealthBarLabel {
  width: 100%;
  text-align: center;
  vertical-align: middle;
  color: white;
  font-weight: bold;
  text-shadow: 0px 2px 2px black;
  font-size: 18px;
}

#UnitAttributes {
  margin-top: 36px;
  width: 100%;
  height: 66px;
}

#UnitAttributesProperties {
  width: 100%;
  height: 100%;
}

#UnitAttributesLeft,
#UnitAttributesRight {
  width: 50%;
  flow-children: down;
}

#UnitAttributesRight {
  horizontal-align: right;
}

#UnitAttributesLeft .UnitAttributeProperty {
  padding-right: 10px;
}

#UnitAttributesRight .UnitAttributeProperty {
  padding-left: 10px;
}

#UnitAttributesProperties .UnitAttributeProperty {
  width: 100%;
  padding-bottom: 10px;
  flow-children: right-wrap;
}

#UnitAttributesProperties .UnitAttributeProperty.right {
  /*padding-left: 50px;*/
}

#UnitAttributesProperties .UnitAttributeProperty .UnitAttributeLabel {
  color: #606565;
}

#UnitAttributesProperties .UnitAttributeProperty .UnitAttributeValue {
  color: white;
  horizontal-align: right;
  font-weight: bold;
}

#UnitAbilities {
  width: 100%;
  height: 75px;
  vertical-align: bottom;
}

.UnitPortraitContainer {
  width: 70px;
  height: 40px;
  background-color: black;
  margin-top: 5px;
  margin-right: 5px;
}

.UnitPortraitContainer #UnitPortraitButton {
  width: 100%;
  height: 100%;
}

.UnitPortraitContainer #UnitPortraitImage {
  width: 100%;
  height: 100%;
}


text:
package at.ac.tuwien.infosys.monitoring.test;

import org.w3c.dom.Element;

import at.ac.tuwien.infosys.monitoring.config.MonitoringConfig;
import io.hummer.util.Util;

@org.junit.Ignore
public class MonitoringTest {

	private static Util util = new Util();

	public static void main(String[] args) throws Exception {

		final MonitoringConfig config = util.xml.toJaxbObject(MonitoringConfig.class,
				util.xml.toElement(util.io.readFile(MonitoringTest.class.getResourceAsStream(
						"monitoringTest.xml"))));

		System.out.println(config.toString());

		Element element = util.xml.toElement(config);

		System.out.println(element);

	}

}


text:
<?php
/**
 * Shop System SDK:
 * - Terms of Use can be found under:
 * https://github.com/wirecard/paymentSDK-php/blob/master/_TERMS_OF_USE
 * - License can be found under:
 * https://github.com/wirecard/paymentSDK-php/blob/master/LICENSE
 */

// # Masterpass reservation

// The method `reserve` of the _transactionService_ provides the means
// to reserve an amount (also known as authorization).

// ## Required objects

// To include the necessary files, we use the composer for PSR-4 autoloading.
require __DIR__ . '/../../../vendor/autoload.php';
require __DIR__ . '/../../inc/common.php';
require __DIR__ . '/../../configuration/config.php';

require __DIR__ . '/../../inc/header.php';

use Wirecard\PaymentSdk\Entity\Amount;
use Wirecard\PaymentSdk\Entity\Redirect;
use Wirecard\PaymentSdk\Response\FailureResponse;
use Wirecard\PaymentSdk\Response\InteractionResponse;
use Wirecard\PaymentSdk\Transaction\MasterpassTransaction;
use Wirecard\PaymentSdk\TransactionService;

// ### Transaction related objects

// Create a amount object as amount which has to be paid by the consumer.
$amount = new Amount(70.00, 'EUR');

// The redirect URL determines where the consumer should be redirected to
// after an approval/cancellation on the Masterpass lightbox
$redirect = new Redirect(
    getUrl('return.php?status=success'),
    getUrl('return.php?status=cancel'),
    getUrl('return.php?status=failure')
);

// ### Transaction

// The Masterpass transaction contains all relevant data for the payment process.
$transaction = new MasterpassTransaction();
$transaction->setAmount($amount);
$transaction->setRedirect($redirect);

// ### Transaction Service

// The service is used to execute the reservation (authorization) operation itself. A response object is returned.
$transactionService = new TransactionService($config);
$response = $transactionService->reserve($transaction);

// ## Response handling

// The response from the service can be used for disambiguation.
// If a redirect of the customer is required a `FormInteractionResponse` object is returned.
if ($response instanceof InteractionResponse):
    die("<meta http-equiv='refresh' content='0;url={$response->getRedirectUrl()}'>");
// In case of a failed transaction, a `FailureResponse` object is returned.
elseif ($response instanceof FailureResponse):
    // In our example we iterate over all errors and display them in a raw state.
    // You should handle them based on the given severity as error, warning or information.
    foreach ($response->getStatusCollection() as $status) {
        /**
         * @var $status \Wirecard\PaymentSdk\Entity\Status
         */
        $severity = ucfirst($status->getSeverity());
        $code = $status->getCode();
        $description = $status->getDescription();
        echo sprintf('%s with code %s and message "%s" occurred.<br>', $severity, $code, $description);
    }
endif;

require __DIR__ . '/../../inc/footer.php';


text:
package org.sagebionetworks.table.cluster.metadata;

/**
 * Factory for {@link ObjectFieldModelResolver} instances
 *
 * @author Marco Marasca
 *
 */
public interface ObjectFieldModelResolverFactory {

	/**
	 * @param fieldTypeMapper
	 * @return An instance of an {@link ObjectFieldModelResolver} that can be used
	 *         to map default object fields
	 */
	ObjectFieldModelResolver getObjectFieldModelResolver(ObjectFieldTypeMapper fieldTypeMapper);

}


text:
package log

import (
	"testing"
	"time"

	"gopkg.in/mgo.v2"
)

const numregs = 100

func TestMap(t *testing.T) {
	addstore(t, NewMap, numregs)
}

func TestMgo(t *testing.T) {
	t.SkipNow()
	addstore(t, NewMongoDb, "mongodb://localhost/test", "test", &mgo.Safe{}, &TestStruct{}, 30*time.Second)
}

func TestStores(t *testing.T) {
	for _, store := range maps {
		t.Log("Testing store:", store.Name)
		dropeverthing(t, store.Store)
		empty(t, store.Store)
		readonly(t, store.Store)
		put(t, store.Store, numregs)
		length(t, store.Store, numregs+1)
		get(t, store.Store, numregs)
		del(t, store.Store, numregs)
		put(t, store.Store, numregs)
		iter(t, store.Store, numregs)
		testsort(t, store.Store)
		testiter2(t, store.Store)
		dropeverthing(t, store.Store)
	}
}


text:
package org.olat.modules.qpool;

/**
 *
 * Initial date: 21.03.2013<br>
 * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
 *
 */
public interface QuestionItemView extends QuestionItemShort {

	public boolean isEditable();

	public boolean isMarked();

	public Double getRating();

	//general
	public String getCoverage();

	public String getAdditionalInformations();

	//life cycle
	public String getItemVersion();

}


text:
<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

    <changeSet id="1" author="alice">
        <createTable tableName="debug_info">
            <column name="message" type="varchar(255)"/>
            <column name="date_ran" type="datetime">
                    <constraints nullable="false"/>
            </column>
        </createTable>
    </changeSet>

    <changeSet id="run-mark" author="alice" runAlways="true">
        <insert tableName="debug_info">
            <column name="message" value="Liquibase update was ran"/>
            <column name="date_ran" valueComputed="current_datetime"/>
        </insert>
        <rollback/>
    </changeSet>

    <changeSet id="2" author="chuck">
        <insert tableName="debug_info">
            <column name="message" value="Database is ${database.databaseProductName} (${database.typeName}) version ${database.databaseMajorVersion}.${database.databaseMinorVersion}"/>
            <column name="date_ran" valueComputed="current_datetime"/>
        </insert>
        <rollback>delete from debug_info</rollback>
    </changeSet>

    <changeSet id="dbms-mysql" author="chuck" dbms="mysql">
        <insert tableName="debug_info">
            <column name="message" value="A mysql changeset was ran"/>
            <column name="date_ran" valueComputed="current_datetime"/>
        </insert>
        <rollback/>
    </changeSet>

    <changeSet id="dbms-h2" author="alice" dbms="h2">
        <insert tableName="debug_info">
            <column name="message" value="An h2 changeset was ran"/>
            <column name="date_ran" valueComputed="current_datetime"/>
        </insert>
        <rollback/>
    </changeSet>

    <changeSet id="dbms-not-derby" author="alice" dbms="!derby">
        <insert tableName="debug_info">
            <column name="message">A changest that does not run on derby was ran</column>
            <column name="date_ran" valueComputed="current_datetime"/>
        </insert>
        <rollback/>
    </changeSet>

    <changeSet id="context-production" author="chuck" context="production">
        <insert tableName="debug_info">
            <column name="message">A 'production' context changeset was ran</column>
            <column name="date_ran" valueComputed="current_datetime"/>
        </insert>
        <rollback/>
    </changeSet>

    <changeSet id="context-test" author="bob" context="test">
        <insert tableName="debug_info">
            <column name="message">A 'test' context changeset was ran</column>
            <column name="date_ran" valueComputed="current_datetime"/>
        </insert>
        <rollback/>
    </changeSet>

    <include file="com/example/features/employees.xml"/>
    <include file="features/store.sql" relativeToChangelogFile="true"/>

    <includeAll path="com/example/versions"/>

</databaseChangeLog>


text:
#ifndef DALI_INTERNAL_SCENE_GRAPH_TEXTURE_SET_H
#define DALI_INTERNAL_SCENE_GRAPH_TEXTURE_SET_H

// INTERNAL INCLUDES
#include <dali/internal/common/buffer-index.h>
#include <dali/internal/common/message.h>
#include <dali/internal/event/common/event-thread-services.h>
#include <dali/public-api/rendering/texture-set.h>

namespace Dali
{
namespace Internal
{
namespace Render
{
struct Sampler;
class Texture;
} // namespace Render
namespace SceneGraph
{
class Renderer;

class TextureSet
{
public:
  /**
   * Construct a new TextureSet.
   */
  static TextureSet* New();

  /**
   * Destructor. Not virtual as not a base class and not inheriting anything
   */
  ~TextureSet();

  /**
   * Overriden delete operator
   * Deletes the texture set from its global memory pool
   */
  void operator delete(void* ptr);

  /**
   * Set the sampler to be used by the texture at position "index"
   * @param[in] index The index of the texture
   * @param[in] sampler The sampler to be used by the texture
   */
  void SetSampler(uint32_t index, Render::Sampler* sampler);

  /**
   * Set the texture at position "index"
   * @param[in] index The index of the texture
   * @param[in] texture The texture
   */
  void SetTexture(uint32_t index, Render::Texture* texture);

  /**
   * Return whether any texture in the texture set has an alpha channel
   * @return true if at least one texture in the texture set has an alpha channel, false otherwise
   */
  bool HasAlpha() const;

  /**
   * Accessor for textures (used by RenderDataProvider impl)
   */
  const Vector<Render::Texture*>& GetTextures()
  {
    return mTextures;
  }

  /**
   * Accessor for samplers (used by RenderDataProvider impl)
   */
  const Vector<Render::Sampler*>& GetSamplers()
  {
    return mSamplers;
  }

private:
  /**
   * Protected constructor; See also TextureSet::New()
   */
  TextureSet();

private:                              // Data
  Vector<Render::Sampler*> mSamplers; ///< List of samplers used by each texture. Not owned
  Vector<Render::Texture*> mTextures; ///< List of Textures. Not owned
  bool                     mHasAlpha; ///< if any of the textures has an alpha channel
};

inline void SetTextureMessage(EventThreadServices& eventThreadServices, const TextureSet& textureSet, uint32_t index, Render::Texture* texture)
{
  using LocalType = MessageValue2<TextureSet, uint32_t, Render::Texture*>;

  // Reserve some memory inside the message queue
  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));

  // Construct message in the message queue memory; note that delete should not be called on the return value
  new(slot) LocalType(&textureSet, &TextureSet::SetTexture, index, texture);
}

inline void SetSamplerMessage(EventThreadServices& eventThreadServices, const TextureSet& textureSet, uint32_t index, Render::Sampler* sampler)
{
  using LocalType = MessageValue2<TextureSet, uint32_t, Render::Sampler*>;

  // Reserve some memory inside the message queue
  uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));

  // Construct message in the message queue memory; note that delete should not be called on the return value
  new(slot) LocalType(&textureSet, &TextureSet::SetSampler, index, sampler);
}

} // namespace SceneGraph

} // namespace Internal

} // namespace Dali

#endif //  DALI_INTERNAL_SCENE_GRAPH_TEXTURE_SET_H


text:
/* --------------------------------------------------------------------------
 *    Name: show.c
 * Purpose: Associative array implemented as a digital search tree
 * ----------------------------------------------------------------------- */

#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>

#include "base/errors.h"

#include "datastruct/dstree.h"

#include "impl.h"

typedef struct dstree__show_args
{
  dstree_show_key     *key;
  dstree_show_destroy *key_destroy;
  dstree_show_value   *value;
  dstree_show_destroy *value_destroy;
  FILE                *f;
}
dstree__show_args_t;

static error dstree__node_show(dstree__node_t *n, int level, void *opaque)
{
  static const char stars[] = "********************************"; // works up to 32 levels deep

  dstree__show_args_t *args = opaque;
  const char          *key;
  const char          *value;

  key   = args->key   && n->item.key   ? args->key(n->item.key)     : NULL;
  value = args->value && n->item.value ? args->value(n->item.value) : NULL;

  (void) fprintf(args->f, "dst: %p: %-32.*s : %s -> %s\n",
                 n, level + 1, stars,
                 key   ? key   : "(null)",
                 value ? value : "(null)");

  if (args->key_destroy   && key)   args->key_destroy((char *) key);
  if (args->value_destroy && value) args->value_destroy((char *) value);

  return error_OK;
}

error dstree_show(const dstree_t      *t,
                  dstree_show_key     *key,
                  dstree_show_destroy *key_destroy,
                  dstree_show_value   *value,
                  dstree_show_destroy *value_destroy,
                  FILE                *f)
{
  dstree__show_args_t args;

  args.key           = key;
  args.key_destroy   = key_destroy;
  args.value         = value;
  args.value_destroy = value_destroy;
  args.f             = f;

  /* this walks the tree in post order but we don't mind (as the tree is
   * unordered) */
  return dstree__walk_internal((dstree_t *) t, dstree__node_show, &args);
}