text:
package com.mocoder.dingding.web.controller;

import com.mocoder.dingding.model.LoginAccount;
import com.mocoder.dingding.service.LoginAccountService;
import com.mocoder.dingding.utils.bean.RedisRequestSession;
import com.mocoder.dingding.vo.CommonRequest;
import com.mocoder.dingding.vo.CommonResponse;
import com.mocoder.dingding.vo.LoginAccountRequest;
import com.mocoder.dingding.web.annotation.ValidateBody;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException;

/**
 * 登录账户相关功能的控制器,包括登录、注册、获取验证码等,其中获取验证码也对应不同的入口,这样是为了区分开是哪个功能调用的获取验证码,从来增加一些条件判断
 */
@Controller
@RequestMapping("/account/")
public class LoginAccountController {

    public static final Logger log = LogManager.getLogger(LoginAccountController.class);

    @Resource
    private LoginAccountService loginAccountService;

    @RequestMapping("loginByPass")
    @ResponseBody
    public CommonResponse<LoginAccount> loginByPassword(@ValidateBody(requiredAttrs = {"mobile", "password"}) LoginAccountRequest body, RedisRequestSession session,CommonRequest request) {
        //TODO 调试完成候去掉,保护用户关键信息隐私
        log.info("密码登陆开始:入参:body:{},request:{}", ReflectionToStringBuilder.toString(body, ToStringStyle.SIMPLE_STYLE),ReflectionToStringBuilder.toString(request, ToStringStyle.SIMPLE_STYLE));
        CommonResponse<LoginAccount> response = loginAccountService.loginByPass(body.getMobile(), body.getPassword(), session,request);
        log.info("密码登陆完成:{}", ReflectionToStringBuilder.toString(response, ToStringStyle.SIMPLE_STYLE));
        return response;
    }

    @RequestMapping(value = "loginByCode",method = {RequestMethod.POST})
    @ResponseBody
    public CommonResponse<LoginAccount> loginByCode(@ValidateBody(requiredAttrs = {"mobile", "verifyCode"}) LoginAccountRequest body, RedisRequestSession session,CommonRequest request) {
        log.info("验证码登陆开始:入参:body:{},request:{}", ReflectionToStringBuilder.toString(body, ToStringStyle.SIMPLE_STYLE),ReflectionToStringBuilder.toString(request, ToStringStyle.SIMPLE_STYLE));
        CommonResponse<LoginAccount> response  = loginAccountService.loginByVerifyCode(body.getMobile(), body.getVerifyCode(), session,request);
        log.info("验证码登陆完成:{}", ReflectionToStringBuilder.toString(response, ToStringStyle.SIMPLE_STYLE));
        return response;
    }

    @RequestMapping("getRegVerifyCode")
    @ResponseBody
    public CommonResponse<String> getRegVerifyCode(@ValidateBody(requiredAttrs = "mobile") LoginAccountRequest body, RedisRequestSession session) {
        log.info("获取注册验证码开始:入参:body:{}", ReflectionToStringBuilder.toString(body, ToStringStyle.SIMPLE_STYLE));
        CommonResponse<String> response = loginAccountService.getRegVerifyCode(body.getMobile(), session);
        log.info("获取注册验证码完成:{}", ReflectionToStringBuilder.toString(response, ToStringStyle.SIMPLE_STYLE));
        return response;
    }

    @RequestMapping("getLoginVerifyCode")
    @ResponseBody
    public CommonResponse<String> getLoginVerifyCode(@ValidateBody(requiredAttrs = "mobile") LoginAccountRequest body, RedisRequestSession session) {
        log.info("获取登陆验证码开始:入参:body:{}", ReflectionToStringBuilder.toString(body, ToStringStyle.SIMPLE_STYLE));
        CommonResponse<String> response = loginAccountService.getLoginVerifyCode(body.getMobile(), session);
        log.info("获取登陆验证码完成:{}", ReflectionToStringBuilder.toString(response, ToStringStyle.SIMPLE_STYLE));
        return response;
    }

    @RequestMapping("reg")
    @ResponseBody
    public CommonResponse<LoginAccount> reg(@ValidateBody(requiredAttrs = {"mobile","verifyCode"}) LoginAccountRequest body, RedisRequestSession session,CommonRequest request) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
        log.info("注册开始:入参:body:{},request:{}", ReflectionToStringBuilder.toString(body, ToStringStyle.SIMPLE_STYLE),ReflectionToStringBuilder.toString(request, ToStringStyle.SIMPLE_STYLE));
        CommonResponse<LoginAccount> response = loginAccountService.registerAccount(body, session,request);
        log.info("注册完成:{}", ReflectionToStringBuilder.toString(response, ToStringStyle.SIMPLE_STYLE));
        return response;
    }

    @RequestMapping("logout")
    @ResponseBody
    public CommonResponse<LoginAccount> logout(@ValidateBody(requiredAttrs = {"mobile"}) LoginAccountRequest body, RedisRequestSession session) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
        CommonResponse<LoginAccount> response = loginAccountService.logoutAccount(body, session);
        return response;
    }

    @RequestMapping("update")
    @ResponseBody
    public CommonResponse<LoginAccount> updateInfo(@ValidateBody(requiredAttrs = {"mobile"}) LoginAccountRequest body, RedisRequestSession session,CommonRequest request) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
        log.info("更新用户信息开始:入参:body:{},request:{}", ReflectionToStringBuilder.toString(body, ToStringStyle.SIMPLE_STYLE),ReflectionToStringBuilder.toString(request, ToStringStyle.SIMPLE_STYLE));
        CommonResponse<LoginAccount> response = loginAccountService.updateAccount(body, session,request);
        log.info("更新用户信息完成:{}", ReflectionToStringBuilder.toString(response, ToStringStyle.SIMPLE_STYLE));
        return response;
    }
}


text:
Facebook-Graph-Helper
=====================

Helps in  fetching and posting using Facebook Graph API

This API is now in working condition.

To use :
=====================

Directly adding jar:
============
You can download the jar file from http://killer.heliohost.org/maven/com/killer923/dataFetcher/Facebook-Graph-Helper/1.0-SNAPSHOT/Facebook-Graph-Helper-1.0-SNAPSHOT.jar
and add it to your build path.

Maven:
============
In pom.xml of your project,

Add dependency

	<dependencies>
		<dependency>
			<groupId>com.killer923.dataFetcher</groupId>
			<artifactId>Facebook-Graph-Helper</artifactId>
			<version>1.0-SNAPSHOT</version>
		</dependency>
	</dependencies>

Add repository

	<repositories>
		<repository>
			<releases>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
				<checksumPolicy>fail</checksumPolicy>
			</releases>
			<id>com.killer923</id>
			<name>killer Maven Repository</name>
			<url>http://killer.heliohost.org/maven</url>
			<layout>default</layout>
		</repository>
	</repositories>

SAMPLE
============

package main;

import java.util.LinkedHashMap;
import com.killer923.dataFetcher.net.http.HttpRequestDispatcher;
import com.killer923.fb.model.Facebook;
import com.killer923.fb.model.FacebookVersion;
import com.killer923.fb.service.FacebookGraphService;

