text:
package com.tyrlib2.graphics.animation;

import java.nio.FloatBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.tyrlib2.game.IUpdateable;
import com.tyrlib2.graphics.renderer.Material;
import com.tyrlib2.graphics.renderer.Mesh;
import com.tyrlib2.graphics.renderer.OpenGLRenderer;
import com.tyrlib2.graphics.renderer.Program;
import com.tyrlib2.graphics.renderer.TyrGL;
import com.tyrlib2.graphics.scene.SceneManager;
import com.tyrlib2.graphics.scene.SceneNode;

/**
 * This class manages skeletal animations by using bones.
 * @author Sascha
 *
 */

public class Skeleton implements IUpdateable {

	private List<Animation> animations = new ArrayList<Animation>();;
	private Map<String, Animation> animationsMap = new HashMap<String, Animation>();
	protected List<Bone> bones = new ArrayList<Bone>();
	protected float[] boneData = null;
	protected SceneNode rootNode = new SceneNode();

	/**
	 * Add a new animation
	 * @param animation
	 */
	public void addAnimation(Animation animation) {
		animations.add(animation);
		animationsMap.put(animation.name, animation);
		animation.skeleton = this;
	}

	/**
	 * Get an existing animation
	 * @param animationName
	 */
	public Animation getAnimation(String animationName) {
		Animation anim = animationsMap.get(animationName);
		return anim;
	}

	public boolean hasAnimation(String animationName) {
		return animationsMap.containsKey(animationName);
	}

	/**
	 * Add a new bone
	 * @param bone
	 */
	public void addBone(Bone bone) {
		boneData = null;
		bones.add(bone);
	}

	/**
	 * Add a bone and assign a parent for it
	 * @param bone
	 * @param parent
	 */
	public void addBone(Bone bone, Bone parent) {
		parent.attachChild(bone);
		addBone(bone);
	}

	public Bone getBone(int index) {
		return bones.get(index);
	}

	@Override
	public void onUpdate(float time) {
		boolean boneUpdate = false;
		for (int i = 0; i < animations.size(); ++i) {
			if (animations.get(i).playing) {
				animations.get(i).onUpdate(time);
				boneUpdate = true;
			}
		}

		if (boneUpdate) {

			for (int i = 0, countBones = bones.size(); i < countBones; ++i) {
				Bone bone = bones.get(i);
				if (bone.getParent() == null) {
					rootNode.attachChild(bone);
				}
				bone.forceUpdate();
			}

			rootNode.update();

			if (boneData == null) {
				boneData = new float[16 * bones.size()];
			}

			updateBoneData();
		}
	}

	public float[] getBoneData() {
		if (boneData == null) {
			boneData = new float[16 * bones.size()];
			updateBoneData();
		}
		return boneData;
	}

	private void updateBoneData() {
		for (int i = 0; i < bones.size(); ++i) {
			float[] modelMatrix = bones.get(i).getModelMatrix();
			System.arraycopy(modelMatrix, 0, boneData, i*16, 16);
		}
	}

	@Override
	public boolean isFinished() {
		return false;
	}

	public int getCountBones() {
		return bones.size();
	}

	public static void passData(float[] skeletonBuffer, int bones, Material material, Mesh mesh) {
		passData(skeletonBuffer, bones, 0.1f, material, mesh);
	}

	public static void passData(float[] skeletonBuffer, int bones, float size, Material material, Mesh mesh) {
		if (skeletonBuffer != null && skeletonBuffer.length > 0) {
			Program program = material.getProgram();
			passDataIntern(skeletonBuffer,bones,size,material,mesh,program);
		}
	}

	public static void passShadowData(float[] skeletonBuffer, int bones, Material material, Mesh mesh) {
		if (skeletonBuffer != null && skeletonBuffer.length > 0) {
			Program program = SceneManager.getInstance().getRenderer().getShadowProgram(true);
			program.use();
			material.updateHandles();
			passDataIntern(skeletonBuffer,bones,0.1f,material,mesh,program);
		}
	}

	private static void passDataIntern(float[] skeletonBuffer, int bones, float size, Material material, Mesh mesh, Program program) {

		int boneHandle = TyrGL.glGetUniformLocation(program.handle, material.getBoneParam());
		int sizeHandle = TyrGL.glGetUniformLocation(program.handle, "u_Size");
		int boneIndexHandle = TyrGL.glGetAttribLocation(program.handle, material.getBoneIndexParam());
		int boneWeightHandle = TyrGL.glGetAttribLocation(program.handle, material.getBoneWeightParam());

        // Prepare the skeleton data
		TyrGL.glUniformMatrix4fv(boneHandle, bones, false, skeletonBuffer, 0);

		if (sizeHandle != -1) {
			TyrGL.glUniform1f(sizeHandle, size);
		}

		if (mesh.isUsingVBO()) {
			TyrGL.glBindBuffer(TyrGL.GL_ARRAY_BUFFER, mesh.getBBuffer());
	        TyrGL.glEnableVertexAttribArray(boneIndexHandle);
	        TyrGL.glVertexAttribPointer(boneIndexHandle, Mesh.MAX_BONES_PER_VERTEX,
	        							TyrGL.GL_FLOAT, false,
						                Mesh.BONE_BYTE_STRIDE * OpenGLRenderer.BYTES_PER_FLOAT,
						                Mesh.BONE_INDEX_OFFSET * OpenGLRenderer.BYTES_PER_FLOAT);

	        TyrGL.glEnableVertexAttribArray(boneWeightHandle);
	        TyrGL.glVertexAttribPointer(boneWeightHandle, Mesh.MAX_BONES_PER_VERTEX,
	        							TyrGL.GL_FLOAT, false,
						                Mesh.BONE_BYTE_STRIDE * OpenGLRenderer.BYTES_PER_FLOAT,
						                Mesh.BONE_WEIGHT_OFFSET * OpenGLRenderer.BYTES_PER_FLOAT);
		} else {
	        FloatBuffer boneBuffer = mesh.getBoneBuffer();
	        TyrGL.glEnableVertexAttribArray(boneIndexHandle);
	        boneBuffer.position(Mesh.BONE_INDEX_OFFSET);
	        TyrGL.glVertexAttribPointer(boneIndexHandle, Mesh.MAX_BONES_PER_VERTEX,
	        							TyrGL.GL_FLOAT, false,
						                Mesh.BONE_BYTE_STRIDE * OpenGLRenderer.BYTES_PER_FLOAT,
						                mesh.getBoneBuffer());

	        boneBuffer.position(Mesh.BONE_WEIGHT_OFFSET);
	        TyrGL.glEnableVertexAttribArray(boneWeightHandle);
	        TyrGL.glVertexAttribPointer(boneWeightHandle, Mesh.MAX_BONES_PER_VERTEX,
	        							TyrGL.GL_FLOAT, false,
						                Mesh.BONE_BYTE_STRIDE * OpenGLRenderer.BYTES_PER_FLOAT,
						                mesh.getBoneBuffer());
		}
	}

}


text:
title: "Detection & Segmentation"
categories:
  - Research
tags:
  - paper skimming
header:
  teaser: /assets/images/paper skim/land mark.png
  overlay_image: /assets/images/paper skim/land mark.png
  overlay_filter: 0.4
sidebar:
  nav: "dl"
author_profile: false
---

This post is a summary and paper skimming on detection and segmentation related research.
So, this post will be keep updating by the time.

{% include toc title="Table of Contents" icon="file-text" %}

# Paper List

