text:
package org.tomitribe.jeewiz.metrics.annotations;

import javax.interceptor.InterceptorBinding;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author WalmartLabs
 * @author Tomitribe
 * @author Ryan McGuinness [rmcguinness@walmartlabs.com]
 *         Created: 5/19/15
 */
@Inherited
@InterceptorBinding
@Retention(RUNTIME)
@Target({TYPE})
public @interface MetricAware {
}


text:
//Copyright 2010 Microsoft Corporation
//
//Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and limitations under the License.

namespace System.Data.Services.Client
{
    using System.Collections.Generic;

    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1010", Justification = "required for this feature")]
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710", Justification = "required for this feature")]
    public sealed class DataServiceResponse : IEnumerable<OperationResponse>
    {
        private Dictionary<string, string> headers;

        private int statusCode;

        private IEnumerable<OperationResponse> response;

        private bool batchResponse;

        internal DataServiceResponse(Dictionary<string, string> headers, int statusCode, IEnumerable<OperationResponse> response, bool batchResponse)
        {
            this.headers = headers ?? new Dictionary<string, string>(EqualityComparer<string>.Default);
            this.statusCode = statusCode;
            this.batchResponse = batchResponse;
            this.response = response;
        }

        public IDictionary<string, string> BatchHeaders
        {
            get { return this.headers; }
        }

        public int BatchStatusCode
        {
            get { return this.statusCode; }
        }

        public bool IsBatchResponse
        {
            get { return this.batchResponse; }
        }

        public IEnumerator<OperationResponse> GetEnumerator()
        {
            return this.response.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return this.GetEnumerator();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
import { injectReducer } from 'reducers'
import createContainer from 'utils/createContainer'

const connectComponent2 = createContainer(
    ({flowDetails }) => ({flowDetails}),
    require('actions/public/LoginAction').default
)

const connectComponent3 = createContainer(
    ({register }) => ({register}),
    require('actions/public/RegisterAction').default
)

const connectComponent = createContainer(
    ({flowDetails }) => ({flowDetails}),
    require('actions/home/index').default
)

export default {
  path: '/',
  component: require('view/app').default,
  indexRoute: {
    component: require('view/Welcome').default
  },
  childRoutes: [
    {
        childRoutes: [
            {
                path: 'home',
                getComponent (nextState, cb) {
                    require.ensure([], (require) => {
                        injectReducer('home', require('reducers/home/index').default)
                        cb(null,connectComponent(require('view/Home').default))
                    }, 'home')
                }
            },
            {
                path: 'login',
                getComponent (nextState, cb) {
                    require.ensure([], (require) => {
                        // injectReducer('login', require('reducers/public/LoginReducer').default)
                        cb(null, connectComponent2(require('view/login').default))
                    }, 'login')
                }
            },
            {
                path: 'register',
                getComponent (nextState, cb) {
                    require.ensure([], (require) => {
                        // injectReducer('login', require('reducers/public/LoginReducer').default)
                        cb(null, connectComponent3(require('view/pcenter/Register').default))
                    }, 'register')
                }
            }
        ]
    },
    { path: 'redirect', component: require('view/Redirect').default },
    { path: '*', component: require('view/404').default }
  ]
}


text:
package me.randomHashTags.RandomPackage.api.enums;

public enum RPItem {
    RANDOM_BOOK,
    GOD_DP, GOD_RANDOMIZATION_SCROLL,
    SOUL_BOOK, SOUL_FIREBALL,
    LEGENDARY_BOOK, LEGENDARY_RANDOMIZATION_SCROLL, LEGENDARY_DP, LEGENDARY_FIREBALL, LEGENDARY_SOUL_TRACKER,
    ULTIMATE_BOOK, ULTIMATE_RANDOMIZATION_SCROLL, ULTIMATE_DP, ULTIMATE_FIREBALL, ULTIMATE_SOUL_TRACKER,
    ELITE_BOOK, ELITE_RANDOMIZATION_SCROLL, ELITE_DP, ELITE_FIREBALL, ELITE_SOUL_TRACKER,
    UNIQUE_BOOK, UNIQUE_RANDOMIZATION_SCROLL, UNIQUE_DP, UNIQUE_FIREBALL, UNIQUE_SOUL_TRACKER,
    SIMPLE_BOOK, SIMPLE_RANDOMIZATION_SCROLL, SIMPLE_DP, SIMPLE_FIREBALL, SIMPLE_SOUL_TRACKER,
    //
    FACTION_CRYSTAL, FACTION_MCMMO_BOOSTER, FACTION_XP_BOOSTER,
    MCMMO_CREDIT_VOUCHER, MCMMO_XP_VOUCHER, MCMMO_LEVEL_VOUCHER,
    BLACK_SCROLL, WHITE_SCROLL, TRANSMOG_SCROLL, ARMOR_ENCHANTMENT_ORB, WEAPON_ENCHANTMENT_ORB,
    EXPLOSIVE_CAKE, EXPERIENCE_BOTTLE, BANKNOTE, ITEM_NAME_TAG, MYSTERY_MOB_SPAWNER, SOUL_GEM,
    HALLOWEEN_CANDY, CHRISTMAS_CANDY, CHRISTMAS_EGGNOG, MYSTERY_DUST, SPACE_DRINK, SPACE_FIREWORK,
}


text:
/* Includes ------------------------------------------------------------------*/
#include "stm32l4xx_hal.h"

extern void Error_Handler(void);
/* USER CODE BEGIN 0 */

/* USER CODE END 0 */
/**
  * Initializes the Global MSP.
  */
void HAL_MspInit(void)
{
  /* USER CODE BEGIN MspInit 0 */

  /* USER CODE END MspInit 0 */

  __HAL_RCC_SYSCFG_CLK_ENABLE();
  __HAL_RCC_PWR_CLK_ENABLE();

  HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);

  /* System interrupt init*/
  /* MemoryManagement_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(MemoryManagement_IRQn, 0, 0);
  /* BusFault_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(BusFault_IRQn, 0, 0);
  /* UsageFault_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(UsageFault_IRQn, 0, 0);
  /* SVCall_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(SVCall_IRQn, 0, 0);
  /* DebugMonitor_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(DebugMonitor_IRQn, 0, 0);
  /* PendSV_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(PendSV_IRQn, 0, 0);
  /* SysTick_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);

  /* Peripheral interrupt init*/
  /* RCC_IRQn interrupt configuration */
  HAL_NVIC_SetPriority(RCC_IRQn, 0, 0);
  HAL_NVIC_EnableIRQ(RCC_IRQn);

  /* USER CODE BEGIN MspInit 1 */

  /* USER CODE END MspInit 1 */
}

void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
{

  GPIO_InitTypeDef GPIO_InitStruct;
  if(hadc->Instance==ADC1)
  {
  /* USER CODE BEGIN ADC1_MspInit 0 */

  /* USER CODE END ADC1_MspInit 0 */
    /* Peripheral clock enable */
    __HAL_RCC_ADC_CLK_ENABLE();

    /**ADC1 GPIO Configuration
    PC0     ------> ADC1_IN1
    */
    GPIO_InitStruct.Pin = GPIO_PIN_0;
    GPIO_InitStruct.Mode = GPIO_MODE_ANALOG_ADC_CONTROL;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

  /* USER CODE BEGIN ADC1_MspInit 1 */

  /* USER CODE END ADC1_MspInit 1 */
  }

}

void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
{

  if(hadc->Instance==ADC1)
  {
  /* USER CODE BEGIN ADC1_MspDeInit 0 */

  /* USER CODE END ADC1_MspDeInit 0 */
    /* Peripheral clock disable */
    __HAL_RCC_ADC_CLK_DISABLE();

    /**ADC1 GPIO Configuration
    PC0     ------> ADC1_IN1
    */
    HAL_GPIO_DeInit(GPIOC, GPIO_PIN_0);

  }
  /* USER CODE BEGIN ADC1_MspDeInit 1 */

  /* USER CODE END ADC1_MspDeInit 1 */

}

void HAL_UART_MspInit(UART_HandleTypeDef* huart)
{

  GPIO_InitTypeDef GPIO_InitStruct;
  if(huart->Instance==USART2)
  {
  /* USER CODE BEGIN USART2_MspInit 0 */

  /* USER CODE END USART2_MspInit 0 */
    /* Peripheral clock enable */
    __HAL_RCC_USART2_CLK_ENABLE();

    /**USART2 GPIO Configuration
    PA2     ------> USART2_TX
    PA3     ------> USART2_RX
    */
    GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_PULLUP;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
    GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

  /* USER CODE BEGIN USART2_MspInit 1 */

  /* USER CODE END USART2_MspInit 1 */
  }

}

void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
{

  if(huart->Instance==USART2)
  {
  /* USER CODE BEGIN USART2_MspDeInit 0 */

  /* USER CODE END USART2_MspDeInit 0 */
    /* Peripheral clock disable */
    __HAL_RCC_USART2_CLK_DISABLE();

    /**USART2 GPIO Configuration
    PA2     ------> USART2_TX
    PA3     ------> USART2_RX
    */
    HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);

  }
  /* USER CODE BEGIN USART2_MspDeInit 1 */

  /* USER CODE END USART2_MspDeInit 1 */

}

/* USER CODE BEGIN 1 */

/* USER CODE END 1 */

/**
  * @}
  */

/**
  * @}
  */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.jruyi.core.internal;

import java.util.HashMap;
import java.util.Map;

import org.jruyi.common.StrUtil;
import org.jruyi.core.IBufferFactory;
import org.jruyi.io.IBuffer;
import org.jruyi.io.buffer.BufferFactory;

final class BufferFactoryWrapper implements IBufferFactory, IBufferFactory.IConfiguration {

	private final Map<String, Object> m_properties = new HashMap<>(2);
	private final BufferFactory m_bf = new BufferFactory();
	private boolean m_started;

	public BufferFactoryWrapper() {
	}

	public BufferFactoryWrapper(String name) {
		if (name == null || (name = name.trim()).isEmpty())
			throw new IllegalArgumentException("name cannot be null or empty");
		m_properties.put(BufferFactory.BUFFER_ID, name);
	}

	@Override
	public IConfiguration unitCapacity(int unitCapacity) {
		if (unitCapacity < BufferFactory.MIN_UNIT_CAPACITY)
			throw new IllegalArgumentException(
					StrUtil.join("Illegal unitCapacity: ", unitCapacity, " >= " + BufferFactory.MIN_UNIT_CAPACITY));
		m_properties.put("unitCapacity", unitCapacity);
		return this;
	}

	@Override
	public int unitCapacity() {
		final Object v = m_properties.get("unitCapacity");
		return v == null ? 8 * 1024 : (int) v;
	}

	@Override
	public String name() {
		return (String) m_properties.get(BufferFactory.BUFFER_ID);
	}

	@Override
	public IConfiguration configuration() {
		return this;
	}

	@Override
	public IBuffer create() {
		return m_bf.create();
	}

	@Override
	public synchronized void apply() {
		if (m_started)
			m_bf.modified(m_properties);
	}

	synchronized void start() {
		if (m_started)
			return;
		m_started = true;
		m_bf.activate(m_properties);
	}

	synchronized void stop() {
		if (m_started) {
			m_started = false;
			m_bf.deactivate();
		}
	}

	BufferFactory unwrap() {
		return m_bf;
	}
}


text:
<?php

   // Note: This implementation is based on a Tutorial
   // that one of the developers used to learn about web security.
   // Tutorial Name: Creating Secure PHP Websites
   // Author: Kevin Skoglund
   // Website of Tutorial: Lynda.com