public class Main
{
	public static void main(String[] args)
	{
		//setup
		FacebookGraphService service = new FacebookGraphService();
		Facebook fb = new Facebook();
		fb.setApplicationId("<Application Id>");
		fb.setAccessToken("<Access Token generated by UI.>");
		fb.setVersion(FacebookVersion.unversionsed);
		HttpRequestDispatcher httpRequestDispatcher = new HttpRequestDispatcher();
		service.setFb(fb);
		service.setHttpRequestDispatcher(httpRequestDispatcher);

		//test
		try{
		LinkedHashMap me =service.getUrl("me?fields=id,name");
		System.out.println(me);
		LinkedHashMap friends = service.getUrl("me/friends");
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
// Licensed under the MIT License:
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package org.capnproto

import java.nio.ByteBuffer

import org.scalatest.FunSuite
import org.scalatest.Matchers._

class SerializeSuite extends FunSuite {
  /**
   * @param exampleSegmentCount number of segments
   * @param exampleBytes byte array containing `segmentCount` segments; segment `i` contains `i` words each set to `i`
   */
  def expectSerializesTo(exampleSegmentCount: Int, exampleBytes: Array[Byte]): Unit = {
    def checkSegmentContents(arena: ReaderArena): Unit = {
      arena.segments should have length exampleSegmentCount
      for (i <- 0 until exampleSegmentCount) {
        val segment = arena.segments.get(i)
        val segmentWords = segment.buffer.asLongBuffer()

        segmentWords.capacity should equal (i)
        segmentWords.rewind()
        while (segmentWords.hasRemaining) {
          segmentWords.get should equal (i)
        }
      }
    }

    // ----
    // read via ReadableByteChannel
    {
      val messageReader = Serialize.read(new ArrayInputStream(ByteBuffer.wrap(exampleBytes)))
      checkSegmentContents(messageReader.arena)
    }

    // ------
    // read via ByteBuffer
    {
      val messageReader = Serialize.read(ByteBuffer.wrap(exampleBytes))
      checkSegmentContents(messageReader.arena)
    }
  }

  test("SegmentReading") {
    // When transmitting over a stream, the following should be sent. All integers are unsigned and little-endian.
    // - (4 bytes) The number of segments, minus one (since there is always at least one segment).
    // - (N * 4 bytes) The size of each segment, in words.
    // - (0 or 4 bytes) Padding up to the next word boundary.
    // - The content of each segment, in order.

    expectSerializesTo(1, Array[Byte](
      0, 0, 0, 0, // 1 segment
      0, 0, 0, 0  // Segment 0 contains 0 bytes
      // No padding
      // Segment 0 (empty)
    ))

    expectSerializesTo(2, Array[Byte](
      1, 0, 0, 0, // 2 segments
      0, 0, 0, 0, // Segment 0 contains 0 words
      1, 0, 0, 0, // Segment 1 contains 1 words
      // Padding
      0, 0, 0, 0,
      // Segment 0 (empty)
      // Segment 1
      1, 0, 0, 0, 0, 0, 0, 0
    ))

    expectSerializesTo(3, Array[Byte](
      2, 0, 0, 0, // 3 segments
      0, 0, 0, 0, // Segment 0 contains 0 words
      1, 0, 0, 0, // Segment 1 contains 1 words
      2, 0, 0, 0, // Segment 2 contains 2 words
      // No padding
      // Segment 0 (empty)
      // Segment 1
      1, 0, 0, 0, 0, 0, 0, 0,
      // Segment 2
      2, 0, 0, 0, 0, 0, 0, 0,
      2, 0, 0, 0, 0, 0, 0, 0
    ))

    expectSerializesTo(4, Array[Byte](
      3, 0, 0, 0, // 4 segments
      0, 0, 0, 0, // Segment 0 contains 0 words
      1, 0, 0, 0, // Segment 1 contains 1 words
      2, 0, 0, 0, // Segment 2 contains 2 words
      3, 0, 0, 0, // Segment 3 contains 3 words
      // Padding
      0, 0, 0, 0,
      // Segment 0 (empty)
      // Segment 1
      1, 0, 0, 0, 0, 0, 0, 0,
      // Segment 2
      2, 0, 0, 0, 0, 0, 0, 0,
      2, 0, 0, 0, 0, 0, 0, 0,
      // Segment 3
      3, 0, 0, 0, 0, 0, 0, 0,
      3, 0, 0, 0, 0, 0, 0, 0,
      3, 0, 0, 0, 0, 0, 0, 0
    ))
  }
}


text:
package com.google.android.exoplayer.dash.mpd;

import java.util.Collections;
import java.util.List;

/**
 * Represents a set of interchangeable encoded versions of a media content component.
 */
public class AdaptationSet {

  public static final int TYPE_UNKNOWN = -1;
  public static final int TYPE_VIDEO = 0;
  public static final int TYPE_AUDIO = 1;
  public static final int TYPE_TEXT = 2;

  public final int id;

  public final int type;

  public final List<Representation> representations;
  public final List<ContentProtection> contentProtections;

  public AdaptationSet(int id, int type, List<Representation> representations,
      List<ContentProtection> contentProtections) {
    this.id = id;
    this.type = type;
    this.representations = Collections.unmodifiableList(representations);
    if (contentProtections == null) {
      this.contentProtections = Collections.emptyList();
    } else {
      this.contentProtections = Collections.unmodifiableList(contentProtections);
    }
  }

  public AdaptationSet(int id, int type, List<Representation> representations) {
    this(id, type, representations, null);
  }

  public boolean hasContentProtection() {
    return !contentProtections.isEmpty();
  }

}


text:
We're sorry, but something went wrong.

If you are the application owner check the logs for more information.


text:
extern "C" {
#endif

#include "include/capi/cef_base_capi.h"

///
// Structure used to represent a frame in the browser window. When used in the
// browser process the functions of this structure may be called on any thread
// unless otherwise indicated in the comments. When used in the render process
// the functions of this structure may only be called on the main thread.
///
typedef struct _cef_frame_t {
  ///
  // Base structure.
  ///
  cef_base_t base;

  ///
  // True if this object is currently attached to a valid frame.
  ///
  int (CEF_CALLBACK *is_valid)(struct _cef_frame_t* self);

  ///
  // Execute undo in this frame.
  ///
  void (CEF_CALLBACK *undo)(struct _cef_frame_t* self);

  ///
  // Execute redo in this frame.
  ///
  void (CEF_CALLBACK *redo)(struct _cef_frame_t* self);

  ///
  // Execute cut in this frame.
  ///
  void (CEF_CALLBACK *cut)(struct _cef_frame_t* self);

  ///
  // Execute copy in this frame.
  ///
  void (CEF_CALLBACK *copy)(struct _cef_frame_t* self);

  ///
  // Execute paste in this frame.
  ///
  void (CEF_CALLBACK *paste)(struct _cef_frame_t* self);

  ///
  // Execute delete in this frame.
  ///
  void (CEF_CALLBACK *del)(struct _cef_frame_t* self);

  ///
  // Execute select all in this frame.
  ///
  void (CEF_CALLBACK *select_all)(struct _cef_frame_t* self);

  ///
  // Save this frame's HTML source to a temporary file and open it in the
  // default text viewing application. This function can only be called from the
  // browser process.
  ///
  void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self);

  ///
  // Retrieve this frame's HTML source as a string sent to the specified
  // visitor.
  ///
  void (CEF_CALLBACK *get_source)(struct _cef_frame_t* self,
      struct _cef_string_visitor_t* visitor);

  ///
  // Retrieve this frame's display text as a string sent to the specified
  // visitor.
  ///
  void (CEF_CALLBACK *get_text)(struct _cef_frame_t* self,
      struct _cef_string_visitor_t* visitor);

  ///
  // Load the request represented by the |request| object.
  ///
  void (CEF_CALLBACK *load_request)(struct _cef_frame_t* self,
      struct _cef_request_t* request);

  ///
  // Load the specified |url|.
  ///
  void (CEF_CALLBACK *load_url)(struct _cef_frame_t* self,
      const cef_string_t* url);

  ///
  // Load the contents of |string_val| with the optional dummy target |url|.
  ///
  void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self,
      const cef_string_t* string_val, const cef_string_t* url);

  ///
  // Execute a string of JavaScript code in this frame. The |script_url|
  // parameter is the URL where the script in question can be found, if any. The
  // renderer may request this URL to show the developer the source of the
  // error.  The |start_line| parameter is the base line number to use for error
  // reporting.
  ///
  void (CEF_CALLBACK *execute_java_script)(struct _cef_frame_t* self,
      const cef_string_t* jsCode, const cef_string_t* scriptUrl,
      int startLine);

  ///
  // Returns true (1) if this is the main (top-level) frame.
  ///
  int (CEF_CALLBACK *is_main)(struct _cef_frame_t* self);

  ///
  // Returns true (1) if this is the focused frame.
  ///
  int (CEF_CALLBACK *is_focused)(struct _cef_frame_t* self);

  ///
  // Returns the name for this frame. If the frame has an assigned name (for
  // example, set via the iframe "name" attribute) then that value will be
  // returned. Otherwise a unique name will be constructed based on the frame
  // parent hierarchy. The main (top-level) frame will always have an NULL name
  // value.
  ///
  // The resulting string must be freed by calling cef_string_userfree_free().
  cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_frame_t* self);

  ///
  // Returns the globally unique identifier for this frame.
  ///
  int64 (CEF_CALLBACK *get_identifier)(struct _cef_frame_t* self);

  ///
  // Returns the parent of this frame or NULL if this is the main (top-level)
  // frame.
  ///
  struct _cef_frame_t* (CEF_CALLBACK *get_parent)(struct _cef_frame_t* self);

  ///
  // Returns the URL currently loaded in this frame.
  ///
  // The resulting string must be freed by calling cef_string_userfree_free().
  cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_frame_t* self);

  ///
  // Returns the browser that this frame belongs to.
  ///
  struct _cef_browser_t* (CEF_CALLBACK *get_browser)(struct _cef_frame_t* self);

  ///
  // Get the V8 context associated with the frame. This function can only be
  // called from the render process.
  ///
  struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)(
      struct _cef_frame_t* self);
} cef_frame_t;

#ifdef __cplusplus
}
#endif

#endif  // CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_


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

<TITLE>
URISpecification (Apache FOP 2.1 API)
</TITLE>

<META NAME="date" CONTENT="2016-01-07">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

fop 2.1

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.fop.datatypes

Class URISpecification

java.lang.Object
  org.apache.fop.datatypes.URISpecification

public final class URISpecification
extends java.lang.Object

This class contains method to deal with the <uri-specification> datatype from XSL-FO.

Method Summary

static java.lang.String
escapeURI(java.lang.String uri)

          Escapes any illegal URI character in a given URI, for example, it escapes a space to "%20".

static java.lang.String
getURL(java.lang.String href)

          Get the URL string from a wrapped URL.

Methods inherited from class java.lang.Object

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

Method Detail

getURL

public static java.lang.String getURL(java.lang.String href)

Get the URL string from a wrapped URL.

Parameters:
href - the input wrapped URL

Returns:
the raw URL

escapeURI

public static java.lang.String escapeURI(java.lang.String uri)

Escapes any illegal URI character in a given URI, for example, it escapes a space to "%20".
 Note: This method does not "parse" the URI and therefore does not treat the individual
 components (user-info, path, query etc.) individually.

Parameters:
uri - the URI to inspect

Returns:
the escaped URI

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

fop 2.1

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2016 The Apache Software Foundation. All Rights Reserved.


text:
#ifndef GRAPHLAB_RPC_THREAD_LOCAL_SEND_BUFFER_HPP
#define GRAPHLAB_RPC_THREAD_LOCAL_SEND_BUFFER_HPP
#include <serialization/oarchive.hpp>
#include <rpc/dc_compile_parameters.hpp>
#include <rpc/dc_internal_types.hpp>
#include <util/dense_bitset.hpp>
#include <graphlab/util/inplace_lf_queue2.hpp>
namespace graphlab {
class distributed_control;

namespace dc_impl {

struct thread_local_buffer {
  std::vector<inplace_lf_queue2<buffer_elem>* > outbuf;
  std::vector<size_t> bytes_sent;

  std::vector<mutex> archive_locks;
  // where all the writes happen
  std::vector<oarchive> current_archive;
  // where all the contended writes happen
  oarchive secondary_archive;
  size_t prev_acquire_archive_size;
  bool using_secondary;

  procid_t procid;
  distributed_control* dc;

  thread_local_buffer();
  ~thread_local_buffer();

  /**
   * Must be called from within the thread owning this buffer.
   * Acquires a buffer to write to
   */
  oarchive* acquire(procid_t target);

  inline size_t get_bytes_sent(procid_t target) {
    return bytes_sent[target];
  }
  /**
   * Must be called from within the thread owning this buffer.
   * Releases a buffer previously acquired with acquire
   */
  void release(procid_t target, bool do_not_count_bytes_sent);

  void write(procid_t target, char* c, size_t len, bool do_not_count_bytes_sent);

  /**
   * Must be called from within the thread owning this buffer.
   * Flushes the buffer to the sender. This should really only be used
   * when the thread is dying since this incurs a large performance penalty by
   * locking up the sender.
   */
  void push_flush();

  /**
   * Can be called anywhere.
   * Flushes the buffer to the sender. This function blocks until all
   * buffers have been flushed. Equivalent to calling distributed_control::flush()
   */
  void pull_flush();

  /**
   * Can be called anywhere.
   * Flushes the buffer to the sender. This function blocks until all
   * buffers have been flushed. Equivalent to calling distributed_control::flush()
   */
  void pull_flush(procid_t p);

  /**
   * Can be called anywhere.
   * Flushes the buffer to the sender. This function requests a flush to happen
   * soon. Equivalent to calling distributed_control::flush()
   */
  void pull_flush_soon();

  /**
   * Can be called anywhere.
   * Flushes the buffer to the sender. This function requests a flush to happen
   * soon. Equivalent to calling distributed_control::flush()
   */
  void pull_flush_soon(procid_t p);

  /**
   * Extracts the buffer going to a given target.
   * The first element of the pair points to the head of the linked list
   * The linked list ends when the pointer becomes the second element of
   * the pair.
   */
  std::pair<buffer_elem*, buffer_elem*> extract(procid_t target);

  void inc_calls_sent(procid_t target);

  void add_to_queue(procid_t target, char* ptr, size_t len);
};
}
}
#endif


text:
package com.sequenceiq.freeipa.flow.freeipa.repair.changeprimarygw;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.util.List;
import java.util.Optional;
import java.util.Set;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import com.sequenceiq.cloudbreak.common.exception.NotFoundException;
import com.sequenceiq.cloudbreak.common.orchestration.Node;
import com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException;
import com.sequenceiq.cloudbreak.orchestrator.host.HostOrchestrator;
import com.sequenceiq.cloudbreak.orchestrator.model.GatewayConfig;
import com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceMetadataType;
import com.sequenceiq.freeipa.entity.InstanceMetaData;
import com.sequenceiq.freeipa.entity.Stack;
import com.sequenceiq.freeipa.repository.InstanceMetaDataRepository;
import com.sequenceiq.freeipa.service.GatewayConfigService;
import com.sequenceiq.freeipa.service.freeipa.flow.FreeIpaNodeUtilService;