## Segmentation
- [Revisiting Dilated Convolution: A Simple Approach for Weakly- and Semi- Supervised semantic Segmentation]({{ site.url }}{{ site.baseurl }}/research/research-paper-skim/#revisiting-dilated-convolution), CVPR2018
  - [Paper](https://arxiv.org/pdf/1805.04574)

- [What's the point: semantic segmentation with point supervision]({{ site.url }}{{ site.baseurl }}/research/research-paper-skim/#whats-the-point), ICCV2016
  - [Paper](http://calvin.inf.ed.ac.uk/wp-content/uploads/Publications/bearman16cvpr.pdf)

## Detection
- [Unsupervised Learning of Object Landmarks by Factorized Spatial embeddings]({{ site.url }}{{ site.baseurl }}/research/research-paper-skim/#unsupervised-learning-of-object-landmarks-by-factorized-spatial-embeddings), ICCV2016
  - [Paper](https://www.robots.ox.ac.uk/~vedaldi/assets/pubs/thewlis17unsupervised.pdf)

- [Scalable Deep Learning Logo Detection]({{ site.url }}{{ site.baseurl }}/research/research-paper-skim/#scalable-deep-learning-logo-detection)
  - [Paper](https://arxiv.org/pdf/1803.11417.pdf)

# Revisiting Dilated Convolution
- Title: Revisiting Dilated Convolution: A Simple Approach for Weakly- and Semi- Supervised semantic Segmentation
- Conference: CVPR2018
- Institute: UIUC, NUS, IBM, Tencent

## Summary
- **Problem Statement**
  - Time-consuming boudning box annotation is sidestepped in *weakly supervised learning*.
  - In this case, the supervised information is restricted to binary labels (object absence/presence) without their locations.

- **Research Objective**
  - To infer the object locations during weakly supervised learning

- **Proposed Solution**
  - Propose a multiple-instance learning approach that iteratively trains the detector and infers the object locations in the positive training images
  - Window refinement method

- **Contribution**
  - Multi-fold multiple instance learning procedure, which prevents training from prematurely locking onto erroneous object locations
  - Window refinement method improves the localization accuracy by incorporating an objectness prior.

![Algorithm]({{ site.url }}{{ site.baseurl }}/assets/images/paper skim/mil algo.png){: .align-center}{:height="80%" width="80%"}
*Figure: Multi-fold weakly supervised training*
{: .text-center}

## References
- Paper: [Revisiting Dilated Convolution: A Simple Approach for Weakly- and Semi- Supervised semantic Segmentation](https://arxiv.org/pdf/1805.04574)

# Unsupervised Learning of Object Landmarks by Factorized Spatial embeddings
- Conference: ICCV2016
- Institute: University of Oxford

## Summary
- **Problem Statement**
  - Learning automatically the structure of object categories is an oppen problem in computer vision.

- **Research Objective**
  - To learn landmarks of objects with unsupervised approach

- **Proposed Solution**
  - Propose a unsupervised approach that can discover and learn landmarks in object categories, thus characterizing their structure.
  - Approach is based on factorizing image deformations, as induced by a viewpoint change or an object deformation, by learning a deep neural network that detects landmarks consistently with such visual effects.

- **Contribution**
  - Learned-landmarks establish meaningful correspondences between different object instances in a category without having to impose this requirement explicitly.
  - Proposed unsupervised landmarks are highly predictive of manually-annotated landmarks in face benchmark datasets, and can be used to regree these with a high degree of accuracy.

![Algorithm]({{ site.url }}{{ site.baseurl }}/assets/images/paper skim/land mark.png){: .align-center}{:height="80%" width="80%"}
*Figure: Proposed method that cna learn view point invariant landmarks without any supervision.*
{: .text-center}

## References
- Paper: [Unsupervised Learning of Object Landmarks by Factorized Spatial embeddings](https://www.robots.ox.ac.uk/~vedaldi/assets/pubs/thewlis17unsupervised.pdf)

# Scalable Deep Learning Logo Detection
- Conference: Arxiv
- Institute: Queen Mary University of London, Vision Semantics Ltd.

## Summary
- **Problem Statement**
  - Existing logo detection methods usually consider a small number of logo classes and limited images per class with a strong assumption of requiring tedious object bounding box annotations.
  - This is not scalable to real-world dynamic applications.

- **Research Objective**
  - To handle the problem by exploring the webly data learning principle without the need for exhaustive manual labelling.
  - To learn scalable logo detection method

- **Proposed Solution**
  - Propose a novel incremental learning approach, called Scalable Logo Self-co-Learning (SL2)
  - It is capable of automatically self-discovering informative training images from noisy web data for progressively improving model capability in a cross-model co-learning manner.

- **Contribution**
  - Introduce a very large (2,190,757 images of 194 logo classes) logo dataset "WebLogo-2M"
  - Proposed SL2 method is superior over the state-of-the-art and weekly supervised detection and contemporary webly data learning approaches.

![Algorithm]({{ site.url }}{{ site.baseurl }}/assets/images/paper skim/logo.png){: .align-center}{:height="80%" width="80%"}
*Figure: Logo detection performance on WebLogo-2M.*
{: .text-center}

## References
- Paper: [Scalable Deep Learning Logo Detection](https://arxiv.org/pdf/1803.11417.pdf)

# What's the point
- Title: What's the point: semantic segmentation with point supervision
- Conference: ICCV2016

## Summary

- **Problem Statement**
  - Detailed per-pixel annotations enable training accurate models but are very time-consuming to obtain
  - Image-level class labels are an order of magnitude cheaper but result in less accurate models

- **Research Objective**
  - To take a natural step (point) from image-level annotation towards stronger supervision

- **Proposed Solution**
  - Annotators *point* to an object if one exists
  - Incorporate this point supervision along with a novel objectness potential in the training loss function of a CNN model.

- **Contribution**
  - Experimental results on the PASCAL VOC 2012 benchmark reveal that the combined effect of point-level supervision and objectness potential yields an improvement of 12.9% mIOU over image-level supervision
  - Models trained with point-level supervision are more accurate than models trained with image-level, squiggle-level or full supervision given a fixed annotation budget

![Segmentation Method]({{ site.url }}{{ site.baseurl }}/assets/images/paper skim/segmentation method.png){: .align-center}{:height="100%" width="100%"}
*Figure:(Top): Overview of our semantic segmentation training framework. (Bottom): Different levels of training supervision*
{: .text-center}

## References
- Paper: [What's the point: semantic segmentation with point supervision](http://calvin.inf.ed.ac.uk/wp-content/uploads/Publications/bearman16cvpr.pdf)

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Hyper\AdsBundle\Payment;

interface ParamsProviderInterface
{
    /**
     * @param OrderInterface $order
     * @return array
     */
    public function getParametersFromOrder(OrderInterface $order);
}


text:
<instance description="" template="ebps">
	<list name="extensions">
		<template_reference name="exts" value="ebpextensions\entity_blueprint_ext">
			<string name="alternate_sua" value="armies\soviet\weapons\artillery_152mm_ml20\artillery_152mm_ml20" />
			<bool name="always_revealed_in_fow" value="False" />
			<file name="animator" value="armies\soviet\weapons\artillery_152mm_ml20\artillery_152mm_ml20" />
			<bool name="is_visible_in_game" value="True" />
			<float name="precise_size" value="-1" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\sim_entity_ext">
			<bool name="is_in_spatial_bucket" value="True" />
			<float name="rotate_snap" value="360" />
			<float name="transferable" value="0" />
			<bool name="kill_paradrop" value="False" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\ability_ext">
			<list name="abilities">
				<instance_reference name="ability" value="abilities\soviet\modal_ability\artillery\artillery_barrage_ability\ml_20_152mm_barrage_ability_mp" />
				<instance_reference name="ability" value="abilities\soviet\modal_ability\artillery\artillery_barrage_ability\ml_20_152mm_barrage_ability_vet3_mp" />
				<instance_reference name="ability" value="abilities\soviet\modal_ability\artillery\artillery_barrage_ability\ml_20_152mm_barrage_precison_ability_mp" />
				<instance_reference name="ability" value="abilities\soviet\modal_ability\artillery\artillery_barrage_ability\ml_20_152mm_barrage_ability_victortarget_mp" />
			</list>
		</template_reference>
		<template_reference name="exts" value="ebpextensions\action_apply_ext">
			<list name="actions">
			</list>
		</template_reference>
		<template_reference name="exts" value="ebpextensions\cost_ext">
			<group name="time_cost">
				<group name="cost">
					<float name="action" value="0" />
					<float name="command" value="0" />
					<float name="fuel" value="0" />
					<float name="manpower" value="260" />
					<float name="munition" value="0" />
					<float name="popcap" value="0" />
				</group>
				<float name="time_seconds" value="180" />
			</group>
		</template_reference>
		<template_reference name="exts" value="ebpextensions\health_ext">
			<bool name="can_repair" value="True" />
			<bool name="cuttable" value="False" />
			<string name="death_event_name" value="Death" />
			<float name="death_seconds" value="1" />
			<bool name="delete_when_dead" value="True" />
			<bool name="force_attacker_memory" value="False" />
			<float name="hitpoints" value="400" />
			<bool name="is_invincible" value="False" />
			<bool name="is_salvagable_wreck" value="False" />
			<bool name="keep_wreck_ownership" value="False" />
			<bool name="rear_damage_enabled" value="False" />
			<instance_reference name="rebuilt_entity" value="" />
			<instance_reference name="rebuilt_squad" value="" />
			<bool name="rebuilt_use_wreck_owner" value="False" />
			<bool name="receive_weapon_cover_modifiers" value="False" />
			<float name="regeneration" value="0" />
			<bool name="regeneration_disabled" value="False" />
			<bool name="remove_from_pathfinding_on_death" value="True" />
			<bool name="reveal_to_all_on_death" value="False" />
			<bool name="ui_can_scuttle" value="False" />
			<instance_reference name="wreck_entity" value="ebps\environment\art_ambient\objects\vehicles\wrecked_vehicles\wrecked_atgun_ml20" />
			<list name="death_actions">
			</list>
			<float name="armor" value="70" />
			<float name="rear_armor" value="0" />
			<float name="target_size" value="20" />
			<bool name="dies_from_broken_ice" value="True" />
			<list name="criticals">
				<group name="critical_group">
					<float name="max_health_percentage" value="0" />
					<list name="critical_info">
						<group name="info">
							<float name="weight" value="100" />
							<enum_table name="applicable_weapons">
								<bool name="small_arms" value="True" />
								<bool name="flame" value="False" />
								<bool name="ballistic" value="True" />
								<bool name="explosive" value="True" />
							</enum_table>
							<instance_reference name="critical" value="critical\vehicle_destroy" />
							<enum_table name="applicable_hit_direction">
								<bool name="front" value="True" />
								<bool name="rear" value="True" />
							</enum_table>
						</group>
					</list>
				</group>
			</list>
			<float name="weapon_priority" value="0" />
			<template_reference name="wreck_entity_option" value="options\none">
			</template_reference>
		</template_reference>
		<template_reference name="exts" value="ebpextensions\hit_object_ext">
			<instance_reference name="hit_material" value="hit_material\armour" />
			<bool name="hit_non_neutral" value="False" />
			<float name="hit_percentage" value="1" />
			<bool name="pass_through" value="False" />
			<group name="projectile_pass_through">
				<bool name="tp_artillery" value="True" />
				<bool name="tp_artillery_inf" value="True" />
				<bool name="tp_artillery_overwatch" value="True" />
				<bool name="tp_homing" value="True" />
				<bool name="tp_homing_inf" value="True" />
				<bool name="tp_sticky" value="True" />
				<bool name="tp_throw" value="True" />
			</group>
		</template_reference>
		<template_reference name="exts" value="ebpextensions\line_of_sight_ext">
			<group name="blocking_box">
				<float name="x" value="0.01" />
				<float name="y" value="0.01" />
				<float name="z" value="0.01" />
			</group>
			<bool name="is_shot_blocking" value="False" />
			<bool name="use_blocking_box" value="False" />
			<enum name="does_block_line_of_sight" value="Never" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\modifier_ext">
		</template_reference>
		<template_reference name="exts" value="ebpextensions\population_ext">
			<float name="medic_pop" value="0" />
			<float name="personnel_pop" value="11" />
			<float name="vehicle_pop" value="0" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\sight_ext">
			<group name="detect_camouflage">
				<float name="tp_global" value="10" />
				<float name="tp_mine" value="0" />
			</group>
			<bool name="extended_sight" value="False" />
			<float name="extended_sight_radius" value="70" />
			<float name="reveal_area_on_death_time" value="6" />
			<group name="sight_package">
				<float name="inner_height" value="2.5" />
				<float name="inner_radius" value="1" />
				<float name="outer_height" value="-3" />
				<float name="outer_radius" value="40" />
				<float name="cone_angle" value="360" />
				<float name="cone_start_radius" value="0" />
			</group>
			<group name="extended_sight_target_info">
				<template_reference name="extended_sight_target_info" value="type_ability_target_type\all">
				</template_reference>
			</group>
		</template_reference>
		<template_reference name="exts" value="ebpextensions\type_ext">
			<group name="unit_type_list">
				<enum name="unit_type00" value="" />
				<enum name="unit_type01" value="no_vehicle_button" />
				<enum name="unit_type02" value="" />
				<enum name="unit_type03" value="team_weapon" />
				<enum name="unit_type04" value="" />
				<enum name="unit_type05" value="artillery" />
				<enum name="unit_type06" value="soviet_artillery" />
				<enum name="unit_type07" value="ml20_artillery" />
				<enum name="unit_type08" value="mp_unit" />
				<enum name="unit_type09" value="" />
				<enum name="unit_type10" value="" />
				<enum name="unit_type11" value="salvageable_object" />
				<enum name="unit_type12" value="" />
				<enum name="unit_type13" value="" />
				<enum name="unit_type14" value="" />
				<enum name="unit_type15" value="" />
			</group>
			<enum name="weapon_targeting" value="manual_only" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\ui_ext">
			<bool name="ap_killed_kicker" value="True" />
			<bool name="ap_loss_kicker" value="True" />
			<bool name="cullsphere_selectable" value="False" />
			<float name="decorator_offset" value="0.6" />
			<string name="extra_text_deprecated" value="" />
			<bool name="ghost_enable" value="False" />
			<bool name="has_speech_code" value="True" />
			<locstring name="help_text" value="11031931" />
			<string name="hotkey_name" value="R" />
			<icon name="icon_name" value="Icons_vehicles_vehicle_soviet_ml20_artillery_gun" />
			<enum name="kill_type" value="heavy_armour" />
			<float name="minimap_color_a" value="255" />
			<float name="minimap_color_b" value="255" />
			<float name="minimap_color_g" value="255" />
			<float name="minimap_color_r" value="255" />
			<bool name="minimap_enable" value="False" />
			<bool name="minimap_team_only" value="False" />
			<bool name="minimap_teamcolor" value="False" />
			<bool name="obb_selectable" value="False" />
			<string name="overlay_name" value="" />
			<bool name="reveal_for_decryption" value="True" />
			<locstring name="screen_name" value="11008238" />
			<enum name="selection_name" value="vehicle" />
			<float name="selection_scale" value="1" />
			<enum name="selection_type" value="squad_select" />
			<bool name="sloppy_selectable" value="True" />
			<group name="speaker">
				<string name="code_1" value="wp" />
				<string name="code_2" value="gs" />
				<string name="code_3" value="" />
			</group>
			<group name="speech_code_2">
				<string name="code_1" value="rt" />
				<string name="code_2" value="in" />
				<string name="code_3" value="" />
			</group>
			<group name="speech_code_3">
				<string name="code_1" value="art" />
				<string name="code_2" value="how" />
				<string name="code_3" value="" />
			</group>
			<group name="speech_code_cover">
				<string name="code_1" value="" />
				<string name="code_2" value="" />
				<string name="code_3" value="" />
			</group>
			<bool name="tacmap_team_only" value="False" />
			<locstring name="tooltip_txt" value="11049219" />
			<int name="ui_priority" value="0" />
			<icon name="minimap_icon" value="" />
			<icon name="portrait_icon_winter" value="Icons_portraits_vehicle_soviet_ml20_152mm_artillery_w_portrait" />
			<group name="speaker_alt">
				<string name="code_1" value="" />
				<string name="code_2" value="" />
				<string name="code_3" value="" />
			</group>
			<float name="minimap_icon_scale" value="1" />
			<icon name="portrait_icon_summer" value="Icons_portraits_vehicle_soviet_ml20_152mm_artillery_s_portrait" />
			<locstring name="brief_text" value="0" />
			<locstring name="extra_text" value="11042783" />
			<locstring name="screen_name_short" value="0" />
			<bool name="show_in_build_log" value="False" />
			<bool name="show_entity_appearance" value="True" />
			<locstring name="screen_name_world" value="11047983" />
			<locstring name="help_text_world" value="11047466" />
			<locstring name="extra_text_world" value="11047464" />
			<enum name="map_rotation_type_override" value="no_override" />
			<icon name="symbol_icon_name" value="Icons_symbols_vehicle_soviet_ml20_artillery_gun_symbol" />
			<enum name="occlusion_state" value="can_be_occluded" />
			<enum name="decorator_visibility" value="default" />
			<string name="decorator_marker_name" value="Marker_FX_UI" />
			<bool name="skin_pack_override" value="False" />
			<string name="skin_summer" value="" />
			<string name="skin_winter" value="" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\attention_gen_ext">
			<string name="animation_event_name" value="" />
			<enum name="attention_mode" value="positional_toward" />
			<enum name="attention_type" value="" />
			<float name="attention_weight" value="50" />
			<float name="chance_to_use" value="0.1" />
			<float name="directional_angle" value="0" />
			<bool name="ignore_in_combat" value="True" />
			<bool name="ignore_while_calm" value="False" />
			<bool name="ignore_while_moving" value="False" />
			<bool name="ignore_while_stationary" value="False" />
			<bool name="ignore_while_tense" value="False" />
			<float name="initial_delay" value="-1" />
			<float name="max_range" value="10" />
			<float name="time_limit" value="3" />
			<bool name="generates_spotted_events" value="False" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\combat_ext">
			<bool name="reject_attack_command" value="True" />
			<list name="hardpoints">
				<group name="hardpoint">
					<float name="parent_hardpoint" value="-1" />
					<list name="weapon_table">
						<group name="weapon">
							<group name="heading">
								<float name="x" value="0" />
								<float name="y" value="0" />
								<float name="z" value="1" />
							</group>
							<float name="length" value="3" />
							<group name="origin">
								<float name="x" value="-0.00511" />
								<float name="y" value="4" />
								<float name="z" value="-0.31433" />
							</group>
							<enum name="type" value="default" />
							<instance_reference name="weapon" value="weapon\soviet\explosive_weapons\heavy_artillery\152mm_m-30_disabled_mp" mod="95f9ec3171c849d792717e865bd5e612" />
						</group>
					</list>
					<bool name="receives_attack_commands" value="False" />
				</group>
				<group name="hardpoint">
					<float name="parent_hardpoint" value="-1" />
					<list name="weapon_table">
						<group name="weapon">
							<group name="heading">
								<float name="x" value="0" />
								<float name="y" value="0" />
								<float name="z" value="1" />
							</group>
							<float name="length" value="3" />
							<group name="origin">
								<float name="x" value="-0.00511" />
								<float name="y" value="4" />
								<float name="z" value="-0.31433" />
							</group>
							<enum name="type" value="default" />
							<instance_reference name="weapon" value="weapon\soviet\explosive_weapons\heavy_artillery\152mm_m-30_mp" />
						</group>
					</list>
					<bool name="receives_attack_commands" value="False" />
				</group>
				<group name="hardpoint">
					<float name="parent_hardpoint" value="2" />
					<list name="weapon_table">
						<group name="weapon">
							<group name="heading">
								<float name="x" value="0" />
								<float name="y" value="0" />
								<float name="z" value="1" />
							</group>
							<float name="length" value="3" />
							<group name="origin">
								<float name="x" value="-0.00511" />
								<float name="y" value="4" />
								<float name="z" value="-0.31433" />
							</group>
							<enum name="type" value="default" />
							<instance_reference name="weapon" value="weapon\soviet\explosive_weapons\heavy_artillery\152mm_m-30_precision_mp" mod="95f9ec3171c849d792717e865bd5e612" />
						</group>
					</list>
					<bool name="receives_attack_commands" value="False" />
				</group>
				<group name="hardpoint">
					<float name="parent_hardpoint" value="2" />
					<list name="weapon_table">
						<group name="weapon">
							<group name="heading">
								<float name="x" value="0" />
								<float name="y" value="0" />
								<float name="z" value="1" />
							</group>
							<float name="length" value="3" />
							<group name="origin">
								<float name="x" value="-0.00511" />
								<float name="y" value="4" />
								<float name="z" value="-0.31433" />
							</group>
							<enum name="type" value="default" />
							<instance_reference name="weapon" value="weapon\soviet\explosive_weapons\heavy_artillery\152mm_m-30_vet3_mp" mod="95f9ec3171c849d792717e865bd5e612" />
						</group>
					</list>
					<bool name="receives_attack_commands" value="False" />
				</group>
				<group name="hardpoint">
					<float name="parent_hardpoint" value="2" />
					<list name="weapon_table">
						<group name="weapon">
							<group name="heading">
								<float name="x" value="0" />
								<float name="y" value="0" />
								<float name="z" value="1" />
							</group>
							<float name="length" value="3" />
							<group name="origin">
								<float name="x" value="-0.00511" />
								<float name="y" value="4" />
								<float name="z" value="-0.31433" />
							</group>
							<enum name="type" value="default" />
							<instance_reference name="weapon" value="weapon\soviet\explosive_weapons\heavy_artillery\152mm_m-30_victortarget_mp" mod="95f9ec3171c849d792717e865bd5e612" />
						</group>
					</list>
					<bool name="receives_attack_commands" value="False" />
				</group>
			</list>
			<int name="sight_hardpoint" value="-1" />
			<list name="kill_actions">
			</list>
		</template_reference>
		<template_reference name="exts" value="ebpextensions\modifier_apply_ext">
			<list name="modifiers">
			</list>
		</template_reference>
		<template_reference name="exts" value="ebpextensions\team_weapon_ext">
			<string name="attach_state_name" value="Artillery_Attach" />
			<bool name="can_manual_abandon" value="False" />
			<bool name="disable_garrison" value="False" />
			<string name="ownership_state_name" value="AntiTankGun_Owner" />
			<string name="role_state_name" value="Artillery_Role" />
			<string name="sync_target_name" value="Artillery_Target" />
			<enum name="team_weapon_type" value="tp_mobile" />
			<string name="weapon_usage_state_name" value="" />
			<list name="on_abandon_action">
				<template_reference name="action" value="action\retreat_action">
					<instance_reference name="entity_type_to_retreat_to" value="" />
					<enum name="retreat_type" value="withdraw_to_edge" />
					<uniqueid name="id" value="1073747646" />
					<float name="refund_percent_after_retreat" value="0" />
				</template_reference>
				<template_reference name="action" value="action\apply_modifiers_action">
					<float name="duration" value="0" />
					<bool name="permanent" value="False" />
					<list name="modifiers">
						<template_reference name="modifier" value="modifiers\sight_radius_modifier">
							<enum name="application_type" value="apply_to_squad" />
							<bool name="exclusive" value="False" />
							<string name="modifier_id" value="" />
							<string name="target_type_name" value="" />
							<enum name="usage_type" value="multiplication" />
							<float name="value" value="0" />
							<instance_reference name="tooltip" value="modifier_tooltip\sight_radius_modifier" />
						</template_reference>
					</list>
					<uniqueid name="id" value="1073747647" />
				</template_reference>
			</list>
			<list name="role_list">
				<group name="role">
					<string name="coordinate_sync_event" value="" />
					<string name="join_sync_marker" value="Gunner_Sync" />
					<string name="leave_sync_marker" value="Gunner_Sync" />
					<bool name="required" value="True" />
					<string name="role_name" value="Gunner" />
				</group>
				<group name="role">
					<string name="coordinate_sync_event" value="" />
					<string name="join_sync_marker" value="Loader_Sync" />
					<string name="leave_sync_marker" value="Loader_Sync" />
					<bool name="required" value="True" />
					<string name="role_name" value="Loader" />
				</group>
			</list>
			<float name="destroy_on_abandon_health_threshold" value="-1" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\marker_ext">
		</template_reference>
		<template_reference name="exts" value="ebpextensions\recrewable_ext">
			<list name="race_list">
				<group name="race_data">
					<instance_reference name="ext_key" value="" />
					<group name="info">
						<instance_reference name="capture_squad_blueprint" value="sbps\races\soviet\vehicles\m1937_152mm_ml_20_artillery\m1937_152mm_ml_20_artillery_mp" />
						<float name="max_capture_crew_size" value="3" />
						<float name="min_capture_crew_size" value="2" />
						<list name="recrew_penalties_list">
						</list>
						<float name="abandon_animation_seconds" value="0" />
						<int name="recrew_max_squad_size" value="4" />
						<bool name="abandoned_allows_pass_through" value="False" />
						<list name="apply_to_driver_action">
						</list>
						<float name="driver_death_chance_on_entity_death" value="1" />
						<instance_reference name="driver_squad_blueprint" value="" />
					</group>
				</group>
			</list>
		</template_reference>
		<template_reference name="exts" value="ebpextensions\holdable_ext">
			<enum name="holdable" value="hold_large_gun" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\construction_ext">
			<bool name="automatic_fit_on_placement" value="True" />
			<bool name="can_set_facing" value="True" />
			<float name="cancel_refund_percentage" value="100" />
			<bool name="check_terrain" value="False" />
			<string name="construction_state_name" value="blowtorch_state" />
			<float name="construction_transition_time" value="1.36667" />
			<bool name="force_construction" value="False" />
			<float name="max_engineers" value="8" />
			<bool name="must_be_in_command_territory" value="False" />
			<bool name="must_be_in_line_of_sight" value="False" />
			<bool name="must_be_in_supply_territory" value="True" />
			<bool name="must_be_in_territory" value="False" />
			<bool name="must_be_on" value="False" />
			<bool name="must_not_be_in_walkable_surfaces" value="True" />
			<instance_reference name="on_construction_squad" value="sbps\races\soviet\vehicles\m1937_152mm_ml_20_artillery\m1937_152mm_ml_20_artillery_mp" />
			<float name="orientation" value="0" />
			<enum name="placement_type" value="tp_structure" />
			<bool name="prefer_spots_on_side_with_leader" value="False" />
			<bool name="query_abilities_for_range_ui" value="False" />
			<bool name="query_construction_actions_for_range_ui" value="False" />
			<bool name="query_upgrade_actions_for_range_ui" value="False" />
			<bool name="random_rotation" value="False" />
			<float name="replace_ghost_distance" value="5" />
			<float name="spacing_distance" value="0" />
			<bool name="self_construct" value="False" />
			<list name="on_construction_actions">
				<template_reference name="action" value="action\upgrade_add">
					<bool name="apply_to_entities_in_squad" value="True" />
					<bool name="trigger_publish_event" value="False" />
					<instance_reference name="upgrade" value="upgrade\howitzer_built" />
					<uniqueid name="id" value="1073747648" />
				</template_reference>
			</list>
			<list name="materials">
			</list>
			<group name="field_placement_info">
				<instance_reference name="border_entity" value="" />
				<instance_reference name="replace_entity" value="" />
				<int name="replace_count" value="0" />
				<float name="replace_retry_distance" value="0" />
			</group>
			<instance_reference name="placement_valid" value="ui_rectangle\construction_placement_valid" />
			<instance_reference name="placement_invalid" value="ui_rectangle\construction_placement_invalid" />
			<instance_reference name="ui_range" value="ui_reticule\construction_range_artillery" />
			<float name="ui_range_radius" value="0" />
			<instance_reference name="ui_setfacing" value="ui_setfacing\construction_artillery" />
			<bool name="query_weapon_for_range_ui" value="True" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\impass_ext">
			<bool name="cant_build" value="True" />
			<bool name="heavy_crush" value="True" />
			<bool name="land" value="True" />
			<bool name="light_crush" value="True" />
			<bool name="medium_crush" value="True" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\site_ext">
			<float name="extra_build_test_footprint" value="0.8" />
			<bool name="require_all_cells_clear" value="True" />
			<bool name="snap_to_terrain" value="False" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\obj_cover_ext">
			<enum name="cover_type" value="tp_zz_team_weapon_heavy" />
			<bool name="is_cover_directional" value="False" />
			<bool name="is_shoot_through" value="False" />
			<bool name="lengthwise_spots" value="False" />
			<float name="offset_x" value="0" />
			<float name="offset_y" value="0" />
			<float name="offset_z" value="0" />
			<bool name="prevent_prone" value="False" />
			<float name="range_x" value="0" />
			<float name="range_y" value="0" />
			<float name="range_z" value="0" />
			<bool name="require_standing" value="False" />
			<bool name="use_simbox_range" value="False" />
			<bool name="use_simbox_range_plus_spots" value="True" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\requirement_ext">
			<list name="requirement_table">
				<template_reference name="required" value="requirements\required_resource">
					<enum name="reason" value="usage" />
					<locstring name="ui_name" value="11048163" />
					<template_reference name="resource" value="tables\resource_table">
						<float name="action" value="0" />
						<float name="command" value="8" />
						<float name="fuel" value="0" />
						<float name="manpower" value="0" />
						<float name="munition" value="0" />
						<float name="soviet_progression" value="0" />
						<float name="soviet_227" value="0" />
						<float name="popcap" value="0" />
					</template_reference>
				</template_reference>
				<template_reference name="required" value="requirements\required_player_upgrade">
					<enum name="reason" value="usage_and_display" />
					<locstring name="ui_name" value="0" />
					<bool name="is_present" value="True" />
					<float name="max_completed" value="100" />
					<float name="min_completed" value="1" />
					<instance_reference name="upgrade_name" value="upgrade\soviet\commander\passive\ml_20_howitzer_unlock" />
				</template_reference>
			</list>
		</template_reference>
		<template_reference name="exts" value="ebpextensions\moving_ext">
			<float name="acceleration" value="1.875" />
			<float name="deceleration" value="5.5" />
			<float name="high_path_look_ahead_max_dist" value="25" />
			<bool name="orient_to_terrain" value="True" />
			<instance_reference name="pass_type" value="pass_types\land_only" />
			<float name="rotation_rate" value="20" />
			<float name="rotation_rate_crouch" value="870" />
			<float name="rotation_rate_prone" value="225" />
			<float name="rotation_rate_stand" value="870" />
			<bool name="smooth_path" value="True" />
			<float name="speed_max" value="0" />
			<instance_reference name="turn_plan" value="turn_plan\gun_i" />
			<float name="on_ice_accel_decel_multiplier" value="1" />
			<float name="on_land_overturn_scale" value="0" />
			<float name="on_ice_overturn_scale" value="0" />
		</template_reference>
		<template_reference name="exts" value="ebpextensions\upgrade_ext">
			<bool name="must_be_in_supply" value="False" />
			<float name="number_of_standard_slots" value="-1" />
			<list name="standard_upgrades">
			</list>
		</template_reference>
	</list>
	<uniqueid name="pbgid" value="3189" />
</instance>


text:
@implementation OVCClient

- (id)initWithBaseURL:(NSURL *)url {
    self = [super initWithBaseURL:url];
    if (self) {
        [self registerHTTPOperationClass:[OVCRequestOperation class]];
        [self setDefaultHeader:@"Accept" value:@"application/json"];
    }

    return self;
}

- (OVCRequestOperation *)GET:(NSString *)path parameters:(NSDictionary *)parameters resultClass:(Class)resultClass resultKeyPath:(NSString *)keyPath completion:(void (^)(AFHTTPRequestOperation *operation, id responseObject, NSError *error))block {
    NSURLRequest *request = [self requestWithMethod:@"GET" path:path parameters:parameters];
    OVCRequestOperation *operation = [self HTTPRequestOperationWithRequest:request
                                                               resultClass:resultClass
                                                             resultKeyPath:keyPath
                                                                completion:block];
    [self enqueueHTTPRequestOperation:operation];
    return operation;
}

- (OVCRequestOperation *)POST:(NSString *)path parameters:(NSDictionary *)parameters resultClass:(Class)resultClass resultKeyPath:(NSString *)keyPath completion:(void (^)(AFHTTPRequestOperation *operation, id responseObject, NSError *error))block {
    NSURLRequest *request = [self requestWithMethod:@"POST" path:path parameters:parameters];
    OVCRequestOperation *operation = [self HTTPRequestOperationWithRequest:request
                                                               resultClass:resultClass
                                                             resultKeyPath:keyPath
                                                                completion:block];
    [self enqueueHTTPRequestOperation:operation];
    return operation;
}

- (OVCRequestOperation *)PUT:(NSString *)path parameters:(NSDictionary *)parameters resultClass:(Class)resultClass resultKeyPath:(NSString *)keyPath completion:(void (^)(AFHTTPRequestOperation *operation, id responseObject, NSError *error))block {
    NSURLRequest *request = [self requestWithMethod:@"PUT" path:path parameters:parameters];
    OVCRequestOperation *operation = [self HTTPRequestOperationWithRequest:request
                                                               resultClass:resultClass
                                                             resultKeyPath:keyPath
                                                                completion:block];
    [self enqueueHTTPRequestOperation:operation];
    return operation;
}

- (OVCRequestOperation *)HTTPRequestOperationWithRequest:(NSURLRequest *)urlRequest resultClass:(Class)resultClass resultKeyPath:(NSString *)keyPath completion:(void (^)(AFHTTPRequestOperation *operation, id responseObject, NSError *error))block {
    OVCRequestOperation *requestOperation = (OVCRequestOperation *)[self HTTPRequestOperationWithRequest:urlRequest
                                                                                success:nil
                                                                                failure:nil];
    NSAssert([requestOperation isKindOfClass:[OVCRequestOperation class]], @"*** Unsupported operation class.");

    requestOperation.valueTransformer = [OVCRequestOperation valueTransformerWithResultClass:resultClass resultKeyPath:keyPath];

    if (block) {
        [requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
            block((OVCRequestOperation *) operation, responseObject, nil);
        } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
            block((OVCRequestOperation *) operation, nil, error);
        }];
    }

    return requestOperation;
}

- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters parts:(NSArray *)parts {
    return [self multipartFormRequestWithMethod:method path:path parameters:parameters constructingBodyWithBlock:^(id <AFMultipartFormData> formData) {
        for (OVCMultipartPart *part in parts) {
            [formData appendPartWithFileData:part.data name:part.name fileName:part.filename mimeType:part.type];
        }
    }];
}

@end


text:
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.Azure.Management.Authorization;
using Microsoft.Azure.Management.Authorization.Models;

namespace Microsoft.Azure.Management.Authorization
{
    /// <summary>
    /// TBD  (see http://TBD for more information)
    /// </summary>
    public partial interface IRoleAssignmentOperations
    {
        /// <summary>
        /// Create role assignment.
        /// </summary>
        /// <param name='scope'>
        /// Scope.
        /// </param>
        /// <param name='roleAssignmentName'>
        /// Role assignment name.
        /// </param>
        /// <param name='parameters'>
        /// Role assignment.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignments creation results
        /// </returns>
        Task<RoleAssignmentCreateResult> CreateAsync(string scope, Guid roleAssignmentName, RoleAssignmentCreateParameters parameters, CancellationToken cancellationToken);

        /// <summary>
        /// Create role assignment by Id.
        /// </summary>
        /// <param name='roleAssignmentId'>
        /// Role assignment Id
        /// </param>
        /// <param name='parameters'>
        /// Role assignment.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignments creation results
        /// </returns>
        Task<RoleAssignmentCreateResult> CreateByIdAsync(string roleAssignmentId, RoleAssignmentCreateParameters parameters, CancellationToken cancellationToken);

        /// <summary>
        /// Delete role assignment.
        /// </summary>
        /// <param name='scope'>
        /// Scope.
        /// </param>
        /// <param name='roleAssignmentName'>
        /// Role assignment name.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignments delete result
        /// </returns>
        Task<RoleAssignmentDeleteResult> DeleteAsync(string scope, Guid roleAssignmentName, CancellationToken cancellationToken);

        /// <summary>
        /// Delete role assignment.
        /// </summary>
        /// <param name='roleAssignmentId'>
        /// Role assignment Id
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignments delete result
        /// </returns>
        Task<RoleAssignmentDeleteResult> DeleteByIdAsync(string roleAssignmentId, CancellationToken cancellationToken);

        /// <summary>
        /// Get single role assignment.
        /// </summary>
        /// <param name='scope'>
        /// Scope.
        /// </param>
        /// <param name='roleAssignmentName'>
        /// Role assignment name.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignment get operation result.
        /// </returns>
        Task<RoleAssignmentGetResult> GetAsync(string scope, Guid roleAssignmentName, CancellationToken cancellationToken);

        /// <summary>
        /// Get single role assignment.
        /// </summary>
        /// <param name='roleAssignmentId'>
        /// Role assignment Id
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignment get operation result.
        /// </returns>
        Task<RoleAssignmentGetResult> GetByIdAsync(string roleAssignmentId, CancellationToken cancellationToken);

        /// <summary>
        /// Gets role assignments of the subscription.
        /// </summary>
        /// <param name='parameters'>
        /// List operation filters. If null will return all role assignments
        /// at, above or below the subscription.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignment list operation result.
        /// </returns>
        Task<RoleAssignmentListResult> ListAsync(ListAssignmentsFilterParameters parameters, CancellationToken cancellationToken);

        /// <summary>
        /// Gets role assignments of the resource.
        /// </summary>
        /// <param name='resourceGroupName'>
        /// The name of the resource group.
        /// </param>
        /// <param name='identity'>
        /// Resource identity.
        /// </param>
        /// <param name='parameters'>
        /// List operation filters. If null will return all role assignments
        /// at, above or below the resource.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignment list operation result.
        /// </returns>
        Task<RoleAssignmentListResult> ListForResourceAsync(string resourceGroupName, ResourceIdentity identity, ListAssignmentsFilterParameters parameters, CancellationToken cancellationToken);

        /// <summary>
        /// Gets role assignments of the resource group.
        /// </summary>
        /// <param name='resourceGroupName'>
        /// Resource group name.
        /// </param>
        /// <param name='parameters'>
        /// List operation filters. If null will return all role assignments
        /// at, above or below the resource group.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignment list operation result.
        /// </returns>
        Task<RoleAssignmentListResult> ListForResourceGroupAsync(string resourceGroupName, ListAssignmentsFilterParameters parameters, CancellationToken cancellationToken);

        /// <summary>
        /// Gets role assignments of the resource group.
        /// </summary>
        /// <param name='nextLink'>
        /// NextLink from the previous successful call to List operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignment list operation result.
        /// </returns>
        Task<RoleAssignmentListResult> ListForResourceGroupNextAsync(string nextLink, CancellationToken cancellationToken);

        /// <summary>
        /// Gets role assignments of the resource.
        /// </summary>
        /// <param name='nextLink'>
        /// NextLink from the previous successful call to List operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignment list operation result.
        /// </returns>
        Task<RoleAssignmentListResult> ListForResourceNextAsync(string nextLink, CancellationToken cancellationToken);

        /// <summary>
        /// Gets role assignments of the scope.
        /// </summary>
        /// <param name='scope'>
        /// Scope.
        /// </param>
        /// <param name='parameters'>
        /// List operation filters. If null will return all role assignments
        /// at, above or below the subscription.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignment list operation result.
        /// </returns>
        Task<RoleAssignmentListResult> ListForScopeAsync(string scope, ListAssignmentsFilterParameters parameters, CancellationToken cancellationToken);

        /// <summary>
        /// Gets role assignments of the scope.
        /// </summary>
        /// <param name='nextLink'>
        /// NextLink from the previous successful call to List operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignment list operation result.
        /// </returns>
        Task<RoleAssignmentListResult> ListForScopeNextAsync(string nextLink, CancellationToken cancellationToken);

        /// <summary>
        /// Gets role assignments of the subscription.
        /// </summary>
        /// <param name='nextLink'>
        /// NextLink from the previous successful call to List operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Role assignment list operation result.
        /// </returns>
        Task<RoleAssignmentListResult> ListNextAsync(string nextLink, CancellationToken cancellationToken);
    }
}


text:
package service_helpers

import (
	"errors"
	"testing"

	"github.com/golang/mock/gomock"
	"github.com/stretchr/testify/assert"

	"gitlab.com/gitlab-org/gitlab-ci-multi-runner/helpers/service/mocks"
)

var errExample = errors.New("example error")

func TestStart(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	mi := &mocks.Interface{}
	s := &SimpleService{i: mi}

	mi.On("Start", s).Return(errExample)

	err := s.Run()
	assert.Equal(t, err, errExample)
	mi.AssertExpectations(t)
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Hypholoma irroratum (P. Karst.) Sacc.

### Remarks
null


text:
message("")
message("==============================================================================")
message("                            SeqAn Features")
message("==============================================================================")
message("")
if (ZLIB_FOUND AND BZIP2_FOUND AND Boost_FOUND AND OPENMP_FOUND)
    message("ALL dependencies were found and the SeqAn build system has SUCCESSFULLY")
    message("configured your build files or IDE project files.  ALL functionality has")
    message("been enabled.")
else ()
    message("The SeqAn build system has SUCCESSFULLY configured your build files or IDE")
    message("project files.  Most features of SeqAn depend only on core C/C++ features and")
    message("are available on any platform.  However, some functionality is only enabled")
    message("with external libraries installed.  The following report shows you which of")
    message("these OPTIONAL features are disabled on your system.  Also, it gives you")
    message("some hints on what to do to enable the features.")
endif ()
message("")
if (ZLIB_FOUND)
    message("ZLIB       - FOUND")
else (ZLIB_FOUND)
    message("ZLIB       - NOT FOUND")
    message("")
    message("  zlib is a library for file compression (powering the ubiquitous .gz files,")
    message("  for example.  Reading/writing zlib-compressed streams depends on zlib,")
    message("  especially does support for BAM files.  For Linux systems, zlib is available")
    message("  in all distribution's package repositoryies, make sure to also install the")
    message("  developer files.  For Mac Os X, zlib should be installed together with the")
    message("  XCode Tools.  For Windows, we have prepared a ZIP archive with common")
    message("  binaries, available together with installation instructions here:")
    message("")
    message("    http://trac.seqan.de/wiki/HowTo/InstallContribsWindows")
    message("")
    message("  The following functionality has been disabled:")
    message("")
    message("    * Reading/writing of gzip and BGZF files (Stream<GZFile>, Stream<BGZF>).")
    message("    * Reading/writing of BAM files.")
    message("")
endif (ZLIB_FOUND)
if (BZIP2_FOUND)
    message("BZIP2      - FOUND")
else (BZIP2_FOUND)
    message("BZIP2      - NOT FOUND")
    message("")
    message("  bzlib is a library for compression (powering .bz2 files).  The compression")
    message("  ratio is better than with zlib/gzip but compression and decompression are")
    message("  slower.  For Linux, libbz2 is available in all distribution's package")
    message("  repositories, make sure to also install the developer files.  For Mac Os X,")
    message("  bzlib should be installed together with the XCode Tools.  For Windows, we")
    message("  have prepared a ZIP archive with common binaries, including bzlib, available")
    message("  together with installation instructions here:")
    message("")
    message("    http://trac.seqan.de/wiki/HowTo/InstallContribsWindows")
    message("")
    message("  The following functionality has been disabled:")
    message("")
    message("   * Reading/writing of bz2 files (Stream<BZ2Stream>).")
    message("")
endif (BZIP2_FOUND)
if (OPENMP_FOUND)
    message("OPENMP     - FOUND")
else (OPENMP_FOUND)
    message("OPENMP     - NOT FOUND")
    message("")
    message("  OpenMP is a C/C++ language extension for parallel programming.  It provides")
    message("  C pragmas that allow parallelization-related annotations of the program code")
    message("  and a run time library.  No functionality is disabled but the parallel")
    message("  versions of algorithms will not be available.  Also, some applications will")
    message("  not be built with OpenMP missing (see messages above).")
    message("")
    message("  OpenMP is available in the GCC C++/MinGW and Microsoft Visual C++ compilers.")
    message("  LLVM/Clang currently does not have support for OpenMP.")
    message("")
endif (OPENMP_FOUND)
if (Boost_FOUND)
    message("BOOST      - FOUND")
else (Boost_FOUND)
    message("BOOST      - NOT FOUND")
    message("")
    message("  Boost the largest C++ template library.  Because of its size, we chose not")
    message("  to depend on Boost for core library functionality.  However, some")
    message("  applications depend on Boost, e.g. for the math/statistics Boost libraries.")
    message("  These applications will appear in your build and project files (as indicated")
    message("  above).")
    message("")
endif (Boost_FOUND)
message("")
message("Build Type - ${CMAKE_BUILD_TYPE}")
message("")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("             Programs will be built in DEBUG mode.  Debug symbols and")
message("             assertions will be enabled.  The code is compiled with DISABLED")
message("             OPTIMIZATIONS")
message("")
message("                  /!\\ DEBUG mode will result in BAD PERFORMANCE /!\\")
message("")
message("             For PRODUCTION USAGE, you should compile in Release mode. To")
message("             enable the release mode, pass -DCMAKE_BUILD_TYPE=Release to the")
message("             cmake call.")
elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
message("             Programs will be built in RELEASE WITH DEBUG SYMBOLS mode.")
message("             Debug symbols and optimizations are enabled, assertions are only")
message("             enabled for the tests.")
elseif (CMAKE_BUILD_TYPE STREQUAL "Release")
message("             Programs will be built in RELEASE mode. Optimizations are")
message("             enabled, debug symbols are disabled, and assertions are only")
message("             enabled for the tests.")
endif ()
message("")
message("==============================================================================")
message("")


text:
<?php

/**
 * PluginPosSponsorTable
 *
 * This class has been auto-generated by the Doctrine ORM Framework
 */
class PluginPosSponsorTable extends Doctrine_Table {
/**
 * Returns an instance of this class.
 *
 * @return object PluginPosSponsorTable
 */
    public static function getInstance() {
        return Doctrine_Core::getTable('PluginPosSponsor');
    }
    public function getSponsorPos($num=null) {
        return $this->createQuery('p')
        ->where('p.expire_date > ?', date( 'Y-m-d h:i:s', time() ))
        ->orderBy('p.sort_order DESC')
        ->limit($num)
        ->execute();
    }
}


text:
import copy

from openstackclient.common import utils
from openstackclient.tests import fakes
from openstackclient.tests.identity.v3 import fakes as identity_fakes
from openstackclient.tests import utils as tests_utils
from openstackclient.tests.volume.v2 import fakes as volume_fakes
from openstackclient.volume.v2 import volume_type

class TestType(volume_fakes.TestVolume):

    def setUp(self):
        super(TestType, self).setUp()

        self.types_mock = self.app.client_manager.volume.volume_types
        self.types_mock.reset_mock()

        self.types_access_mock = (
            self.app.client_manager.volume.volume_type_access)
        self.types_access_mock.reset_mock()

        self.projects_mock = self.app.client_manager.identity.projects
        self.projects_mock.reset_mock()

class TestTypeCreate(TestType):

    columns = (
        'description',
        'id',
        'name',
    )

    def setUp(self):
        super(TestTypeCreate, self).setUp()

        self.new_volume_type = volume_fakes.FakeType.create_one_type()
        self.data = (
            self.new_volume_type.description,
            self.new_volume_type.id,
            self.new_volume_type.name,
        )

        self.types_mock.create.return_value = self.new_volume_type
        # Get the command object to test
        self.cmd = volume_type.CreateVolumeType(self.app, None)

    def test_type_create_public(self):
        arglist = [
            "--description", self.new_volume_type.description,
            "--public",
            self.new_volume_type.name,
        ]
        verifylist = [
            ("description", self.new_volume_type.description),
            ("public", True),
            ("private", False),
            ("name", self.new_volume_type.name),
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        columns, data = self.cmd.take_action(parsed_args)
        self.types_mock.create.assert_called_with(
            self.new_volume_type.name,
            description=self.new_volume_type.description,
            is_public=True,
        )

        self.assertEqual(self.columns, columns)
        self.assertEqual(self.data, data)

    def test_type_create_private(self):
        arglist = [
            "--description", self.new_volume_type.description,
            "--private",
            self.new_volume_type.name,
        ]
        verifylist = [
            ("description", self.new_volume_type.description),
            ("public", False),
            ("private", True),
            ("name", self.new_volume_type.name),
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        columns, data = self.cmd.take_action(parsed_args)
        self.types_mock.create.assert_called_with(
            self.new_volume_type.name,
            description=self.new_volume_type.description,
            is_public=False,
        )

        self.assertEqual(self.columns, columns)
        self.assertEqual(self.data, data)

class TestTypeDelete(TestType):

    volume_type = volume_fakes.FakeType.create_one_type()

    def setUp(self):
        super(TestTypeDelete, self).setUp()

        self.types_mock.get.return_value = self.volume_type
        self.types_mock.delete.return_value = None

        # Get the command object to mock
        self.cmd = volume_type.DeleteVolumeType(self.app, None)

    def test_type_delete(self):
        arglist = [
            self.volume_type.id
        ]
        verifylist = [
            ("volume_type", self.volume_type.id)
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        result = self.cmd.take_action(parsed_args)

        self.types_mock.delete.assert_called_with(self.volume_type.id)
        self.assertIsNone(result)

class TestTypeList(TestType):

    volume_types = volume_fakes.FakeType.create_types()

    columns = [
        "ID",
        "Name"
    ]
    columns_long = columns + [
        "Description",
        "Properties"
    ]

    data = []
    for t in volume_types:
        data.append((
            t.id,
            t.name,
        ))
    data_long = []
    for t in volume_types:
        data_long.append((
            t.id,
            t.name,
            t.description,
            utils.format_dict(t.extra_specs),
        ))

    def setUp(self):
        super(TestTypeList, self).setUp()

        self.types_mock.list.return_value = self.volume_types
        # get the command to test
        self.cmd = volume_type.ListVolumeType(self.app, None)

    def test_type_list_without_options(self):
        arglist = []
        verifylist = [
            ("long", False)
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        columns, data = self.cmd.take_action(parsed_args)
        self.assertEqual(self.columns, columns)
        self.assertEqual(self.data, list(data))

    def test_type_list_with_options(self):
        arglist = ["--long"]
        verifylist = [("long", True)]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        columns, data = self.cmd.take_action(parsed_args)
        self.assertEqual(self.columns_long, columns)
        self.assertEqual(self.data_long, list(data))

class TestTypeSet(TestType):

    volume_type = volume_fakes.FakeType.create_one_type(
        methods={'set_keys': None})

    def setUp(self):
        super(TestTypeSet, self).setUp()

        self.types_mock.get.return_value = self.volume_type

        # Return a project
        self.projects_mock.get.return_value = fakes.FakeResource(
            None,
            copy.deepcopy(identity_fakes.PROJECT),
            loaded=True,
        )
        # Get the command object to test
        self.cmd = volume_type.SetVolumeType(self.app, None)

    def test_type_set_name(self):
        new_name = 'new_name'
        arglist = [
            '--name', new_name,
            self.volume_type.id,
        ]
        verifylist = [
            ('name', new_name),
            ('description', None),
            ('property', None),
            ('volume_type', self.volume_type.id),
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        result = self.cmd.take_action(parsed_args)

        # Set expected values
        kwargs = {
            'name': new_name,
        }
        self.types_mock.update.assert_called_with(
            self.volume_type.id,
            **kwargs
        )
        self.assertIsNone(result)

    def test_type_set_description(self):
        new_desc = 'new_desc'
        arglist = [
            '--description', new_desc,
            self.volume_type.id,
        ]
        verifylist = [
            ('name', None),
            ('description', new_desc),
            ('property', None),
            ('volume_type', self.volume_type.id),
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        result = self.cmd.take_action(parsed_args)

        # Set expected values
        kwargs = {
            'description': new_desc,
        }
        self.types_mock.update.assert_called_with(
            self.volume_type.id,
            **kwargs
        )
        self.assertIsNone(result)

    def test_type_set_property(self):
        arglist = [
            '--property', 'myprop=myvalue',
            self.volume_type.id,
        ]
        verifylist = [
            ('name', None),
            ('description', None),
            ('property', {'myprop': 'myvalue'}),
            ('volume_type', self.volume_type.id),
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        result = self.cmd.take_action(parsed_args)
        self.volume_type.set_keys.assert_called_once_with(
            {'myprop': 'myvalue'})
        self.assertIsNone(result)

    def test_type_set_not_called_without_project_argument(self):
        arglist = [
            '--project', '',
            self.volume_type.id,
        ]
        verifylist = [
            ('project', ''),
            ('volume_type', self.volume_type.id),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        result = self.cmd.take_action(parsed_args)
        self.assertIsNone(result)

        self.assertFalse(self.types_access_mock.add_project_access.called)

    def test_type_set_failed_with_missing_volume_type_argument(self):
        arglist = [
            '--project', 'identity_fakes.project_id',
        ]
        verifylist = [
            ('project', 'identity_fakes.project_id'),
        ]

        self.assertRaises(tests_utils.ParserException,
                          self.check_parser,
                          self.cmd,
                          arglist,
                          verifylist)

    def test_type_set_project_access(self):
        arglist = [
            '--project', identity_fakes.project_id,
            self.volume_type.id,
        ]
        verifylist = [
            ('project', identity_fakes.project_id),
            ('volume_type', self.volume_type.id),
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        result = self.cmd.take_action(parsed_args)
        self.assertIsNone(result)

        self.types_access_mock.add_project_access.assert_called_with(
            self.volume_type.id,
            identity_fakes.project_id,
        )

class TestTypeShow(TestType):

    columns = (
        'description',
        'id',
        'name',
        'properties',
    )

    def setUp(self):
        super(TestTypeShow, self).setUp()

        self.volume_type = volume_fakes.FakeType.create_one_type()
        self.data = (
            self.volume_type.description,
            self.volume_type.id,
            self.volume_type.name,
            utils.format_dict(self.volume_type.extra_specs)
        )

        self.types_mock.get.return_value = self.volume_type

        # Get the command object to test
        self.cmd = volume_type.ShowVolumeType(self.app, None)

    def test_type_show(self):
        arglist = [
            self.volume_type.id
        ]
        verifylist = [
            ("volume_type", self.volume_type.id)
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        columns, data = self.cmd.take_action(parsed_args)
        self.types_mock.get.assert_called_with(self.volume_type.id)

        self.assertEqual(self.columns, columns)
        self.assertEqual(self.data, data)

class TestTypeUnset(TestType):

    volume_type = volume_fakes.FakeType.create_one_type(
        methods={'unset_keys': None})

    def setUp(self):
        super(TestTypeUnset, self).setUp()

        self.types_mock.get.return_value = self.volume_type

        # Return a project
        self.projects_mock.get.return_value = fakes.FakeResource(
            None,
            copy.deepcopy(identity_fakes.PROJECT),
            loaded=True,
        )

        # Get the command object to test
        self.cmd = volume_type.UnsetVolumeType(self.app, None)

    def test_type_unset(self):
        arglist = [
            '--property', 'property',
            '--property', 'multi_property',
            self.volume_type.id,
        ]
        verifylist = [
            ('property', ['property', 'multi_property']),
            ('volume_type', self.volume_type.id),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        result = self.cmd.take_action(parsed_args)
        self.volume_type.unset_keys.assert_called_once_with(
            ['property', 'multi_property'])
        self.assertIsNone(result)

    def test_type_unset_project_access(self):
        arglist = [
            '--project', identity_fakes.project_id,
            self.volume_type.id,
        ]
        verifylist = [
            ('project', identity_fakes.project_id),
            ('volume_type', self.volume_type.id),
        ]
        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        result = self.cmd.take_action(parsed_args)
        self.assertIsNone(result)

        self.types_access_mock.remove_project_access.assert_called_with(
            self.volume_type.id,
            identity_fakes.project_id,
        )

    def test_type_unset_not_called_without_project_argument(self):
        arglist = [
            '--project', '',
            self.volume_type.id,
        ]
        verifylist = [
            ('project', ''),
            ('volume_type', self.volume_type.id),
        ]

        parsed_args = self.check_parser(self.cmd, arglist, verifylist)

        result = self.cmd.take_action(parsed_args)
        self.assertIsNone(result)

        self.assertFalse(self.types_access_mock.remove_project_access.called)

    def test_type_unset_failed_with_missing_volume_type_argument(self):
        arglist = [
            '--project', 'identity_fakes.project_id',
        ]
        verifylist = [
            ('project', 'identity_fakes.project_id'),
        ]

        self.assertRaises(tests_utils.ParserException,
                          self.check_parser,
                          self.cmd,
                          arglist,
                          verifylist)


text:
/**
 *
 */
package com.trendrr.oss.concurrent;

import java.util.Date;
import java.util.concurrent.atomic.AtomicReference;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * An object that will be lazily initialized, and reinitialize every X millis
 *
 *
 * @author Dustin Norlander
 * @created Dec 6, 2010
 *
 */
public abstract class ReinitObject<T> implements Initializer<T>{

	protected static Log log = LogFactory.getLog(ReinitObject.class);

	private PeriodicLock lock = null;
	private AtomicReference<T> ref = new AtomicReference<T>();
	private boolean usePreviousIfNull = false;

	public ReinitObject(long millisBetweenInit) {
		lock = new PeriodicLock(0, millisBetweenInit);
	}

	/**
	 *
	 * @param millisBetweenInit
	 * @param usePreviousIfNull if init returns null should we use the old result?
	 */
	public ReinitObject(long millisBetweenInit, boolean usePreviousIfNull) {
		lock = new PeriodicLock(0, millisBetweenInit);
		this.usePreviousIfNull = usePreviousIfNull;
	}

	public T get() {
		if (ref.get() == null) {
			//we block if the object is unitialized.  otherwise we skip while initia
			if (lock.lockOrWait()) {
				try {
					if (ref.get() == null) { //check again
						ref.set(this.init());
					}
				} finally {
					lock.unlock();
				}
			}
		} else {
			// else we return the old results while the new ones are being initialized
			if (lock.lockOrSkip()) {
				T old = null;
				try {

					T val = this.init();
					if (val != null || !this.usePreviousIfNull) {
						old = this.ref.get();
						ref.set(val);
					} else {
//						log.info("Skipping cause this init is null");
					}
				} finally {
					lock.unlock();
				}

				//cleanup outside the lock.
				if (old != null) {
					this.cleanup(old);
				}
			}

		}
		return ref.get();
	}

	/**
	 * This is called when the object is reinitialized.  allows to cleanup any resources.
	 * @param object
	 */
	public void cleanup(T object) {

	}

	/**
	 * passively looks to see if this object needs to be re-initialized
	 * @return
	 */
	public boolean isExpired() {
		return lock.getNextUnlock().getTime() < new Date().getTime();
	}

	/**
	 * clears the initialized object if it is expired.
	 */
	public void clearIfExpired() {
		if (lock.lockOrWait()) {
			try {
				ref.set(null);
			} finally {
				lock.unlock();
			}
		}
		lock.lockUntil(new Date());
	}
}


text:
package org.jivesoftware.smackx.omemo.signal;

import java.util.logging.Level;

import org.jivesoftware.smackx.omemo.OmemoManager;
import org.jivesoftware.smackx.omemo.OmemoService;
import org.jivesoftware.smackx.omemo.OmemoStore;
import org.jivesoftware.smackx.omemo.exceptions.CorruptedOmemoKeyException;
import org.jivesoftware.smackx.omemo.internal.OmemoDevice;

import org.whispersystems.libsignal.IdentityKey;
import org.whispersystems.libsignal.IdentityKeyPair;
import org.whispersystems.libsignal.SessionBuilder;
import org.whispersystems.libsignal.SessionCipher;
import org.whispersystems.libsignal.SignalProtocolAddress;
import org.whispersystems.libsignal.UntrustedIdentityException;
import org.whispersystems.libsignal.ecc.ECPublicKey;
import org.whispersystems.libsignal.state.PreKeyBundle;
import org.whispersystems.libsignal.state.PreKeyRecord;
import org.whispersystems.libsignal.state.SessionRecord;
import org.whispersystems.libsignal.state.SignedPreKeyRecord;

/**
 * Concrete implementation of the OmemoService using the Signal library.
 *
 * @author Paul Schaub
 */
@SuppressWarnings("unused")
public final class SignalOmemoService
        extends OmemoService<IdentityKeyPair, IdentityKey, PreKeyRecord, SignedPreKeyRecord, SessionRecord,
        SignalProtocolAddress, ECPublicKey, PreKeyBundle, SessionCipher> {

    private static SignalOmemoService INSTANCE;
    private static boolean LICENSE_ACKNOWLEDGED = false;

    @Override
    protected SignalOmemoRatchet instantiateOmemoRatchet(
            OmemoManager manager,
            OmemoStore<IdentityKeyPair, IdentityKey, PreKeyRecord, SignedPreKeyRecord, SessionRecord,
                    SignalProtocolAddress, ECPublicKey, PreKeyBundle, SessionCipher> store) {

        return new SignalOmemoRatchet(manager, getOmemoStoreBackend());
    }

    public static void setup() {
        if (!LICENSE_ACKNOWLEDGED) {
            throw new IllegalStateException("smack-omemo-signal is licensed under the terms of the GPLv3. " +
                    "Please be aware that you can only use this library within the terms of the GPLv3. " +
                    "See for example https://www.gnu.org/licenses/quick-guide-gplv3 for more details. Please call " +
                    "SignalOmemoService.acknowledgeLicense() prior to the setup() method in order to prevent " +
                    "this exception.");
        }
        if (INSTANCE == null) {
            INSTANCE = new SignalOmemoService();
        }
        setInstance(INSTANCE);
    }

    @Override
    public OmemoStore<IdentityKeyPair, IdentityKey, PreKeyRecord, SignedPreKeyRecord, SessionRecord,
            SignalProtocolAddress, ECPublicKey, PreKeyBundle, SessionCipher>
    createDefaultOmemoStoreBackend() {
        return new SignalCachingOmemoStore();
    }

    private SignalOmemoService() {
        super();
    }

    public static void acknowledgeLicense() {
        LICENSE_ACKNOWLEDGED = true;
    }

    @Override
    protected void processBundle(OmemoManager omemoManager,
                                 PreKeyBundle contactsBundle,
                                 OmemoDevice contactsDevice)
            throws CorruptedOmemoKeyException {

        SignalOmemoStoreConnector connector = new SignalOmemoStoreConnector(omemoManager, getOmemoStoreBackend());
        SessionBuilder builder = new SessionBuilder(connector, connector, connector, connector,
                SignalOmemoStoreConnector.asAddress(contactsDevice));
        try {
            builder.process(contactsBundle);
            LOGGER.log(Level.FINE, "Session built with " + contactsDevice);
        } catch (org.whispersystems.libsignal.InvalidKeyException e) {
            throw new CorruptedOmemoKeyException(e);
        } catch (UntrustedIdentityException e) {
            // This should never happen.
            throw new AssertionError(e);
        }
    }
}


text:
'use strict'

const test = require('ava')
const data = require('./fixture/data.json')
const encontre = require('../src')

test('Deve retornar um array com 2 objetos contendo o nome Thiago', t => {
	const result = encontre(data, 'name', 'Thiago Lagden')
	t.true(result.length > 0)
	t.true(result.length === 2)
	t.is(result[0].name, 'Thiago Lagden')
	t.is(result[1].name, 'Thiago Magalhães')
})

test('Deve retornar um array contendo um objeto com o nome Felipe Oliveira', t => {
	const result = encontre(data, 'name', 'Felipe Oliveira', {split: false})
	t.true(result.length > 0)
	t.true(result.length === 1)
	t.is(result[0].name, 'Felipe Oliveira')
})

test('Deve retornar um array vazio', t => {
	const result = encontre(data, 'name', 'Sabrina')
	t.true(result.length === 0)
})

test('Deve retornar um array contendo um objeto com o nome Lucas Tadashi', t => {
	const result = encontre(data, 'name', 'lucas', {caseSensitive: false})
	t.true(result.length === 1)
	t.is(result[0].name, 'Lucas Tadashi')
})


text:
![PowerShell Logo](powershell_logo.png) ![GitHub Mark](GitHub-Mark.png)

# Posh-GitHub

Unofficial Powershell cmdlets that expose the GitHub API

## Early Code

This is a super super early take on some rudimentary GitHub functionality.
I will continue to improve this over time as need grows / time allows.  There
may be bugs or things I haven't thought of -- please report if that's the case!

## Compatibility

* This is written for Powershell v3 and makes use of the simplified
[Invoke-RestMethod][invoke-rest] instead of the `WebClient` class.
  * Powershell v3 can be installed with [Chocolatey][Choc] via `cinst powershell`

* This is written against GitHub API v3

[invoke-rest]: http://technet.microsoft.com/en-us/library/hh849971.aspx
[Choc]: http://www.chocolatey.org

## Installation

### Chocolatey

Once Chocolatey has been installed, simply use the `cinst` command.

```powershell
cinst posh-github
```

Chocolatey installation will import the module into your PowerShell profile.

## Updating

### Chocolatey

After installing with Chocolatey, simply use the `cup` command.

```powershell
cup posh-github
```

## Supported Commands

### Environment Variables

Cmdlets are set to use the following environment variables as defaults

* `GITHUB_OAUTH_TOKEN` - Required for all cmdlets - use `New-GitHubOAuthToken`
  to establish a token and automatically set this variable for the current user
* `GITHUB_USERNAME` - Can be optionally set to specify a global default user -
use the `Set-GitHubUserName` helper
* `GITHUB_ORGANIZATION` - Can be optionally set to specify a global default
organization - use the `Set-GitHubOrganization` helper

### Last Command Output

A Powershell object created from the incoming JSON is always stored
in the variable `$GITHUB_API_OUTPUT` after each call to the GitHub API

### New-GitHubOAuthToken

Used to create a new OAuth token for use with the GitHub using your
username/password in basic auth over HTTPS.  The result is stashed in the
`GITHUB_OAUTH_TOKEN` environment variable.

```powershell
New-GitHubOAuthToken -UserName Bob -Password bobpassword
```

```powershell
New-GitHubOAuthToken -UserName Bob -Password bobpassword -NoEnvironmentVariable
```

### Get-GitHubOAuthTokens

Used to list all the authorizations you have provided to applications / tooling

```powershell
Get-GitHubOAuthTokens Bob bobspass
```

### Set-GitHubUserName

Adds the username to the current Powershell session and sets a global User
environment variable

```powershell
Set-GitHubUserName Iristyle
```

### Set-GitHubOrganization

Adds the organization to the current Powershell session and sets a global User
environment variable

```powershell
Set-GitHubOrganization EastPoint
```

### Get-GitHubRepositories

List all your repositories - gives a fork indicator, a date for when the last
update (push) occurred, how many open issues and size

```powershell
Get-GitHubRepositories
```

```powershell
Get-GitHubRepositories -Type owner -Sort pushed
```

### New-GitHubRepository

Creates a new GitHub repository and clones it locally by default.

By default creates a public repository for the user configured by
`GITHUB_USERNAME`, and clones it afterwards.

```powershell
New-GitHubRepository MyNewRepository
```

If you are a member of an organization and have set a `GITHUB_ORG` environment
variable, this will create the repository under that organization.  Note that
organization repositories require a TeamId

```powershell
New-GitHubRepository MyNewOrgRepo -ForOrganization -TeamId 1234
```

If you are a member of multiple organizations you may override the default
configured organization

```powershell
New-GitHubRepository MyNewOrgRepo -Organization DifferentOrg -TeamId 1234
```

A fancier set of switches -- pretty self-explanatory.
The complete [Gitignore list][gitignore] here is at your disposal.

```powershell
New-GitHubRepository RepoName -Description 'A New Repo' `
  -Homepage 'https://www.foo.com' -Private -NoIssues -NoWiki -NoDownloads `
  -AutoInit -GitIgnoreTemplate 'CSharp' -NoClone
```

[gitignore]: https://github.com/github/gitignore

### New-GitHubFork

Forks a repository, clones it locally, then properly adds a remote named
`upstream` to point back to the parent repository.  Aborts if there is a
directory in the current working directory that shares the name of the
repository.

Uses the environment variable `GITHUB_OAUTH_TOKEN` to properly fork to your
account.  After forking, clones the original source, resets origin to the new
url for your account `https://github.com/YOURUSERNAME/Posh-GitHub.git`,
and sets the upstream remote to `https://github.com/Iristyle/Posh-GitHub.git`

```powershell
New-GitHubFork Iristyle 'Posh-GitHub'
```

Performs the same operation as above, instead forking to the default
organization specified by the `GITHUB_ORG` environment variable.

```powershell
New-GitHubFork Iristyle 'Posh-GitHub' -ForOrganization
```

Performs the same operation as above, instead forking to a user specified
organization specified by the `-Organization` switch.

```powershell
New-GitHubFork Iristyle 'Posh-GitHub' -Organization MySecondOrganization
```

Forks the repository, without calling `git clone` after the fork.

```powershell
New-GitHubFork -Owner Iristyle -Repository 'Posh-GitHub' -NoClone
```

### Get-GitHubIssues

List issues against the repository for the current working directory,
or can list issues against a specific repo and owner.

Simply list issues for the current working directory repository.  Checks first
for an `upstream` remote and falls back to `origin`

If the current directory is not a repository, then lists all the issues assigned
to you, assuming the `GITHUB_OAUTH_TOKEN` has been set properly.

```powershell
Get-GitHubIssues
```

To get your issues regardless of whether or not the current directory is a Git
repository.

```powershell
Get-GitHubIssues -ForUser
```

Same as above, but finds up to the last 30 closed issues.

```powershell
Get-GitHubIssues -State closed
```

All parameters possible when searching for user issues

```powershell
Get-GitHubIssues -ForUser -State open -Filter created -Sort comments `
  -Direction asc -Labels 'ui','sql' -Since 8/31/2012
```

Must be ordered by Owner, Repo if not using switches on params

```powershell
Get-GitHubIssues EastPoint Burden
```

Switch on params form

```powershell
Get-GitHubIssues -Owner EastPoint -Repository Burden
```

Closed issues

```powershell
Get-GitHubIssues -Owner EastPoint -Repository Burden -State closed
```

Supplying all parameters for a repository based issue search

```powershell
Get-GitHubIssues -Owner EastPoint -Repository Burden -State closed `
  -Milestone '*' -Assignee 'none' -Creator 'Iristyle' -Mentioned 'Iristyle'
  -Labels 'ui','sql' -Sort updated -Direction desc -Since 8/31/2012
```

### New-GitHubPullRequest

Initiates a new pull request to the `upstream` repo.

If you follow the convention of setting a remote named upstream, and you create
new branches for new work, then this cmdlet should work mostly automatically
to find the appropriate owner and repo to send the pull request to, and it will
base it on the origin username and current branch name.

Supports a title and body.

```powershell
New-GitHubPullRequest -Title 'Fixed some stuff' -Body 'More detail'
```

Support an issue id.

```powershell
New-GitHubPullRequest -Issue 5
```

Supports a branch other than master to send the pull to.

```powershell
New-GitHubPullRequest -Issue 10 -Base 'devel'
```

If you don't have a remote set, then override the default sniffing behavior.

```powershell
New-GitHubPullRequest -Issue 10 -Owner EastPoint -Repository Burden
```

If you're not on the current branch you want to send the pull for, override it.

```powershell
New-GitHubPullRequest -Title 'fixes' -Head 'myusername:somebranch'
```

Note that GitHub generally requires that head be prefixed with `username:`

### Get-GitHubPullRequests

List pull requests against the repository for the current working directory,
or can list pull requests against all forks from a user.

Inside of a Git repository, this will look first for a remote named `upstream`
before falling back to `origin`.

Inside of a non-Git directory, this will list pulls for all of your forks,
assuming you have set the `GITHUB_USERNAME` environment variable

```powershell
Get-GitHubPullRequests
```

When inside of a Git directory, the repo lookup behavior may be overridden
with the `-ForUser` switch, assuming `GITHUB_USERNAME` has been set

```powershell
Get-GitHubPullRequests -ForUser
```

Will list all open pull requests the 'Posh-GitHub' repository

```powershell
Get-GitHubPullRequests -Owner EastPoint -Repository 'Posh-GitHub'
```

Lists all open __public__ pull requests against the given users forks, overriding
the `GITHUB_USERNAME` default user.

```powershell
Get-GitHubPullRequests -User Iristyle
```

Will list all closed pull requests against the 'Posh-GitHub' repository

```powershell
Get-GitHubPullRequests -Owner EastPoint -Repository 'Posh-Github' -State closed
```

### Get-GitHubTeams

The default parameterless version will use the `GITHUB_ORG` environment variable
to get the list of teams, their ids and members.

```powershell
Get-GitHubTeams
```

This will find all the teams for the EastPoint organization.  You must have
access to the given organization to list its teams.

```powershell
Get-GitHubTeams EastPoint
```

### Get-GitHubEvents

Will list, in chronological order, the last 30 events that you have generated

```powershell
Get-GitHubEvents
```

Will list the public events for another user

```powershell
Get-GitHubEvents -User Iristyle
```

## Additional Git helper commands

These commands do not use GitHub service, but are common enough for inclusion.

### Clear-GitMergedBranches

Will remove any local branch cruft from branches that have been merged into
the master branch.

```powershell
Clear-GitMergedBranches
```

When pull requests have been merged, it's typical to delete the branch after
accepting.  Remotes may no longer have branch names for things that have been
merged.  This command removes remote branch names that no longer exist.

```powershell
Clear-GitMergedBranches -Remote
```

## Roadmap

None really.. just waiting to see what I might need.


text:
#pragma once

#include "common/helpers.h"
#include "common/vk_common.h"
#include "core/descriptor_set_layout.h"
#include "core/shader_module.h"

namespace vkb
{
class Device;
class ShaderModule;
class DescriptorSetLayout;

class PipelineLayout
{
  public:
	PipelineLayout(Device &device, const std::vector<ShaderModule *> &shader_modules);

	PipelineLayout(const PipelineLayout &) = delete;

	PipelineLayout(PipelineLayout &&other);

	~PipelineLayout();

	PipelineLayout &operator=(const PipelineLayout &) = delete;

	PipelineLayout &operator=(PipelineLayout &&) = delete;

	VkPipelineLayout get_handle() const;

	const std::vector<ShaderModule *> &get_shader_modules() const;

	const std::vector<ShaderResource> get_resources(const ShaderResourceType &type = ShaderResourceType::All, VkShaderStageFlagBits stage = VK_SHADER_STAGE_ALL) const;

	const std::unordered_map<uint32_t, std::vector<ShaderResource>> &get_shader_sets() const;

	bool has_descriptor_set_layout(const uint32_t set_index) const;

	DescriptorSetLayout &get_descriptor_set_layout(const uint32_t set_index) const;

	VkShaderStageFlags get_push_constant_range_stage(uint32_t size, uint32_t offset = 0) const;

  private:
	Device &device;

	VkPipelineLayout handle{VK_NULL_HANDLE};

	// The shader modules that this pipeline layout uses
	std::vector<ShaderModule *> shader_modules;

	// The shader resources that this pipeline layout uses, indexed by their name
	std::unordered_map<std::string, ShaderResource> shader_resources;

	// A map of each set and the resources it owns used by the pipeline layout
	std::unordered_map<uint32_t, std::vector<ShaderResource>> shader_sets;

	// The different descriptor set layouts for this pipeline layout
	std::vector<DescriptorSetLayout *> descriptor_set_layouts;
};
}        // namespace vkb


text:
package sorcer.core.dispatch;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sorcer.core.context.model.ent.ProcModel;
import sorcer.core.exertion.Mograms;
import sorcer.core.provider.Provider;
import sorcer.service.*;
import sorcer.service.modeling.Model;

import java.rmi.RemoteException;
import java.util.List;
import java.util.Set;

import static sorcer.service.Exec.*;

public class CatalogSequentialDispatcher extends CatalogExertDispatcher {
    private final Logger logger = LoggerFactory.getLogger(CatalogSequentialDispatcher.class);

	@SuppressWarnings("rawtypes")
    public CatalogSequentialDispatcher(Exertion job,
                                       Set<Context> sharedContext,
                                       boolean isSpawned,
                                       Provider provider,
                                       ProvisionManager provisionManager) {
        super(job, sharedContext, isSpawned, provider, provisionManager);
    }

    protected void doExec(Arg... args) throws MogramException, SignatureException {
        String pn;
        if (inputXrts == null) {
            xrt.setStatus(FAILED);
            state = FAILED;
            try {
                pn = provider.getProviderName();
                if (pn == null)
                    pn = provider.getClass().getName();
                ExertionException fe = new ExertionException(pn + " received invalid job: "
                        + xrt.getName(), xrt);

                xrt.reportException(fe);
                dispatchers.remove(xrt.getId());
                throw fe;
            } catch (RemoteException e) {
                logger.warn("Error during local call", e);
            }
        }

        xrt.startExecTime();
        Context previous = null;
        for (Mogram mogram: inputXrts) {
            if (xrt.isBlock()) {
                try {
                    if (mogram.getScope() != null)
                        mogram.getScope().append(xrt.getContext());
                    else {
                        mogram.setScope(xrt.getContext());
                    }
                } catch (Exception ce) {
                    throw new MogramException(ce);
                }
            }

            try {
                if (mogram instanceof Exertion) {
                    ServiceExertion se = (ServiceExertion) mogram;
                    // support for continuous pre and post execution of task
                    // signatures
                    if (previous != null && se.isTask() && ((Task) se).isContinous())
                        se.setContext(previous);
                    dispatchExertion(se, args);
                    previous = se.getContext();
                } else if (mogram instanceof ProcModel) {
                    ((ProcModel)mogram).updateEntries(xrt.getContext());
                    xrt.getDataContext().append((Context) ((Model) mogram).getResponse());
                }
            } catch (Exception e) {
                e.printStackTrace();
                throw new ExertionException(e);
            }

        }

        if (masterXrt != null) {
            masterXrt = (ServiceExertion) execExertion(masterXrt, args); // executeMasterExertion();
            if (masterXrt.getStatus() <= FAILED) {
                state = FAILED;
                xrt.setStatus(FAILED);
            } else {
                state = DONE;
                xrt.setStatus(DONE);
            }
        } else
            state = DONE;
        dispatchers.remove(xrt.getId());
        xrt.stopExecTime();
        xrt.setStatus(DONE);
    }

    protected void dispatchExertion(ServiceExertion se, Arg... args) throws SignatureException, ExertionException {
        se = (ServiceExertion) execExertion(se, args);
        if (se.getStatus() <= FAILED) {
            xrt.setStatus(FAILED);
            state = FAILED;
            try {
                String pn = provider.getProviderName();
                if (pn == null)
                    pn = provider.getClass().getName();
                ExertionException fe = new ExertionException(pn
                        + " received failed task: " + se.getName(), se);
                xrt.reportException(fe);
                dispatchers.remove(xrt.getId());
                throw fe;
            } catch (RemoteException e) {
                logger.warn("Exception during local call");
            }
        } else if (se.getStatus() == SUSPENDED
                || xrt.getControlContext().isReview(se)) {
            xrt.setStatus(SUSPENDED);
            ExertionException ex = new ExertionException(
                    "exertion suspended", se);
            se.reportException(ex);
            dispatchers.remove(xrt.getId());
            throw ex;
        }
    }

    protected List<Mogram> getInputExertions() throws ContextException {
        return Mograms.getInputExertions(((Job) xrt));
    }

}