text:
////////////////////////// scene_System ///////////////////////////
//
class scene_System
{
	friend class scene_Object;

/////////////////////////////////////////////////
// Type declarations
protected:

	typedef list< scene_Object* >		SceneryList_t;
	struct SceneryMapNode_t;

/////////////////////////////////////////////////
// INTERFACE
public:

	BOOL Create();
	void Destroy();

	void Update();
	void Render();

	INLINE scene_Object* TestPoint( const std_Point ptTest );

/////////////////////////////////////////////////
// Utility Methods
protected:

	void AddToSceneryMap( scene_Object* pObject );

	INLINE void SceneListInsert(  scene_Object* pObject );

	static INLINE void AnimateSceneryObject( scene_Object* pObject );
	static INLINE void RenderSceneryObject( scene_Object* pObject );

/////////////////////////////////////////////////
// Data Members
public:

	// Scenery map
	SceneryMapNode_t*	m_SceneryMap;
	std_Size			m_SceneryMapSize;

	// Scene list
	SceneryList_t		m_CurrentScene;

	// Animators
	SceneryList_t		m_Animators;

	std_Rect			m_ViewRect;

/////////////////////////////////////////////////
// Internal structures
protected:

	struct SceneryMapNode_t
	{
		SceneryList_t				Objects;
	//	ObjectPtrList_t::iterator	Start;		// Flats and stuff like that are at the beginning
	//	ObjectPtrList_t::iterator	Ground;		// Ground level stuff, sorted by its y value in screen space
	//	ObjectPtrList_t::iterator	Air;		// Air level stuff
	};

/////////////////////////////////////////////////
// Default Constructor/Deconstructor
public:
	scene_System();
	virtual ~scene_System();
/////////////////////////////////////////////////

}; // End class - scene_System
/////////////////////////////////////////////////////////////////////

// Include inline implementaions here for a NON-debug build
#ifndef _DEBUG
 #include "scene_System.inl"
#endif // !defined( _DEBUG )