@ExtendWith(MockitoExtension.class)
class ChangePrimaryGatewayServiceTest {

    private static final Long STACK_ID = 1L;

    private static final String INSTANCE_ID_1 = "i-1";

    private static final String INSTANCE_ID_2 = "i-2";

    private static final String INSTANCE_ID_3 = "i-3";

    private static final String HOSTNAME_1 = "example1.com";

    private static final String HOSTNAME_2 = "example2.com";

    private static final String HOSTNAME_3 = "example3.com";

    @Mock
    private HostOrchestrator hostOrchestrator;

    @Mock
    private GatewayConfigService gatewayConfigService;

    @Mock
    private InstanceMetaDataRepository instanceMetaDataRepository;

    @Mock
    private FreeIpaNodeUtilService freeIpaNodeUtilService;

    @InjectMocks
    private ChangePrimaryGatewayService underTest;

    @Test
    void testGetPrimaryGatewayInstanceIdWhenPresent() {
        Stack stack = mock(Stack.class);
        GatewayConfig gatewayConfig = mock(GatewayConfig.class);

        when(gatewayConfigService.getPrimaryGatewayConfig(any())).thenReturn(gatewayConfig);
        when(gatewayConfig.getInstanceId()).thenReturn(INSTANCE_ID_1);

        assertEquals(Optional.of(INSTANCE_ID_1), underTest.getPrimaryGatewayInstanceId(stack));

        verify(gatewayConfigService).getPrimaryGatewayConfig(eq(stack));
    }

    @Test
    void testGetPrimaryGatewayInstanceIdWhenNotPresent() {
        Stack stack = mock(Stack.class);

        when(gatewayConfigService.getPrimaryGatewayConfig(any())).thenThrow(NotFoundException.class);

        assertEquals(Optional.empty(), underTest.getPrimaryGatewayInstanceId(stack));

        verify(gatewayConfigService).getPrimaryGatewayConfig(eq(stack));
    }

    @Test
    void testGetNewPrimaryGatewayInstanceIdWhenExistingPrimaryGwIsGood() throws Exception {
        Stack stack = mock(Stack.class);
        GatewayConfig gatewayConfig = mock(GatewayConfig.class);
        InstanceMetaData im1 = mock(InstanceMetaData.class);
        InstanceMetaData im2 = mock(InstanceMetaData.class);

        when(gatewayConfigService.getPrimaryGatewayConfig(any())).thenReturn(gatewayConfig);
        when(hostOrchestrator.getFreeIpaMasterHostname(any(), any())).thenReturn(Optional.of(HOSTNAME_1));
        when(stack.getNotDeletedInstanceMetaDataList()).thenReturn(List.of(im1, im2));
        when(im1.getDiscoveryFQDN()).thenReturn(HOSTNAME_1);
        lenient().when(im2.getDiscoveryFQDN()).thenReturn(HOSTNAME_2);
        when(im1.getInstanceId()).thenReturn(INSTANCE_ID_1);
        lenient().when(im2.getInstanceId()).thenReturn(INSTANCE_ID_2);

        assertEquals(INSTANCE_ID_1, underTest.selectNewPrimaryGatewayInstanceId(stack, List.of()));

        verify(gatewayConfigService).getPrimaryGatewayConfig(eq(stack));
        verify(hostOrchestrator).getFreeIpaMasterHostname(eq(gatewayConfig), any());
    }

    @Test
    void testGetNewPrimaryGatewayInstanceIdWhenPrimaryGwDoesNotExist() throws Exception {
        Stack stack = mock(Stack.class);
        InstanceMetaData im1 = mock(InstanceMetaData.class);
        InstanceMetaData im2 = mock(InstanceMetaData.class);

        when(gatewayConfigService.getPrimaryGatewayConfig(any())).thenThrow(NotFoundException.class);
        when(stack.getNotDeletedInstanceMetaDataList()).thenReturn(List.of(im1, im2));
        when(im1.getInstanceId()).thenReturn(INSTANCE_ID_1);
        lenient().when(im2.getInstanceId()).thenReturn(INSTANCE_ID_2);

        assertEquals(INSTANCE_ID_1, underTest.selectNewPrimaryGatewayInstanceId(stack, List.of(INSTANCE_ID_2)));

        verify(gatewayConfigService).getPrimaryGatewayConfig(eq(stack));
    }

    @Test
    void testGetNewPrimaryGatewayInstanceIdWhenPrimaryGwDoesNotRespond() throws Exception {
        Stack stack = mock(Stack.class);
        InstanceMetaData im1 = mock(InstanceMetaData.class);
        InstanceMetaData im2 = mock(InstanceMetaData.class);

        when(hostOrchestrator.getFreeIpaMasterHostname(any(), any())).thenThrow(CloudbreakOrchestratorFailedException.class);
        when(stack.getNotDeletedInstanceMetaDataList()).thenReturn(List.of(im1, im2));
        when(im1.getInstanceId()).thenReturn(INSTANCE_ID_1);
        lenient().when(im2.getInstanceId()).thenReturn(INSTANCE_ID_2);

        assertEquals(INSTANCE_ID_1, underTest.selectNewPrimaryGatewayInstanceId(stack, List.of(INSTANCE_ID_2)));

        verify(gatewayConfigService).getPrimaryGatewayConfig(eq(stack));
    }

    @Test
    void testGetNewPrimaryGatewayInstanceIdWhenExistingPrimaryGwIsOnListToAvoid() throws Exception {
        Stack stack = mock(Stack.class);
        GatewayConfig gatewayConfig = mock(GatewayConfig.class);
        InstanceMetaData im1 = mock(InstanceMetaData.class);
        InstanceMetaData im2 = mock(InstanceMetaData.class);
        Node node = mock(Node.class);
        Set<Node> allNodes = Set.of(node);

        when(gatewayConfigService.getPrimaryGatewayConfig(any())).thenReturn(gatewayConfig);
        when(gatewayConfig.getInstanceId()).thenReturn(INSTANCE_ID_1);
        when(freeIpaNodeUtilService.mapInstancesToNodes(any())).thenReturn(allNodes);
        when(hostOrchestrator.getFreeIpaMasterHostname(any(), any())).thenReturn(Optional.of(HOSTNAME_1));
        when(stack.getNotDeletedInstanceMetaDataList()).thenReturn(List.of(im1, im2));
        when(im1.getDiscoveryFQDN()).thenReturn(HOSTNAME_1);
        lenient().when(im2.getDiscoveryFQDN()).thenReturn(HOSTNAME_2);
        when(im1.getInstanceId()).thenReturn(INSTANCE_ID_1);
        lenient().when(im2.getInstanceId()).thenReturn(INSTANCE_ID_2);

        assertEquals(INSTANCE_ID_2, underTest.selectNewPrimaryGatewayInstanceId(stack, List.of(INSTANCE_ID_1)));

        verify(gatewayConfigService).getPrimaryGatewayConfig(eq(stack));
        verify(hostOrchestrator).getFreeIpaMasterHostname(eq(gatewayConfig), eq(allNodes));
    }

    @Test
    void testGetNewPrimaryGatewayInstanceIdWhenExistingPrimaryGwAndMasterIsOnListToAvoid() throws Exception {
        Stack stack = mock(Stack.class);
        GatewayConfig gatewayConfig = mock(GatewayConfig.class);
        InstanceMetaData im1 = mock(InstanceMetaData.class);
        InstanceMetaData im2 = mock(InstanceMetaData.class);
        InstanceMetaData im3 = mock(InstanceMetaData.class);
        Node node = mock(Node.class);
        Set<Node> allNodes = Set.of(node);

        when(gatewayConfigService.getPrimaryGatewayConfig(any())).thenReturn(gatewayConfig);
        when(gatewayConfig.getInstanceId()).thenReturn(INSTANCE_ID_2);
        when(freeIpaNodeUtilService.mapInstancesToNodes(any())).thenReturn(allNodes);
        when(hostOrchestrator.getFreeIpaMasterHostname(any(), any())).thenReturn(Optional.of(HOSTNAME_1));
        when(stack.getNotDeletedInstanceMetaDataList()).thenReturn(List.of(im1, im2, im3));
        when(im1.getDiscoveryFQDN()).thenReturn(HOSTNAME_1);
        lenient().when(im2.getDiscoveryFQDN()).thenReturn(HOSTNAME_2);
        lenient().when(im3.getDiscoveryFQDN()).thenReturn(HOSTNAME_3);
        when(im1.getInstanceId()).thenReturn(INSTANCE_ID_1);
        lenient().when(im2.getInstanceId()).thenReturn(INSTANCE_ID_2);
        when(im3.getInstanceId()).thenReturn(INSTANCE_ID_3);

        assertEquals(INSTANCE_ID_3, underTest.selectNewPrimaryGatewayInstanceId(stack, List.of(INSTANCE_ID_1, INSTANCE_ID_2)));

        verify(gatewayConfigService).getPrimaryGatewayConfig(eq(stack));
        verify(hostOrchestrator).getFreeIpaMasterHostname(eq(gatewayConfig), eq(allNodes));
    }

    @Test
    void testChangePrimaryGatewayMetadataWhenFormerPgwIsNewPgwThenItDoesNotSaveMetadata() {
        Stack stack = mock(Stack.class);

        underTest.changePrimaryGatewayMetadata(stack, Optional.of(INSTANCE_ID_1), INSTANCE_ID_1);

        verify(instanceMetaDataRepository, never()).save(any());
    }

    @Test
    void testChangePrimaryGatewayMetadataWhenFormerPgwIsEmptyThenItSavesMetadata() {
        Stack stack = mock(Stack.class);
        InstanceMetaData im1 = mock(InstanceMetaData.class);
        InstanceMetaData im2 = mock(InstanceMetaData.class);

        when(stack.getId()).thenReturn(STACK_ID);
        when(instanceMetaDataRepository.findNotTerminatedForStack(anyLong())).thenReturn(Set.of(im1, im2));
        when(im1.getInstanceId()).thenReturn(INSTANCE_ID_1);
        lenient().when(im2.getInstanceId()).thenReturn(INSTANCE_ID_2);

        underTest.changePrimaryGatewayMetadata(stack, Optional.empty(), INSTANCE_ID_1);

        verify(im1).setInstanceMetadataType(eq(InstanceMetadataType.GATEWAY_PRIMARY));
        verify(instanceMetaDataRepository).save(eq(im1));
    }