   // These functions can be used to validate that a use has access to a private page.
   // The purpose of these functions are to ensure that a session is valid and to
   // determine that the user is logged into the site.

   // Comment This out when not testing
   // session_start();

   // Function that forcibly ends the current session
   function end_session() {
      // Thses two functions are used to destroy or remove all the
      // current session data. The purpose of using both have to do
      // with broswer compatability.
      session_unset();
      session_destroy();
   }

   // The next three functions are used for the validation of the session
   // ip_address_matches_server_ip()
   // user_agent_matches_server_agent()
   // last_login_time_valid()

   // Function to check if the current ip address matches the original ip
   // address used when login in. Note: 'ip_address' should be set as a session
   // variable when the user successfully logs in to use this function properly.
   function ip_address_matches_server_ip() {

      // Check if values exists for the ip addresses
      if (!isset($_SESSION['ip_address']) || !isset($_SERVER['REMOTE_ADDR'])) {
         return false;
      }

      // Check if the ip addresses match
      if ($_SESSION['ip_address'] === $_SERVER['REMOTE_ADDR']) {
         return true;
      } else {
         return false;
      }
   }

   // Function to check if the current user agent matches the original user agent
   // that was recorded at login. Note: 'user_agent' should be set as a session
   // variable when the user successfully  logs in to use this function properly.
   function user_agent_matches_server_agent() {

      // Check if the user agent variables exists
      if (!isset($_SESSION['user_agent']) || !isset($_SERVER['HTTP_USER_AGENT'])) {
         return false;
      }

      // Check if the user agents match
      if ($_SESSION['user_agent'] === $_SERVER['HTTP_USER_AGENT']) {
         return true;
      } else {
         return false;
      }
   }

   // Function to Check if the user has been logged in no longer
   // than a specified time period. Note: 'last_login' should be set as
   // a session variable when the user successfully logs in.
   function last_login_time_valid() {

      // The maximum amount of time the user can be login\
      // for a given session
      $max_elapsed_time = 60 * 60 * 24;  // 1 day

      // check to see if the time of the user's login was recorded
      if (!isset($_SESSION['last_login'])) {
         return false;
      }

      // Check if the last login has not exceed the time limit
      if (($_SESSION['last_login'] + $max_elapsed_time) >= time()) {
         return true;
      } else {
         return false;
      }
   }

   // Function to Check if the session is a valid session
   // Helper function
   function is_session_valid() {

      if (!ip_address_matches_server_ip()) {
         return false;
      }
      if (!user_agent_matches_server_agent()) {
         return false;
      }
      if (!last_login_time_valid()) {
         return false;
      }

      return true;
   }

   // Function to confirm the session is valid
   // If the session is not valid, redirect the
   // user to the login page.
   function confirm_session_is_valid() {

      if(!is_session_valid()) {
         end_session();
         header("Location: index.php");
         exit;
      }
   }

   // Function to check if the user is logged in
   // Helper function
   function is_logged_in() {
       return isset($_SESSION['logged_in']) && $_SESSION['logged_in'];
   }

   // Function to confirm that the user is logged in
   // If the user is not logged in, redirect the
   // user to the login page.
   function confirm_user_is_logged_in() {
      if (!is_logged_in()) {
         end_session();
         header("Location: index.php");
         exit;
      }
   }

   // Function that resets the session id for the current session
   // and sets the necessary Session variables for security checks
   // on the site.
   function after_successful_login() {
      session_regenerate_id();
       $_SESSION['logged_in'] = true;
       $_SESSION['ip_address'] = $_SERVER['REMOTE_ADDR'];
       $_SESSION['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
       $_SESSION['last_login'] = time();
   }

   // Function that sets the user login record to
   // false indicating that the user is no longer
   // logged in and ends the current session.
   function after_successful_logout() {
      $_SESSION['logged_in'] = false;
      end_session();
   }

   // Function to validate that the user is logged in and
   // that the current session is valid.
   // Note: Call this function before displaying any
   // protected page on the site to prevent invalid
   // users from viewing/accessing restricted content.
   function validate_user_before_displaying() {
      confirm_user_is_logged_in();
      confirm_session_is_valid();
   }

?>


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

namespace ConsoleApplication4
{
	class Program
	{
		static void Main(string[] args)
		{
			var test = "asdf";
			var someInts = new List<int>() { 1, 2, 3 };
			// Need to copy
			var a = new TrulyImmutableThing(test, someInts);
			someInts.Add(4);

			Debug.Assert(!Object.ReferenceEquals(someInts, a.SomeInts));
			Debug.Assert(a.SomeInts.Count == 3);

			var modifiedOtherProperty = "fdsa";
			// Optimized.
			var b = new TrulyImmutableThing(modifiedOtherProperty, a.SomeInts);
			Debug.Assert(Object.ReferenceEquals(a.SomeInts, b.SomeInts));
		}
	}

	class TrulyImmutableThing
	{
		public TrulyImmutableThing(string test, IEnumerable<int> someInts)
		{
			this.Test = test;
			this.SomeInts = SealableList.Create(someInts);
		}

		public string Test { get; }
		public ISealedList<int> SomeInts { get; }
	}

	interface ISealedList<T> : IReadOnlyList<T>
	{
	}

	static class SealableList
	{
		public static ISealedList<T> Create<T>(IEnumerable<T> list)
		{
			if (list == null)
			{
				return null;
			}

			var asSealed = list as ISealedList<T>;
			if (asSealed != null)
			{
				// Already sealed.
				return asSealed;
			}

			var asSealable = list as SealableList<T>;
			if (asSealable != null && asSealable.IsSealed)
			{
				// Already sealed.
				// If this is not already sealed, do not call this as it may unintentionally seal the list.
				return asSealable.Seal();
			}

			// Must clone to ensure seal.
			var sealableList = new SealableList<T>(list);
			return sealableList.Seal();
		}
	}

	class SealableList<T> : IList<T>
	{
		public SealableList()
		{
		}

		public SealableList(IEnumerable<T> list)
		{
			this.inner.AddRange(list);
		}

		private readonly List<T> inner = new List<T>();

		private SealedList seal;

		public bool IsSealed { get { return this.seal != null; } }

		public ISealedList<T> Seal()
		{
			if (this.seal == null)
			{
				this.seal = new SealedList(this);
			}
			return this.seal;
		}

		private void CheckSealed()
		{
			if (this.IsSealed)
			{
				throw new InvalidOperationException();
			}
		}

		public T this[int index]
		{
			get { return this.inner[index]; }
			set
			{
				this.CheckSealed();
				this.inner[index] = value;
			}
		}

		public int Count
		{
			get { return this.inner.Count; }
		}

		public bool IsReadOnly
		{
			get { return !this.IsSealed; }
		}

		public void Add(T item)
		{
			this.CheckSealed();
			this.inner.Add(item);
		}

		public void Clear()
		{
			this.CheckSealed();
			this.inner.Clear();
		}

		public bool Contains(T item)
		{
			return this.inner.Contains(item);
		}

		public void CopyTo(T[] array, int arrayIndex)
		{
			this.inner.CopyTo(array, arrayIndex);
		}

		public IEnumerator<T> GetEnumerator()
		{
			return this.inner.GetEnumerator();
		}

		public int IndexOf(T item)
		{
			return this.inner.IndexOf(item);
		}

		public void Insert(int index, T item)
		{
			this.CheckSealed();
			this.inner.Insert(index, item);
		}

		public bool Remove(T item)
		{
			this.CheckSealed();
			return this.inner.Remove(item);
		}

		public void RemoveAt(int index)
		{
			this.CheckSealed();
			this.inner.RemoveAt(index);
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return ((IEnumerable)this.inner).GetEnumerator();
		}

		private sealed class SealedList : ISealedList<T>
		{
			public SealedList(SealableList<T> sealableList)
			{
				this.inner = sealableList.inner;
			}

			private readonly IReadOnlyList<T> inner;

			public T this[int index]
			{
				get { return this.inner[index]; }
			}

			public int Count
			{
				get { return this.inner.Count; }
			}

			public IEnumerator<T> GetEnumerator()
			{
				return this.inner.GetEnumerator();
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return ((IEnumerable)this.inner).GetEnumerator();
			}
		}
	}
}


text:
package de.felixbruns.jotify.protocol.channel;

import java.io.IOException;
import java.io.OutputStream;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

public class ChannelAudioHandler implements ChannelListener {
	private Cipher       cipher;
	private Key          key;
	private byte[]       iv;
	private int          offset;
	private OutputStream output;

	public ChannelAudioHandler(byte[] key, OutputStream output){
		/* Get AES cipher instance. */
		try {
			this.cipher = Cipher.getInstance("AES/CTR/NoPadding");
		}
		catch (NoSuchAlgorithmException e){
			System.err.println("AES not available! Aargh!");
		}
		catch (NoSuchPaddingException e){
			System.out.println("No padding not available... haha!");
		}

		/* Create secret key from bytes. */
		this.key = new SecretKeySpec(key, "AES");

		/* Set IV. */
		this.iv = new byte[]{
			(byte)0x72, (byte)0xe0, (byte)0x67, (byte)0xfb,
			(byte)0xdd, (byte)0xcb, (byte)0xcf, (byte)0x77,
			(byte)0xeb, (byte)0xe8, (byte)0xbc, (byte)0x64,
			(byte)0x3f, (byte)0x63, (byte)0x0d, (byte)0x93
		};

		/* Initialize cipher with key and iv in encrypt mode. */
		try {
			this.cipher.init(Cipher.ENCRYPT_MODE, this.key, new IvParameterSpec(this.iv));
		}
		catch (InvalidKeyException e){
			System.out.println("Invalid key!");
		}
		catch (InvalidAlgorithmParameterException e){
			System.out.println("Invalid IV!");
		}

		/* Set output stream. */
		this.output = output;
	}

	public void channelHeader(Channel channel, byte[] header){
		/* Do nothing. */
	}

	public void channelData(Channel channel, byte[] data){
		/* Offsets needed for deinterleaving. */
		int off, w, x, y, z;

		/* Allocate space for ciphertext. */
		byte[] ciphertext = new byte[data.length + 1024];
		byte[] keystream  = new byte[16];

		/* Decrypt each 1024 byte block. */
		for(int block = 0; block < data.length / 1024; block++){
			/* Deinterleave the 4x256 byte blocks. */
			off = block * 1024;
			w	= block * 1024 + 0 * 256;
			x	= block * 1024 + 1 * 256;
			y	= block * 1024 + 2 * 256;
			z	= block * 1024 + 3 * 256;

			for(int i = 0; i < 1024 && (block * 1024 + i) < data.length; i += 4){
				ciphertext[off++] = data[w++];
				ciphertext[off++] = data[x++];
				ciphertext[off++] = data[y++];
				ciphertext[off++] = data[z++];
			}

			/* Decrypt 1024 bytes block. This will fail for the last block. */
			for(int i = 0; i < 1024 && (block * 1024 + i) < data.length; i += 16){
				/* Produce 16 bytes of keystream from the IV. */
				try{
					keystream = this.cipher.doFinal(this.iv);
				}
				catch(IllegalBlockSizeException e){
					e.printStackTrace();
				}
				catch(BadPaddingException e){
					e.printStackTrace();
				}

				/*
				 * Produce plaintext by XORing ciphertext with keystream.
				 * And somehow I also need to XOR with the IV... Please
				 * somebody tell me what I'm doing wrong, or is it the
				 * Java implementation of AES? At least it works like this.
				 */
				for(int j = 0; j < 16; j++){
					ciphertext[block * 1024 + i + j] ^= keystream[j] ^ this.iv[j];
				}

				/* Update IV counter. */
				for(int j = 15; j >= 0; j--){
					this.iv[j] += 1;

					if((int)(this.iv[j] & 0xFF) != 0){
						break;
					}
				}

				/* Set new IV. */
				try{
					this.cipher.init(Cipher.ENCRYPT_MODE, this.key, new IvParameterSpec(this.iv));
				}
				catch(InvalidKeyException e){
					e.printStackTrace();
				}
				catch(InvalidAlgorithmParameterException e){
					e.printStackTrace();
				}
			}
		}

		/* Write data to output stream. */
		try{
			this.output.write(ciphertext, 0, ciphertext.length - 1024);
		}
		catch(IOException e){
			/* Just don't care... */
		}
	}

	public void channelEnd(Channel channel){
		this.offset += channel.getDataLength();

		Channel.unregister(channel.getId());
	}

	public void channelError(Channel channel){
		/* Do nothing. */
	}
}


text:
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    for (NSString *familyName in [UIFont familyNames]) {
        NSLog(@"字体族:%@",familyName);
        for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) {
            NSLog(@"\t字体:%@",fontName);
        }
    }

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
package common

import (
	"bytes"
	"fmt"
	"github.com/hashicorp/packer/packer"
	"github.com/mitchellh/multistep"
	"log"
)

// This step uploads a file containing the VirtualBox version, which
// can be useful for various provisioning reasons.
type StepUploadVersion struct {
	Path string
}

func (s *StepUploadVersion) Run(state multistep.StateBag) multistep.StepAction {
	comm := state.Get("communicator").(packer.Communicator)
	driver := state.Get("driver").(Driver)
	ui := state.Get("ui").(packer.Ui)

	if s.Path == "" {
		log.Println("VBoxVersionFile is empty. Not uploading.")
		return multistep.ActionContinue
	}

	version, err := driver.Version()
	if err != nil {
		state.Put("error", fmt.Errorf("Error reading version for metadata upload: %s", err))
		return multistep.ActionHalt
	}

	ui.Say(fmt.Sprintf("Uploading VirtualBox version info (%s)", version))
	var data bytes.Buffer
	data.WriteString(version)
	if err := comm.Upload(s.Path, &data, nil); err != nil {
		state.Put("error", fmt.Errorf("Error uploading VirtualBox version: %s", err))
		return multistep.ActionHalt
	}

	return multistep.ActionContinue
}

func (s *StepUploadVersion) Cleanup(state multistep.StateBag) {}


text:
Copyright (c) 2011-2015, Vsevolod Stakhov <vsevolod@highsecure.ru>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]--