/////////////////////////////////////////////////////////////////////
#endif // !defined(_SCENE_SYSTEM_H_)


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.resourcemover.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Defines the disk encryption set resource settings. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType")
@JsonTypeName("Microsoft.Compute/diskEncryptionSets")
@Immutable
public final class DiskEncryptionSetResourceSettings extends ResourceSettings {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionSetResourceSettings.class);

    /** {@inheritDoc} */
    @Override
    public DiskEncryptionSetResourceSettings withTargetResourceName(String targetResourceName) {
        super.withTargetResourceName(targetResourceName);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System.Collections.Generic;

namespace Sparrow.Reactive.Linq
{
    public class QueueWhenMessenger<T, TKey> : Messenger<T, T>
    {
        public QueueWhenMessenger(ISender<T> sender, ISender<TKey> trigger) : base(null)
        {
            queue = new List<T>();
            sender.Attach(this.Receive);
            trigger.Attach(this.Flush);
        }

        private List<T> queue;

        public void Flush(TKey key)
        {
            foreach (var item in queue)
                Send(item);
            queue.Clear();
        }

        public override void Receive(T value)
        {
            queue.Add(value);
        }
    }
}


text:
require "./spec/cases/helper"
Maxitest.static_class_order = true
$calls = []

5.times do |i|
  describe rand do
    it { puts "#{i}" }

    describe rand do
      it { puts "#{i}n" }
    end
  end
end


text:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is JavaScript Engine testing utilities.
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corp.
 * Portions created by the Initial Developer are Copyright (C) 2003
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   igor@fastmail.fm, PhilSchwartau@aol.com
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

/*
 *
 * Date:    24 Nov 2003
 * SUMMARY: Testing for recursion check in js_EmitTree
 *
 * See http://bugzilla.mozilla.org/show_bug.cgi?id=226507
 * Igor's comments:
 *
 * "For example, with N in the test  set to 35, I got on my RedHat
 * Linux 10 box a segmentation fault from js after setting the stack limit
 * to 100K. When I set the stack limit to 20K I still got the segmentation fault.
 * Only after -s was changed to 15K, too-deep recursion was detected:
 *

 ~/w/js/x> ulimit -s
 100
 ~/w/js/x> js  fintest.js
 Segmentation fault
 ~/w/js/x> js -S $((20*1024)) fintest.js
 Segmentation fault
 ~/w/js/x> js -S $((15*1024)) fintest.js
 fintest.js:19: InternalError: too much recursion

 *
 * After playing with numbers it seems that while processing try/finally the
 * recursion in js_Emit takes 10 times more space the corresponding recursion
 * in the parser."
 *
 *
 * Note the use of the new -S option to the JS shell to limit stack size.
 * See http://bugzilla.mozilla.org/show_bug.cgi?id=225061. This in turn
 * can be passed to the JS shell by the test driver's -o option, as in:
 *
 * perl jsDriver.pl -e smdebug -fTEST.html -o "-S 100" -l js1_5/Regress
 *
 */
//-----------------------------------------------------------------------------
var gTestfile = 'regress-226507.js';
var UBound = 0;
var BUGNUMBER = 226507;
var summary = 'Testing for recursion check in js_EmitTree';
var status = '';
var statusitems = [];
var actual = '';
var actualvalues = [];
var expect= '';
var expectedvalues = [];

/*
 * With stack limit 100K on Linux debug build even N=30 already can cause
 * stack overflow; use 35 to trigger it for sure.
 */
var N = 350;

var counter = 0;
function f()
{
  ++counter;
}

/*
 * Example: if N were 3, this is what |source|
 * would end up looking like:
 *
 *     try { f(); } finally {
 *     try { f(); } finally {
 *     try { f(); } finally {
 *     f(1,1,1,1);
 *     }}}
 *
 */
var source = "".concat(
  repeat_str("try { f(); } finally {\n", N),
  "f(",
  repeat_str("1,", N),
  "1);\n",
  repeat_str("}", N));

// Repeat it for additional stress testing
source += source;

/*
 * In Rhino, eval() always uses interpreted mode.
 * To use compiled mode, use Script.exec() instead.
 */
if (typeof Script == 'undefined')
{
  print('Test skipped. Script not defined.');
  expect = actual = 0;
}
else
{
  try
  {
    var script = Script(source);
    script();

    status = inSection(1);
    actual = counter;
    expect = (N + 1) * 2;
  }
  catch(ex)
  {
    actual = ex + '';
  }
}
addThis();

//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------

function repeat_str(str, repeat_count)
{
  var arr = new Array(--repeat_count);
  while (repeat_count != 0)
    arr[--repeat_count] = str;
  return str.concat.apply(str, arr);
}

function addThis()
{
  statusitems[UBound] = status;
  actualvalues[UBound] = actual;
  expectedvalues[UBound] = expect;
  UBound++;
}

function test()
{
  enterFunc('test');
  printBugNumber(BUGNUMBER);
  printStatus(summary);

  for (var i=0; i<UBound; i++)
  {
    reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
  }

  exitFunc ('test');
}


text:
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdio.h>

#include "laplace_code.h"
#include "generic_code.h"
#include "entenc.h"
#include "entdec.h"
#include "logging.h"
#include "odintrin.h"

/** Encodes a value from 0 to N-1 (with N up to 16) based on a cdf and adapts
 * the cdf accordingly.
 *
 * @param [in,out] enc   range encoder
 * @param [in]     val   variable being encoded
 * @param [in]     cdf   CDF of the variable (Q15)
 * @param [in]     n     number of values possible
 * @param [in]     increment adaptation speed (Q15)
 */
void od_encode_cdf_adapt(od_ec_enc *ec, int val, ogg_uint16_t *cdf, int n,
 int increment) {
  int i;
  od_ec_encode_cdf_unscaled(ec, val, cdf, n);
  if (cdf[n-1] + increment > 32767) {
    for (i = 0; i < n; i++) {
      /* Second term ensures that the pdf is non-null */
      cdf[i] = (cdf[i] >> 1) + i + 1;
    }
  }
  for (i = val; i < n; i++) cdf[i] += increment;
}

/** Encodes a random variable using a "generic" model, assuming that the
 * distribution is one-sided (zero and up), has a single mode, and decays
 * exponentially past the model.
 *
 * @param [in,out] enc   range encoder
 * @param [in,out] model generic probability model
 * @param [in]     x     variable being encoded
 * @param [in]     max   largest value possible
 * @param [in,out] ExQ16 expectation of x (adapted)
 * @param [in]     integration integration period of ExQ16 (leaky average over
 * 1<<integration samples)
 */
void generic_encode(od_ec_enc *enc, generic_encoder *model, int x, int max,
 int *ex_q16, int integration) {
  int lg_q1;
  int shift;
  int id;
  ogg_uint16_t *cdf;
  int xs;
  int ms;
  if (max == 0) return;
  lg_q1 = log_ex(*ex_q16);
  OD_LOG((OD_LOG_ENTROPY_CODER, OD_LOG_DEBUG,
   "%d %d", *ex_q16, lg_q1));
  /* If expectation is too large, shift x to ensure that
     all we have past xs=15 is the exponentially decaying tail
     of the distribution */
  shift = OD_MAXI(0, (lg_q1 - 5) >> 1);
  /* Choose the cdf to use: we have two per "octave" of ExQ16 */
  id = OD_MINI(GENERIC_TABLES - 1, lg_q1);
  cdf = model->cdf[id];
  xs = (x + (1 << shift >> 1)) >> shift;
  ms = (max + (1 << shift >> 1)) >> shift;
  OD_ASSERT(max == -1 || xs <= ms);
  if (max == -1) od_ec_encode_cdf_unscaled(enc, OD_MINI(15, xs), cdf, 16);
  else {
    od_ec_encode_cdf_unscaled(enc, OD_MINI(15, xs), cdf, OD_MINI(ms + 1, 16));
  }
  if (xs >= 15) {
    int e;
    unsigned decay;
    /* Estimate decay based on the assumption that the distribution is close
       to Laplacian for large values. We should probably have an adaptive
       estimate instead. Note: The 2* is a kludge that's not fully understood
       yet. */
    e = ((2**ex_q16 >> 8) + (1 << shift >> 1)) >> shift;
    decay = OD_MAXI(2, OD_MINI(254, 256*e/(e + 256)));
    /* Encode the tail of the distribution assuming exponential decay. */
    laplace_encode_special(enc, xs - 15, decay, (max == -1) ? -1 : ms - 15);
  }
  if (shift != 0) {
    int special;
    /* Because of the rounding, there's only half the number of possibilities
       for xs=0. */
    special = xs == 0;
    if (shift - special > 0) {
      od_ec_enc_bits(enc, x - (xs << shift) + (!special << (shift - 1)),
       shift - special);
    }
  }
  generic_model_update(model, ex_q16, x, xs, id, integration);
  OD_LOG((OD_LOG_ENTROPY_CODER, OD_LOG_DEBUG,
   "enc: %d %d %d %d %d %x", *ex_q16, x, shift, id, xs, enc->rng));
}


text:
AccDC Bootstrap 1.6 for jQuery
=====

IMPORTANT: All of the AccDC projects have been deprecated as of May4, 2021. All future development will instead be done through the Apex 4X project, which is much more powerful and feature rich. To learn more, read the Apex 4X release article at:  https://www.linkedin.com/pulse/released-apex-4x-comprehensive-aria-development-suite-bryan-garaventa

AccDC Bootstrap is an HTML parser that renders advanced, accessible interactive controls using semantic HTML markup.

Supported by the Royal Society of Arts, AccDC was awarded the "Above and Beyond Accessibility Award" from the United States Department of Labor, and was presented at the Developing with Accessibility Event, hosted by the Federal Communications Commission in Washington DC in 2012.

This version of AccDC interfaces with jQuery as an extension.
All of the AccDC accessible component modules plug into this interface.

Bootstrapping refers to the use of semantic HTML markup to configure advanced controls, which are then magically converted into dynamic interactive components when the content finishes loading.

This allows developers to include complex functionality that is fully configurable across thousands of web pages, without having to program individual components using JavaScript.

Benefits:

* Easy implementation
* Consistent layouts
* Reliable functionality
* Full customization
* Automatic accessibility

AccDC Bootstrap is module based, so it can be extended or reduced as needed for any site-wide implementation.

The style sheets for all bootstrap components are fully configurable, so they can be customized to fit the user interface design of any site while maintaining the same level of reliability and accessibility.

The bootstrap module itself is also fully configurable, so that new features and components can easily be added and customized for global integration.

All AccDC Bootstrap components are WCAG 2.0 compliant, ARIA standards compliant, and Section-508 compliant.

Tested using:

1. JAWS 11+> using IE 8 and 9, and Firefox.
2. NVDA using IE 8 and 9, and Firefox.
3. Voiceover using iOS Safari.

AccDC Bootstrap is designed to automatically enforce accessibility, while making it possible to populate individual components with any type of content, in any language, using any visual styling.

Recursive processing is also supported, so that new content, when rendered, will automatically be bootstrapped; even when pulled from an external resource.

Bootstrapping can also be manually invoked using the $A.bootstrap method for individual DOM nodes.<br />

AccDC Bootstrap is distributed under the terms of the Open Source Initiative OSI - MIT License.

Bootstrapped Modules
-----

Bootstrapping occurs using modules from the AccDC Component Library.

The AccDC Component Library is a collection of accessible control types that automate the structural and functional accessibility of each control according to relevant accessibility best practices. The controls can be populated with any type of content, and can be styled to fit any type of user interface layout, in any language, without negatively impacting accessibility. The controls tap into the accessibility features of the AccDC API to render content in an accessible manner, then apply supporting markup and scripting to automatically ensure accessibility for screen reader and keyboard only users. This makes it possible for developers to add fully customizable components, that look and feel exactly as they desire, while ensuring functional accessibility at the same time without the risk of coding misinterpretation by those who are unfamiliar with ATs.

The following modules are included:

* Accessible Modal controls.
* Accessible Banner controls.
* Accessible Tooltip controls.
* Accessible Popup controls.
* ARIA Tab controls.
* ARIA context sensitive dropdown Menu controls.
* ARIA Tree controls.
* ARIA Date Picker controls.
* Accessible Accordion controls.
* Accessible Carousel, Slideshow, and Wizard controls.
* Keyboard accessible Scrollable Div controls.
* ARIA Toggle controls.
* Accessible Footnote controls

For specific coding guidance, visit: http://whatsock.com/tsg

Distributed under the terms of the Open Source Initiative OSI - MIT License.

Developed and maintained by: Bryan Garaventa https://www.linkedin.com/in/bgaraventa
Or on Twitter at https://twitter.com/bryanegaraventa

Includes contributions by: Danny Allen (dannya.com) / Wonderscore Ltd (wonderscore.co.uk) https://www.linkedin.com/in/danny-allen-49690451/

Note: All visual design by Angela Ricci (web designer and web front-end developer). You can check her work at her personal site http://gericci.me/
Or you can follow her on Twitter at https://twitter.com/gericci

Project home:
-----

http://whatsock.com/bootstrap/jquery/

Related projects:
-----

* WhatSock Organization: https://github.com/whatsock
* Visual ARIA: https://github.com/accdc/visual-aria

Understanding AccDC: A Quick Start Guide
-----

It helps to understand precisely what AccDC is and how it works at the most basic level.

The AccDC API is designed to process and normalize code across the three most widely used JavaScript libraries and frameworks, jQuery, Dojo, and MooTools.

To be specific, the AccDC API is an extension for jQuery, Dojo, and MooTools.

The AccDC API module interfaces with each of these libraries and frameworks in order to utilize all of the available rendering, AJAX, event handling, and associated processes, and extends them, so that any relevant command that is processed using the $A namespace, is automatically powered by the core processes within jQuery, Dojo, or MooTools.

An example showing the value of this, is described in the LinkedIn article at
http://lnkd.in/b9VGQxf

This means that, any widget that uses the following AccDC API methods, will automatically normalize equally across jQuery, Dojo, and MooTools, without requiring any coding changes to work correctly.

* $A.getEl // Get the element with the specified ID
* $A.createEl // Create a new element node, plus optional attributes, styling, and content
* $A.getAttr // Get the value of a specified attribute
* $A.setAttr // Set the value of one or more attributes
* $A.remAttr // Remove one or more attributes
* $A.getText // Get the textual content of a container element
(Coding documentation: WhatSock.com > Core API > Misc)

* $A.css // Get or Set the styling properties of one or more elements
* $A.hasClass // Check if an element includes one or more class names
* $A.addClass // Add one or more class names to an element
* $A.remClass // Remove one or more class names from an element
(Coding documentation: WhatSock.com > Core API > CSS)

* $A.bind // Add event handlers for one or more elements
* $A.unbind // Remove event handlers for one or more elements
* $A.trigger // Fire the specified event on an element
(Coding documentation: WhatSock.com > Core API > Events)

* $A.load // Pull markup code from an external resource and load into a container element
* $A.get // Pull code from an external resource and process it
* $A.getJSON // Pull JSON code from an external resource and process it
* $A.getScript // Execute an external JavaScript file
* $A.post // Submit data to a server side script using a POST request
* $A.ajax // Manually configure custom AJAX GET or POST requests
(Coding documentation: WhatSock.com > Core API > AJAX)

* $A.announce // Announce a string or the content of a container element to screen reader users
(Coding documentation: WhatSock.com > Core API > Accessibility)

There are many more AccDC API commands and customizable rendering functionalities documented on the Core API tab at WhatSock.com, but these cover all of the most commonly used public methods.

In order to test and verify this functionality, there are three dedicated TSG GitHub projects, all of which use the same component code for each widget type shared between them, which tie into the AccDC API for automatic normalization.

* Powered by jQuery: https://github.com/whatsock/tsg
* Powered by Dojo: https://github.com/whatsock/tsg-dojo
* Powered by MooTools: https://github.com/whatsock/tsg-mootools

In order to ensure the highest level of accessibility possible for all user types, including non-sighted screen reader users, mobility impaired keyboard only users, voice navigation software users, and low vision screen magnification software users, all of the scalable widgets provided within the TSG archives are programmed specifically to be as accessible as possible using all current standards, with specific adherence to the principles and guidelines documented at:

http://whatsock.com/training

Also available for download at:
https://github.com/whatsock/training

For community support, please address any questions to the Accessibility Innovators LinkedIn group, at:
https://www.linkedin.com/groups/Accessibility-Innovators-4512178

Future updates and announcements will be posted on Twitter, at
https://twitter.com/bryanegaraventa


text: This publisher is the companion to the Faux Pas build step.


text:
layout: page
title: Liberated Card Chemical Trade Fair
date: 2016-05-24
author: Terry Le
tags: weekly links, java
status: published
summary: Morbi urna quam, maximus at neque eget.
banner: images/banner/office-01.jpg
booking:
  startDate: 03/20/2019
  endDate: 03/21/2019
  ctyhocn: LAXGGHX
  groupCode: LCCTF
published: true
---
Fusce imperdiet orci ut risus rutrum interdum. Praesent accumsan enim a interdum eleifend. Integer malesuada gravida nibh a varius. Morbi pharetra, leo lobortis condimentum varius, sem urna auctor libero, at ullamcorper urna odio id risus. Morbi tincidunt sed magna sed varius. Integer sollicitudin justo ut ante vehicula, lacinia mollis neque accumsan. Praesent auctor tempor finibus. Integer accumsan faucibus massa eu commodo. Donec et sem varius, tincidunt dui sit amet, gravida nibh.

* Proin in augue in quam dictum tincidunt vitae sit amet enim
* Mauris ultrices lacus quis egestas dignissim.

Praesent imperdiet leo nec erat tempor tincidunt. Maecenas facilisis in tellus interdum aliquet. In sed hendrerit massa, quis aliquet justo. Integer sed mauris a libero posuere varius id sed lorem. Nam posuere suscipit sem, et interdum sem luctus sit amet. Proin fringilla, nibh eu ultrices molestie, erat arcu sollicitudin quam, eget ultricies eros sem sed urna. Cras a condimentum nisl, id pellentesque nisi. Nunc vitae metus interdum, scelerisque purus ullamcorper, viverra sem. Praesent tincidunt nunc quis arcu accumsan, iaculis porttitor elit pellentesque. Aenean tellus turpis, tristique non sem eget, lacinia gravida purus. Praesent lobortis nec magna eget tempus. Donec iaculis vehicula ipsum. Proin viverra volutpat augue.


text:
function() {
/*
is_app(true)
component_type("VB")
display_name("REST API call control")
description("This will return the REST API call control")
base_component_id("rest_control")
load_once_from_file(true)
visibility("PRIVATE")
read_only(true)
properties(
    [
        {
            id:         "width",
            name:       "Width",
            default:    180,
            type:       "Number"
        }
        ,
        {
            id:         "height",
            name:       "Height",
            default:    70,
            type:       "Number"
        }
        ,

        {
            id:         "text",
            name:       "Dev text",
            default:    "REST API Call",
            type:       "String"
        }
        ,

        {
            id:         "has_details_ui",
            name:       "Has details UI?",
            type:       "Boolean",
            default:    true,
            hidden:     true
        }
        ,

        {
            id:             "callDefaultRestApi",
            pre_snippet:    `await `,
            snippet:        `callDefaultRestApi()`,
            name:           "Call Default API",
            type:           "Action"
        }
        ,
        {
            id:         "callRestApi",
            pre_snippet:    `await `,
            snippet:    `callRestApi("http://INSERT_URL_HERE")`,
            name:       "Call Rest API",
            type:       "Action"
        }
        ,

        {
            id:         "productionRoot",
            name:       "Production response path",
            default:    "",
            type:       "String"
        }
        ,

        {
            id:         "productionFilter",
            name:       "Production filter",
            default:    new Object(),
            hidden:     true,
            type:       "Object"
        }
        ,

        {
            id:         "URL",
            name:       "URL",
            default:    "http://127.0.0.1:3000/change_this_url",
            type:       "String"
        }
        ,
        {
            id:         "error",
            name:       "Error",
            default:    "",
            type:       "String"
        }
        ,
        {
            id:         "jsonPaths",
            name:       "JSON Paths",
            default:    [],
            hidden:     true,
            type:       "Array"
        }
        ,
        {
            id:         "jsonRoots",
            name:       "JSON Roots",
            default:    [],
            hidden:     true,
            type:       "Array"
        }
        ,
        {
            id:         "filteredProductionResponse",
            name:       "Filtered Production Response",
            default:    null,
            hidden:     true,
            type:       "Object",
            types:      {canConvertToString: true}
        }
        ,
        {
            id:         "response",
            name:       "Response",
            default:    null,
            hidden:     true,
            type:       "Object"
        }
        ,
        {
            id:         "httpMethod",
            name:       "HTTP Method",
            type:       "Select",
            default:    "GET",
            values:     [
                            {display: "Get",   value: "GET"},
                            {display: "Head",  value: "HEAD"},
                            {display: "Post",  value: "POST"},
                            {display: "Put",  value: "PUT"},
                            {display: "Delete",  value: "DELETE"},
                            {display: "Connect",  value: "CONNECT"},
                            {display: "Options",  value: "OPTIONS"},
                            {display: "Trace",  value: "TRACE"},
                            {display: "Patch",  value: "PATCH"}
                        ]
        }
        ,
        {
            id:         "body",
            name:       "HTTP Body",
            default:    "",
            textarea:   true,
            type:       "String"
        }

        ,
        {
            id:         "callApiOnStartup",
            name:       "Call API on Startup",
            type:       "Select",
            default:    "False",
            values:     [
                            {display: "True",   value: "True"},
                            {display: "False",  value: "False"}
                        ]
        }
        ,
        {
            id:         "headerName1",
            name:       "Header 1 Name",
            default:    "",
            type:       "String"
        }
        ,
        {
            id:         "headerValue1",
            name:       "Header 1 Value",
            default:    "",
            textarea:   true,
            type:       "String"
        }
        ,

        {
            id:         "headerName2",
            name:       "Header 2 Name",
            default:    "",
            type:       "String"
        }
        ,
        {
            id:         "headerValue2",
            name:       "Header 2 Value",
            default:    "",
            textarea:   true,
            type:       "String"
        }
        ,

        {
            id:         "headerName3",
            name:       "Header 3 Name",
            default:    "",
            type:       "String"
        }
        ,
        {
            id:         "headerValue3",
            name:       "Header 3 Value",
            default:    "",
            textarea:   true,
            type:       "String"
        }
        ,
        {
            id:         "username",
            name:       "Username",
            default:    "",
            type:       "String"
        }
        ,

        {
            id:         "password",
            name:       "Password",
            default:    "",
            type:       "String"
        }
        ,

        {
            id:         "send_immediately",
            name:       "Send Immediately",
            type:       "Select",
            default:    "True",
            values:     [
                            {display: "True",   value: "True"},
                            {display: "False",  value: "False"}
                        ]
        }

    ]
)//properties
logo_url("/driver_icons/rest.png")
*/

    Vue.component("rest_control",{

        props: ["meta", "args","design_mode","refresh"]

        ,

        template:

`

        {{args.text}}

        <button    class="btn btn-primary"
                   v-on:click="callLiveRestApi()">

              Test API

        </button>

        <button    class="btn btn-info"
                   v-if="!showAsCode"
                   v-on:click="showThisAsCode()">

              Show as code

        </button>

        <button    class="btn btn-danger"
                   v-on:click="makeLive()">

              Make live

        </button>

        <button    class="btn btn-info"
                   v-if="showAsCode"
                   v-on:click="hideCode()">

              Hide code

        </button>

            <input v-model="args.URL" size=60 @change="changeURL()"></input>

Root

            <select v-model="args.productionRoot" @change="filterProductionRestApi();showAsCode = false;">
              <option disabled value="">Please select one</option>
              <option  v-for="jsonRoot in args.jsonRoots"
                    v-bind:selected="jsonRoot == args.productionRoot"
                        >{{jsonRoot}}</option>
            </select>

 0)'>Error: {{args.error}}

List of Paths

            <button    class="btn-sm btn-secondary"  v-on:click="selectAll()">Select All</button>
            <button    class="btn-sm btn-secondary"  v-on:click="selectNone()">Select None</button>

                   <input   v-if="jsonPath.startsWith(args.productionRoot)"
                            type="checkbox"
                            id="{{jsonPath}}"
                            value="{{jsonPath}}"
                            v-model="args.productionFilter[jsonPath]"
                            @change="if (args.productionFilter[jsonPath]) {checkParents(jsonPath)} else {uncheckChildren(jsonPath)};filterProductionRestApi();showAsCode = false;">

                   {{jsonPath}}

Result

{{args.filteredProductionResponse}}

var result = await callFunction(
{
    driver_name: "rest_call_service_v2",
    method_name: "rest_call_service_v2"
}
,
{
    URL:       {{JSON.stringify(args.URL)}},
    filter:    {{JSON.stringify(args.productionFilter)}},
    root:      {{JSON.stringify(args.productionRoot)}}
    {{(args.username && args.username.length > 0)?",username: " + JSON.stringify(args.username):""}}
    {{(args.username && args.username.length > 0)?",password: " + JSON.stringify(args.password):""}}
})

           {{args.text}}

{{args.URL}}

            <slot v-bind:refresh='refresh'>
            </slot>

`

        ,
        // ----------------------------------------------------------------
        //
        //                              data
        //
        //
        //
        //
        // ----------------------------------------------------------------

        data: function() {
            return {
                    showAsCode: false
            }
        }

        ,

        // ----------------------------------------------------------------
        //
        //                              mounted
        //
        //
        //
        //
        // ----------------------------------------------------------------

        mounted: async function() {
            registerComponent(this)
            if (this.args.callApiOnStartup == 'True') {
                this.callDefaultRestApi()
            }
        }
        ,

        methods: {
            // ----------------------------------------------------------------
            //
            //                        changeURL
            //
            //
            //
            //
            // ----------------------------------------------------------------
            changeURL: async function() {
                var mm = this
                mm.args.productionFilter = new Object()
                mm.args.productionRoot = ""
            }
            ,

            callRestApiInternal: async function(url, noFilter, wholeTree) {
                var mm = this
                try {
                    mm.args.error = ""
                    var headers={}
                    if (mm.args.headerName1 && (mm.args.headerName1 != "")) {
                        headers[mm.args.headerName1] = mm.args.headerValue1
                    }
                    if (mm.args.headerName2 && (mm.args.headerName2 != "")) {
                        headers[mm.args.headerName2] = mm.args.headerValue2
                    }
                    if (mm.args.headerName3 && (mm.args.headerName3 != "")) {
                        headers[mm.args.headerName3] = mm.args.headerValue3
                    }
                    var result = await callFunction(
                    {
                        driver_name: "rest_call_service_v2",
                        method_name: "rest_call_service_v2"
                    }
                    ,
                    {
                        URL:             url,
                        filter:          noFilter?null:this.args.productionFilter,
                        root:            wholeTree?null:this.args.productionRoot,
                        returnDetails:   true,
                        headers:         headers,
                        method:          this.args.httpMethod?this.args.httpMethod:"GET",
                        body:            this.args.body?this.args.body:"",
                        username:        (this.args.username && (this.args.username.length > 0))?this.args.username:null,
                        password:        (this.args.password && (this.args.password.length > 0))?this.args.password:null,
                        sendImmediately: ((this.args.send_immediately == 'True')?true:false)

                    })

                    if (result) {
                        this.args.productionResponse = result.raw
                        this.args.filteredProductionResponse = result.filtered
                        this.args.response = result.filtered
                        return result.filtered
                    }
                    return null
                } catch (err) {
                    //alert(err)
                    //add failure event here
                    mm.args.error = err
                }

            }
            ,

            callRestApiInternalV2: async function(url, noFilter, wholeTree) {
                var mm = this
                try {
                    mm.args.error = ""
                    var headers={}
                    if (mm.args.headerName1 && (mm.args.headerName1 != "")) {
                        headers[mm.args.headerName1] = mm.args.headerValue1
                    }
                    if (mm.args.headerName2 && (mm.args.headerName2 != "")) {
                        headers[mm.args.headerName2] = mm.args.headerValue2
                    }
                    if (mm.args.headerName3 && (mm.args.headerName3 != "")) {
                        headers[mm.args.headerName3] = mm.args.headerValue3
                    }
                    var result = await callFunction(
                    {
                        driver_name: "rest_call_service_v2",
                        method_name: "rest_call_service_v2"
                    }
                    ,
                    {
                        URL:             url,
                        filter:          noFilter?null:this.args.productionFilter,
                        root:            wholeTree?null:this.args.productionRoot,
                        returnDetails:   true,
                        headers:         headers,
                        method:          this.args.httpMethod?this.args.httpMethod:"GET",
                        body:            this.args.body?this.args.body:"",
                        username:        (this.args.username && (this.args.username.length > 0))?this.args.username:null,
                        password:        (this.args.password && (this.args.password.length > 0))?this.args.password:null,
                        sendImmediately: ((this.args.send_immediately == 'True')?true:false)
                    })

                    if (result) {
                        this.args.productionResponse = result.raw
                        this.args.filteredProductionResponse = result.filtered
                        this.args.response = result.filtered
                        return result.filtered
                    }
                    return null
                } catch (err) {
                    //alert(err)
                    //add failure event here
                    mm.args.error = err
                }

            }
            ,

            // ----------------------------------------------------------------
            //
            //                        getListOfResponsePathsForJson
            //
            //
            //
            //
            // ----------------------------------------------------------------

            getListOfResponsePathsForJson: async function(input) {
                var mm = this

                var result = await callFunction(
                {
                    driver_name: "json_traverse_service",
                    method_name: "json_traverse_service"
                }
                ,
                {
                    input: input
                })

                if (result) {
                    return result
                }
                return null
            }
            ,

            // ----------------------------------------------------------------
            //
            //                        getJsonFiltered
            //
            //
            //
            //
            // ----------------------------------------------------------------

            getJsonFiltered: async function(input) {
                var mm = this

                var result = await callFunction(
                {
                    driver_name: "json_filter_service",
                    method_name: "json_filter_service"
                }
                ,
                {
                    input: input,
                    filter: this.args.productionFilter,
                    root:  this.args.productionRoot

                })

                if (result) {
                    return result
                }
                return null
            }
            ,

            // ----------------------------------------------------------------
            //
            //                        callDefaultRestApi
            //
            //
            //
            //
            // ----------------------------------------------------------------

            callDefaultRestApi: async function() {

                let jsonResponse = await this.callRestApiInternal(this.args.URL)
                this.args.productionResponse   = jsonResponse
                this.args.filteredProductionResponse = JSON.parse(JSON.stringify(this.args.productionResponse))
                return jsonResponse
            }
            ,

            // ----------------------------------------------------------------
            //
            //                        callRestApi
            //
            //
            //
            //
            // ----------------------------------------------------------------

            callRestApi: async function(urlToCall, options) {

                let mm = this
                if (!urlToCall) {
                    urlToCall = mm.args.URL
                }

                if (options) {
                    if (options.filter) {
                        mm.args.productionFilter = JSON.parse(JSON.stringify(options.filter))
                    }
                    if (options.root) {
                        mm.args.productionRoot = JSON.parse(JSON.stringify(options.root))
                    }
                }

                let qwe = await this.callRestApiInternal(urlToCall)
                return qwe
            }
            ,

            // ----------------------------------------------------------------
            //
            //                        selectAll
            //
            //
            //
            //
            // ----------------------------------------------------------------

            selectAll: async function( ) {
                for ( var ert = 0  ;  ert < this.args.jsonPaths.length  ;  ert++  ) {
                    if (this.args.productionFilter[this.args.jsonPaths[ert]] == false) {
                        this.args.productionFilter[this.args.jsonPaths[ert]] = true
                    }
                }
                this.showAsCode = false
                this.filterProductionRestApi()
            }
            ,

            // ----------------------------------------------------------------
            //
            //                        checkParents
            //
            //
            //
            //
            // ----------------------------------------------------------------

            checkParents: async function( jsonPath ) {
                var lastDotPos = jsonPath.lastIndexOf(".")
                if (lastDotPos != -1) {
                    jsonPath = jsonPath.substring(jsonPath,lastDotPos)
                    //alert(jsonPath)
                    this.args.productionFilter[jsonPath] = true
                    this.checkParents(jsonPath)
                }
                this.showAsCode = false
            }
            ,

            // ----------------------------------------------------------------
            //
            //                        uncheckChildren
            //
            //
            //
            //
            // ----------------------------------------------------------------

            uncheckChildren: async function( jsonPath ) {
                for ( var ert = 0  ;  ert < this.args.jsonPaths.length  ;  ert++  ) {
                    if (this.args.jsonPaths[ert].startsWith(jsonPath)) {
                        this.args.productionFilter[this.args.jsonPaths[ert]] = false
                    }
                }
                this.showAsCode = false
            }
            ,

            // ----------------------------------------------------------------
            //
            //                             selectNone
            //
            //
            //
            //
            // ----------------------------------------------------------------

            selectNone: async function( ) {
                for ( var ert = 0  ;  ert < this.args.jsonPaths.length  ;  ert++  ) {
                    if (this.args.productionFilter[this.args.jsonPaths[ert]] == true) {
                        this.args.productionFilter[this.args.jsonPaths[ert]] = false
                    }
                }
                this.filterProductionRestApi()
                this.showAsCode = false
            }
            ,

            // ----------------------------------------------------------------
            //
            //                     callLiveRestApi
            //
            //
            //
            //
            // ----------------------------------------------------------------

            callLiveRestApi: async function( ) {

                //
                // get the JSON response
                //
                this.showAsCode = false
                this.args.filteredProductionResponse = new Object()
                var jsonResponse  = await this.callRestApiInternal(this.args.URL,true,true)
                this.args.productionResponse   = jsonResponse
                this.args.filteredProductionResponse = JSON.parse(JSON.stringify(this.args.productionResponse))

                //
                // get the JSON paths and roots in the  response
                //

                var aa = await this.getListOfResponsePathsForJson(jsonResponse)
                this.args.jsonPaths = Object.keys(aa.paths)
                this.args.jsonRoots = Object.keys(aa.roots)

                //
                // show all the fields in the JSON response
                //
                for (var ert=0;ert<this.args.jsonPaths.length;ert++) {
                     if (this.args.productionFilter[this.args.jsonPaths[ert]] == undefined) {
                            this.args.productionFilter[this.args.jsonPaths[ert]] = true
                     }

                }

            }
            ,

            // ----------------------------------------------------------------
            //
            //                             showAsCode
            //
            //
            //
            //
            // ----------------------------------------------------------------

            showThisAsCode: async function() {
                this.showAsCode  = true
            }
            ,

            // ----------------------------------------------------------------
            //
            //                             hide code
            //
            //
            //
            //
            // ----------------------------------------------------------------

            hideCode: async function() {

                this.showAsCode  = false
            }
            ,

            // ----------------------------------------------------------------
            //
            //                          filterLiveRestApi
            //
            //
            //
            //
            // ----------------------------------------------------------------

            filterProductionRestApi: async function() {
                var aa = await this.getJsonFiltered(this.args.productionResponse)
                this.args.filteredProductionResponse  = aa
                this.args.response  = aa
            }

            ,

            makeLive: async function() {

            }

        }

    })
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/picture_border"
    android:padding="@dimen/marginBase">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/picture_border"
        android:padding="1px">

        <com.uit_252254.mr3chi.kltn.Controls.CustomImageView xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/image"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/picture_border"
            android:scaleType="centerCrop"
            android:src="@drawable/sample_photo" />
    </RelativeLayout>

</RelativeLayout>


text:
package com.amazonaws.services.elasticache.model;

/**
 *
 */
public enum ChangeType {

    Immediate("immediate"),
    RequiresReboot("requires-reboot");

    private String value;

    private ChangeType(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return ChangeType corresponding to the value
     */
    public static ChangeType fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (ChangeType enumEntry : ChangeType.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value
                + " value!");
    }
}


text:
<!DOCTYPE HTML>

		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>SFOAuthCoordinatorDelegate Protocol Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<meta name="viewport" content="width=550" />
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.0.5 (build 789)" />

SalesforceOAuth

				Salesforce.com

SFOAuthCoordinatorDelegate Protocol Reference

					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents">Table of Contents</button>

					<select id="jumpTo">
	<option value="top">Jump To…</option>

	<option value="overview">Overview</option>

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

	<option value="instance_methods">Instance Methods</option>

	<option value="//api/name/oauthCoordinator:didBeginAuthenticationWithView:">    - oauthCoordinator:didBeginAuthenticationWithView:</option>

	<option value="//api/name/oauthCoordinator:didFailWithError:">    - oauthCoordinator:didFailWithError:</option>

	<option value="//api/name/oauthCoordinator:didFailWithError:authInfo:">    - oauthCoordinator:didFailWithError:authInfo:</option>

	<option value="//api/name/oauthCoordinator:didFinishLoad:error:">    - oauthCoordinator:didFinishLoad:error:</option>

	<option value="//api/name/oauthCoordinator:didStartLoad:">    - oauthCoordinator:didStartLoad:</option>

	<option value="//api/name/oauthCoordinator:willBeginAuthenticationWithView:">    - oauthCoordinator:willBeginAuthenticationWithView:</option>

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

	<option value="//api/name/oauthCoordinatorDidAuthenticate:authInfo:">    - oauthCoordinatorDidAuthenticate:authInfo:</option>

</select>

Overview

Tasks

Instance Methods

oauthCoordinator:didBeginAuthenticationWithView:

oauthCoordinator:didFailWithError:

oauthCoordinator:didFailWithError:authInfo:

oauthCoordinator:didFinishLoad:error:

oauthCoordinator:didStartLoad:

oauthCoordinator:willBeginAuthenticationWithView:

oauthCoordinatorDidAuthenticate:

oauthCoordinatorDidAuthenticate:authInfo:

Index

Hierarchy

SFOAuthCoordinatorDelegate Protocol Reference

	Conforms to
	NSObject

	Declared in
	SFOAuthCoordinator.h

Overview

Protocol for objects intending to be a delegate for an OAuth coordinator.

Implement this protocol to receive updates from an SFOAuthCoordinator instance.
Use these methods to update your interface and refresh your application once a session restarts.

Tasks

		– oauthCoordinator:willBeginAuthenticationWithView:

Sent when authentication will begin.

		– oauthCoordinator:didStartLoad:

Sent when the web will starts to load its content.

		– oauthCoordinator:didFinishLoad:error:

Sent when the web will completed to load its content.

		– oauthCoordinatorDidAuthenticate:

Sent when authentication successfully completes. Note: This method is deprecated.  You should use
the oauthCoordinatorDidAuthenticate:authInfo: method instead.

		– oauthCoordinatorDidAuthenticate:authInfo:

Sent when authentication successfully completes.

		– oauthCoordinator:didFailWithError:

Sent if authentication fails due to an error. Note: This method is deprecated.  You should use the
oauthCoordinator:didFailWithError:authInfo method instead.

		– oauthCoordinator:didFailWithError:authInfo:

Sent if authentication fails due to an error.

		– oauthCoordinator:didBeginAuthenticationWithView:

Sent after authentication has begun and the view parameter is displaying the first page of authentication content.

	required method

Instance Methods

oauthCoordinator:didBeginAuthenticationWithView:

Sent after authentication has begun and the view parameter is displaying the first page of authentication content.

- (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator didBeginAuthenticationWithView:(UIWebView *)view

Parameters

coordinator

The SFOAuthCoordinator instance processing this message

view

The UIWebView instance that will be used to conduct the authentication workflow

Discussion

Sent after authentication has begun and the view parameter is displaying the first page of authentication content.

The delegate will receive this message when the first page of the authentication flow is visible in the view parameter.
The receiver should display the view in the implementation of this method.

Warning: the view parameter must be added to a superview upon completion of this method or an assert will fail

See Also

SFOAuthCoordinator

Declared In

		SFOAuthCoordinator.h

oauthCoordinator:didFailWithError:

Sent if authentication fails due to an error. Note: This method is deprecated.  You should use the
oauthCoordinator:didFailWithError:authInfo method instead.

- (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator didFailWithError:(NSError *)error

Parameters

coordinator

The SFOAuthCoordinator instance processing this message

error

The error message

Discussion

Sent if authentication fails due to an error. Note: This method is deprecated.  You should use the
oauthCoordinator:didFailWithError:authInfo method instead.

See Also

SFOAuthCoordinator

Declared In

		SFOAuthCoordinator.h

oauthCoordinator:didFailWithError:authInfo:

Sent if authentication fails due to an error.

- (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator didFailWithError:(NSError *)error authInfo:(SFOAuthInfo *)info

Parameters

coordinator

The SFOAuthCoordinator instance processing this message.

error

The error associated with the failure.

info

Object containing info associated with the authentication attempt.

Discussion

Sent if authentication fails due to an error.

See Also

SFOAuthCoordinator

Declared In

		SFOAuthCoordinator.h

oauthCoordinator:didFinishLoad:error:

Sent when the web will completed to load its content.

- (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator didFinishLoad:(UIWebView *)view error:(NSError *)errorOrNil

Parameters

coordinator

The SFOAuthCoordinator instance processing this message

view

The UIWebView instance that will be used to conduct the authentication workflow

errorOrNil

Contains the error or nil if no error

Discussion

Sent when the web will completed to load its content.

Declared In

		SFOAuthCoordinator.h

oauthCoordinator:didStartLoad:

Sent when the web will starts to load its content.

- (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator didStartLoad:(UIWebView *)view

Parameters

coordinator

The SFOAuthCoordinator instance processing this message

view

The UIWebView instance that will be used to conduct the authentication workflow

Discussion

Sent when the web will starts to load its content.

Declared In

		SFOAuthCoordinator.h

oauthCoordinator:willBeginAuthenticationWithView:

Sent when authentication will begin.

- (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator willBeginAuthenticationWithView:(UIWebView *)view

Parameters

coordinator

The SFOAuthCoordinator instance processing this message

view

The UIWebView instance that will be used to conduct the authentication workflow

Discussion

Sent when authentication will begin.

This method supplies the delegate with the UIWebView instance, which the user will use to input their OAuth credentials
during the login process. At the time this method is called the UIWebView may not yet have any content loaded,
therefore the UIWebView should not be displayed until willBeginAuthenticationWithView:

See Also

SFOAuthCoordinator

Declared In

		SFOAuthCoordinator.h

oauthCoordinatorDidAuthenticate:

Sent when authentication successfully completes. Note: This method is deprecated.  You should use
the oauthCoordinatorDidAuthenticate:authInfo: method instead.

- (void)oauthCoordinatorDidAuthenticate:(SFOAuthCoordinator *)coordinator

Parameters

coordinator

The SFOAuthCoordinator instance processing this message

Discussion

Sent when authentication successfully completes. Note: This method is deprecated.  You should use
the oauthCoordinatorDidAuthenticate:authInfo: method instead.

See Also

SFOAuthCoordinator

Declared In

		SFOAuthCoordinator.h

oauthCoordinatorDidAuthenticate:authInfo:

Sent when authentication successfully completes.

- (void)oauthCoordinatorDidAuthenticate:(SFOAuthCoordinator *)coordinator authInfo:(SFOAuthInfo *)info

Parameters

coordinator

The SFOAuthCoordinator instance processing this message.

info

Object containing info associated with this authentication attempt.

Discussion

Sent when authentication successfully completes.

See Also

SFOAuthCoordinator

Declared In

		SFOAuthCoordinator.h

Index

Hierarchy

© 2012 Salesforce.com. All rights reserved. (Last updated: 2012-09-03)

						Generated by appledoc 2.0.5 (build 789).


text:
package com.nirima.libvirt.model;

import java.io.Serializable;

/**
 * @author Nigel Magnay
 */
public class RemoteDomainEmulatorPinInfo implements Serializable {

    public int[] cpumaps;
    public int ret;
}


text:
namespace {

#if !defined(OS_ANDROID)
const base::char16 kDot = '.';

// Build a path from the first |num_components| elements in |path_elements|.
// Prepends |path_prefix|, appends |filename|, inserts ellipsis if appropriate.
base::string16 BuildPathFromComponents(
    const base::string16& path_prefix,
    const std::vector<base::string16>& path_elements,
    const base::string16& filename,
    size_t num_components) {
  DCHECK_LE(num_components, path_elements.size());

  // Add the initial elements of the path.
  base::string16 path = path_prefix;

  // Build path from first |num_components| elements.
  for (size_t j = 0; j < num_components; ++j)
    path += path_elements[j] + gfx::kForwardSlash;

  // Add |filename|, ellipsis if necessary.
  if (num_components != (path_elements.size() - 1))
    path += base::string16(gfx::kEllipsisUTF16) + gfx::kForwardSlash;
  path += filename;

  return path;
}

// Takes a prefix (Domain, or Domain+subdomain) and a collection of path
// components and elides if possible. Returns a string containing the longest
// possible elided path, or an empty string if elision is not possible.
base::string16 ElideComponentizedPath(
    const base::string16& url_path_prefix,
    const std::vector<base::string16>& url_path_elements,
    const base::string16& url_filename,
    const base::string16& url_query,
    const gfx::FontList& font_list,
    float available_pixel_width) {
  CHECK(!url_path_elements.empty());

  // Find the longest set of leading path components that fits in
  // |available_pixel_width|.  Since BuildPathFromComponents() is O(n), using a
  // binary search here makes the overall complexity O(n lg n), which is
  // meaningful since there may be thousands of components in extreme cases.
  base::string16 elided_path_at_min_index;
  size_t min_index = 0;
  for (size_t max_index = url_path_elements.size();
       min_index != max_index - 1;) {
    const size_t cutting_index = (min_index + max_index) / 2;
    const base::string16 elided_path = BuildPathFromComponents(
        url_path_prefix, url_path_elements, url_filename, cutting_index);
    if (gfx::GetStringWidthF(elided_path, font_list) <= available_pixel_width) {
      min_index = cutting_index;
      elided_path_at_min_index = elided_path;
    } else {
      max_index = cutting_index;
    }
  }

  // If the cutting point is at the beginning and nothing gets elided, return
  // failure even if the whole text could fit. TODO(https://crbug.com/1074034).
  if (min_index == 0)
    return base::string16();

  // Elide starting at |min_index|.
  return gfx::ElideText(elided_path_at_min_index + url_query, font_list,
                        available_pixel_width, gfx::ELIDE_TAIL);
}

// Splits the hostname in the |url| into sub-strings for the full hostname,
// the domain (TLD+1), and the subdomain (everything leading the domain).
void SplitHost(const GURL& url,
               base::string16* url_host,
               base::string16* url_domain,
               base::string16* url_subdomain) {
  // GURL stores IDN hostnames in punycode.  Convert back to Unicode for
  // display to the user.  (IDNToUnicode() will only perform this conversion
  // if it's safe to display this host/domain in Unicode.)
  *url_host = url_formatter::IDNToUnicode(url.host());

  // Get domain and registry information from the URL.
  std::string domain_puny =
      net::registry_controlled_domains::GetDomainAndRegistry(
          url, net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
  *url_domain = domain_puny.empty() ?
      *url_host : url_formatter::IDNToUnicode(domain_puny);

  // Add port if required.
  if (!url.port().empty()) {
    *url_host += base::UTF8ToUTF16(":" + url.port());
    *url_domain += base::UTF8ToUTF16(":" + url.port());
  }

  // Get sub domain.
  const size_t domain_start_index = url_host->find(*url_domain);
  base::string16 kWwwPrefix = base::UTF8ToUTF16("www.");
  if (domain_start_index != base::string16::npos)
    *url_subdomain = url_host->substr(0, domain_start_index);
  if ((*url_subdomain == kWwwPrefix || url_subdomain->empty() ||
       url.SchemeIsFile())) {
    url_subdomain->clear();
  }
}
#endif  // !defined(OS_ANDROID)

bool ShouldShowScheme(base::StringPiece scheme,
                      const url_formatter::SchemeDisplay scheme_display) {
  switch (scheme_display) {
    case url_formatter::SchemeDisplay::SHOW:
      return true;

    case url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS:
      return scheme != url::kHttpsScheme && scheme != url::kHttpScheme;

    case url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC:
      return scheme != url::kHttpsScheme && scheme != url::kWssScheme;
  }

  return true;
}

// TODO(jshin): Come up with a way to show Bidi URLs 'safely' (e.g. wrap up
// the entire url with {LSI, PDI} and individual domain labels with {FSI, PDI}).
// See http://crbug.com/650760 . For now, fall back to punycode if there's a
// strong RTL character.
base::string16 HostForDisplay(base::StringPiece host_in_puny) {
  base::string16 host = url_formatter::IDNToUnicode(host_in_puny);
  return base::i18n::StringContainsStrongRTLChars(host) ?
      base::ASCIIToUTF16(host_in_puny) : host;
}

}  // namespace

namespace url_formatter {

#if !defined(OS_ANDROID)

// TODO(pkasting): http://crbug.com/77883 This whole function gets
// kerning/ligatures/etc. issues potentially wrong by assuming that the width of
// a rendered string is always the sum of the widths of its substrings.  Also I
// suspect it could be made simpler.
base::string16 ElideUrl(const GURL& url,
                        const gfx::FontList& font_list,
                        float available_pixel_width) {
  // Get a formatted string and corresponding parsing of the url.
  url::Parsed parsed;
  const base::string16 url_string = url_formatter::FormatUrl(
      url, url_formatter::kFormatUrlOmitDefaults, net::UnescapeRule::SPACES,
      &parsed, nullptr, nullptr);
  if (available_pixel_width <= 0)
    return url_string;

  if (!url.IsStandard()) {
    return gfx::ElideText(url_string, font_list, available_pixel_width,
                          gfx::ELIDE_TAIL);
  }

  // Now start eliding url_string to fit within available pixel width.
  // Fist pass - check to see whether entire url_string fits.
  const float pixel_width_url_string =
      gfx::GetStringWidthF(url_string, font_list);
  if (available_pixel_width >= pixel_width_url_string)
    return url_string;

  // Get the path substring, including query and reference.
  const size_t path_start_index = parsed.path.begin;
  const size_t path_len = parsed.path.len;
  base::string16 url_path_query_etc;
  base::string16 url_path;
  if (parsed.path.is_valid()) {
    url_path_query_etc = url_string.substr(path_start_index);
    url_path = url_string.substr(path_start_index, path_len);
  }

  // Return general elided text if url minus the query fits.
  const base::string16 url_minus_query =
      url_string.substr(0, path_start_index + path_len);
  if (available_pixel_width >=
      gfx::GetStringWidthF(url_minus_query, font_list)) {
    return gfx::ElideText(url_string, font_list, available_pixel_width,
                          gfx::ELIDE_TAIL);
  }

  base::string16 url_host;
  base::string16 url_domain;
  base::string16 url_subdomain;
  SplitHost(url, &url_host, &url_domain, &url_subdomain);

  // If this is a file type, the path is now defined as everything after ":".
  // For example, "C:/aa/aa/bb", the path is "/aa/bb/cc". Interesting, the
  // domain is now C: - this is a nice hack for eliding to work pleasantly.
  if (url.SchemeIsFile()) {
    // Split the path string using ":"
    const base::string16 kColon(1, ':');
    std::vector<base::string16> file_path_split = base::SplitString(
        url_path, kColon, base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
    if (file_path_split.size() > 1) {  // File is of type "file:///C:/.."
      url_host.clear();
      url_domain.clear();
      url_subdomain.clear();

      url_host = url_domain = file_path_split.at(0).substr(1) + kColon;
      url_path_query_etc = url_path = file_path_split.at(1);
    }
  }

  // Second Pass - remove scheme - the rest fits.
  const float pixel_width_url_host = gfx::GetStringWidthF(url_host, font_list);
  const float pixel_width_url_path =
      gfx::GetStringWidthF(url_path_query_etc, font_list);
  if (available_pixel_width >= pixel_width_url_host + pixel_width_url_path)
    return url_host + url_path_query_etc;

  // Third Pass: Subdomain, domain and entire path fits.
  const float pixel_width_url_domain =
      gfx::GetStringWidthF(url_domain, font_list);
  const float pixel_width_url_subdomain =
      gfx::GetStringWidthF(url_subdomain, font_list);
  if (available_pixel_width >=
      pixel_width_url_subdomain + pixel_width_url_domain + pixel_width_url_path)
    return url_subdomain + url_domain + url_path_query_etc;

  // Query element.
  base::string16 url_query;
  const float kPixelWidthDotsTrailer =
      gfx::GetStringWidthF(base::string16(gfx::kEllipsisUTF16), font_list);
  if (parsed.query.is_nonempty()) {
    url_query = base::UTF8ToUTF16("?") + url_string.substr(parsed.query.begin);
    if (available_pixel_width >=
        (pixel_width_url_subdomain + pixel_width_url_domain +
         pixel_width_url_path - gfx::GetStringWidthF(url_query, font_list))) {
      return gfx::ElideText(url_subdomain + url_domain + url_path_query_etc,
                            font_list, available_pixel_width, gfx::ELIDE_TAIL);
    }
  }

  // Parse url_path using '/'.
  std::vector<base::string16> url_path_elements =
      base::SplitString(url_path, base::string16(1, gfx::kForwardSlash),
                        base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);

  // Get filename - note that for a path ending with /
  // such as www.google.com/intl/ads/, the file name is ads/.
  base::string16 url_filename(
      url_path_elements.empty() ? base::string16() : url_path_elements.back());
  size_t url_path_number_of_elements = url_path_elements.size();
  if (url_filename.empty() && (url_path_number_of_elements > 1)) {
    // Path ends with a '/'.
    --url_path_number_of_elements;
    url_filename =
        url_path_elements[url_path_number_of_elements - 1] + gfx::kForwardSlash;
  }

  // Start eliding the path and replacing elements by ".../".
  const base::string16 kEllipsisAndSlash =
      base::string16(gfx::kEllipsisUTF16) + gfx::kForwardSlash;
  const float pixel_width_ellipsis_slash =
      gfx::GetStringWidthF(kEllipsisAndSlash, font_list);

  // Check with both subdomain and domain.
  if (url_path_number_of_elements > 0) {
    base::string16 elided_path = ElideComponentizedPath(
        url_subdomain + url_domain, url_path_elements, url_filename, url_query,
        font_list, available_pixel_width);
    if (!elided_path.empty())
      return elided_path;
  }

  // Check with only domain.
  // If a subdomain is present, add an ellipsis before domain.
  // This is added only if the subdomain pixel width is larger than
  // the pixel width of kEllipsis. Otherwise, subdomain remains,
  // which means that this case has been resolved earlier.
  base::string16 url_elided_domain = url_subdomain + url_domain;
  if (pixel_width_url_subdomain > kPixelWidthDotsTrailer) {
    if (!url_subdomain.empty())
      url_elided_domain = kEllipsisAndSlash[0] + url_domain;
    else
      url_elided_domain = url_domain;

    if (url_path_number_of_elements > 0) {
      base::string16 elided_path = ElideComponentizedPath(
          url_elided_domain, url_path_elements, url_filename, url_query,
          font_list, available_pixel_width);
      if (!elided_path.empty())
        return elided_path;
    }
  }

  // Return elided domain/.../filename anyway.
  base::string16 final_elided_url_string(url_elided_domain);
  const float url_elided_domain_width =
      gfx::GetStringWidthF(url_elided_domain, font_list);

  // A hack to prevent trailing ".../...".
  if (url_path_number_of_elements > 0 &&
      url_elided_domain_width + pixel_width_ellipsis_slash +
              kPixelWidthDotsTrailer +
              gfx::GetStringWidthF(base::ASCIIToUTF16("UV"), font_list) <
          available_pixel_width) {
    final_elided_url_string += BuildPathFromComponents(
        base::string16(), url_path_elements, url_filename, 1);
  } else {
    final_elided_url_string += url_path;
  }

  return gfx::ElideText(final_elided_url_string, font_list,
                        available_pixel_width, gfx::ELIDE_TAIL);
}

base::string16 ElideHost(const GURL& url,
                         const gfx::FontList& font_list,
                         float available_pixel_width) {
  base::string16 url_host;
  base::string16 url_domain;
  base::string16 url_subdomain;
  SplitHost(url, &url_host, &url_domain, &url_subdomain);

  const float pixel_width_url_host = gfx::GetStringWidthF(url_host, font_list);
  if (available_pixel_width >= pixel_width_url_host)
    return url_host;

  if (url_subdomain.empty())
    return url_domain;

  const float pixel_width_url_domain =
      gfx::GetStringWidthF(url_domain, font_list);
  float subdomain_width = available_pixel_width - pixel_width_url_domain;
  if (subdomain_width <= 0)
    return base::string16(gfx::kEllipsisUTF16) + kDot + url_domain;

  return gfx::ElideText(url_host, font_list, available_pixel_width,
                        gfx::ELIDE_HEAD);
}

#endif  // !defined(OS_ANDROID)

base::string16 FormatUrlForSecurityDisplay(const GURL& url,
                                           const SchemeDisplay scheme_display) {
  if (!url.is_valid() || url.is_empty() || !url.IsStandard())
    return url_formatter::FormatUrl(url);

  const base::string16 colon(base::ASCIIToUTF16(":"));
  const base::string16 scheme_separator(
      base::ASCIIToUTF16(url::kStandardSchemeSeparator));

  if (url.SchemeIsFile()) {
    return base::ASCIIToUTF16(url::kFileScheme) + scheme_separator +
           base::UTF8ToUTF16(url.path());
  }

  if (url.SchemeIsFileSystem()) {
    const GURL* inner_url = url.inner_url();
    if (inner_url->SchemeIsFile()) {
      return base::ASCIIToUTF16(url::kFileSystemScheme) + colon +
             FormatUrlForSecurityDisplay(*inner_url) +
             base::UTF8ToUTF16(url.path());
    }
    return base::ASCIIToUTF16(url::kFileSystemScheme) + colon +
           FormatUrlForSecurityDisplay(*inner_url);
  }

  const GURL origin = url.GetOrigin();
  base::StringPiece scheme = origin.scheme_piece();
  base::StringPiece host = origin.host_piece();

  base::string16 result;
  if (ShouldShowScheme(scheme, scheme_display))
    result = base::UTF8ToUTF16(scheme) + scheme_separator;
  result += HostForDisplay(host);

  const int port = origin.IntPort();
  const int default_port = url::DefaultPortForScheme(
      scheme.data(), static_cast<int>(scheme.length()));
  if (port != url::PORT_UNSPECIFIED && port != default_port)
    result += colon + base::UTF8ToUTF16(origin.port_piece());

  return result;
}

base::string16 FormatOriginForSecurityDisplay(
    const url::Origin& origin,
    const SchemeDisplay scheme_display) {
  base::StringPiece scheme = origin.scheme();
  base::StringPiece host = origin.host();
  if (scheme.empty() && host.empty())
    return base::string16();

  const base::string16 colon(base::ASCIIToUTF16(":"));
  const base::string16 scheme_separator(
      base::ASCIIToUTF16(url::kStandardSchemeSeparator));

  base::string16 result;
  if (ShouldShowScheme(scheme, scheme_display))
    result = base::UTF8ToUTF16(scheme) + scheme_separator;
  result += HostForDisplay(host);

  int port = static_cast<int>(origin.port());
  const int default_port = url::DefaultPortForScheme(
      scheme.data(), static_cast<int>(scheme.length()));
  if (port != 0 && port != default_port)
    result += colon + base::NumberToString16(origin.port());

  return result;
}

}  // namespace url_formatter


text:
var ran = false;

async function test() {
  try {
    let namespace = await import('modules-skip-4.js');
    assertEquals(42, namespace.life());
    assertEquals("42", namespace.stringlife);
    ran = true;
  } catch(e) {
    %AbortJS('failure: '+ e);
  }
}

test();

%PerformMicrotaskCheckpoint();

assertTrue(ran);


text:
export const SetUID = 'set_uid';
export const Subscribe = 'subscribe';
export const Unsubscribe = 'unsubscribe';
export const Push = 'push';
export const Update = 'update';
export const Remove = 'remove';
export const PushFile = 'push_file';
export const RemoveFile = 'remove_file';
export const RemoveFiles = 'remove_files';


text:
package me.aymen.castle.role;

/**
 * An Interface that represents the highest Role of a system. A super role contains
 * all other administrative roles. There should be only one super role in a system.
 * @author Aymen Alquaiti
 * @Date 19/07/2014
 */
public interface SuperRole extends AdminRole
{
    /**
     * Refers to the constant name given to SuperRole. Name is always "System Role"
     */
    public static final String name = "System Role";

    /**
     * Return Admin Roles linked to Super Role
     * @return Array of AdminRole object
     */
    AdminRole[] getAdminRoles();

    /**
     * Add Admin Role to Super Role. Name must be unique within a system. Admin
     * Role's names also must not be "System Role"
     * @param role Admin Role to Add
     * @throws IllegalArgumentException if AdminRole already exists, if value
     * passed is Super Role, or if Admin Role is named "System Role"
     * @throws NullPointerException if Role is null
     */
    void addAdminRole(AdminRole role) throws IllegalArgumentException, NullPointerException;

    /**
     * Remove Admin Role from Super Role. System Role cannot be removed
     * @param name Admin Role name
     * @throws IllegalArgumentException if Admin Role does not exist, or if name
     * passed is "System Role"
     */
    void removeAdminRole(String name) throws IllegalArgumentException;

    /**
     * Checks if Super Role contains an Admin Role
     * @param name Admin Role name
     * @return true if exist, false if not
     */
    boolean hasAdminRole(String name);

    /**
     * Return Admin Role linked to Super Role
     * @param name AdminRole name
     * @return AdminRole object
     * @throws IllegalArgumentException if Admin Role does not exist
     */
    AdminRole getAdminRole(String name) throws IllegalArgumentException;
}


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

namespace Ejemplos.DAO.DataSets
{
    partial class Empleados
    {
        partial class PersonRow
        {
            public string FullName
            {
                get
                {
                    return this.FirstName + " " + this.LastName;
                }
            }
        }

    }
}


text:
/*
 *  Illustrating Curiously Recurring Template Pattern
 */

#ifndef COUNTER_H
#define COUNTER_H

template <typename T> struct counter {
  static int objects_created;
  static int objects_alive;

  counter() {
    ++objects_created;
    ++objects_alive;
  }

  counter(const counter &) {
    ++objects_created;
    ++objects_alive;
  }

  int getCreated() { return objects_created; }

  int getAlive() { return objects_alive; }

protected:
  ~counter() { --objects_alive; }
};
template <typename T> int counter<T>::objects_created{0};
template <typename T> int counter<T>::objects_alive{0};

#endif


text:
<?xml version="1.0" encoding="utf-8"?>
<CrawlItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Text>12 narudžbi od kad su otvorili na pauzi, nikad problema ni s hranom ni s dostavom</Text>
  <Rating>6</Rating>
  <Source>http://pauza.hr/menu/halo-maksimirski-zmaj</Source>
</CrawlItem>


text:
namespace component_updater {

// Returns a string literal corresponding to the value of the downloader |d|.
const char* DownloaderToString(CrxDownloader::DownloadMetrics::Downloader d) {
  switch (d) {
    case CrxDownloader::DownloadMetrics::kUrlFetcher:
      return "direct";
    case CrxDownloader::DownloadMetrics::kBits:
      return "bits";
    default:
      return "unknown";
  }
}

// Sends a fire and forget ping. The instances of this class have no
// ownership and they self-delete upon completion.
class PingSender : public net::URLFetcherDelegate {
 public:
  PingSender();

  void SendPing(const GURL& ping_url,
                net::URLRequestContextGetter* url_request_context_getter,
                const CrxUpdateItem* item);
 private:
  virtual ~PingSender();

  // Overrides for URLFetcherDelegate.
  virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;

  static std::string BuildPing(const CrxUpdateItem* item);
  static std::string BuildDownloadCompleteEventElements(
      const CrxUpdateItem* item);
  static std::string BuildUpdateCompleteEventElement(const CrxUpdateItem* item);

  scoped_ptr<net::URLFetcher> url_fetcher_;

  DISALLOW_COPY_AND_ASSIGN(PingSender);
};

PingSender::PingSender() {}

PingSender::~PingSender() {}

void PingSender::OnURLFetchComplete(const net::URLFetcher* source) {
  delete this;
}

void PingSender::SendPing(
    const GURL& ping_url,
    net::URLRequestContextGetter* url_request_context_getter,
    const CrxUpdateItem* item) {
  DCHECK(item);

  if (!ping_url.is_valid())
    return;

  url_fetcher_.reset(SendProtocolRequest(ping_url,
                                         BuildPing(item),
                                         this,
                                         url_request_context_getter));
}

// Builds a ping message for the specified update item.
std::string PingSender::BuildPing(const CrxUpdateItem* item) {
  const char app_element_format[] =
      "<app appid=\"%s\" version=\"%s\" nextversion=\"%s\">"
      "%s"
      "%s"
      "</app>";
  const std::string app_element(base::StringPrintf(
      app_element_format,
      item->id.c_str(),                                     // "appid"
      item->previous_version.GetString().c_str(),           // "version"
      item->next_version.GetString().c_str(),               // "nextversion"
      BuildUpdateCompleteEventElement(item).c_str(),        // update event
      BuildDownloadCompleteEventElements(item).c_str()));   // download events

  return BuildProtocolRequest(app_element, "");
}

// Returns a string representing a sequence of download complete events
// corresponding to each download metrics in |item|.
std::string PingSender::BuildDownloadCompleteEventElements(
    const CrxUpdateItem* item) {
  using base::StringAppendF;
  std::string download_events;
  for (size_t i = 0; i != item->download_metrics.size(); ++i) {
    const CrxDownloader::DownloadMetrics& metrics = item->download_metrics[i];
    std::string event("<event eventtype=\"14\"");
    StringAppendF(&event, " eventresult=\"%d\"", metrics.error == 0);
    StringAppendF(&event,
                  " downloader=\"%s\"", DownloaderToString(metrics.downloader));
    if (metrics.error)
      StringAppendF(&event, " errorcode=\"%d\"", metrics.error);
    StringAppendF(&event, " url=\"%s\"", metrics.url.spec().c_str());

    // -1 means that the  byte counts are not known.
    if (metrics.bytes_downloaded != -1) {
      StringAppendF(&event, " downloaded=\"%s\"",
                    base::Int64ToString(metrics.bytes_downloaded).c_str());
    }
    if (metrics.bytes_total != -1) {
      StringAppendF(&event, " total=\"%s\"",
                    base::Int64ToString(metrics.bytes_total).c_str());
    }

    if (metrics.download_time_ms) {
      StringAppendF(&event, " download_time_ms=\"%s\"",
                    base::Uint64ToString(metrics.download_time_ms).c_str());
    }
    StringAppendF(&event, "/>");

    download_events += event;
  }
  return download_events;
}

// Returns a string representing one ping event xml element for an update item.
std::string PingSender::BuildUpdateCompleteEventElement(
    const CrxUpdateItem* item) {
  DCHECK(item->status == CrxUpdateItem::kNoUpdate ||
         item->status == CrxUpdateItem::kUpdated);

  using base::StringAppendF;

  std::string ping_event("<event eventtype=\"3\"");
  const int event_result = item->status == CrxUpdateItem::kUpdated;
  StringAppendF(&ping_event, " eventresult=\"%d\"", event_result);
  if (item->error_category)
    StringAppendF(&ping_event, " errorcat=\"%d\"", item->error_category);
  if (item->error_code)
    StringAppendF(&ping_event, " errorcode=\"%d\"", item->error_code);
  if (item->extra_code1)
    StringAppendF(&ping_event, " extracode1=\"%d\"", item->extra_code1);
  if (HasDiffUpdate(item))
    StringAppendF(&ping_event, " diffresult=\"%d\"", !item->diff_update_failed);
  if (item->diff_error_category)
    StringAppendF(&ping_event,
                  " differrorcat=\"%d\"",
                  item->diff_error_category);
  if (item->diff_error_code)
    StringAppendF(&ping_event, " differrorcode=\"%d\"", item->diff_error_code);
  if (item->diff_extra_code1) {
    StringAppendF(&ping_event,
                  " diffextracode1=\"%d\"",
                  item->diff_extra_code1);
  }
  if (!item->previous_fp.empty())
    StringAppendF(&ping_event, " previousfp=\"%s\"", item->previous_fp.c_str());
  if (!item->next_fp.empty())
    StringAppendF(&ping_event, " nextfp=\"%s\"", item->next_fp.c_str());
  StringAppendF(&ping_event, "/>");
  return ping_event;
}

PingManager::PingManager(
    const GURL& ping_url,
    net::URLRequestContextGetter* url_request_context_getter)
    : ping_url_(ping_url),
      url_request_context_getter_(url_request_context_getter) {
}

PingManager::~PingManager() {
}

// Sends a fire and forget ping when the updates are complete. The ping
// sender object self-deletes after sending the ping.
void PingManager::OnUpdateComplete(const CrxUpdateItem* item) {
  PingSender* ping_sender(new PingSender);
  ping_sender->SendPing(ping_url_, url_request_context_getter_, item);
}

}  // namespace component_updater