    @Test
    void testChangePrimaryGatewayMetadataWhenFormerPgwExiststThenItSavesMetadata() {
        Stack stack = mock(Stack.class);
        InstanceMetaData im1 = mock(InstanceMetaData.class);
        InstanceMetaData im2 = mock(InstanceMetaData.class);
        InstanceMetaData im3 = mock(InstanceMetaData.class);

        when(stack.getId()).thenReturn(STACK_ID);
        when(instanceMetaDataRepository.findNotTerminatedForStack(anyLong())).thenReturn(Set.of(im1, im2, im3));
        when(im1.getInstanceId()).thenReturn(INSTANCE_ID_1);
        when(im2.getInstanceId()).thenReturn(INSTANCE_ID_2);
        lenient().when(im3.getInstanceId()).thenReturn(INSTANCE_ID_3);

        underTest.changePrimaryGatewayMetadata(stack, Optional.of(INSTANCE_ID_1), INSTANCE_ID_2);

        verify(im1).setInstanceMetadataType(eq(InstanceMetadataType.GATEWAY));
        verify(im2).setInstanceMetadataType(eq(InstanceMetadataType.GATEWAY_PRIMARY));
        verify(instanceMetaDataRepository).save(eq(im1));
        verify(instanceMetaDataRepository).save(eq(im2));
    }
}


text:
@class IDEDocSearchController, IDEDocSearchResultsContext, NSString;

@interface IDEDocSearchResultsHTMLPageGenerator : NSObject
{
    IDEDocSearchController *_searchController;
    IDEDocSearchResultsContext *_resultsContext;
    NSString *_rootOutputDirectory;
}

- (void).cxx_destruct;
- (id)HTMLTemplate;
- (void)_generateHTMLPageForGroup:(id)arg1 outputPath:(id)arg2;
- (id)_chooserViewForResultsContext:(id)arg1 forGroup:(id)arg2;
- (id)_tableRowForResultWithTitle:(id)arg1 URL:(id)arg2 iconPath:(id)arg3 abstract:(id)arg4 scope:(id)arg5 availability:(id)arg6;
- (void)generateHTMLPagesForResultsContext:(id)arg1 completionBlock:(CDUnknownBlockType)arg2;
- (id)_pathToGeneratedHTMLForGroupWithIdentifier:(id)arg1;

@end


text:
<?php

namespace CoreBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use CoreBundle\Entity\Subindustry;
use CoreBundle\Form\SubindustryType;

/**
 * Subindustry controller.
 *
 */
class SubindustryController extends Controller
{

    /**
     * Lists all Subindustry entities.
     *
     */
    public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

        $entities = $em->getRepository('CoreBundle:Subindustry')->findAll();