-- A plugin that implements ratelimits using redis or kvstorage server

-- Default settings for limits, 1-st member is burst, second is rate and the third is numeric type
local settings = {
  -- Limit for all mail per recipient (burst 100, rate 2 per minute)
  to = {0, 0.033333333},
  -- Limit for all mail per one source ip (burst 30, rate 1.5 per minute)
  to_ip = {0, 0.025},
  -- Limit for all mail per one source ip and from address (burst 20, rate 1 per minute)
  to_ip_from = {0, 0.01666666667},

  -- Limit for all bounce mail (burst 10, rate 2 per hour)
  bounce_to = {0, 0.000555556},
  -- Limit for bounce mail per one source ip (burst 5, rate 1 per hour)
  bounce_to_ip = {0, 0.000277778},

  -- Limit for all mail per user (authuser) (burst 20, rate 1 per minute)
  user = {0, 0.01666666667}
}
-- Senders that are considered as bounce
local bounce_senders = {'postmaster', 'mailer-daemon', '', 'null', 'fetchmail-daemon', 'mdaemon'}
-- Do not check ratelimits for these senders
local whitelisted_rcpts = {'postmaster', 'mailer-daemon'}
local whitelisted_ip
local max_rcpt = 5
local upstreams
local ratelimit_symbol
-- Do not delay mail after 1 day
local max_delay = 24 * 3600

local rspamd_logger = require "rspamd_logger"
local rspamd_redis = require "rspamd_redis"
local upstream_list = require "rspamd_upstream_list"
local rspamd_util = require "rspamd_util"
local _ = require "fun"
--local dumper = require 'pl.pretty'.dump

--- Parse atime and bucket of limit
local function parse_limits(data)
  local function parse_limit_elt(str)
    local elts = rspamd_str_split(str, ':')
    if not elts or #elts < 2 then
      return {0, 0, 0}
    else
      local atime = tonumber(elts[1])
      local bucket = tonumber(elts[2])
      local ctime = atime

      if elts[3] then
        ctime = tonumber(elts[3])
      end

      if not ctime then
        ctime = atime
      end

      return {atime,bucket,ctime}
    end
  end

  return _.iter(data):map(function(e)
    if type(e) == 'string' then
      return parse_limit_elt(e)
    else
      return {0, 0, 0}
    end
  end):totable()
end

local function generate_format_string(args, is_set)
  if is_set then
    return 'MSET'
    --return _.foldl(function(acc, k) return acc .. ' %s %s' end, 'MSET', args)
  end
  return 'MGET'
  --return _.foldl(function(acc, k) return acc .. ' %s' end, 'MGET', args)
end

--- Check specific limit inside redis
local function check_limits(task, args)

  local key = _.foldl(function(acc, k) return acc .. k[2] end, '', args)
  local upstream = upstreams:get_upstream_by_hash(key)
  local addr = upstream:get_addr()
  --- Called when value is got from server
  local function rate_get_cb(task, err, data)
    if data then
      local ntime = rspamd_util.get_time()

      _.each(function(elt, limit)
        local bucket = elt[2]
        local rate = limit[2]
        local threshold = limit[1]
        local atime = elt[1]
        local ctime = elt[3]

        if atime == 0 then return end

        if atime - ctime > max_delay then
          rspamd_logger.infox(task, 'limit is too old: %1 seconds; ignore it',
            atime - ctime)
        else
          bucket = bucket - rate * (ntime - atime);
          if bucket > 0 then
            if ratelimit_symbol then
              local mult = 2 * rspamd_util.tanh(bucket / (threshold * 2))

              if mult > 0.5 then
                task:insert_result(ratelimit_symbol, mult,
                  tostring(mult))
              end
            else
              if bucket > threshold then
                task:set_pre_result('soft reject', 'Ratelimit exceeded')
              end
            end
          end
        end
      end, _.zip(parse_limits(data), _.map(function(a) return a[1] end, args)))
    elseif err then
      rspamd_logger.infox(task, 'got error while getting limit: %1', err)
      upstream:fail()
    end
  end

  if upstream then
    local cmd = generate_format_string(args, false)

    rspamd_redis.make_request(task, addr, rate_get_cb, cmd,
      _.totable(_.map(function(l) return l[2] end, args)))
  end
end

--- Set specific limit inside redis
local function set_limits(task, args)
  local key = _.foldl(function(acc, k) return acc .. k[2] end, '', args)
  local upstream = upstreams:get_upstream_by_hash(key)
  local addr = upstream:get_addr()

  local function rate_set_cb(task, err, data)
    if data then
      local ntime = rspamd_util.get_time()
      local values = {}
      _.each(function(elt, limit)
        local bucket = elt[2]
        local rate = limit[1][2]
        local threshold = limit[1][1]
        local atime = elt[1]
        local ctime = elt[3]

        if atime - ctime > max_delay then
          rspamd_logger.infox(task, 'limit is too old: %1 seconds; start it over',
            atime - ctime)
          bucket = 1
          ctime = ntime
          atime = ntime
        else
          if bucket > 0 then
            bucket = bucket - rate * (ntime - atime) + 1;
            if bucket < 0 then
              bucket = 1
            end
          else
            bucket = 1
          end
        end

        if ctime == 0 then ctime = ntime end

        local lstr = string.format('%.3f:%.3f:%.3f', ntime, bucket, ctime)
        table.insert(values, {limit[2], max_delay, lstr})
      end, _.zip(parse_limits(data), _.iter(args)))

      local conn = rspamd_redis.connect({
        task = task,
        host = addr
      })

      if conn then
        _.each(function(v)
          conn:add_cmd('setex', v)
        end, values)
      else
        rspamd_logger.infox(task, 'got error while connecting to redis: %1', addr)
        upstream:fail()
      end
    elseif err then
      rspamd_logger.infox(task, 'got error while setting limit: %1', err)
      upstream:fail()
    end
  end
  if upstream then
    local cmd = generate_format_string(args, false)

    rspamd_redis.make_request(task, addr, rate_set_cb, cmd,
      _.totable(_.map(function(l) return l[2] end, args)))
  end
end

--- Make rate key
local function make_rate_key(from, to, ip)
  if from and ip and ip:is_valid() then
    return string.format('%s:%s:%s', from, to, ip:to_string())
  elseif from then
    return string.format('%s:%s', from, to)
  elseif ip and ip:is_valid() then
    return string.format('%s:%s', to, ip:to_string())
  elseif to then
    return to
  else
    return nil
  end
end

--- Check whether this addr is bounce
local function check_bounce(from)
  return _.any(function(b) return b == from end, bounce_senders)
end

--- Check or update ratelimit
local function rate_test_set(task, func)
  local args = {}
  -- Get initial task data
  local ip = task:get_from_ip()
  if ip and ip:is_valid() and whitelisted_ip then
    if whitelisted_ip:get_key(ip) then
      -- Do not check whitelisted ip
      rspamd_logger.infox(task, 'skip ratelimit for whitelisted IP')
      return
    end
  end
  -- Parse all rcpts
  local rcpts = task:get_recipients()
  local rcpts_user = {}
  if rcpts then
    _.each(function(r) table.insert(rcpts_user, r['user']) end, rcpts)
    if _.any(function(r)
      _.any(function(w) return r == w end, whitelisted_rcpts) end,
      rcpts_user) then

      rspamd_logger.infox(task, 'skip ratelimit for whitelisted recipient')
      return
    end
  end
  -- Parse from
  local from = task:get_from()
  local from_user = '<>'
  local from_addr = '<>'
  if from and from[1] and from[1]['addr'] then
    from_user = from[1]['user']
    from_addr = from[1]['addr']
  end
  -- Get user (authuser)
  local auser = task:get_user()
  if auser and settings['user'][1] > 0 then
    table.insert(args, {settings['user'], make_rate_key (auser, '<auth>', nil)})
  end

  local is_bounce = check_bounce(from_user)

  if rcpts and not auser then
    _.each(function(r)
      if is_bounce then
        if settings['bounce_to'][1] > 0 then
          table.insert(args, { settings['bounce_to'], make_rate_key('<>', r['addr'], nil) })
        end
        if ip and settings['bounce_to_ip'][1] > 0 then
          table.insert(args, { settings['bounce_to_ip'], make_rate_key('<>', r['addr'], ip) })
        end
      end
      if settings['to'][1] > 0 then
        table.insert(args, { settings['to'], make_rate_key(nil, r['addr'], nil) })
      end
      if ip then
        if settings['to_ip'][1] > 0 then
          table.insert(args, { settings['to_ip'], make_rate_key(nil, r['addr'], ip) })
        end
        if settings['to_ip_from'][1] > 0 then
          table.insert(args, { settings['to_ip_from'], make_rate_key(from_addr, r['addr'], ip) })
        end
      end
    end, rcpts)
  end

  if #args > 0 then
    func(task, args)
  end
end

--- Check limit
local function rate_test(task)
  rate_test_set(task, check_limits)
end
--- Update limit
local function rate_set(task)
  rate_test_set(task, set_limits)
end