        return $this->render('CoreBundle:Subindustry:index.html.twig', array(
            'entities' => $entities,
        ));
    }
    /**
     * Creates a new Subindustry entity.
     *
     */
    public function createAction(Request $request)
    {
        $entity = new Subindustry();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('subindustry_show', array('id' => $entity->getId())));
        }

        return $this->render('CoreBundle:Subindustry:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView(),
        ));
    }

    /**
     * Creates a form to create a Subindustry entity.
     *
     * @param Subindustry $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createCreateForm(Subindustry $entity)
    {
        $form = $this->createForm(new SubindustryType(), $entity, array(
            'action' => $this->generateUrl('subindustry_create'),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }

    /**
     * Displays a form to create a new Subindustry entity.
     *
     */
    public function newAction()
    {
        $entity = new Subindustry();
        $form   = $this->createCreateForm($entity);

        return $this->render('CoreBundle:Subindustry:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView(),
        ));
    }

    /**
     * Finds and displays a Subindustry entity.
     *
     */
    public function showAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('CoreBundle:Subindustry')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Subindustry entity.');
        }

        $deleteForm = $this->createDeleteForm($id);

        return $this->render('CoreBundle:Subindustry:show.html.twig', array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Displays a form to edit an existing Subindustry entity.
     *
     */
    public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('CoreBundle:Subindustry')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Subindustry entity.');
        }

        $editForm = $this->createEditForm($entity);
        $deleteForm = $this->createDeleteForm($id);

        return $this->render('CoreBundle:Subindustry:edit.html.twig', array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
    * Creates a form to edit a Subindustry entity.
    *
    * @param Subindustry $entity The entity
    *
    * @return \Symfony\Component\Form\Form The form
    */
    private function createEditForm(Subindustry $entity)
    {
        $form = $this->createForm(new SubindustryType(), $entity, array(
            'action' => $this->generateUrl('subindustry_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
    /**
     * Edits an existing Subindustry entity.
     *
     */
    public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('CoreBundle:Subindustry')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Subindustry entity.');
        }

        $deleteForm = $this->createDeleteForm($id);
        $editForm = $this->createEditForm($entity);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $em->flush();

            return $this->redirect($this->generateUrl('subindustry_edit', array('id' => $id)));
        }

        return $this->render('CoreBundle:Subindustry:edit.html.twig', array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }
    /**
     * Deletes a Subindustry entity.
     *
     */
    public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $entity = $em->getRepository('CoreBundle:Subindustry')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find Subindustry entity.');
            }

            $em->remove($entity);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('subindustry'));
    }

    /**
     * Creates a form to delete a Subindustry entity by id.
     *
     * @param mixed $id The entity id
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm($id)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('subindustry_delete', array('id' => $id)))
            ->setMethod('DELETE')
            ->add('submit', 'submit', array('label' => 'Delete'))
            ->getForm()
        ;
    }
}


text:
    <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{L_TOPIC_TOOLS}">

    </button>

        Unsubscribe

        {S_WATCH_TOPIC_TITLE}

        {S_BOOKMARK_TOPIC}

        {L_BUMP_TOPIC}

        {L_EMAIL_TOPIC}

         {L_PRINT_TOPIC}


text:
using System;
using System.IdentityModel.Tokens;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Claims;
using System.Web.Http;
using Thinktecture.IdentityModel.WebApi.Authentication.Handler;

namespace TestRessourceServer.Controllers
{
    public class TokenController : ApiController
    {
        public IHttpActionResult Get(HttpRequestMessage request)
        {

            var authN = new HttpAuthentication(WebApiConfig.Configuration);

            // Code to minimize time after token expiration when token is still successfully validated. Just for test purposes!
            authN.Configuration.Mappings.First().TokenHandler.Configuration.MaxClockSkew = TimeSpan.FromSeconds(3);
            try
            {
                ClaimsPrincipal principal = authN.Authenticate(request);
                if (principal.Identity.IsAuthenticated == false)
                {
                    return StatusCode(HttpStatusCode.Forbidden);
                }
            } catch (SecurityTokenValidationException)
            {
                return StatusCode(HttpStatusCode.Forbidden);
            }

            return Ok();
        }
    }
}


text:
// gulp/tasks/build/css.js
'use strict';

// ----------------------------------
// available tasks:
//    'gulp build:css' : main css task
// ----------------------------------
// plugins:
//     gulp-csso               : $.csso
//     gulp-rename             : $.rename
//     gulp-plumber            : $.plumber
//     gulp-concat             : $.concat
//     gulp-uncss              : $.uncss
//     gulp-cssbeautify        : $.cssbeautify
//     gulp-strip-css-comments : $.stripCssComments
// ----------------------------------
// config:
//     config.task.build : task name
// ----------------------------------

module.exports = function(gulp, $, path, config) {

    // start css task
    gulp.task(config.task.build + ':css', 'build css files (beautify/concat/minify..)', function() {

        return gulp.src([
                // order css files for concat
                path.to.sass.dist.dev + '/vendor/*.css',
                path.to.sass.dist.dev + '/*.css',
                '!' + path.to.sass.dist.dev + '/**/_*{,/**}/'
            ])
            // remove unused css selectors
            // .pipe($.postcss([ $.uncss.postcssPlugin(
            //     config.css.uncssOptions // options
            // )]))
            // strip unimportant css comments
            .pipe($.stripCssComments(
                config.css.stripCommentsOptions // options
            ))
            // beautify final css code
            .pipe($.cssbeautify(
                config.css.cssbeautifyOptions // options
            ))
            // concat all css files
            .pipe($.concat('style.css'))
            // minify
            .pipe($.csso())
            // rename files
            .pipe($.rename(
                config.css.renameOptions // options
            ))
            .pipe(gulp.dest(path.to.sass.dist.prod));

    });

};


text:
package org.apache.shardingsphere.route.time;

import org.junit.Test;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

public final class TimeServiceConfigurationTest {

    @Test
    public void assertInitDataSource() {
        PropertiesUtils.createProperties("com.mysql.jdbc.Driver", null);
        TimeServiceConfiguration config = TimeServiceConfiguration.getInstance();
        assertNotNull(config.getDataSource());
        assertTrue(PropertiesUtils.remove());
    }
}


text:
package charts.builder.spreadsheet;

import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.Set;

import org.junit.Assert;
import org.junit.Test;

import scala.Option;
import charts.builder.spreadsheet.external.ResolvedRef;
import charts.builder.spreadsheet.external.UnresolvedRef;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;

public abstract class SpreadsheetDataSourceTest {

  private final Map<String, String[]> extrefs = new ImmutableMap.Builder<String, String[]>()
      .put("progress1.xls", new String[] {"bar!C7", "foo!D7"})
      .put("6d843435-9ee5-45a0-9187-ccedc5b223f6", new String[] {"bar!C8", "foo!D8"})
      .put("progress2.xlsx", new String[] {"bar!C9", "foo!D9"})
      .put("progress1.xlsx", new String[] {"bar!A1", "O'Brien's Sales!E3"})
      .put("progress3.xlsx", new String[] {"O'Brien's!A1", "O'Brien's Sales!E4"})
      .put("groundcover below 50%.xlsx", new String[] {"areaBelow50_ordered!Z28", "O'Brien's Sales!A5"})
      .build();

  abstract SpreadsheetDataSource datasource() throws IOException;

  abstract SpreadsheetDataSource datasource(InputStream in) throws IOException;

  public void testExternalReference(SpreadsheetDataSource ds) throws IOException {
    Set<UnresolvedRef> urefs = ds.externalReferences();
    Assert.assertNotNull(urefs);
    Assert.assertEquals(extrefs.size(), urefs.size());
    for(UnresolvedRef uref : urefs) {
      String[] links = extrefs.get(uref.source());
      Assert.assertNotNull(String.format("%s not found in testdata", uref.source()), links);
      Assert.assertEquals(links[0], uref.link().source());
      Assert.assertEquals(links[1], uref.link().destination());
    }
  }

  public void testUpdateExternalReferences(SpreadsheetDataSource ds) throws IOException {
    InputStream in = updateExternalRefs(ds);
    Assert.assertNotNull(in);
    SpreadsheetDataSource ds2 = datasource(in);
    Assert.assertNull(updateExternalRefs(ds2));
    Assert.assertNull(updateExternalRefs(ds));
  }

  private InputStream updateExternalRefs(SpreadsheetDataSource ds) throws IOException {
    Set<ResolvedRef> refs = resolve(ds, ds.externalReferences());
    return ds.updateExternalReferences(refs);
  }

  private Set<ResolvedRef> resolve(final SpreadsheetDataSource ds, Set<UnresolvedRef> urefs) {
    Set<ResolvedRef> refs = Sets.newHashSet();
    for(UnresolvedRef uref : urefs) {
      refs.add(new ResolvedRef(new Option<SpreadsheetDataSource>() {

        @Override
        public int productArity() {
          throw new RuntimeException("not implemented");
        }

        @Override
        public Object productElement(int arg0) {
          throw new RuntimeException("not implemented");
        }

        @Override
        public boolean canEqual(Object arg0) {
          throw new RuntimeException("not implemented");
        }

        @Override
        public SpreadsheetDataSource get() {
          return ds;
        }

        @Override
        public boolean isEmpty() {
          return false;
        }}, uref.link()));
    }
    return refs;
  }

  @Test
  public void testExternalReference() throws IOException {
    testExternalReference(datasource());
  }

  @Test
  public void testUpdateExternalReferences() throws IOException {
    testUpdateExternalReferences(datasource());
  }
}


text:
using System.Threading.Tasks;
using Nimbus.Handlers;
using Nimbus.Tests.Common;
using Nimbus.Tests.Common.TestUtilities;
using Nimbus.UnitTests.DependencyResolverTests.AllComponentTypes.MessageContracts;

#pragma warning disable 4014

namespace Nimbus.UnitTests.DependencyResolverTests.AllComponentTypes.Handlers
{
    public class BrokerTestCommandHandler : IHandleCommand<FooCommand>
    {
        public async Task Handle(FooCommand busCommand)
        {
            MethodCallCounter.RecordCall<BrokerTestCommandHandler>(h => h.Handle(busCommand));
        }
    }
}


text:
/**
 *
 */
package com.velocity.enums;

/**
 * This Enum defines the value for Language
 *
 * @author Vimal Kumar
 * @date 12-March-2015
 */
public enum Language {

	ENG
}


text:
#include <pantheios/util/test/compiler_warnings_suppression.first_include.h>

/* xTests header files */
#include <xtests/xtests.h>

/* Pantheios header files */
#include <pantheios/pantheios.hpp>      // Pantheios C++ main header
#include <pantheios/inserters/ids.hpp>  // for pantheios::processId
#include <pantheios/backends/bec.test.h>

/* STLSoft header files */
#include <stlsoft/conversion/integer_to_string.hpp>
#include <platformstl/platformstl.h>

/* Standard C header files */
#include <stdlib.h>                     // for exit codes

#if defined(PLATFORMSTL_OS_IS_UNIX)
# include <unistd.h>
#elif defined(PLATFORMSTL_OS_IS_WINDOWS)
# include <windows.h>
#else /* ? OS */
# error Not discriminated for platforms other than UNIX and Windows
#endif /* OS */

#include <pantheios/util/test/compiler_warnings_suppression.last_include.h>

/* /////////////////////////////////////////////////////////////////////////
 * forward declarations
 */

static void test_1_01();

static int pan_get_pid_();

/* ////////////////////////////////////////////////////////////////////// */

/* Define the stock front-end process identity, so that it links when using
 * fe.N, fe.simple, etc. */
PANTHEIOS_EXTERN PAN_CHAR_T const PANTHEIOS_FE_PROCESS_IDENTITY[] = PANTHEIOS_LITERAL_STRING("test.component.inserters.processId");

/* ////////////////////////////////////////////////////////////////////// */

#define PSTR(x)         PANTHEIOS_LITERAL_STRING(x)

/* /////////////////////////////////////////////////////////////////////////
 * character encoding
 */

#ifdef PANTHEIOS_USE_WIDE_STRINGS

# define XTESTS_TEST_STRING_EQUAL       XTESTS_TEST_WIDE_STRING_EQUAL

#else /* ? PANTHEIOS_USE_WIDE_STRINGS */

# define XTESTS_TEST_STRING_EQUAL       XTESTS_TEST_MULTIBYTE_STRING_EQUAL

#endif /* PANTHEIOS_USE_WIDE_STRINGS */

/* ////////////////////////////////////////////////////////////////////// */

int main(int argc, char** argv)
{
    int retCode = EXIT_SUCCESS;
    int verbosity = 2;

    XTESTS_COMMANDLINE_PARSEVERBOSITY(argc, argv, &verbosity);

    if(XTESTS_START_RUNNER("test.component.inserters.processId", verbosity))
    {
        XTESTS_RUN_CASE(test_1_01);

        XTESTS_PRINT_RESULTS();

        XTESTS_END_RUNNER_UPDATE_EXITCODE(&retCode);
    }

    return retCode;
}

/* ////////////////////////////////////////////////////////////////////// */

static void test_1_01()
{
    // 1. Setup

    PAN_CHAR_T const  prefix[]    =   PSTR("process: ");
    PAN_CHAR_T        pid_[21 + STLSOFT_NUM_ELEMENTS(prefix)];
    PAN_CHAR_T const* pid         =   stlsoft::integer_to_string(&pid_[0], STLSOFT_NUM_ELEMENTS(pid_), pan_get_pid_());
    PAN_CHAR_T const* stmt        =   pid - (STLSOFT_NUM_ELEMENTS(prefix) - 1);

#ifdef PANTHEIOS_USE_WIDE_STRINGS
    ::wcsncpy(const_cast<PAN_CHAR_T*>(stmt), prefix, (STLSOFT_NUM_ELEMENTS(prefix) - 1));
#else /* ? PANTHEIOS_USE_WIDE_STRINGS */
    ::strncpy(const_cast<PAN_CHAR_T*>(stmt), prefix, (STLSOFT_NUM_ELEMENTS(prefix) - 1));
#endif /* PANTHEIOS_USE_WIDE_STRINGS */

    pantheios::be::test::reset();

    // 2. Create test data

    pantheios::log_NOTICE(pantheios::processId);
    pantheios::log_NOTICE(prefix, pantheios::processId);

    // 3. Verification

    pantheios::be::test::Results  results = pantheios::be::test::results();

    XTESTS_TEST_BOOLEAN_FALSE(results.empty());
    XTESTS_REQUIRE(XTESTS_TEST_INTEGER_EQUAL(2u, results.size()));
    XTESTS_TEST_STRING_EQUAL(pid, results[0].statement);
    XTESTS_TEST_STRING_EQUAL(stmt, results[1].statement);
}

static int pan_get_pid_()
{
#if defined(PLATFORMSTL_OS_IS_UNIX)
    return static_cast<int>(::getpid());
#elif defined(PLATFORMSTL_OS_IS_WINDOWS)
    return static_cast<int>(::GetCurrentProcessId());
#else /* ? OS */
# error Not discriminated for platforms other than UNIX and Windows
#endif /* OS */
}

/* ///////////////////////////// end of file //////////////////////////// */


text:
package remotely

import java.util.concurrent.Executors
import org.scalatest.matchers.{Matcher,MatchResult}
import org.scalatest.{FlatSpec,Matchers,BeforeAndAfterAll}
import remotely.transport.netty._
import scala.concurrent.duration.DurationInt
import scalaz.stream.Process
import scalaz.concurrent.{Strategy,Task}
import codecs._

class CapabilitiesSpec extends FlatSpec
    with Matchers
    with BeforeAndAfterAll {

  val addr1 = new java.net.InetSocketAddress("localhost", 9003)

  val server1 = new CountServer
  val shutdown1: Task[Unit] = NettyServer.serve(addr1, server1.environment, capabilities = Capabilities(Set())).run

  override def afterAll() {
    shutdown1.run
  }
  val endpoint1 = (NettyTransport.single(addr1) map Endpoint.single).run

  behavior of "Capabilities"

  it should "not call an incompatible server" in {
    import Response.Context
    import Remote.implicits._
    import codecs._

    an[IncompatibleServer] should be thrownBy (
      try {
        val _ = evaluate(endpoint1, Monitoring.empty)(CountClient.ping(1)).apply(Context.empty).run
      } catch {
        case t: IncompatibleServer =>
          throw t
        case t: Throwable =>
          t.printStackTrace
          throw t
      }
    )
  }
}


text:
namespace Gaffer
{

IE_CORE_FORWARDDECLARE( Plug )
IE_CORE_FORWARDDECLARE( Context )

} // namespace Gaffer

namespace GafferUI
{

/// \todo Maybe rename GafferUI.PlugValueWidget to PlugWidget and
/// GafferUI.PlugWidget to GafferUI.LabelledPlugWidget, to better match
/// this class (and shorten some rather long names).
/// Add read-only support in the same way as PlugValueWidget does it.
class GAFFERUI_API PlugGadget : public ContainerGadget
{

	public :

		PlugGadget( Gaffer::PlugPtr plug );
		~PlugGadget() override;

		GAFFER_GRAPHCOMPONENT_DECLARE_TYPE( GafferUI::PlugGadget, PlugGadgetTypeId, Gadget );

		void setPlug( Gaffer::PlugPtr plug );
		template<typename T=Gaffer::Plug>
		T *getPlug();

		void setContext( Gaffer::ContextPtr context );
		Gaffer::Context *getContext();

	protected :

		/// Must be implemented by derived classes - will be called whenever
		/// the ui needs to be updated to reflect a change in the plug.
		virtual void updateFromPlug();

	private :

		void plugDirtied( Gaffer::Plug *plug );
		void plugInputChanged( Gaffer::Plug *plug );
		void contextChanged( const Gaffer::Context *context, const IECore::InternedString &name );
		void updateContextConnection();

		Gaffer::Signals::ScopedConnection m_plugDirtiedConnection;
		Gaffer::Signals::ScopedConnection m_plugInputChangedConnection;
		Gaffer::Signals::ScopedConnection m_contextChangedConnection;
		Gaffer::PlugPtr m_plug;
		Gaffer::ContextPtr m_context;

};

IE_CORE_DECLAREPTR( PlugGadget )

} // namespace GafferUI

#include "GafferUI/PlugGadget.inl"

#endif // GAFFERUI_PLUGGADGET_H


text:
Here's how to uninstall Hue: `rpm -qa | grep hue | xargs sudo rpm -e`. This
article from december 2014 describe how to  [install the latest version of hue
on HDP](http://gethue.com/how-to-deploy-hue-on-hdp/).

## Metadata

    metadata =
      header: 'Hue Install'
      schema:
        banner_style:
          type: 'string'
        ca_bundle:
          type: 'string'
        clean_tmp:
          type: 'boolean'
        conf_dir:
          type: 'string'
        ini:
          type: 'object'
        group:
          "$ref": "/nikita/system/group"

## Action

    module.exports = header: metadata.header, schema: metadata.schema, handler: ({options}) ->

## Identities

By default, the "hue" package create the following entries:

```bash
cat /etc/passwd | grep hue
hue:x:494:494:Hue:/var/lib/hue:/sbin/nologin
cat /etc/group | grep hue
hue:x:494:
```

      # @system.group header: 'Group', options.group
      # @system.user header: 'User', options.user

## IPTables

| Service    | Port  | Proto | Parameter          |
|------------|-------|-------|--------------------|
| Hue Web UI | 8888  | http  | desktop.http_port  |

IPTables rules are only inserted if the parameter "iptables.action" is set to
"start" (default value).

      # @tools.iptables
      #   header: 'IPTables'
      #   rules: [
      #     { chain: 'INPUT', jump: 'ACCEPT', dport: options.ini['desktop']['http_port'], protocol: 'tcp', state: 'NEW', comment: "Hue Web UI" }
      #   ]
      #   if: options.iptables

## Packages

The packages "extjs-2.2-1" and "hue" are installed.

      # @call header: 'Dependencies', ->
      #   @service.install
      #     if: options.db.engine in ['mariadb', 'mysql']
      #     name: 'mariadb'
      #   @service.install
      #     if: options.db.engine in ['postgresql']
      #     name: 'postgresql'
      #   @service.install name for name in [
      #     'ant', 'asciidoc', 'cyrus-sasl-devel', 'cyrus-sasl-gssapi'
      #     'cyrus-sasl-plain', 'gcc', 'gcc-c++', 'krb5-devel', 'libffi-devel'
      #     'libxml2-devel', 'libxslt-devel', 'make', 'maven', 'mysql', 'mysql-devel',
      #     'openldap-devel', 'openssl-devel', 'python-devel', 'rsync', 'sqlite-devel', 'gmp-devel'
      #   ]
      #   @system.execute
      #     header: 'Node.js'
      #     unless_exec: 'command -v node'
      #     cmd: """
      #     yum install -y epel-release
      #     yum install -y nodejs
      #     """
      # @file.download
      #   header: 'Download'
      #   source: 'https://cdn.gethue.com/downloads/hue-4.6.0.tgz'
      #   target: '/tmp/hue-4.6.0.tgz'
      # @system.execute
      #   header: 'Extract'
      #   unless_exists: '/tmp/hue-4.6.0'
      #   cmd: """
      #   tar -xzf /tmp/hue-4.6.0.tgz -C /tmp/
      #   """
      # @system.execute
      #   header: 'Compile'
      #   unless_exists: '/usr/share/hue/build/env/bin/supervisor'
      #   cwd: '/tmp/hue-4.6.0'
      #   cmd: """
      #   rm -rf /usr/share/hue/
      #   PREFIX=/usr/share make install
      #   """

## Configure

Configure the "/etc/hue/conf" file following the [HortonWorks](http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.0.8.0/bk_installing_manually_book/content/rpm-chap-hue-5-2.html)
recommandations. Merge the configuration object from "hdp.hue.ini" with the properties of the target file.

      @file.ini
        header: 'Configure'
        target: "#{options.conf_dir}/hue.ini"
        content: options.ini
        merge: true
        parse: misc.ini.parse_multi_brackets
        stringify: misc.ini.stringify_multi_brackets
        separator: '='
        comment: '#'
        uid: options.user.name
        gid: options.group.name
        mode: 0o0750

## Database

Setup the database hosting the Hue data. Currently two database providers are
implemented but Hue supports MySQL, PostgreSQL, and Oracle. Note, sqlite is
the default database while mysql is the recommanded choice.

      @call header: 'DB', ->

Wait for database to listen

        @call '@rybajs/tools/db_admin/wait', once: true, options.wait_db_admin

Create the database hosting the Ambari data with restrictive user permissions.

        # @db.user options.db, database: null,
        #   header: 'User'
        #   if: options.db.engine in ['mariadb', 'mysql', 'postgresql']
        # @db.database options.db,
        #   header: 'Database'
        #   user: options.db.username
        #   if: options.db.engine in ['mariadb', 'mysql', 'postgresql']
        # @db.schema options.db,
        #   header: 'Schema'
        #   if: options.db.engine is 'postgresql'
        #   options:
        #     schema: options.db.schema or options.db.database
        #     database: options.db.database
        #     owner: options.db.username

Load the database with initial data

        # @db.query options.db,
        #   cmd: "show tables from #{options.db.database};"
        #   grep: 'auth_user'
        #   shy: true
        # @system.execute
        #   header: 'Init'
        #   unless: -> @status -1
        #   cmd: """
        #   su -l #{options.user.name} -c "/usr/share/hue/build/env/bin/hue syncdb --noinput && /usr/share/hue/build/env/bin/hue migrate"
        #   """
## SSL

      @call header: 'SSL IPA', ->
        @file
          header: 'Sync'
          target: "#{options.conf_dir}/import_ipa_cert.sh"
          mode: 0o0755
          content: """
          cp -rp /etc/ipa/cert.pem #{options.ini.desktop.ssl_certificate}
          cp -rp /etc/ipa/key.pem #{options.ini.desktop.ssl_private_key}
          cp -rp /etc/ipa/ca.crt #{options.ini.desktop.ssl_cacerts}
          chown #{options.user.name} \\
            #{options.ini.desktop.ssl_certificate} \\
            #{options.ini.desktop.ssl_private_key} \\
            #{options.ini.desktop.ssl_cacerts}
          """
          uid: "#{options.user.name}"
          gid: "#{options.group.name}"
          eof: true
          trap: true
        @tools.cron.add
          header: 'Cron'
          cmd: "#{options.conf_dir}/import_ipa_cert.sh"
          when: '0 5 * * *'
          user: "#{options.user.name}"
          exec: true
          backup: true

      return

## Kerberos

The principal for the Hue service is created and named after "hue/{host}@{realm}". inside
the "/etc/hue/conf/hue.ini" configuration file, all the composants myst be tagged with
the "security_enabled" property set to "true".

      @krb5.addprinc krb5,
        header: 'Kerberos'
        principal: options.ini.desktop.kerberos.hue_principal
        randkey: true
        keytab: options.ini.desktop.kerberos.hue_keytab
        uid: options.user.name
        gid: options.group.name

## SSL Client

      @call header: 'SSL Client', ->
        ca_bundle = if options.ssl.client_ca then options.ca_bundle else ''
        @file
          target: "#{ca_bundle}"
          source: "#{options.ssl.client_ca}"
          local: true
          if: !!options.ssl.client_ca
        @service.init
          target: '/etc/init.d/hue'
          match: /^DAEMON="export REQUESTS_CA_BUNDLE='.*';\$DAEMON"$/m
          replace: "DAEMON=\"export REQUESTS_CA_BUNDLE='#{ca_bundle}';$DAEMON\""
          append: /^DAEMON=.*$/m
          mode: 0o755

## SSL Server

Upload and register the SSL certificate and private key respectively defined by
the "hdp.hue.ssl.certificate" and "hdp.hue.ssl.private_key"  configuration
properties. It follows the [official Hue Web Server
Configuration](http://gethue.com/docs-3.5.0/manual.html#_web_server_configuration).
The "hue" service is restarted if there was any  changes.

      @call header: 'SSL Server', ->
        @file.download
          source: options.ssl.certificate
          target: "#{options.conf_dir}/cert.pem"
          uid: options.user.name
          gid: options.group.name
        @file.download
          source: options.ssl.private_key
          target: "#{options.conf_dir}/key.pem"
          uid: options.user.name
          gid: options.group.name
        @file.ini
          target: "#{options.conf_dir}/hue.ini"
          content: desktop:
            ssl_certificate: "#{options.conf_dir}/cert.pem"
            ssl_private_key: "#{options.conf_dir}/key.pem"
          merge: true
          parse: misc.ini.parse_multi_brackets
          stringify: misc.ini.stringify_multi_brackets
          separator: '='
          comment: '#'

## Systemd Service

      @service.init
        header: 'Systemd Script'
        target: '/etc/systemd/system/hue.service'
        source: "#{__dirname}/assets/hue-systemd.j2"
        local: true
        # context: options: options
        uid: 'root'
        gid: 'root'
        mode: 0o0644

## Fix Banner

In the current version "2.5.1", the HTML of the banner is escaped.

      @call header: 'Fix Banner', ->
        @file
          target: '/usr/lib/hue/desktop/core/src/desktop/templates/login.mako'
          match: '${conf.CUSTOM.BANNER_TOP_HTML.get()}'
          replace: '${ conf.CUSTOM.BANNER_TOP_HTML.get() | n,unicode }'
          bck: true
        @file
          target: '/usr/lib/hue/desktop/core/src/desktop/templates/common_header.mako'
          write: [
            match: '${conf.CUSTOM.BANNER_TOP_HTML.get()}'
            replace: '${ conf.CUSTOM.BANNER_TOP_HTML.get() | n,unicode }'
            bck: true
          ,
            match: /\.banner \{([\s\S]*?)\}/
            replace: ".banner {#{options.banner_style}}"
            bck: true
            if: options.banner_style
          ]

## Clean Temp Files

Clean up the "/tmp" from temporary Hue directories. All the directories which
modified time are older than 10 days will be removed.

      @tools.cron.add
        header: 'Clean Temp Files'
        cmd: "find /tmp -maxdepth 1 -type d -mtime +10 -user #{options.user.name} -exec rm {} \\;",
        when: '0 */19 * * *'
        user: "#{options.user.name}"
        match: "\\/tmp .*-user #{options.user.name}"
        exec: true
        if: options.clean_tmp

## Dependencies

    misc = require '@nikitajs/core/lib/misc'

## Resources:

*   [Official Hue website](http://gethue.com)
*   [Hortonworks instructions](http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.0.8.0/bk_installing_manually_book/content/rpm-chap-hue.html)


text:
var fireBeforeFeatures = true,
// saves AfterFeatures event to fire once after all features
  afterFeaturesEvent = null;

function EventBroadcaster(listeners, supportCodeLibrary) {
  var Cucumber = require('cucumber'),
    listenerDefaultTimeout = supportCodeLibrary.getDefaultTimeout(),
    supportCodeListeners = supportCodeLibrary.getListeners();

  var self = {
    broadcastAroundEvent: function broadcastAroundEvent(event, userFunction, callback) {
      self.broadcastBeforeEvent(event, function() {
        userFunction(function() {
          var userFunctionCallbackArguments = arguments;
          self.broadcastAfterEvent(event, function() {
            callback.apply(null, userFunctionCallbackArguments);
          });
        });
      });
    },

    broadcastBeforeEvent: function broadcastBeforeEvent(event, callback) {
      var preEvent = event.replicateAsPreEvent();
      self.broadcastEvent(preEvent, callback);
    },

    broadcastAfterEvent: function broadcastAfterEvent(event, callback) {
      var postEvent = event.replicateAsPostEvent();
      self.broadcastEvent(postEvent, callback);
    },

    broadcastEvent: function broadcastEvent(event, callback) {
      Cucumber.Util.asyncForEach(getAllListeners(), function (listener, callback) {
        listener.hear(event, listenerDefaultTimeout, function(error) {
          if (error) {
            process.nextTick(function(){ throw error; }); // prevent swallow by unhandled rejection
          }
          callback();
        });
      }, callback);
    }
  };

  var realBroadcastEvent = self.broadcastEvent;

  self.broadcastEventUncensored = function broadcastEventUncensored(event, callback) {
    realBroadcastEvent(event, callback);
  };

  self.broadcastAfterFeaturesEvent = function broadcastAfterFeaturesEvent(callback) {
    self.broadcastEventUncensored(afterFeaturesEvent, callback);
  };

  // customised broadcaster in order to fire BeforeFeatures and AfterFeatures once
  self.broadcastEvent = function (event, callback) {
    if (isCensoredEvent(event)) {
      disableSupportCodeListeners();
      realBroadcastEvent(event, function () {
        enableSupportCodeListeners();
        callback();
      });
    }
    else {
      realBroadcastEvent(event, callback);
    }
  };

  function getAllListeners() {
    return listeners.concat(supportCodeListeners);
  }

  function disableSupportCodeListeners() {
    supportCodeListeners = [];
  }

  function enableSupportCodeListeners() {
    supportCodeListeners = supportCodeLibrary.getListeners();
  }

  function isCensoredEvent(event) {
    var name = event.getName();

    if (name === 'BeforeFeatures') {
      if (fireBeforeFeatures) {
        fireBeforeFeatures = false;
        return false;
      }
      return true;
    }

    else if (name === 'AfterFeatures') {
      afterFeaturesEvent = event;
      return true;
    }

    else {
      return false;
    }
  }

  return self;
}

module.exports = EventBroadcaster;


text:
#ifndef _CPU_IO2_PEI_H_
#define _CPU_IO2_PEI_H_

#include <PiDxe.h>

#include <Ppi/CpuIo.h>

#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
#include <Library/PeiServicesLib.h>

#define MAX_IO_PORT_ADDRESS   0xFFFF

/**
  Reads memory-mapped registers.

  @param[in]  PeiServices  An indirect pointer to the PEI Services Table
                           published by the PEI Foundation.
  @param[in]  This         Pointer to local data for the interface.
  @param[in]  Width        The width of the access. Enumerated in bytes.
  @param[in]  Address      The physical address of the access.
  @param[in]  Count        The number of accesses to perform.
  @param[out] Buffer       A pointer to the buffer of data.

  @retval EFI_SUCCESS            The function completed successfully.
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
                                 and Count is not valid for this EFI system.

**/
EFI_STATUS
EFIAPI
CpuMemoryServiceRead (
  IN  CONST EFI_PEI_SERVICES    **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI  *This,
  IN  EFI_PEI_CPU_IO_PPI_WIDTH  Width,
  IN  UINT64                    Address,
  IN  UINTN                     Count,
  OUT VOID                      *Buffer
  );

/**
  Writes memory-mapped registers.

  @param[in]  PeiServices  An indirect pointer to the PEI Services Table
                           published by the PEI Foundation.
  @param[in]  This         Pointer to local data for the interface.
  @param[in]  Width        The width of the access. Enumerated in bytes.
  @param[in]  Address      The physical address of the access.
  @param[in]  Count        The number of accesses to perform.
  @param[in]  Buffer       A pointer to the buffer of data.

  @retval EFI_SUCCESS            The function completed successfully.
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
                                 and Count is not valid for this EFI system.

**/
EFI_STATUS
EFIAPI
CpuMemoryServiceWrite (
  IN CONST EFI_PEI_SERVICES    **PeiServices,
  IN CONST EFI_PEI_CPU_IO_PPI  *This,
  IN EFI_PEI_CPU_IO_PPI_WIDTH  Width,
  IN UINT64                    Address,
  IN UINTN                     Count,
  IN VOID                      *Buffer
  );

/**
  Reads I/O registers.

  @param[in]  PeiServices  An indirect pointer to the PEI Services Table
                           published by the PEI Foundation.
  @param[in]  This         Pointer to local data for the interface.
  @param[in]  Width        The width of the access. Enumerated in bytes.
  @param[in]  Address      The physical address of the access.
  @param[in]  Count        The number of accesses to perform.
  @param[out] Buffer       A pointer to the buffer of data.

  @retval EFI_SUCCESS            The function completed successfully.
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
                                 and Count is not valid for this EFI system.

**/
EFI_STATUS
EFIAPI
CpuIoServiceRead (
  IN  CONST EFI_PEI_SERVICES    **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI  *This,
  IN  EFI_PEI_CPU_IO_PPI_WIDTH  Width,
  IN  UINT64                    Address,
  IN  UINTN                     Count,
  OUT VOID                      *Buffer
  );

/**
  Write I/O registers.

  @param[in]  PeiServices  An indirect pointer to the PEI Services Table
                           published by the PEI Foundation.
  @param[in]  This         Pointer to local data for the interface.
  @param[in]  Width        The width of the access. Enumerated in bytes.
  @param[in]  Address      The physical address of the access.
  @param[in]  Count        The number of accesses to perform.
  @param[in]  Buffer       A pointer to the buffer of data.

  @retval EFI_SUCCESS            The function completed successfully.
  @retval EFI_INVALID_PARAMETER  Width is invalid for this EFI system.
  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
                                 and Count is not valid for this EFI system.

**/
EFI_STATUS
EFIAPI
CpuIoServiceWrite (
  IN CONST EFI_PEI_SERVICES    **PeiServices,
  IN CONST EFI_PEI_CPU_IO_PPI  *This,
  IN EFI_PEI_CPU_IO_PPI_WIDTH  Width,
  IN UINT64                    Address,
  IN UINTN                     Count,
  IN VOID                      *Buffer
  );

/**
  8-bit I/O read operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.

  @return  An 8-bit value returned from the I/O space.
**/
UINT8
EFIAPI
CpuIoRead8 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address
  );

/**
  16-bit I/O read operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.

  @return  A 16-bit value returned from the I/O space.

**/
UINT16
EFIAPI
CpuIoRead16 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address
  );

/**
  32-bit I/O read operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.

  @return  A 32-bit value returned from the I/O space.

**/
UINT32
EFIAPI
CpuIoRead32 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address
  );

/**
  64-bit I/O read operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.

  @return  A 64-bit value returned from the I/O space.

**/
UINT64
EFIAPI
CpuIoRead64 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address
  );

/**
  8-bit I/O write operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.
  @param[in] Data         The data to write.

**/
VOID
EFIAPI
CpuIoWrite8 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address,
  IN  UINT8                       Data
  );

/**
  16-bit I/O write operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.
  @param[in] Data         The data to write.

**/
VOID
EFIAPI
CpuIoWrite16 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address,
  IN  UINT16                      Data
  );

/**
  32-bit I/O write operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.
  @param[in] Data         The data to write.

**/
VOID
EFIAPI
CpuIoWrite32 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address,
  IN  UINT32                      Data
  );

/**
  64-bit I/O write operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.
  @param[in] Data         The data to write.

**/
VOID
EFIAPI
CpuIoWrite64 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address,
  IN  UINT64                      Data
  );

/**
  8-bit memory read operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.

  @return  An 8-bit value returned from the memory space.

**/
UINT8
EFIAPI
CpuMemRead8 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address
  );

/**
  16-bit memory read operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.

  @return  A 16-bit value returned from the memory space.

**/
UINT16
EFIAPI
CpuMemRead16 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address
  );

/**
  32-bit memory read operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.

  @return  A 32-bit value returned from the memory space.

**/
UINT32
EFIAPI
CpuMemRead32 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address
  );

/**
  64-bit memory read operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.

  @return  A 64-bit value returned from the memory space.

**/
UINT64
EFIAPI
CpuMemRead64 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address
  );