--- Parse a single limit description
local function parse_limit(str)
  local params = rspamd_str_split(str, ':')

  local function set_limit(limit, burst, rate)
    limit[1] = tonumber(burst)
    limit[2] = tonumber(rate)
  end

  if table.maxn(params) ~= 3 then
    rspamd_logger.errx(rspamd_config, 'invalid limit definition: ' .. str)
    return
  end

  if params[1] == 'to' then
    set_limit(settings['to'], params[2], params[3])
  elseif params[1] == 'to_ip' then
    set_limit(settings['to_ip'], params[2], params[3])
  elseif params[1] == 'to_ip_from' then
    set_limit(settings['to_ip_from'], params[2], params[3])
  elseif params[1] == 'bounce_to' then
    set_limit(settings['bounce_to'], params[2], params[3])
  elseif params[1] == 'bounce_to_ip' then
    set_limit(settings['bounce_to_ip'], params[2], params[3])
  elseif params[1] == 'user' then
    set_limit(settings['user'], params[2], params[3])
  else
    rspamd_logger.errx(rspamd_config, 'invalid limit type: ' .. params[1])
  end
end

local opts =  rspamd_config:get_all_opt('ratelimit')
if opts then
  local rates = opts['limit']
  if rates and type(rates) == 'table' then
    _.each(parse_limit, rates)
  elseif rates and type(rates) == 'string' then
    parse_limit(rates)
  end

  if opts['rates'] and type(opts['rates']) == 'table' then
    -- new way of setting limits
    _.each(function(t, lim)
      if type(lim) == 'table' and settings[t] then
        settings[t] = lim
      else
        rspamd_logger.errx(rspamd_config, 'bad rate: %s: %s', t, lim)
      end
    end, opts['rates'])
  end

  local enabled_limits = _.totable(_.map(function(t, lim)
    return t
  end, _.filter(function(t, lim) return lim[1] > 0 end, settings)))
  rspamd_logger.infox(rspamd_config, 'enabled rate buckets: %s', enabled_limits)

  if opts['whitelisted_rcpts'] and type(opts['whitelisted_rcpts']) == 'string' then
    whitelisted_rcpts = rspamd_str_split(opts['whitelisted_rcpts'], ',')
  elseif type(opts['whitelisted_rcpts']) == 'table' then
    whitelisted_rcpts = opts['whitelisted_rcpts']
  end

  if opts['whitelisted_ip'] then
    whitelisted_ip = rspamd_config:add_radix_map(opts['whitelisted_ip'], 'Ratelimit whitelist ip map')
  end

  if opts['symbol'] then
    -- We want symbol instead of pre-result
    ratelimit_symbol = opts['symbol']
  end

  if opts['max_rcpt'] then
    max_rcpt = tonumber(opts['max_rcpt'])
  end

  if opts['max_delay'] then
    max_rcpt = tonumber(opts['max_delay'])
  end

  upstreams = rspamd_parse_redis_server('ratelimit')
  if not upstreams then
    rspamd_logger.infox(rspamd_config, 'no servers are specified, disabling module')
  else
    if not ratelimit_symbol then
      rspamd_config:register_pre_filter(rate_test)
    else
      rspamd_config:register_symbol({
        name = ratelimit_symbol,
        callback = rate_test,
        flags = 'empty'
      })
    end

    rspamd_config:register_post_filter(rate_set)
  end
end


text:
<?php

/**
 * Reads from and writes to PHP configuration files and provides access to
 * the settings they contain.
 *
 * @category Phergie
 * @package  Phergie
 * @author   Phergie Development Team <team@phergie.org>
 * @license  http://phergie.org/license New BSD License
 * @link     http://pear.phergie.org/package/Phergie
 */
class Phergie_Config implements ArrayAccess
{
    /**
     * Mapping of configuration file paths to an array of names of settings
     * they contain
     *
     * @var array
     */
    protected $files = array();

    /**
     * Mapping of setting names to their current corresponding values
     *
     * @var array
     */
    protected $settings = array();

    /**
     * Includes a specified PHP configuration file and incorporates its
     * return value (which should be an associative array) into the current
     * configuration settings.
     *
     * @param string $file Path to the file to read
     *
     * @return Phergie_Config Provides a fluent interface
     * @throws Phergie_Config_Exception
     */
    public function read($file)
    {
        if (!file_exists($file)) {
            throw new Phergie_Config_Exception(
                'File "' . $file . '" does not exist',
                Phergie_Config_Exception::ERR_FILE_NOT_FOUND
            );
        }

        if (!is_readable($file)) {
            throw new Phergie_Config_Exception(
                'File "' . $file . '" cannot be read',
                Phergie_Config_Exception::ERR_FILE_NOT_READABLE
            );
        }

        $settings = include $file;
        if (!is_array($settings)) {
            throw new Phergie_Config_Exception(
                'File "' . $file . '" does not return an array',
                Phergie_Config_Exception::ERR_ARRAY_NOT_RETURNED
            );
        }

        $this->files[$file] = array_keys($settings);
        $this->settings += $settings;

        return $this;
    }

    /**
     * Merges an associative array of configuration setting values into the
     * current configuration settings.
     *
     * @param array $settings Associative array of configuration setting
     *        values keyed by setting name
     *
     * @return Phergie_Config Provides a fluent interface
     */
    public function readArray(array $settings)
    {
        $this->settings += $settings;

        return $this;
    }

    /**
     * Writes the values of the current configuration settings back to their
     * originating files.
     *
     * @return Phergie_Config Provides a fluent interface
     */
    public function write()
    {
        foreach ($this->files as $file => &$settings) {
            $values = array();
            foreach ($settings as $setting) {
                $values[$setting] = $this->settings[$setting];
            }
            $source = '<?php' . PHP_EOL . PHP_EOL .
                'return ' . var_export($values, true) . ';';
            file_put_contents($file, $source);
        }
        return $this;
    }

    /**
     * Checks to see if a configuration setting is assigned a value.
     *
     * @param string $offset Configuration setting name
     *
     * @return bool TRUE if the setting has a value, FALSE otherwise
     * @see ArrayAccess::offsetExists()
     */
    public function offsetExists($offset)
    {
        return isset($this->settings[$offset]);
    }

    /**
     * Returns the value of a configuration setting.
     *
     * @param string $offset Configuration setting name
     *
     * @return mixed Configuration setting value or NULL if it is not
     *         assigned a value
     * @see ArrayAccess::offsetGet()
     */
    public function offsetGet($offset)
    {
        if (isset($this->settings[$offset])) {
            $value = &$this->settings[$offset];
        } else {
            $value = null;
        }

        return $value;
    }

    /**
     * Sets the value of a configuration setting.
     *
     * @param string $offset Configuration setting name
     * @param mixed  $value  New setting value
     *
     * @return void
     * @see ArrayAccess::offsetSet()
     */
    public function offsetSet($offset, $value)
    {
        $this->settings[$offset] = $value;
    }

    /**
     * Removes the value set for a configuration setting.
     *
     * @param string $offset Configuration setting name
     *
     * @return void
     * @see ArrayAccess::offsetUnset()
     */
    public function offsetUnset($offset)
    {
        unset($this->settings[$offset]);

        foreach ($this->files as $file => $settings) {
            $key = array_search($offset, $settings);
            if ($key !== false) {
                unset($this->files[$file][$key]);
            }
        }
    }
}


text:
//
//  SMTemplate.h
//
//  Copyright © 2018 SessionM. All rights reserved.
//

#ifndef __SM_TEMPLATE__
#define __SM_TEMPLATE__

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/*!
 @class SMTemplate
 @abstract Provides the data necessary for presenting UI for a campaign message.
 */
@interface SMTemplate : NSObject

/*!
 @property type
 @abstract Message type.
 */
@property(nonatomic, strong, readonly) NSString *type;
/*!
 @property extras
 @abstract Any data values that do not have an associated class property.
 */
@property(nullable, nonatomic, strong, readonly) NSDictionary<NSString *, id> *extras;

@end

@class SMTemplateMessage;
@class SMTemplateAction;

/*!
 @class SMFeedTemplate
 @abstract Provides the data necessary for presenting UI for a feed message.
 @discussion Note: the developer can configure the following properties for each message through the SessionM Platform portal.
 */
@interface SMFeedTemplate : SMTemplate

/*!
 @property message
 @abstract The ad URL for the current user.
 */
@property(nonatomic, strong, readonly) SMTemplateMessage *message;
/*!
 @property action
 @abstract The ad URL for the current user.
 */
@property(nonatomic, strong, readonly) SMTemplateAction *action;
/*!
 @property data
 @abstract Custom, developer-defined data associated with the messsage.
 */
@property(nullable, nonatomic, strong, readonly) id data;

@end

/*!
 @class SMPromotionTemplate
 @abstract Provides the data necessary for presenting UI for a promotion.
 @discussion Note: the developer can configure the following properties for each message through the SessionM Platform portal.
 */
@interface SMPromotionTemplate : SMTemplate

/*!
 @property htmlPayload
 @abstract The ad URL for the current user.
 */
@property(nullable, nonatomic, strong, readonly) NSString *htmlPayload;

@end

/*!
 @class SMTemplateMessage
 @abstract Contains feed message text and layout configuration data.
 @discussion Note: the developer can configure the following properties for each message through the SessionM Platform portal.
 */
@interface SMTemplateMessage : NSObject

/*!
 @property header
 @abstract Message title.
 */
@property(nonatomic, strong, readonly) NSString *header;
/*!
 @property subheader
 @abstract Message subtitle.
 @discussion Identical to @link callToAction @/link.
 */
@property(nullable, nonatomic, strong, readonly) NSString *subheader;
/*!
 @property descriptionText
 @abstract Message text.
 @deprecated This property has been deprecated - use @link details @/link instead.
 */
@property(nonatomic, strong, readonly) NSString *descriptionText __attribute__((deprecated));
/*!
 @property details
 @abstract Message text.
 */
@property(nonatomic, strong, readonly) NSString *details;
/*!
 @property iconURL
 @abstract URL for feed message icon.
 */
@property(nullable, nonatomic, strong, readonly) NSString *iconURL;
/*!
 @property imageURL
 @abstract URL for optional feed message banner image.
 */
@property(nullable, nonatomic, strong, readonly) NSString *imageURL;
/*!
 @property videoURL
 @abstract URL for optional video content.
 */
@property(nullable, nonatomic, strong, readonly) NSString *videoURL;
/*!
 @property points
 @abstract The amount of points that use can earn by interacting with the message.
 */
@property(nonatomic, assign, readonly) NSInteger points;
/*!
 @property callToAction
 @abstract Message subtitle.
 @discussion Identical to @link subheader @/link.
 */
@property(nullable, nonatomic, strong, readonly) NSString *callToAction;
/*!
 @property extras
 @abstract Any data values that do not have an associated class property.
 */
@property(nullable, nonatomic, strong, readonly) NSDictionary<NSString *, id> *extras;

@end

@class SMEventMetaData;

/*!
 @class SMTemplateAction
 @abstract Contains feed message action configuration data.
 @discussion Note: the developer can configure the following properties for each message through the SessionM Platform portal.
 */
@interface SMTemplateAction : NSObject

/*!
 @property type
 @abstract Determines how the content pointed to by @link url @/link is displayed when @link //apple_ref/occ/instm/SMCampaignsManager/executeMessageAction: @/link is called with the corresponding //apple_ref/occ/cl/SMFeedMessage @/link instance.
 */
@property(nullable, nonatomic, strong, readonly) NSString *type;
/*!
 @property url
 @abstract URL for content that is displayed when @link //apple_ref/occ/instm/SMCampaignsManager/executeMessageAction: @/link is called with the corresponding //apple_ref/occ/cl/SMFeedMessage @/link instance.
 */