/**
  8-bit memory write operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.
  @param[in] Data         The data to write.

**/
VOID
EFIAPI
CpuMemWrite8 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address,
  IN  UINT8                       Data
  );

/**
  16-bit memory write operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.
  @param[in] Data         The data to write.

**/
VOID
EFIAPI
CpuMemWrite16 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address,
  IN  UINT16                      Data
  );

/**
  32-bit memory write operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.
  @param[in] Data         The data to write.

**/
VOID
EFIAPI
CpuMemWrite32 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address,
  IN  UINT32                      Data
  );

/**
  64-bit memory write operations.

  @param[in] PeiServices  An indirect pointer to the PEI Services Table published
                          by the PEI Foundation.
  @param[in] This         Pointer to local data for the interface.
  @param[in] Address      The physical address of the access.
  @param[in] Data         The data to write.

**/
VOID
EFIAPI
CpuMemWrite64 (
  IN  CONST EFI_PEI_SERVICES      **PeiServices,
  IN  CONST EFI_PEI_CPU_IO_PPI    *This,
  IN  UINT64                      Address,
  IN  UINT64                      Data
  );

#endif


text:
package org.apache.qpid.jms.provider.discovery.multicast.parsers;

import java.net.URI;
import java.net.URISyntaxException;

import org.apache.qpid.jms.provider.discovery.multicast.DiscoveryEvent;
import org.apache.qpid.jms.provider.discovery.multicast.DiscoveryEvent.EventType;
import org.apache.qpid.jms.provider.discovery.multicast.PacketParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Parser instance for ActiveMQ multicast discovery processing.
 */
public class ActiveMQPacketParser implements PacketParser {

    private static final Logger LOG = LoggerFactory.getLogger(ActiveMQPacketParser.class);

    private static final String TYPE_SUFFIX = "ActiveMQ-4.";
    private static final String ALIVE = "alive.";
    private static final String DEAD = "dead.";
    private static final String DELIMITER = "%";

    private String group;

    @Override
    public String getGroup() {
        return this.group;
    }

    @Override
    public void setGroup(String group) {
        this.group = group;
    }

    @Override
    public DiscoveryEvent processPacket(byte[] packet, int offset, int length) {
        String str = new String(packet, offset, length);
        DiscoveryEvent event = null;
        if (str.startsWith(getType())) {
            String payload = str.substring(getType().length());
            if (payload.startsWith(ALIVE)) {
                String brokerName = getBrokerName(payload.substring(ALIVE.length()));
                try {
                    String brokerUri = payload.substring(ALIVE.length() + brokerName.length() + 2);
                    event = new DiscoveryEvent(new URI(brokerUri), EventType.ALIVE);
                } catch (URISyntaxException ex) {
                    LOG.warn("Published URI has invalid URI syntax, ignoring: {}", payload);
                }
            } else {
                String brokerName = getBrokerName(payload.substring(DEAD.length()));
                try {
                    String brokerUri = payload.substring(DEAD.length() + brokerName.length() + 2);
                    event = new DiscoveryEvent(new URI(brokerUri), EventType.SHUTDOWN);
                } catch (URISyntaxException ex) {
                    LOG.warn("Published URI has invalid URI syntax, ignoring: {}", payload);
                }
            }
        }
        return event;
    }

    private String getBrokerName(String str) {
        String result = null;
        int start = str.indexOf(DELIMITER);
        if (start >= 0) {
            int end = str.indexOf(DELIMITER, start + 1);
            result = str.substring(start + 1, end);
        }
        return result;
    }

    private String getType() {
        return group + "." + TYPE_SUFFIX;
    }
}


text:
/**
 * Support and FAQ: visit Atmel Support
 */

#include <stdio.h>
#include <asf.h>
#include <unit_test/suite.h>
#include <stdio_serial.h>
#include <conf_test.h>