@property(nullable, nonatomic, strong, readonly) NSString *url;
/*!
 @property trackingURLs
 @abstract URLs used to track an action associated with the message.
 */
@property(nullable, nonatomic, strong, readonly) NSArray<NSString *> *trackingURLs;
/*!
 @property eventMetaData
 @abstract Metadata associated with the message.
 */
@property(nullable, nonatomic, strong, readonly) SMEventMetaData *eventMetaData;
/*!
 @property extras
 @abstract Any data values that do not have an associated class property.
 */
@property(nullable, nonatomic, strong, readonly) NSDictionary<NSString *, id> *extras;

@end

/*!
 @class SMEventMetaData
 @abstract Metadata associated with a feed message.
 */
@interface SMEventMetaData : NSObject

/*!
 @property adUnitID
 @abstract Ad unit identifier.
 */
@property(nullable, nonatomic, strong, readonly) NSString *adUnitID;
/*!
 @property adStatID
 @abstract Ad stat identifier.
 */
@property(nullable, nonatomic, strong, readonly) NSString *adStatID;
/*!
 @property extras
 @abstract Any data values that do not have an associated class property.
 */
@property(nullable, nonatomic, strong, readonly) NSDictionary<NSString *, id> *extras;

@end

NS_ASSUME_NONNULL_END

#endif /* __SM_TEMPLATE__ */


text:
<?xml version="1.0" encoding="utf-8"?>
  <android.support.v7.widget.CardView
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/list_card_view"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginStart="@dimen/card_view_margin_start"
      android:layout_marginEnd="@dimen/card_view_margin_end"
      android:layout_marginTop="@dimen/card_view_margin_top"
      android:layout_marginBottom="@dimen/card_view_margin_bottom"
      app:cardBackgroundColor="@color/cardview_light_background"
      android:elevation="@dimen/card_view_elevation"
      app:cardCornerRadius="@dimen/card_view_corner_radius"
      android:layout_marginLeft="@dimen/card_view_margin_start"
      android:layout_marginRight="@dimen/card_view_margin_end">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="@dimen/stock_quote_list_height"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:paddingLeft="@dimen/stock_quote_list_padding_left"
        android:paddingRight="@dimen/stock_quote_list_padding_right"
        android:paddingStart="@dimen/stock_quote_list_padding_start"
        android:paddingEnd="@dimen/stock_quote_list_padding_end"
        >

        <TextView
            android:id="@+id/stock_symbol"
            style="@style/StockSymbolTextStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="start|center_vertical"
            tools:text="@string/stock_symbol"
            />

      <LinearLayout
          android:layout_width="@dimen/linear_layout_zero_weight"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:gravity="end"
          >
        <TextView
            android:id="@+id/bid_price"
            style="@style/BidPriceTextStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingRight="@dimen/bid_price_padding_right"
            android:paddingEnd="@dimen/bid_price_padding_end"
            android:text="@string/bid_price"
            />
        <TextView
            android:id="@+id/change"
            android:background="@drawable/percent_change_pill"
            style="@style/PercentChangeTextStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingLeft="@dimen/change_padding_left"
            android:paddingRight="@dimen/change_padding_right"
            android:paddingStart="@dimen/change_padding_start"
            android:paddingEnd="@dimen/change_padding_end"
            tools:text="@string/change_percent"
            />
      </LinearLayout>
    </LinearLayout>
  </android.support.v7.widget.CardView>


text:
package org.jboss.pnc.executor;

import org.jboss.pnc.common.Configuration;
import org.jboss.pnc.executor.servicefactories.BuildDriverFactory;
import org.jboss.pnc.spi.builddriver.BuildDriver;
import org.jboss.pnc.spi.builddriver.CompletedBuild;
import org.jboss.pnc.spi.builddriver.RunningBuild;
import org.jboss.pnc.spi.environment.RunningEnvironment;
import org.jboss.pnc.spi.executor.BuildExecutionSession;
import org.jboss.pnc.spi.executor.exceptions.ExecutorException;
import org.jboss.pnc.test.cdi.TestInstance;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import java.util.function.Consumer;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

public class BuildDriverFactoryTest {

    private static String backupConfigPath;

    @BeforeClass
    public static void setUpTestConfigPath() {
        backupConfigPath = System.getProperty("pnc-config-file");
        System.setProperty("pnc-config-file", "testConfig.json");
    }

    @AfterClass
    public static void restoreConfigPath() {
        if (backupConfigPath != null)
            System.setProperty("pnc-config-file", backupConfigPath);
        else
            System.getProperties().remove("pnc-config-file");
    }

    @Test(expected = ExecutorException.class)
    public void shouldSkipDriversWhichAreNotMentionedInConfiguration() throws Exception {
        // given
        ProperDriver testedBuildDriver = new ProperDriver();
        TestInstance<BuildDriver> allDrivers = new TestInstance<>(testedBuildDriver);

        Configuration configuration = new Configuration();
        BuildDriverFactory factory = new BuildDriverFactory(allDrivers, configuration);
        factory.initConfiguration();

        // when
        factory.getBuildDriver();
    }

    @Test
    public void shouldPickProperDriver() throws Exception {
        // given
        ProperDriver testedBuildDriver = new ProperDriver();
        TestInstance<BuildDriver> allDrivers = new TestInstance<>(testedBuildDriver);

        Configuration configuration = mock(Configuration.class);

        BuildDriverFactory factory = new BuildDriverFactory(allDrivers, configuration);

        // when
        BuildDriver buildDriver = factory.getBuildDriver();

        // then
        assertThat(buildDriver).isEqualTo(testedBuildDriver);
    }

    class BuildDriverWhichCanNotBuild implements BuildDriver {

        @Override
        public String getDriverId() {
            return null;
        }

        @Override
        public RunningBuild startProjectBuild(
                BuildExecutionSession currentBuildExecution,
                RunningEnvironment runningEnvironment,
                Consumer<CompletedBuild> onComplete,
                Consumer<Throwable> onError) {
            return null;
        }
    }

    class ProperDriver implements BuildDriver {

        @Override
        public String getDriverId() {
            return null;
        }

        @Override
        public RunningBuild startProjectBuild(
                BuildExecutionSession currentBuildExecution,
                RunningEnvironment runningEnvironment,
                Consumer<CompletedBuild> onComplete,
                Consumer<Throwable> onError) {
            return null;
        }
    }

}


text:
<?php

namespace Recurly;

class Link
{
  var $href;
  var $name;
  var $method;

  function __construct($name, $href, $method) {
    $this->href = $href;
    $this->name = $name;
    $this->method = $method;
  }

  public function __toString()
  {
    return "<Link[{$this->name}] href=\"$this->href\" method=\"$this->method\">";
  }
}


text:
Grizzly-Blink
=============

[Grizzly NIO framework](http://grizzly.java.net/) filters to process the
 [Blink](http://blinkprotocol.org/) protocol serialized messages.

Grizzly-Blink is created and maintained by Chris Molozian (@novabyte).
<br/>
Code licensed under the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0).
 Documentation licensed under [CC BY 3.0](http://creativecommons.org/licenses/by/3.0/).

## Usage ##

Grizzly-Blink is available on [Maven Central](http://search.maven.org/).

```xml
<dependency>
    <groupId>me.cmoz.grizzly</groupId>
    <artifactId>grizzly-blink</artifactId>
    <version>1.0.0</version>
</dependency>
```

If you're not using Maven (or a dependency resolver that's compatible with Maven
 repositories), you can download the JARs you need for your project from
 Maven Central.

### Filter Types ###

At the moment there is only one filter to choose from: __BlinkCompactFilter__.
 This filter implements the [Blink Compact](http://blog.blinkprotocol.org/2013/02/blink-native-binary-format-introduction.html)
 protocol.

There are future plans to add support for the __Blink Native__ version of the
 Blink protocol specification once support for it is added to
 [jblink](https://github.com/pantor-engineering/jblink).

## Example ##

The filter needs a `Schema` type to use to encode and decode messages.

The example below demonstrates the
 [`Hello` protocol](https://github.com/novabyte/grizzly-blink/tree/master/src/test/blink/Hello.blink),
 all messages sent/received by the filter chain will (de)serialize to the `Hello`
 protocol format:

```java
final Schema schema = new Schema();
SchemaReader.readFromString(
        "namespace HelloSpec\n" +
        "Hello/1 ->\n" +
        "  string Greeting", schema);
schema.finalizeSchema();

final FilterChainBuilder serverFilterBuilder = FilterChainBuilder.stateless()
        .add(new TransportFilter())
        .add(new BlinkCompactFilter(schema, "some.package.for.blink.code"))
```

For more detailed examples of how to integrate this filter into your code have a
 look at the [test cases](https://github.com/novabyte/grizzly-blink/tree/master/src/test/java/me/cmoz/grizzly/blink).

## Developer Notes ##

The codebase requires the [Gradle](http://gradle.org) build tool at version
 `1.6+` and the Java compiler at version `1.6.0` or greater.

The main external dependency for the project is [Grizzly NIO](http://grizzly.java.net/),
 at `2.3.5` or greater. At the moment [jblink](https://github.com/pantor-engineering/jblink)
 is being bundled within this library until it's packaged properly and available
 on [Maven Central](http://search.maven.org/).

For a full list of dependencies see the [build script](https://github.com/novabyte/grizzly-blink/blob/master/build.gradle).
 All dependencies are downloaded by Gradle during the build process.

### Building the codebase ###

The codebase requires [NodeJS](http://nodejs.org/) to use the __blinkc__
 compiler, it generates source files that map the protocol specification to Java
 (similarly to how Protobuf-Java works). You'll also need to clone the repository
 with all git submodules to include the `blinkc.js` dependency:

```
git clone --recursive git://github.com/novabyte/grizzly-blink.git
```

A list of all possible build targets can be displayed by Gradle with
 `gradle tasks`.

In a regular write-compile-test cycle use `gradle test`.

A list of all project dependencies can be displayed by Gradle with
 `gradle dependencies`.

It is recommended to run Gradle with the
 [Build Daemon](http://docs.codehaus.org/display/GRADLE/Gradle+Build+Daemon)
 enabled to improve performance. e.g. `gradle --daemon` once the daemon is
 running it can be stopped with `gradle --stop`.

## Contribute ##

All contributions to the documentation and the codebase are very welcome. Feel
 free to open issues on the tracker wherever the documentation needs improving.

Also, pull requests are always welcome! `:)`


text:
StatusQuo Bias is also called as Do-NothingSyndrome.

We preferto keep things the way they are. Why?

1. Less or No     effort(physical and mental)
2. Worried by harm that comes     from action than the harm that comes from inaction.

[![img](file:////Users/kchandra/Library/Group%20Containers/UBF8T346G9.Office/msoclip1/01/9CC34EE3-3A47-DA4E-9238-B60CEA4965A7.png)](http://2.bp.blogspot.com/-DBIPmFLxEaY/VofuqjsXfwI/AAAAAAAA6AQ/tz1zkJa9q2A/s1600/do_not_change_stay_put.jpg)

Earlierin the latticework series, I wrote about [Do Something Bias](http://www.safalniveshak.com/latticework-mental-models-do-something-bias/). It's a cognitive biaswhere people get an urge to take action or make unnecessary decisions when 'notdoing anything' is required.

Nowlet's turn the table, and talk about a bias which is exactly opposite of Do Something Bias.It's called StatusQuo Bias. The tendency of people where they don't doanything and continue to maintain the current state of affairs.

If wecould boil down this cognitive bias to a more fundamental body of knowledge, itwould be Physics. I am sure you must have heard of Newton's laws of motion. Thethird law of motion states –

An object either remains at rest or continues to move at a constantvelocity, unless acted upon by an external force.

Thischaracteristic, called inertia, is exhibited by all physical bodies. And whenit comes to human behaviour, this tendency manifests in the form of Status Quo Bias.

Examples

Default Settings in smartphone

Do youown a smartphone? Chances are that you're reading this on a smartphone or atablet.

One ofthe most interesting thing about these smartphones is that theyallows you to customize everything – data usage, app synchronization, phoneencryption, even how loud you want the camera shutter to sound.

Howmany of these customization settings have you used? In my case – almost none!

AlthoughI'm not technically challenged, but do suffer from, just like most of the otherhuman beings, a cognitive bias.

Organ Donation

Hereis a very intriguing case study which Dan Ariely, author of wildly popular book[Predictably Irrational](http://www.amazon.in/Predictably-Irrational-Hidden-Forces-Decisions/dp/0007368542/ref=sr_1_1?ie=UTF8&qid=1445849313&sr=8-1&keywords=predictably+irrational&tag=safanive-21), mentions in his [blog post](http://danariely.com/2008/05/05/3-main-lessons-of-psychology/) –

This graph shows the percentage of people, across different Europeancountries, who are willing to donate their organs after they pass away. Whenpeople see this plot and try to speculate about the cause for the differencesbetween the countries that donate a lot (in blue) and the countries that donatelittle (in orange) they usually come up with "big" reasons such as religion,culture, etc.

But you will notice that pairs of similar countries have verydifferent levels of organ donations. For example, take the following pairs ofcountries: Denmark and Sweden; the Netherlands and Belgium; Austria and Germany(and depending on your individual perspective France and the UK). These arecountries that we usually think of as rather similar in terms of culture,religion, etc., yet their levels of organ donations are very different.

[![img](file:////Users/kchandra/Library/Group%20Containers/UBF8T346G9.Office/msoclip1/01/B92BD632-9FA8-B444-99EB-F7CD50EB1883.png)](http://2.bp.blogspot.com/-wtFgUQt19tA/VnJcZRFNa3I/AAAAAAAA4wc/rJswBTM5ioI/s1600/od_plot.jpg)

So, what could explain these differences? It turns out that it isthe design of the form at the DMV. In countries where the form is set as"opt-in" (check this box if you want to participate in the organ donationprogram) people do not check the box and as a consequence they do not become apart of the program. In countries where the form is set as "opt-out" (checkthis box if you don't want to participate in the organ donation program) peoplealso do not check the box and are automatically enrolled in the program. Inboth cases large proportions of people simply adopt the default option.

Thisdefault effect caused by StatusQuo Bias on human behaviour is so strong that a wholediscipline of 'choice architectures design' has evolved around this ideaof creating intelligent default options in different policy frameworks andvarious human interfacing systems.

Ifyou really want to learn more about choice architecture, [Nudge](http://www.amazon.in/Nudge-Improving-Decisions-Health-Happiness/dp/0141040017/ref=sr_1_1?ie=UTF8&qid=1445849520&sr=8-1&keywords=Nudge&tag=safanive-21) by Richard Thaler is an excellentbook to read. Thaler writes …

People have a more general tendency to stick with their currentsituation… [It] has been demonstrated in numerous situations. Most teachersknow that students tend to sit in the same seats in class, even without aseating chart. But status quo bias can occur even when the stakes are muchlarger, and it can get us into a lot of trouble.

…Those who are in charge of circulation [magazine subscriptionsbusiness] know that when renewal is automatic, and when people have to make aphone call to cancel, the likelihood of renewal is much higher than it is whenpeople have to indicate that they actually want to continue to receive themagazine.

So nexttime when you apply for a new credit card and later figure out that you havebeen enrolled for couple of unnecessary "premium services" (which you of coursedon't remember opting for), then don't be surprised because the credit cardapplication form probably had those options selected by default and you wereactually required to specifically opt out of them.

Anintelligent but manipulative practice. These very dubious tactics makes me feelthat the credit card industry is largely evil.

Inhis awesome book SeekingWisdom, Peter Bevelin writes…

We prefer to keep things the way they are. We resist change andprefer effort minimization. We favour routine behaviour over innovativebehaviour.

The more emotional a decision is or the more choices we have, themore we prefer the status quo. This is why we stick with our old jobs, brand ofcar, etc. Even in cases where the costs of switching are very low.

…We are more bothered by harm that comes from action than harm thatcomes from inaction. We feel worse when we fail as a result of taking actionthan when we fail from doing nothing.

We prefer the default option, i.e., the alternative that is selectedautomatically unless we change it.

Of coursepeople don't blindly go with the current status. It's only when they areeither confused about the options or there is an uncertainty with a decision,that they choose to stick with the current state of affairs.

ShaneParrish, in his wonderful blog Farnam Street,  writes …

What happens when people are presented with difficult choices and noobvious right answer? We tend to prefer making not decision at all-that is, wechoose the norm.

In high-stakes decisions many options are better than the status-quoand we must make trade-offs. Yet, when faced with decisions that involvelife-and-death trade-offs, people frequently remark "I'd rather not think aboutit."

In otherwords, when faced with a complex decision, people tend to accept the statusquo, as reflected in the old adage, "When in doubt, do nothing."

[![img](file:////Users/kchandra/Library/Group%20Containers/UBF8T346G9.Office/msoclip1/01/876D7872-8C0C-A142-A53D-9F36526657E8.png)](http://1.bp.blogspot.com/-4raZ8n2ceyI/VnJcmLr7GfI/AAAAAAAA4wk/RBj73T6BZuU/s1600/dilbert-statusQuo-e1445849834135.gif)

What'sthe reason behind this cognitive bias?

Behaviouralscientists believe that Loss Aversion Bias could be the culprit here. Any kindof change in the status quo brings the possibility of disruption in yourcomfort zone.

"Thepresent may stink, but I still don't want to lose it," This is how we comfortourselves when we face a need to change.

In Investing

Severalinvestors fall in love with their stocks in the garb of "buy and hold". So theytend to protect the status quo by inventing new reasons to hold onto a dudinvestment. They will remain stuck in a status quo mode because they hate toadmit they've lost money.

Talkingabout status quo bias in the context of making the most efficient use ofcapital, Warren Buffett writes …

We are free of historical biases created by lifelong associationwith a given industry and are not subject to pressures from colleagues having avested interest in maintaining status quo. That's important: If horses hadcontrolled investment decisions, there would be no auto industry.

Benefits of Status Quo

I mighthave created a very negative picture about Status Quo Bias. It isn't that badeither. It's something which mother nature and evolution has ingrained in ourpsyche so it must have some purpose after all. There are some upsides to thisbias too.

Thenoted psychologist, nobel laureate and the father of behaviour economics,Daniel Kahneman, writes in his book [Thinking Fast and Slow](http://www.amazon.in/Thinking-Fast-Penguin-Press-Non-Fiction/dp/0141033576/ref=sr_1_1?ie=UTF8&qid=1445850068&sr=8-1&keywords=Thinking+Fast+and+Slow&tag=safanive-21) …

Loss aversion is a powerful conservative force that favours minimalchanges from the status quo in the lives of both institutions and individuals.This conservatism helps keep us stable in our neighborhood, our marriage, andour job; it is the gravitational force that holds our life together near thereference point.

NassimTaleb, in his book [Antifragile](http://www.amazon.in/Antifragile-Things-that-Gain-Disorder/dp/0141038225/ref=sr_1_1?ie=UTF8&qid=1445850092&sr=8-1&keywords=antifragile&tag=safanive-21), argues that Status Quo biashas been made to look unnecessarily bad and it can coexist with Do SomethingsBias. He writes …

Few understand that procrastination[possibly caused by Status QuoBias] is our natural defence…I use procrastination as a message from my innerself and my deep evolutionary past to resist interventionism[do something bias]in my writing. Yet some psychologists and behavioural economists seem to thinkthat procrastination is a disease to be remedied and cured.

Psychologists document the opposite of interventionism, calling itthe status quo bias. But it seems that the two can co-exist, interventionismand procrastination, in one's profession (where one is supposed to dosomething) and in one's personal life (the opposite). It depends on domain. Itis a sociological and economic problem, one linked to norms and incentivesrather than mental property.

One ofthe ways in which Status Quo can be exploited for your benefit is to start aninvestment SIP. The reason SIP works is because once it's setup people aren'twilling to take the pain of changing or stopping the SIP.

Don't Let Status Quo Kill Your dreams

Statusquo bias holds a lot of relevance in how we live our lives. Most of us born ina middle-class family, and with protective parents, must have heard andexperienced endless stories of the dangers of being curious, standing up,standing out or breaking the tradition.

Believeit or not, this bias manifests in minor things like taking the same drivingroute, shopping from the same old store, using the same old brands coffee,soap, toothpastes and washing powder. Deliberately building habits andconsciously creating routines is a nice hack to simplify life and focus onimportant things but please understand that following a set patternunconsciously could ruin the possibility of a promising future.

Settlingfor the status quo is living for something less than God desires for us. It'snot the way you make your dreams come true. The defender of the status quoappeals to the known against the unknown, to the bird in the hand against thebird in the bush, to present possessions against future dreams, to establishedprecedent and well-tried methods against all kinds of dangerous innovations.

"Dreamershave no respect for the status quo." says Steve Jobs in this famous ad byApple…

May beit's the time to question your assumptions about career, work, money andrelationships. I hope you're not running your life on autopilot mode.

"Only one thing would be worse than the status quo.And that would be for the status quo to become the norm." – ElizabethDole, 1999 campaign speech

Conclusion

Rememberthat deciding to do nothing is also a decision. And the cost of doing nothingcould be greater than the cost of taking an action.

So how doyou overcome Status Quo Bias?

One trickis to periodically revisit your processes and ask whether they are servingtheir purpose.

The 19thCentury British biologist Thomas Henry Huxley said:

Perhaps the most valuable result of all education is the ability tomake yourself do the thing you have to do when it ought to be done whether youlike it or not. It is the first lesson that ought to be learned and howeverearly a person's training begins, it is probably the last lesson a personlearns thoroughly.

Take careand keep learning.

Source

[https://janav.wordpress.com/2013/03/28/status-quo-bias/ ](https://janav.wordpress.com/2013/03/28/status-quo-bias/)


text:
<?xml version="1.0" encoding="utf-8"?>

<!--
  ~ *******************************************************************************
  ~   Copyright (c) 2013-2014 Gabriele Mariotti.
  ~
  ~   Licensed under the Apache License, Version 2.0 (the "License");
  ~   you may not use this file except in compliance with the License.
  ~   You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~   Unless required by applicable law or agreed to in writing, software
  ~   distributed under the License is distributed on an "AS IS" BASIS,
  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~   See the License for the specific language governing permissions and
  ~   limitations under the License.
  ~  *****************************************************************************
  -->

<!-- You can customize this layout.
     You need to have in your layout a `CardView` with the ID `list_cardId` -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="match_parent">

    <it.gmariotti.cardslib.library.view.CardViewNative xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:card="http://schemas.android.com/apk/res-auto"
        android:id="@+id/list_cardId"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/native_list_card.thumbnail"
        card:card_layout_resourceID="@layout/native_card_thumbnail_layout_for_search_result" />

</LinearLayout>


text:
package org.apache.streams.twitter.example;

import com.fasterxml.jackson.databind.node.ObjectNode;
import com.typesafe.config.Config;
import org.apache.streams.config.StreamsConfigurator;
import org.apache.streams.core.StreamBuilder;
import org.apache.streams.core.StreamsDatum;
import org.apache.streams.elasticsearch.ElasticsearchConfigurator;
import org.apache.streams.elasticsearch.ElasticsearchPersistWriter;
import org.apache.streams.elasticsearch.ElasticsearchWriterConfiguration;
import org.apache.streams.json.JsonPathExtractor;
import org.apache.streams.local.builders.LocalStreamBuilder;
import org.apache.streams.pojo.json.Activity;
import org.apache.streams.twitter.TwitterStreamConfiguration;
import org.apache.streams.twitter.processor.TwitterTypeConverter;
import org.apache.streams.twitter.provider.TwitterStreamConfigurator;
import org.apache.streams.twitter.provider.TwitterStreamProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * Created by sblackmon on 12/10/13.
 */
public class TwitterUsermetricsElasticsearch implements Runnable {

    private final static Logger LOGGER = LoggerFactory.getLogger(TwitterUsermetricsElasticsearch.class);

    public static void main(String[] args)
    {
        LOGGER.info(StreamsConfigurator.config.toString());

        TwitterUsermetricsElasticsearch job = new TwitterUsermetricsElasticsearch();
        (new Thread(job)).start();

    }

    @Override
    public void run() {

        Config twitter = StreamsConfigurator.config.getConfig("twitter");
        Config elasticsearch = StreamsConfigurator.config.getConfig("elasticsearch");

        TwitterStreamConfiguration twitterStreamConfiguration = TwitterStreamConfigurator.detectConfiguration(twitter);
        ElasticsearchWriterConfiguration elasticsearchWriterConfiguration = ElasticsearchConfigurator.detectWriterConfiguration(elasticsearch);

        StreamBuilder builder = new LocalStreamBuilder(new LinkedBlockingQueue<StreamsDatum>(100));

        TwitterStreamProvider stream = new TwitterStreamProvider(twitterStreamConfiguration);
        TwitterTypeConverter converter = new TwitterTypeConverter(ObjectNode.class, Activity.class);
        BioExtractor bioExtractor = new BioExtractor();
        ElasticsearchPersistWriter writer = new ElasticsearchPersistWriter(elasticsearchWriterConfiguration);

        builder.newPerpetualStream(TwitterStreamProvider.STREAMS_ID, stream);
        builder.addStreamsProcessor("converter", converter, 2, TwitterStreamProvider.STREAMS_ID);
        builder.addStreamsProcessor(BioExtractor.STREAMS_ID, bioExtractor, 2, "converter");
        builder.addStreamsPersistWriter(ElasticsearchPersistWriter.STREAMS_ID, writer, 1, "converter");
        builder.start();
    }

    private class BioExtractor extends JsonPathExtractor {

        protected final static String STREAMS_ID = "BioExtractor";

        protected BioExtractor() {
            super("$.extensions.twitter.user");
        }

        @Override
        public List<StreamsDatum> process(StreamsDatum entry) {
            List<StreamsDatum> jsonPathResult = super.process(entry);
            for( StreamsDatum item : jsonPathResult ) {
                item.setId(item.getId()+item.getTimestamp());
            }
            return jsonPathResult;
        }
    }
}


text:
package ubuntu

import (
	"github.com/megamsys/libmegdc/templates"
	"github.com/megamsys/urknall"
	//"github.com/megamsys/libgo/cmd"
)

const (
	DataStoreId = "DataStoreId"
	Name        = "Name"
	ImageUrl    = "ImageUrl"
	Type        = "Type"
)

var ubuntucreateoneimage *UbuntuCreateOneImage

func init() {
	ubuntucreateoneimage = &UbuntuCreateOneImage{}
	templates.Register("UbuntuCreateOneImage", ubuntucreateoneimage)
}

type UbuntuCreateOneImage struct {
	datastoreid string
	name        string
	imageurl    string
	imagetype   string
	imagesize   string
}

func (tpl *UbuntuCreateOneImage) Options(t *templates.Template) {
	if datastoreid, ok := t.Options[DataStoreId]; ok {
		tpl.datastoreid = datastoreid
	}
	if name, ok := t.Options[Name]; ok {
		tpl.name = name
	}
	if imageurl, ok := t.Options[ImageUrl]; ok {
		tpl.imageurl = imageurl
	}
	if imagetype, ok := t.Options[Type]; ok {
		tpl.imagetype = imagetype
	}
	if imagesize, ok := t.Options[Size]; ok {
		tpl.imagesize = imagesize
	}

}

func (tpl *UbuntuCreateOneImage) Render(p urknall.Package) {
	p.AddTemplate("createoneimage", &UbuntuCreateOneImageTemplate{
		datastoreid: tpl.datastoreid,
		name:        tpl.name,
		imageurl:    tpl.imageurl,
		imagetype:   tpl.imagetype,
		imagesize:   tpl.imagesize,
	})
}

func (tpl *UbuntuCreateOneImage) Run(target urknall.Target, inputs map[string]string) error {
	return urknall.Run(target, &UbuntuCreateOneImage{
		datastoreid: tpl.datastoreid,
		name:        tpl.name,
		imageurl:    tpl.imageurl,
		imagetype:   tpl.imagetype,
		imagesize:   tpl.imagesize,
	}, inputs)
}

type UbuntuCreateOneImageTemplate struct {
	datastoreid string
	name        string
	imageurl    string
	imagetype   string
	imagesize   string
}

func (m *UbuntuCreateOneImageTemplate) Render(pkg urknall.Package) {
	datastoreid := m.datastoreid
	name := m.name
	imageurl := m.imageurl
	imagetype := m.imagetype
	imagesize := m.imagesize

	pkg.AddCommands("downloadImage",
		Shell("mkdir -p /var/lib/megam/images"),
		Shell("cd /var/lib/megam/images; wget "+imageurl+" -O "+name+".tar.gz"),
	)
	pkg.AddCommands("UntarImage",
		Shell("mkdir /var/lib/megam/images/tmp"),
		Shell("cd /var/lib/megam/images;tar xvf "+name+".tar.gz -C /var/lib/megam/images/tmp"),
	)

	pkg.AddCommands("GetImage",
		Shell("cd /var/lib/megam/images/tmp;first_file=$(ls | sort -n | head -1 );mv $first_file "+name+".img"),
		Shell("mv /var/lib/megam/images/tmp/"+name+".img /var/lib/megam/images"),
		Shell("rm -rf /var/lib/megam/images/tmp"),
	)
	if imagetype == "OS" {
		pkg.AddCommands("oneimagecreate",
			Shell("oneimage create --datastore "+datastoreid+" --name "+name+" --type "+imagetype+" --path /var/lib/megam/images/"+name+".img"),
		)
	} else {
		pkg.AddCommands("oneimagecreate",
			Shell("oneimage create --datastore "+datastoreid+" --name "+name+" --type "+imagetype+" --size "+imagesize+" --path /var/lib/megam/images/"+name+".img"),
		)
	}
	pkg.AddCommands("clearCaches",
		RemoveAllCaches("/var/lib/urknall/createoneimage.*"),
	)
}


text:
AjaxNestedForm
==============

This gem provides adding and removing nested model fields dynamically through JavaScript using jQuery. It may using for Rails 3.1+ with assets pipeline

Installation
------------

Add this line to your application's Gemfile:

    gem 'ajax_nested_form'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install ajax_nested_form

Usage
-----

### Javascript

Add necessary javascript file to app/assets/javascripts/application.js

``` javascript
//= require ajax_nested_form
```

### Using ActionView helper methods

For creating link to add nested model fields use next syntax

``` ruby
link_to_add_fields "LinkText", form_builder_instance, :association_name, "container_for_adding_fields", "position_for_adding"
```

Available positions for adding are "first" and "last". Last is used by default.

Sample

``` ruby
link_to_add_fields "Add list", f, :lists, "#lists-container", "first"
```

For creating link to destroy nested model fields use following code

``` ruby
link_to_remove_fields "Remove", form_builder_instance, "nested_model_fields_container"
```

Sample

``` ruby
link_to_remove_fields "Remove", f, ".list-fields"
```

Contributing
------------

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>App Engine Python SDK: google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="common.css" rel="stylesheet" type="text/css"/>

App Engine Python SDK
    v1.6.9 rev.445

The Python runtime is available as an experimental Preview feature.

google

appengine

ext

mapreduce

api

map_job

input_reader

InputReader

Public Member Functions |
Static Public Attributes |
List of all members

google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader Class Reference

Inheritance diagram for google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader:

  <map id="google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader_map" name="google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader_map">
<area href="classgoogle_1_1appengine_1_1ext_1_1mapreduce_1_1api_1_1map__job_1_1shard__life__cycle_1_1___shard_life_cycle.html" alt="google.appengine.ext.mapreduce.api.map_job.shard_life_cycle._ShardLifeCycle" shape="rect" coords="0,56,632,80"/>
<area href="classgoogle_1_1appengine_1_1ext_1_1mapreduce_1_1json__util_1_1_json_mixin.html" alt="google.appengine.ext.mapreduce.json_util.JsonMixin" shape="rect" coords="642,56,1274,80"/>
<area href="classgoogle_1_1appengine_1_1ext_1_1mapreduce_1_1api_1_1map__job_1_1abstract__datastore__input__r7fe8f6667b89c960fc29ce400c96cbd2.html" alt="google.appengine.ext.mapreduce.api.map_job.abstract_datastore_input_reader.AbstractDatastoreInputReader" shape="rect" coords="321,168,953,192"/>
</map>

Public Member Functions

def 	__init__

def 	__iter__

def 	next

def 	from_json

def 	to_json

def 	split_input

def 	validate

def 	begin_slice

def 	end_slice

def 	params_to_json

def 	params_from_json

 Public Member Functions inherited from google.appengine.ext.mapreduce.api.map_job.shard_life_cycle._ShardLifeCycle

def 	begin_shard

def 	end_shard

def 	begin_slice

def 	end_slice

 Public Member Functions inherited from google.appengine.ext.mapreduce.json_util.JsonMixin

def 	to_json_str

def 	from_json_str

Static Public Attributes

string 	COUNTER_IO_READ_BYTE = "io-read-byte"

string 	COUNTER_IO_READ_MSEC = "io-read-msec"

Detailed Description

Abstract base class for input readers.

InputReader's lifecycle:
1. validate() is called to validate JobConfig.
2. split_input is called to split inputs based on map_job.JobConfig.
   The class method creates a set of InputReader instances.
3. beging_shard/end_shard/begin_slice/end_slice are called at the time
   implied by the names.
4. next() is called by each shard on each instance. The output of next()
   is fed into JobConfig.mapper instance.
5. to_json()/from_json() are used to persist reader's state across multiple
   slices.

Member Function Documentation

          def google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader.begin_slice
          (

          self,

          slice_ctx

          )

Keeps an internal reference to slice_ctx.

Args:
  slice_ctx: SliceContext singleton instance for this slice.

          def google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader.end_slice
          (

          self,

          slice_ctx

          )

Drops the internal reference to slice_ctx.

Args:
  slice_ctx: SliceContext singleton instance for this slice.

          def google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader.from_json
          (

          cls,

          state

          )

Creates an instance of the InputReader for the given state.

Args:
  state: The InputReader state as returned by to_json.

Returns:
  An instance of the InputReader that can resume iteration.

          def google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader.next
          (

          self	)

Returns the next input from this input reader.

Returns:
  The next input read by this input reader. The return value is
  fed into mapper.

Raises:
  StopIteration when no more item is left.

          def google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader.params_from_json
          (

          cls,

          json_params

          )

Reverse function of params_to_json.

          def google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader.params_to_json
          (

          cls,

          params

          )

Translates JobConfig.input_reader_params to json serializable format.

For most reader, this may be an identity transformation.

Args:
  params: JobConfig.input_reader_params.

Returns:
  The json serializable format of params.

          def google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader.split_input
          (

          cls,

          job_config

          )

Returns an iterator of input readers.

This method returns a container of input readers,
one for each shard. The container must have __iter__ defined.
http://docs.python.org/2/reference/datamodel.html#object.__iter__

This method should try to split inputs among readers evenly.

Args:
  job_config: an instance of map_job.JobConfig.

Returns:
  An iterator of input readers.

          def google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader.to_json
          (

          self	)

Returns input reader state for the remaining inputs.

Returns:
  A json-serializable state for the InputReader.

          def google.appengine.ext.mapreduce.api.map_job.input_reader.InputReader.validate
          (

          cls,

          job_config

          )

Validates relevant parameters.

This method can validate fields which it deems relevant.

Args:
  job_config: an instance of map_job.JobConfig.

Raises:
  errors.BadReaderParamsError: required parameters are missing or invalid.

The documentation for this class was generated from the following file:

code/googleappengine-read-only/python/google/appengine/ext/mapreduce/api/map_job/input_reader.py

<address class="footer">
    Maintained by tzmartin
</address>


text:
NOTE: This folder is not meant to be used directly.
Will be used in ../conda_tools/build_all.py

- Build full AmberTools with python 2.7
- Use newly built package to build only Python pakages for different python versions
- Do post-processing: copy lib/pythonX.Y to $AMBERHOME/lib


text:
package chat.rocket.android.service.observer;

import android.content.Context;
import io.realm.RealmObject;

import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.realm_helper.RealmListObserver;
import chat.rocket.android.service.DDPClientRef;
import chat.rocket.android.service.Registrable;

abstract class AbstractModelObserver<T extends RealmObject>
    implements Registrable, RealmListObserver.Query<T>, RealmListObserver.OnUpdateListener<T> {

  protected final Context context;
  protected final String hostname;
  protected final RealmHelper realmHelper;
  protected final DDPClientRef ddpClientRef;
  private final RealmListObserver observer;

  protected AbstractModelObserver(Context context, String hostname,
                                  RealmHelper realmHelper, DDPClientRef ddpClientRef) {
    this.context = context;
    this.hostname = hostname;
    this.realmHelper = realmHelper;
    this.ddpClientRef = ddpClientRef;
    observer = realmHelper.createListObserver(this).setOnUpdateListener(this);
  }

  @Override
  public void register() {
    observer.sub();
  }

  @Override
  public void unregister() {
    observer.unsub();
  }
}


text:
begin
  require "RMagick"
rescue LoadError
end

require 'test_helper'

class Pdf417Test <  Minitest::Test

  should "initialize text as an attr" do
    b = PDF417.new(:text => "fred")
    assert_equal "fred", b.text
  end

  should "initialize text as a single parameter" do
    b = PDF417.new("fred")
    assert_equal "fred", b.text
  end

  should "defaults rows and cols to nil" do
    b = PDF417.new("fred")
    assert_nil b.rows
    assert_nil b.cols
  end

  should "allows fixed cols" do
    b = PDF417.new(text: "01234"*60, error_level: 6, cols: 5)
    b.to_blob
    assert_equal [5, 47], [b.cols, b.rows]

    # if it's too small, auto determine the best value
    b = PDF417.new(text: "01234"*60, error_level: 6, cols: 1)
    b.to_blob
    assert_equal [3, 90], [b.cols, b.rows]

    # if it's too big, auto determine the best value
    b = PDF417.new(text: "01234"*60, error_level: 6, cols: 100)
    b.to_blob
    assert_equal [30, 8], [b.cols, b.rows]
  end

  should "allows fixed rows" do
    b = PDF417.new(text: "01234"*60, error_level: 6, rows: 10)
    b.to_blob
    assert_equal [24, 10], [b.cols, b.rows]

    # if it's too small, auto determine the best value
    b = PDF417.new(text: "01234"*60, error_level: 6, rows: 6)
    b.to_blob
    assert_equal [30, 8], [b.cols, b.rows]

    # if it's too big, auto determine the best value
    b = PDF417.new(text: "01234"*60, error_level: 6, rows: 100)
    b.to_blob
    assert_equal [3, 90], [b.cols, b.rows]
  end

  should "let default aspect_ratio to define rows and cols" do
    b = PDF417.new(text: "01234"*60, error_level: 6)
    b.to_blob
    assert_equal 7, b.cols
    assert_equal 34, b.rows
  end

  should "let custom aspect_ratio to define rows and cols" do
    b = PDF417.new(text: "01234"*60, aspect_ratio: 0.618,
                   error_level: 6)
    b.to_blob
    assert_equal 6, b.cols
    assert_equal 39, b.rows
  end

  should "know the right codewords for fred" do
    assert_equal [4, 815, 514, 119], PDF417.encode_text("fred")
    assert_equal [4, 815, 514, 119], PDF417.new(:text => "fred").codewords
  end

  should "re-generate codewords if the text has been reassigned" do
    b = PDF417.new("fred")
    fred_words = b.codewords
    fred_blob = b.to_blob
    b.text = "Joebob"
    assert fred_words != b.codewords
    assert fred_blob != b.to_blob
  end

  should "re-generate if the text has been updated" do
    b = PDF417.new("fred")
    fred_words = b.codewords
    fred_blob = b.to_blob
    b.text += " and joe"
    assert fred_words != b.codewords
    assert fred_blob != b.to_blob
  end

  should "re-generate if the options have changed" do
    b = PDF417.new("fred")
    fred_words = b.codewords
    fred_blob = b.to_blob
    b.rows = b.rows + 4
    assert_equal fred_words, b.codewords # NOTE that the codewords have not changed, just the binary blob
    assert fred_blob != b.to_blob
  end

  should "set the text to nil when using raw codewords" do
    b = PDF417.new("TEST")
    b.raw_codewords = [4, 815, 514, 119]
    assert_equal "", b.text
  end

  should "accept raw codewords" do
    b = PDF417.new
    b.raw_codewords = [4, 815, 514, 119]
    assert_equal [4, 815, 514, 119], b.codewords
    begin
      b.to_blob
    rescue Exception => e
      assert false, "Expected nothing raised, instead got #{e.message}"
    end
    assert_barcode b
  end

  context "after generating" do
    setup do
      @barcode = PDF417.new("test")
      @barcode.generate!
      @blob = @barcode.blob
    end

    should "have a blob" do
      refute_nil @barcode.blob
      refute_nil @barcode.to_blob
      assert_barcode @barcode
    end

    should "know bit columns" do
      refute_nil @barcode.bit_columns
    end

    should "know bit rows" do
      refute_nil @barcode.bit_rows
    end

    should "know bit length" do
      refute_nil @barcode.bit_length
    end

    should "know rows" do
      refute_nil @barcode.rows
    end

    should "know cols" do
      refute_nil @barcode.cols
    end

    should "know error level" do
      refute_nil @barcode.error_level
    end

    should "know aspect ratio" do
      refute_nil @barcode.aspect_ratio
    end

    should "know y height" do
      refute_nil @barcode.y_height
    end

    should "regenerate after rows changed" do
      @barcode.rows = 10
      refute_equal @blob, @barcode.to_blob
      assert_barcode @barcode
    end

    should "regenerate after cols changed" do
      @barcode.cols = 10
      refute_equal @blob, @barcode.to_blob
      assert_barcode @barcode
    end

    should "regenerate after error level changed" do
      @barcode.error_level = 7
      refute_equal @blob, @barcode.to_blob
      assert_barcode_start_sequence @barcode
      assert_barcode_end_sequence @barcode
    end

    should "regenerate after raw codewords changed" do
      @barcode.raw_codewords = @barcode.codewords + [245, 123]
      @barcode.raw_codewords[0] = @barcode.raw_codewords.length
      refute_equal @blob, @barcode.to_blob
      assert_barcode @barcode
    end

    should "regenerate after aspect ratio changed" do
      # Aspect ratio does not apply when both rows and cols are set, so re-set our
      # reference and make sure there is enough data to have rows and cols
      @barcode.text = "SOME REALLY LONG TEXT HERE! Gonna need some rows...." * 10
      @barcode.rows = nil
      @barcode.cols = 10 # fixed cols input
      @barcode.error_level = 3
      @blob = @barcode.to_blob
      assert_equal [10, 30], [@barcode.cols, @barcode.rows] # cols is fixed at 10

      @barcode.aspect_ratio = 1000
      new_blob = @barcode.to_blob
      assert_equal [4, 90], [@barcode.cols, @barcode.rows] # new cols and rows are defined

      refute_equal @blob, new_blob
      assert_barcode_start_sequence @barcode
      assert_barcode_end_sequence @barcode
    end
  end

  should "know max rows after generating out of bounds" do
    b = PDF417.new(:rows => 10000, :text => "test")
    b.generate!
    refute_equal 10000, b.rows
  end

  # if Object.const_defined? "Magick"
  #   context "using RMagick" do
  #     setup do
  #       @barcode = PDF417.new("test text" * 100)
  #       @barcode.generate!
  #     end
  #
  #     should "make an image" do
  #       # @barcode.to_blob.split(//).collect{|x| x.unpack("B*")}.to_s.inspect
  #       image = Magick::Image::from_blob(@barcode.to_blob).first
  #       puts "Width: #{image.columns}; Height: #{image.rows}"
  #     end
  #   end
  # else
  #   puts "*** Skipping rmagick tests"
  # end

end


text:
package ec2test

import (
	"encoding/xml"
	"fmt"
	"net/http"

	"gopkg.in/amz.v3/ec2"
)

// SetInitialAttributes is deprecated and it's just an alias for
// SetAccountAttributes(). It's kept for now to prevent changing the
// ec2test public interface and should be removed in the next release.
func (srv *Server) SetInitialAttributes(attrs map[string][]string) error {
	return srv.SetAccountAttributes(attrs)
}

// SetAccountAttributes sets the given account attributes on the
// server. When the "default-vpc" attribute is specified, its value
// must match an existing VPC in the test server, otherwise it's an
// error. In addition, only the first value for "default-vpc", the
// rest (if any) are ignored.
func (srv *Server) SetAccountAttributes(attrs map[string][]string) error {
	srv.mu.Lock()
	defer srv.mu.Unlock()

	for attrName, values := range attrs {
		srv.attributes[attrName] = values
		if attrName == "default-vpc" {
			if len(values) == 0 {
				return fmt.Errorf("no value(s) for attribute default-vpc")
			}
			defaultVPCId := values[0] // ignore the rest.
			if _, found := srv.vpcs[defaultVPCId]; !found {
				return fmt.Errorf("VPC %q not found", defaultVPCId)
			}
		}
	}
	return nil
}

func (srv *Server) accountAttributes(w http.ResponseWriter, req *http.Request, reqId string) interface{} {
	srv.mu.Lock()
	defer srv.mu.Unlock()

	attrsMap := parseIDs(req.Form, "AttributeName.")
	var resp struct {
		XMLName xml.Name
		ec2.AccountAttributesResp
	}
	resp.XMLName = xml.Name{defaultXMLName, "DescribeAccountAttributesResponse"}
	resp.RequestId = reqId
	for attrName, _ := range attrsMap {
		vals, ok := srv.attributes[attrName]
		if !ok {
			fatalf(400, "InvalidParameterValue", "describe attrs: not found %q", attrName)
		}
		resp.Attributes = append(resp.Attributes, ec2.AccountAttribute{attrName, vals})
	}
	return &resp
}