/**
 * \mainpage ASF USB Device HID keyboard
 *
 * \section intro Introduction
 * This example implement an USB Device HID keyboard enumeration
 * but the keyboard events to move and click are not linked.
 * It is to validated the HID keyboard enumeration
 * and USB core callback (VBus presence, resume, suspend and SOF).
 * This example uses the native HID driver for these operating systems.
 *
 */

//! \name Unit test configuration
//@{
/**
 * \def CONF_TEST_USART
 * \brief USART to redirect STDIO to
 */
/**
 * \def CONF_TEST_BAUDRATE
 * \brief Baudrate of USART
 */
/**
 * \def CONF_TEST_CHARLENGTH
 * \brief Character length (bits) of USART
 */
/**
 * \def CONF_TEST_PARITY
 * \brief Parity mode of USART
 */
/**
 * \def CONF_TEST_STOPBITS
 * \brief Stopbit configuration of USART
 */
//@}

static bool main_b_vbus_event = false;
static bool main_b_resume_event = false;
static bool main_b_suspend_event = false;
static bool main_b_sof_event = false;
static bool main_b_keyboard_enumerated = false;
static bool main_b_keyboard_led = false;
#if SAMD21 || SAMR21 || SAML21
/* Structure for UART module connected to EDBG (used for unit test output) */
static struct usart_module cdc_uart_module;
#endif

static void run_usb_keyboard_test(const struct test_case *test)
{
	// Start USB stack to authorize VBus monitoring
	udc_start();

	if (!udc_include_vbus_monitoring()) {
		// VBUS monitoring is not available on this product
		// thereby VBUS has to be considered as present
		main_vbus_action(true);
	}

	// The main loop manages only the power mode
	// because the USB management is done by interrupt
	while (!main_b_keyboard_led) {
		sleepmgr_enter_sleep();
		// No test_assert_true() call
		// because it must be a timeout from server
	}
	test_assert_true(test, main_b_keyboard_enumerated,
			"HID keyboard enumeration fails");

	udc_stop();
}

static void run_usb_keyboard_led_test(const struct test_case *test)
{
	test_assert_true(test, main_b_keyboard_led, "Event keyboard led not receive");
}

static void run_usb_vbus_test(const struct test_case *test)
{
	test_assert_true(test, main_b_vbus_event, "Event vbus not receive");
}

static void run_usb_resume_test(const struct test_case *test)
{
	test_assert_true(test, main_b_resume_event, "Event resume not receive");
}

static void run_usb_suspend_test(const struct test_case *test)
{
	test_assert_true(test, main_b_suspend_event, "Event suspend not receive");
}

static void run_usb_sof_test(const struct test_case *test)
{
	test_assert_true(test, main_b_sof_event, "Event sof not receive");
}

/**
 * \brief Run usb device keyboard unit tests
 *
 * Initializes the clock system, board and serial output, then sets up the
 * usb unit test suite and runs it.
 */
int main(void)
{
#if !SAMD21 && !SAMR21 && !SAML21
	const usart_serial_options_t usart_serial_options = {
		.baudrate   = CONF_TEST_BAUDRATE,
		.charlength = CONF_TEST_CHARLENGTH,
		.paritytype = CONF_TEST_PARITY,
		.stopbits   = CONF_TEST_STOPBITS,
	};
#else
	struct usart_config usart_conf;
#endif

	irq_initialize_vectors();
	cpu_irq_enable();

#if !SAMD21 && !SAMR21 && !SAML21
	sysclk_init();
	board_init();
#else
	system_init();
#endif
	// Initialize the sleep manager
	sleepmgr_init();

#if !SAMD21 && !SAMR21 && !SAML21
	stdio_serial_init(CONF_TEST_USART, &usart_serial_options);
#else
	/* Configure USART for unit test output */
	usart_get_config_defaults(&usart_conf);
	usart_conf.mux_setting = CONF_STDIO_MUX_SETTING;
	usart_conf.pinmux_pad0 = CONF_STDIO_PINMUX_PAD0;
	usart_conf.pinmux_pad1 = CONF_STDIO_PINMUX_PAD1;
	usart_conf.pinmux_pad2 = CONF_STDIO_PINMUX_PAD2;
	usart_conf.pinmux_pad3 = CONF_STDIO_PINMUX_PAD3;
	usart_conf.baudrate    = CONF_STDIO_BAUDRATE;

	stdio_serial_init(&cdc_uart_module, CONF_STDIO_USART, &usart_conf);
	usart_enable(&cdc_uart_module);
#endif

	// Define all the timestamp to date test cases
	DEFINE_TEST_CASE(usb_keyboard_test, NULL,
			run_usb_keyboard_test, NULL,
			"USB Device keyboard enumeration test");
	DEFINE_TEST_CASE(usb_keyboard_led_test, NULL,
			run_usb_keyboard_led_test, NULL,
			"USB Device keyboard led event test");
	DEFINE_TEST_CASE(usb_vbus_test, NULL,
			run_usb_vbus_test, NULL,
			"USB vbus event test");
	DEFINE_TEST_CASE(usb_resume_test, NULL,
			run_usb_resume_test, NULL,
			"USB resume event test");
	DEFINE_TEST_CASE(usb_suspend_test, NULL,
			run_usb_suspend_test, NULL,
			"USB suspend event test");
	DEFINE_TEST_CASE(usb_sof_test, NULL,
			run_usb_sof_test, NULL,
			"USB sof event test");

	// Put test case addresses in an array
	DEFINE_TEST_ARRAY(usb_keyboard_tests) = {
		&usb_keyboard_test,
		&usb_keyboard_led_test,
		&usb_vbus_test,
		&usb_resume_test,
		&usb_suspend_test,
		&usb_sof_test,
	};

	// Define the test suite
	DEFINE_TEST_SUITE(usb_keyboard_suite, usb_keyboard_tests,
			"Common usb HID keyboard service with test suite");

	// The unit test prints message via UART which does not support deep sleep mode.
#if SAM
	sleepmgr_lock_mode(SLEEPMGR_ACTIVE);
#else
	sleepmgr_lock_mode(SLEEPMGR_IDLE);
#endif

	// Run all tests in the suite
	test_suite_run(&usb_keyboard_suite);

	while (1) {
		// Intentionally left empty.
	}
}

void main_vbus_action(bool b_high)
{
	if (b_high) {
		main_b_vbus_event = true;
	}
}

void main_suspend_action(void)
{
	main_b_resume_event = true;
}

void main_resume_action(void)
{
	main_b_suspend_event = true;
}

void main_sof_action(void)
{
	main_b_sof_event = true;
}

void main_remotewakeup_enable(void)
{
}

void main_remotewakeup_disable(void)
{
}

bool main_keyboard_enable(void)
{
	main_b_keyboard_enumerated = true;
	return true;
}

void main_keyboard_disable(void)
{
}

void main_keyboard_led(uint8_t value)
{
	UNUSED(value);
	main_b_keyboard_led = true;
}


text: docker run --name=docker-php-hello-world -it --rm -p 80:80 docker-php-hello-world


text:
#ifndef XFILEDATANODEREFERENCE_H
#define XFILEDATANODEREFERENCE_H

#include "pandatoolbase.h"
#include "xFileDataNodeTemplate.h"
#include "pointerTo.h"

/**
 * This is a nested reference to an instance of a template object, declared
 * via the syntax:
 *
 * { InstanceName }
 *
 * in the X File.
 */
class XFileDataNodeReference : public XFileDataNode {
public:
  XFileDataNodeReference(XFileDataNodeTemplate *object);

  INLINE XFileTemplate *get_template() const;
  INLINE XFileDataNodeTemplate *get_object() const;

  virtual bool is_reference() const;
  virtual bool is_complex_object() const;

  virtual void write_text(ostream &out, int indent_level) const;

protected:
  virtual int get_num_elements() const;
  virtual XFileDataObject *get_element(int n);
  virtual XFileDataObject *get_element(const string &name);

private:
  PT(XFileDataNodeTemplate) _object;

public:
  static TypeHandle get_class_type() {
    return _type_handle;
  }
  static void init_type() {
    XFileDataNode::init_type();
    register_type(_type_handle, "XFileDataNodeReference",
                  XFileDataNode::get_class_type());
  }
  virtual TypeHandle get_type() const {
    return get_class_type();
  }
  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}

private:
  static TypeHandle _type_handle;
};

#include "xFileDataNodeReference.I"

#endif


text:
/**
 * Location.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.dfp.axis.v201308;

/**
 * A {@link Location} represents a geographical entity that can be
 * targeted. If
 *             a location type is not available because of the API version
 * you are using,
 *             the location will be represented as just the base class,
 * otherwise it will be
 *             sub-classed correctly.
 */
public class Location  implements java.io.Serializable {
    /* Uniquely identifies each {@code Location}. */
    private java.lang.Long id;

    /* Indicates that this instance is a subtype of Location.
     *                 Although this field is returned in the response, it
     * is ignored on input
     *                 and cannot be selected. Specify xsi:type instead. */
    private java.lang.String locationType;

    public Location() {
    }

    public Location(
           java.lang.Long id,
           java.lang.String locationType) {
           this.id = id;
           this.locationType = locationType;
    }

    /**
     * Gets the id value for this Location.
     *
     * @return id   * Uniquely identifies each {@code Location}.
     */
    public java.lang.Long getId() {
        return id;
    }

    /**
     * Sets the id value for this Location.
     *
     * @param id   * Uniquely identifies each {@code Location}.
     */
    public void setId(java.lang.Long id) {
        this.id = id;
    }

    /**
     * Gets the locationType value for this Location.
     *
     * @return locationType   * Indicates that this instance is a subtype of Location.
     *                 Although this field is returned in the response, it
     * is ignored on input
     *                 and cannot be selected. Specify xsi:type instead.
     */
    public java.lang.String getLocationType() {
        return locationType;
    }

    /**
     * Sets the locationType value for this Location.
     *
     * @param locationType   * Indicates that this instance is a subtype of Location.
     *                 Although this field is returned in the response, it
     * is ignored on input
     *                 and cannot be selected. Specify xsi:type instead.
     */
    public void setLocationType(java.lang.String locationType) {
        this.locationType = locationType;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof Location)) return false;
        Location other = (Location) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.id==null && other.getId()==null) ||
             (this.id!=null &&
              this.id.equals(other.getId()))) &&
            ((this.locationType==null && other.getLocationType()==null) ||
             (this.locationType!=null &&
              this.locationType.equals(other.getLocationType())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getId() != null) {
            _hashCode += getId().hashCode();
        }
        if (getLocationType() != null) {
            _hashCode += getLocationType().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(Location.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201308", "Location"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("id");
        elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201308", "id"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("locationType");
        elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201308", "Location.Type"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
module Skywriter
  module Resource
    module IAM
      # AWS::IAM::Role Resource
      #
      class Role
        include Skywriter::Resource

        property :AssumeRolePolicyDocument
        property :Path
        property :Policies
      end
    end
  end
end