text:
package com.viesis.viescraft.common.items.airships;

import java.text.DecimalFormat;
import java.util.List;

import javax.annotation.Nullable;

import com.viesis.viescraft.ViesCraft;
import com.viesis.viescraft.api.EnumsVC;
import com.viesis.viescraft.api.References;
import com.viesis.viescraft.common.entity.EntityThrownAirship;
import com.viesis.viescraft.common.items.ItemHelper;

import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.stats.StatList;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ItemCreativeAirship extends ItemCreativeAirshipBase {

	public ItemCreativeAirship(String unlocalizedName)
	{
		this.setHasSubtypes(true);
        this.setMaxDamage(0);

        ItemHelper.setItemName(this, unlocalizedName);
		this.setCreativeTab(ViesCraft.tabViesCraftItems);
	}

	@Override
	public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn)
    {
		ItemStack itemstack = playerIn.getHeldItemMainhand();

		this.storedInventory = new NBTTagCompound();

        if(playerIn.isSneaking())
		{
        	if (!playerIn.capabilities.isCreativeMode)
        	{
        		playerIn.inventory.decrStackSize(playerIn.inventory.currentItem, 1);
        	}

			worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));

			if (!worldIn.isRemote)
			{
				EntityThrownAirship entityairship = new EntityThrownAirship(worldIn, playerIn,
						5, 5, 5, 5,
						0,
						0, 0, 1000, 500,
						64, 16, 8,
						0, 0, 0,
			    		0, false,
			    		false,
			    		255, 255, 255,
			    		0, 0, 0, 0, 0, 0, 0,
			    		0, false,
			    		false,
			    		200, 180, 140,
			    		true, 3,
			    		true, 3,
			    		true, 3,
			    		true, 3,
			    		true, 3,
			    		true, 3,
			    		true, 3,
			    		true, 3,
			    		true, 3,
			    		this.storedInventory, "Creative");

				entityairship.shoot(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, -20.0F, 0.7F, 1.0F);
				worldIn.spawnEntity(entityairship);
			}

			playerIn.addStat(StatList.getObjectUseStats(this));
			return new ActionResult(EnumActionResult.SUCCESS, itemstack);
		}

		return new ActionResult(EnumActionResult.SUCCESS, itemstack);
    }

	@Override
	public String getItemStackDisplayName(ItemStack stack)
    {
		String colorName = TextFormatting.GOLD + "Creative";

		return TextFormatting.GOLD + References.Old_I18n.translateToLocalFormatted("vc.main.airship") + TextFormatting.GREEN + " - " + colorName + " "
				+ TextFormatting.DARK_RED + "" + TextFormatting.BOLD
				+ " ("
				+ TextFormatting.BLUE
				+ "C"
				+ TextFormatting.GREEN
				+ "r"
				+ TextFormatting.AQUA
				+ "e"
				+ TextFormatting.RED
				+ "a"
				+ TextFormatting.LIGHT_PURPLE
				+ "t"
				+ TextFormatting.YELLOW
				+ "i"
				+ TextFormatting.WHITE
				+ "v"
				+ TextFormatting.DARK_AQUA
				+ "e"
				+ TextFormatting.DARK_RED + "" + TextFormatting.BOLD
				+ ") ";
    }

	@SideOnly(Side.CLIENT)
	@Override
	public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn)
    {
		GameSettings gameSettingsIn = Minecraft.getMinecraft().gameSettings;

		int mainTierCoreInfo = 5;
		int mainTierFrameInfo = 5;
		int mainTierEngineInfo = 5;
		int mainTierBalloonInfo = 5;

		int currentRedstoneInfo = 500;
		int currentModuleSlot1Info = 0;

		tooltip.add(TextFormatting.DARK_GREEN + "================================");

		//[Hold Shift + Right-Click] to throw this
		tooltip.add(TextFormatting.GREEN + References.localNameVC("vc.item.tt.airship.1") + this.getSecondaryLabelColor(stack.getMetadata()) + " " + References.localNameVC("vc.item.tt.airship.2"));
		//item and unleash the airship within.
		tooltip.add(this.getSecondaryLabelColor(stack.getMetadata()) + References.localNameVC("vc.item.tt.airship.3"));

		if(gameSettingsIn.isKeyDown(gameSettingsIn.keyBindSneak))
		{
			tooltip.add(TextFormatting.DARK_GREEN + "================================");
			//Core :
			tooltip.add(TextFormatting.BLUE + References.localNameVC("vc.main.core") + TextFormatting.DARK_BLUE + " : " + TextFormatting.GRAY + "(" + this.getPrimaryLabelColor(mainTierCoreInfo) + EnumsVC.MainTierCore.byId(mainTierCoreInfo).getLocalizedName() + TextFormatting.GRAY + ")"
					+ TextFormatting.GREEN + " - "+ TextFormatting.BLUE + References.localNameVC("vc.main.redstone") + TextFormatting.DARK_BLUE + " : "
					+ this.getPrimaryLabelColor(mainTierCoreInfo) + EnumsVC.MainTierCore.byId(mainTierCoreInfo).getStoredRedstone());
			//Frame :
			tooltip.add(TextFormatting.BLUE + References.localNameVC("vc.main.frame") + TextFormatting.DARK_BLUE + " : " + TextFormatting.GRAY + "(" + this.getPrimaryLabelColor(mainTierFrameInfo) + EnumsVC.MainTierFrame.byId(mainTierFrameInfo).getLocalizedName() + TextFormatting.GRAY + ")"
					+ TextFormatting.GREEN + " - "+ TextFormatting.BLUE + References.localNameVC("vc.main.speed") + TextFormatting.DARK_BLUE + " : "
					+ this.getPrimaryLabelColor(mainTierFrameInfo) + "+" + mainTierFrameInfo);
			//Engine :
			tooltip.add(TextFormatting.BLUE + References.localNameVC("vc.main.engine") + TextFormatting.DARK_BLUE + " : " + TextFormatting.GRAY + "(" + this.getPrimaryLabelColor(mainTierEngineInfo) + EnumsVC.MainTierEngine.byId(mainTierEngineInfo).getLocalizedName() + TextFormatting.GRAY + ")"
					+ TextFormatting.GREEN + " - "+ TextFormatting.BLUE + References.localNameVC("vc.main.fuel") + TextFormatting.DARK_BLUE + " : "
					+ this.getPrimaryLabelColor(mainTierEngineInfo) + EnumsVC.MainTierEngine.byId(mainTierEngineInfo).getFuelPerTick());
			//Balloon :
			tooltip.add(TextFormatting.BLUE + References.localNameVC("vc.main.balloon") + TextFormatting.DARK_BLUE + " : " + TextFormatting.GRAY + "(" + this.getPrimaryLabelColor(mainTierBalloonInfo) + EnumsVC.MainTierBalloon.byId(mainTierBalloonInfo).getLocalizedName() + TextFormatting.GRAY + ")"
					+ TextFormatting.GREEN + " - "+ TextFormatting.BLUE + References.localNameVC("vc.main.altitude") + TextFormatting.DARK_BLUE + " : " + this.getPrimaryLabelColor(mainTierBalloonInfo) + EnumsVC.MainTierBalloon.byId(mainTierBalloonInfo).getMaxAltitude());

			tooltip.add("");
			//Stored Redstone :
			tooltip.add(TextFormatting.BLUE + References.localNameVC("vc.main.storedredstone") + TextFormatting.DARK_BLUE + " : " + TextFormatting.GREEN + currentRedstoneInfo);
			//Current Module :
			tooltip.add(TextFormatting.BLUE + References.localNameVC("vc.main.current") + " " + References.localNameVC("vc.item.module.#") + TextFormatting.DARK_BLUE + " : " + TextFormatting.GRAY + "None");
		}
		else
		{
			tooltip.add(TextFormatting.DARK_GREEN + "================================");
			tooltip.add(TextFormatting.GREEN + References.localNameVC("vc.item.tt.shifthelper.0"));
		}

		tooltip.add(TextFormatting.DARK_GREEN + "================================");
	}
}


text:
FactoryBot.define do
  sequence(:contact_group_type_title) { |n| "contact group type #{n}" }

  factory :contact_group_type do
    title { generate(:contact_group_type_title) }
  end
end

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Sentient\Route;

use Silex\Route as BaseRoute;

class Route extends BaseRoute {

	private $matchCallbacks = [];

	public function beforeMatch($callable) {
		if(!is_callable($callable)) {
			throw new \InvalidArgumentException('The passed parameter was not callable.');
		}
		$this->matchCallbacks[] = $callable;
	}

	public function getMatchCallbacks() {
		return $this->matchCallbacks;
	}

}


text:
package org.gluu.oxauth.interop;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;

import java.util.Arrays;
import java.util.List;
import java.util.UUID;

import org.gluu.oxauth.BaseTest;
import org.gluu.oxauth.client.AuthorizationRequest;
import org.gluu.oxauth.client.AuthorizationResponse;
import org.gluu.oxauth.client.AuthorizeClient;
import org.gluu.oxauth.client.RegisterClient;
import org.gluu.oxauth.client.RegisterRequest;
import org.gluu.oxauth.client.RegisterResponse;
import org.gluu.oxauth.model.common.ResponseType;
import org.gluu.oxauth.model.register.ApplicationType;
import org.gluu.oxauth.model.util.StringUtils;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

/**
 * OC5:FeatureTest-Rejects redirect uri when Query Parameter Does Not Match
 *
 * @author Javier Rojas Blum
 * @version June 19, 2015
 */
public class RejectsRedirectUriWhenQueryParameterDoesNotMatch extends BaseTest {

    @Parameters({"userId", "userSecret", "redirectUri"})
    @Test
    public void rejectsRedirectUriWhenQueryParameterDoesNotMatch(final String userId, final String userSecret,
                                                                 final String redirectUri) throws Exception {
        showTitle("OC5:FeatureTest-Rejects redirect uri when Query Parameter Does Not Match");

        List<ResponseType> responseTypes = Arrays.asList(ResponseType.CODE);

        // 1. Register client
        RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth test app",
                StringUtils.spaceSeparatedToList(redirectUri + "?foo1=bar"));
        registerRequest.setResponseTypes(responseTypes);

        RegisterClient registerClient = new RegisterClient(registrationEndpoint);
        registerClient.setRequest(registerRequest);
        RegisterResponse registerResponse = registerClient.exec();

        showClient(registerClient);
        assertEquals(registerResponse.getStatus(), 200, "Unexpected response code: " + registerResponse.getEntity());
        assertNotNull(registerResponse.getClientId());
        assertNotNull(registerResponse.getClientSecret());
        assertNotNull(registerResponse.getRegistrationAccessToken());
        assertNotNull(registerResponse.getClientIdIssuedAt());
        assertNotNull(registerResponse.getClientSecretExpiresAt());

        String clientId = registerResponse.getClientId();

        // 2. Request authorization and receive the authorization code.
        List<String> scopes = Arrays.asList("openid", "profile", "address", "email");
        String state = UUID.randomUUID().toString();

        AuthorizationRequest authorizationRequest = new AuthorizationRequest(responseTypes, clientId, scopes,
                redirectUri + "?foo2=bar", null);
        authorizationRequest.setAuthUsername(userId);
        authorizationRequest.setAuthPassword(userSecret);
        authorizationRequest.setState(state);

        AuthorizeClient authorizeClient = new AuthorizeClient(authorizationEndpoint);
        authorizeClient.setRequest(authorizationRequest);
        AuthorizationResponse authorizationResponse = authorizeClient.exec();

        showClient(authorizeClient);
        assertEquals(authorizationResponse.getStatus(), 400, "Unexpected response code: " + authorizationResponse.getStatus());
        assertNotNull(authorizationResponse.getErrorType(), "The error type is null");
        assertNotNull(authorizationResponse.getErrorDescription(), "The error description is null");
    }
}


text:
'use strict';

angular.module('app')
    .controller('ProductoController', ProductoController);

/** @ngInject */
function ProductoController($scope) {

    $scope.prodSelection = 'bebidas';

    $scope.choose = function(option){
        $scope.prodSelection = option;
    };

}


text:
.class Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;
.super Landroid/widget/BaseAdapter;
.source "HistoryActivity.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/sec/android/app/camera/HistoryActivity;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "HistoryListAdapter"
.end annotation

# instance fields
.field private mName:Landroid/widget/TextView;

.field private mPhoto:Landroid/widget/ImageView;

.field private mdate:Landroid/widget/TextView;

.field private micon:Landroid/widget/ImageView;

.field final synthetic this$0:Lcom/sec/android/app/camera/HistoryActivity;

# direct methods
.method private constructor <init>(Lcom/sec/android/app/camera/HistoryActivity;)V
    .locals 0
    .parameter

    .prologue
    .line 184
    iput-object p1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->this$0:Lcom/sec/android/app/camera/HistoryActivity;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/sec/android/app/camera/HistoryActivity;Lcom/sec/android/app/camera/HistoryActivity$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 184
    invoke-direct {p0, p1}, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;-><init>(Lcom/sec/android/app/camera/HistoryActivity;)V

    return-void
.end method

# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 191
    iget-object v0, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->this$0:Lcom/sec/android/app/camera/HistoryActivity;

    iget-object v0, v0, Lcom/sec/android/app/camera/HistoryActivity;->mList:Ljava/util/List;

    if-eqz v0, :cond_0

    .line 192
    iget-object v0, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->this$0:Lcom/sec/android/app/camera/HistoryActivity;

    iget-object v0, v0, Lcom/sec/android/app/camera/HistoryActivity;->mList:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    .line 194
    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .parameter "position"

    .prologue
    .line 234
    const/4 v0, 0x0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .parameter "position"

    .prologue
    .line 240
    const-wide/16 v0, 0x0

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    .line 199
    if-nez p2, :cond_0

    .line 200
    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->this$0:Lcom/sec/android/app/camera/HistoryActivity;

    invoke-static {v1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v1

    const v2, 0x7f03000a

    const/4 v3, 0x0

    invoke-virtual {v1, v2, p3, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p2

    .line 203
    :cond_0
    const v1, 0x7f0b0017

    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    iput-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->mPhoto:Landroid/widget/ImageView;

    .line 204
    const v1, 0x7f0b0012

    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iput-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->mName:Landroid/widget/TextView;

    .line 205
    const v1, 0x7f0b001a

    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    iput-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->micon:Landroid/widget/ImageView;

    .line 206
    const v1, 0x7f0b001b

    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iput-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->mdate:Landroid/widget/TextView;

    .line 208
    const/4 v1, -0x1

    if-le p1, v1, :cond_2

    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->this$0:Lcom/sec/android/app/camera/HistoryActivity;

    iget-object v1, v1, Lcom/sec/android/app/camera/HistoryActivity;->mList:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-ge p1, v1, :cond_2

    .line 209
    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->this$0:Lcom/sec/android/app/camera/HistoryActivity;

    iget-object v1, v1, Lcom/sec/android/app/camera/HistoryActivity;->mList:Ljava/util/List;

    invoke-interface {v1, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/samsung/dmc/ux/db/ProcessInfo;

    .line 210
    .local v0, infor:Lcom/samsung/dmc/ux/db/ProcessInfo;
    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->mName:Landroid/widget/TextView;

    invoke-virtual {v0}, Lcom/samsung/dmc/ux/db/ProcessInfo;->getStrOtherUserName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 211
    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->mdate:Landroid/widget/TextView;

    invoke-virtual {v0}, Lcom/samsung/dmc/ux/db/ProcessInfo;->getCompleteTime()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 212
    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->this$0:Lcom/sec/android/app/camera/HistoryActivity;

    #getter for: Lcom/sec/android/app/camera/HistoryActivity;->done:Z
    invoke-static {v1}, Lcom/sec/android/app/camera/HistoryActivity;->access$200(Lcom/sec/android/app/camera/HistoryActivity;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 213
    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->this$0:Lcom/sec/android/app/camera/HistoryActivity;

    iget-object v1, v1, Lcom/sec/android/app/camera/HistoryActivity;->mThumbnails:Ljava/util/HashMap;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    if-nez v1, :cond_3

    .line 214
    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->mPhoto:Landroid/widget/ImageView;

    const v2, 0x7f02026b

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 218
    :cond_1
    :goto_0
    invoke-virtual {v0}, Lcom/samsung/dmc/ux/db/ProcessInfo;->getTotalPercent()J

    move-result-wide v1

    const-wide/16 v3, 0x1

    cmp-long v1, v1, v3

    if-eqz v1, :cond_4

    .line 219
    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->micon:Landroid/widget/ImageView;

    const v2, 0x7f020231

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 227
    .end local v0           #infor:Lcom/samsung/dmc/ux/db/ProcessInfo;
    :cond_2
    :goto_1
    return-object p2

    .line 216
    .restart local v0       #infor:Lcom/samsung/dmc/ux/db/ProcessInfo;
    :cond_3
    iget-object v2, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->mPhoto:Landroid/widget/ImageView;

    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->this$0:Lcom/sec/android/app/camera/HistoryActivity;

    iget-object v1, v1, Lcom/sec/android/app/camera/HistoryActivity;->mThumbnails:Ljava/util/HashMap;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v1, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/graphics/Bitmap;

    invoke-virtual {v2, v1}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    goto :goto_0

    .line 221
    :cond_4
    invoke-virtual {v0}, Lcom/samsung/dmc/ux/db/ProcessInfo;->getTaskType()Lcom/samsung/dmc/ux/db/ProcessInfo$GSFileTaskType;

    move-result-object v1

    sget-object v2, Lcom/samsung/dmc/ux/db/ProcessInfo$GSFileTaskType;->RECV_TASK:Lcom/samsung/dmc/ux/db/ProcessInfo$GSFileTaskType;

    if-ne v1, v2, :cond_5

    .line 222
    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->micon:Landroid/widget/ImageView;

    const v2, 0x7f020230

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setImageResource(I)V

    goto :goto_1

    .line 223
    :cond_5
    invoke-virtual {v0}, Lcom/samsung/dmc/ux/db/ProcessInfo;->getTaskType()Lcom/samsung/dmc/ux/db/ProcessInfo$GSFileTaskType;

    move-result-object v1

    sget-object v2, Lcom/samsung/dmc/ux/db/ProcessInfo$GSFileTaskType;->SEND_TASK:Lcom/samsung/dmc/ux/db/ProcessInfo$GSFileTaskType;

    if-ne v1, v2, :cond_2

    .line 224
    iget-object v1, p0, Lcom/sec/android/app/camera/HistoryActivity$HistoryListAdapter;->micon:Landroid/widget/ImageView;

    const v2, 0x7f02022f

    invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setImageResource(I)V

    goto :goto_1
.end method


text:
class Report < Hash
  def initialize(created_at = nil)
    send(:[]=, :created_at, created_at.to_s)
  end
end


text:
#!/bin/bash

source "/home/pi/RetroPie-Setup/scriptmodules/inifuncs.sh"

function multiply() {
    echo "Multiplying $1 x $2 with bc, storing raw float value in ANS_FLOAT, storing rounded integer in ANS"
    ANS_FLOAT=$(echo "${1}*${2}" |bc)
    printf -v ANS %.0f "$ANS_FLOAT"
}

function fancy_console_message() {
#Parameters: consoleMessage optionalCowsayFile
    consoleMessage="$1"
    if [ -z "$2" ]
    then
        cowsay "$consoleMessage"
    else
        cowsay -f "$2" "$consoleMessage"
    fi
    echo "$consoleMessage"
}

function reset_permissions_bios_and_roms() {
    echo Resetting permissions on roms and BIOS folders...
    sudo chmod -R 755 /home/pi/RetroPie
}

function rsync_with_progress() {
    echo "rsync with progress by file count, local filesystems only..."
    RSYNC="ionice -c3 rsync"
    # don't use --progress
    RSYNC_ARGS="-axv --stats --human-readable"
    SOURCES="$1"
    TARGET="$2"

    echo "Executing dry-run to see how many files must be transferred..."
    TODO=$(${RSYNC} --dry-run ${RSYNC_ARGS} ${SOURCES} ${TARGET}|grep "^Number of files transferred"|awk '{print $5}')
    #TODO=$(find ${SOURCES} | wc -l)
    echo "$TODO files counted to sync..."

    ${RSYNC} ${RSYNC_ARGS} ${SOURCES} ${TARGET} | pv -l -e -p -s "$TODO"
    #ionice -c3 rsync -xvrltD --delete --stats --human-readable "$1" "$2" | pv -l -e -p -s "$TODO"
}

function ask_for_user_input_and_store_result() {
    echo Parameters for this function are, in order:
    echo Title Backtitle InputBoxTitle optionalIsPassword optionalHeight optionalWidth optionalDefaultValue
    echo The result will be stored in the global variable named RESULT
    echo The user selection code will be stored in the global variable SEL if needed

    if [ -z "$4" ]
    then
        echo "No optionalIsPassword supplied, defaulting to isNotPassword 0"
        isPassword=0
    else
        isPassword=$4
    fi

    if [ -z "$5" ]
    then
        height=0
    else
        height=$5
    fi

    if [ -z "$6" ]
    then
        width=0
    else
        width=$6
    fi

    if [ -z "$7" ]
    then
        defaultValue=""
    else
        defaultValue="$7"
    fi

    if [ $isPassword -eq 1 ]
    then
        dialog --title "$1" --backtitle "$2" --passwordbox "$3" $height $width 2>/tmp/input.$$
    else
        dialog --title "$1" --backtitle "$2" --inputbox "$3" $height $width "$defaultValue" 2>/tmp/input.$$
    fi

    SEL=$?
    RESULT=`cat /tmp/input.$$`
    case $SEL in
        0) echo "RESULT obtained: $RESULT" ;;
        1) echo "Cancel pressed" ;;
        255) echo "[ESCAPE] key pressed" ;;
    esac
    rm -f /tmp/input.$$

}

function create_megarc_login_file() {
    echo Parameters for this function are: email password
    email="$1"
    password="$2"
    echo "Creating your .megarc file from provided email $email and not printing your password out of courtesy, you are welcome..."
    cat > /home/pi/.megarc << _EOF_
[Login]
Username = $email
Password = $password
_EOF_
}

function prepare_to_directly_run_retropie_script_modules() {
    # global variables ==========================================================

    # main retropie install location
    rootdir="/opt/retropie"

    user="$SUDO_USER"
    [[ -z "$user" ]] && user=$(id -un)

    home="$(eval echo ~$user)"
    datadir="$home/RetroPie"
    biosdir="$datadir/BIOS"
    romdir="$datadir/roms"
    emudir="$rootdir/emulators"
    configdir="$rootdir/configs"

    scriptdir="/home/pi/RetroPie-Setup"
    __logdir="$scriptdir/logs"
    __tmpdir="$scriptdir/tmp"
    __builddir="$__tmpdir/build"
    __swapdir="$__tmpdir"

    # check, if sudo is used
    if [[ $(id -u) -ne 0 ]]; then
    echo "Script must be run as root. Try 'sudo $0'"
    exit 1
    fi

    __backtitle="PetRockBlock.com - RetroPie Setup. Installation folder: $rootdir for user $user"

    source "$scriptdir/scriptmodules/system.sh"
    source "$scriptdir/scriptmodules/helpers.sh"
    source "$scriptdir/scriptmodules/packages.sh"
    source "$scriptdir/scriptmodules/admin/setup.sh"

    setup_env

    # set default gcc version
    gcc_version "$__default_gcc_version"

    mkUserDir "$romdir"
    mkUserDir "$biosdir"

    rp_registerAllModules

    ensureFBMode 320 240

}

function download_install_mega_module_on_the_fly() {
    echo "Function download_install_mega_module_on_the_fly() with parameters:"
    echo "Mega module / archive name: $1"
    archiveName="$1"
    echo "Install location: $2"
    installLocation="$2"
    echo "Archive size in bytes: $3"
    archiveSize="$3"
    echo "Mega DL link: $4"
    megaLink="$4"

    if [ -z "$5" ]
    then
        echo "No stripComponentCount supplied, defaulting to stripComponentCount 0"
        stripComponentCount=0
    else
        stripComponentCount=$5
    fi
    echo "Stripping Component Count: $stripComponentCount"

    echo "Checking for at least enough free space to contain the archive size * 1.5 average expansion factor..."
    multiply $archiveSize 1.5
    confirmRequiredDiskSpaceMB $((ANS/1024/1024))

    message="Downloading and installing $archiveName mega module on-the-fly with no archive or temp files..."
    echo "$message"
    cowsay -f flaming-sheep "$message"

    mkdir -p "$installLocation"
    pushd "$installLocation"

    echo Downloading archive from Mega and decompressing it on the fly...

    if [ $stripComponentCount -gt 0 ]
    then
        megadl --no-progress --path=- "$megaLink" | pv -p -s "$archiveSize" | tar xvj --strip-components=$stripComponentCount
    else
        megadl --no-progress --path=- "$megaLink" | pv -p -s "$archiveSize" | tar xvj
    fi

    popd
    echo If you saw any errors, you might consider running a quickUpdatePrimestationOneFiles.sh to ensure you have the latest mega dl link in this script...
}

function download_install_mega_archive_from_cloud_storage_on_the_fly() {
    echo "Function download_install_mega_archive_from_cloud_storage_on_the_fly() with parameters:"
    echo "1: Mega module / archive name: $1"
    archiveName="$1"
    echo "2: Install location: $2"
    installLocation="$2"
    echo "3: Archive size in bytes: $3"
    archiveSize="$3"
    echo "4: Mega file location: $4"
    megaLink="$4"

    if [ -z "$5" ]
    then
        echo "No stripComponentCount supplied, defaulting to stripComponentCount 0"
        stripComponentCount=0
    else
        stripComponentCount=$5
    fi
    echo "5: Stripping Component Count: $stripComponentCount"

    echo "Checking for at least enough free space to contain the archive size * 1.5 average expansion factor..."
    multiply $archiveSize 1.5
    confirmRequiredDiskSpaceMB $((ANS/1024/1024))

    message="Downloading and installing $archiveName mega module on-the-fly with no archive or temp files..."
    echo "$message"
    cowsay -f flaming-sheep "$message"

    mkdir -p "$installLocation"
    pushd "$installLocation"

    echo Downloading archive from Mega and decompressing it on the fly...

    if [ $stripComponentCount -gt 0 ]
    then
        megaget --no-progress --path=- "$megaLink" | pv -p -s "$archiveSize" | tar xvj --strip-components=$stripComponentCount
    else
        megaget --no-progress --path=- "$megaLink" | pv -p -s "$archiveSize" | tar xvj
    fi

    popd
}

function cloud_create_backup_archive {
    echo "Function cloud_create_backup_archive() with parameters:"
    echo "1: Full path to BACKUPARCHIVEFILE: $1"
    BACKUPARCHIVEFILE="$1"

    echo "Clearing any current archive with this name: $BACKUPARCHIVEFILE.tar and $BACKUPARCHIVEFILE.tar.bz2"
    rm "$BACKUPARCHIVEFILE.tar"
    rm "$BACKUPARCHIVEFILE.tar.bz2"

    echo Finding and updating your archove of save states and SRAM files...
    for saveStateFile in /home/pi/RetroPie/roms/*/*.state*; do
        echo "Archiving saveStateFile $saveStateFile..."
        tar --append --file="$BACKUPARCHIVEFILE.tar" "$saveStateFile"
    done

    for SRAMFile in /home/pi/RetroPie/roms/*/*.srm; do
        echo "Archiving SRAMFile $SRAMFile..."
        tar --append --file="$BACKUPARCHIVEFILE.tar" "$SRAMFile"
    done

    echo Backing up any Dreamcast VMUs and controller configs you may have...
    for DcDataFile in /home/pi/.reicast/*; do
        echo "Archiving DcDataFile $DcDataFile..."
        tar --append --file="$BACKUPARCHIVEFILE.tar" "$DcDataFile"
    done

#TODO: Handle Dreamcast VMU cloud backups as they are not in the same folder structure
#    for DreamcastVmuFile in /opt/retropie/emulators/reicast/vmu*.bin; do
#        echo "Archiving Dreamcast VMU file $DreamcastVmuFile..."
#        tar --append --file="$BACKUPARCHIVEFILE.tar" "$DreamcastVmuFile"
#    done

    echo "Compressing your save file $BACKUPARCHIVEFILE.tar to $BACKUPARCHIVEFILE.tar.bz2..."
    compressBz2.sh "$BACKUPARCHIVEFILE.tar"
}

function ask() {
    echo -e -n "$@" '[y/n] ' ; read ans
    case "$ans" in
        y*|Y*) return 0 ;;
        *) return 1 ;;
    esac
}

function confirmRequiredDiskSpaceMB() {
    echo "Function confirmRequiredDiskSpaceMB(), parameters:"
    echo "1: RequiredDiskSpaceInMB: $1"
    required_MB=$1
    echo "2: Optional location to check space on: $2"
    if [ -z "$2" ]
    then
        rootdir="/opt/retropie"
        echo "Optional location to check space on, defaulting to $rootdir"
    else
        rootdir="$2"
    fi
    local rootdirExists=0
    if [[ ! -d "$rootdir" ]]; then
        rootdirExists=1
        mkdir -p $rootdir
    fi
    local __avail=$(df -P $rootdir | tail -n1 | awk '{print $4}')
    if [[ $rootdirExists -eq 1 ]]; then
        rmdir $rootdir
    fi

    available_MB=$((__avail/1024))

    if [[ "$required_MB" -le "$available_MB" ]] || ask "Minimum recommended disk space ($required_MB MB) not available. Try 'sudo raspi-config' to resize partition to full size if you have not yet done so. Only $available_MB MB available at $rootdir continue anyway?"; then
        return 0;
    else
        exit 0;
    fi
}

function generateControllerOverlay() {
    echo "Function generateControllerOverlay() called with parameters:"
    echo "1: Output file location: $1"
    if [ -z "$1" ]
    then
        outputImageFile="/home/pi/splashscreenwithcontrolsandversion.png"
    else
        outputImageFile="$1"
    fi

    echo "2: Controller Map text file location: $2"
    if [ -z "$2" ]
    then
        controlMapFile="/home/pi/primestationone/reference/txt/controlsMappingOverlay.txt"
    else
        controlMapFile="$2"
    fi
    controlsMappingOverlay=$(cat "$controlMapFile")
    controlsMappingTextColor=$(cat /home/pi/primestationone/reference/txt/controlsMappingTextColor.txt)

    echo "3: Right text overlay text file location: $3"
    if [ -z "$3" ]
    then
        rightTextFile="/home/pi/primestationone/reference/txt/listOfLibRetroCores.txt"
    else
        rightTextFile="$3"
    fi
    listOfLibRetroCores=$(cat "$rightTextFile")
    colorOfLibRetroCores=$(cat /home/pi/primestationone/reference/txt/listOfLibRetroCoresColor.txt)

    primestationVersion=$(cat /home/pi/primestationone/reference/txt/version.txt)
    primestationVerColor=$(cat /home/pi/primestationone/reference/txt/vercolor.txt)
    keysToQuitEmusList=$(cat /home/pi/primestationone/reference/txt/keysToQuitEmus.txt)
    colorKeysToQuitEmus=$(cat /home/pi/primestationone/reference/txt/keysToQuitEmusColor.txt)
    echo "PrimeStation One $primestationVersion updating splashscreen version text overlay with $primestationVersion in color $primestationVerColor..."
    echo "...and a $controlsMappingTextColor controlsMappingOverlay: "
    echo "$controlsMappingOverlay"
    echo "...and a $colorOfLibRetroCores listOfLibRetroCores: "
    echo "$listOfLibRetroCores"
    echo "...and a $colorKeysToQuitEmus keysToQuitEmusList: "
    echo "$keysToQuitEmusList"
    echo "More info on the process at http://www.instructables.com/id/Add-text-to-images-with-Linux-convert-command/?ALLSTEPS"
    echo "......"
    convert -font courier-bold -pointsize 44 -fill "$primestationVerColor" -draw "text 1600,45 \"$primestationVersion\"" -pointsize 32 -fill "$controlsMappingTextColor" -draw "text 12,260 \"$controlsMappingOverlay\"" -pointsize 30 -fill "$colorOfLibRetroCores" -draw "text 1560,260 \"$listOfLibRetroCores\"" -pointsize 20 -fill "$colorKeysToQuitEmus" -draw "text 810,245 \"$keysToQuitEmusList\"" /home/pi/splashscreen.png "$outputImageFile"
    echo "Complete, if you didn't just see any errors."
}

function addLineToEndOfFileIfNOtExist() {
    LINE="$1"
    FILE="$2"
    if [ -z "$2" ]
    then
        echo "This function requires 2 parameters: LINE and FILE"
        echo "...if LINE does not exist in FILE, insert LINE at end of FILE."
    else
        echo "If $LINE does not exist in $FILE, inserting $LINE at end of $FILE..."
        grep -q "$LINE" "$FILE" || echo "$LINE" >> "$FILE"
    fi
}


text:
using System;
using System.Collections;
using Approve.EntityBase;
using System.Data;

namespace Approve.EntityCenter
{
    [Serializable]
    public class EbFindPerson : EEnterpriseBase
    {
        public EbFindPerson():base()
		{
            m_EntityType = EntityTypeEnum.EbFindPerson;
		}

		public EbFindPerson(IDictionary iDictionary):base(iDictionary)
		{
            m_EntityType = EntityTypeEnum.EbFindPerson;
		}

		public EbFindPerson(DataRow dr):base(dr)
		{
            m_EntityType = EntityTypeEnum.EbFindPerson;
		}

        public EbFindPerson(DataRow dr, IDictionary rel)
            : base(dr, rel)
		{
            m_EntityType = EntityTypeEnum.EbFindPerson;
		}
        public string FBaseInfoId
        {
            get { return EConvert.ToString(base.GetProperty("FBaseInfoId")); }
            set { base.SetProperty("FBaseInfoId", value); }
        }
        public string FPositionDesc
        {
            get { return EConvert.ToString(base.GetProperty("FPositionDesc")); }
            set { base.SetProperty("FPositionDesc", value); }
        }
        public string FPosition
        {
            get { return EConvert.ToString(base.GetProperty("FPosition")); }
            set { base.SetProperty("FPosition", value); }
        }
        public string FDepartment
        {
            get { return EConvert.ToString(base.GetProperty("FDepartment")); }
            set { base.SetProperty("FDepartment", value); }
        }
        public string FAddress
        {
            get { return EConvert.ToString(base.GetProperty("FAddress")); }
            set { base.SetProperty("FAddress", value); }
        }
        public int FCount
        {
            get { return EConvert.ToInt(base.GetProperty("FCount")); }
            set { base.SetProperty("FCount", value); }
        }
        public int FWorkYear
        {
            get { return EConvert.ToInt(base.GetProperty("FWorkYear")); }
            set { base.SetProperty("FWorkYear", value); }
        }
        public string FDegree
        {
            get { return EConvert.ToString(base.GetProperty("FDegree")); }
            set { base.SetProperty("FDegree", value); }
        }
        public string FAward
        {
            get { return EConvert.ToString(base.GetProperty("FAward")); }
            set { base.SetProperty("FAward", value); }
        }
        public string FPubDate
        {
            get { return EConvert.ToString(base.GetProperty("FPubDate")); }
            set { base.SetProperty("FPubDate", value); }
        }
        public string FAppRequire
        {
            get { return EConvert.ToString(base.GetProperty("FAppRequire")); }
            set { base.SetProperty("FAppRequire", value); }
        }
    }
}


text:
import asyncio
import discord
import json
import os
import pickle
import sys
import time
from datetime import datetime
from random import randint
import urllib.request
import urllib.response
import urllib.error

#Adding commands
def add_command(message):

    commands = pickle.load(open("{}/commands.txt".format(str(message.server)),"rb"))
    commands_array = pickle.load(open("{}/commands_array.txt".format(str(message.server)),"rb"))
    """
    Hypothetically, I could have the bot add commands to itself. What a world.
    """
    valid = True
    adding_command = message.content.split()
    adding_command[1] = adding_command[1].lower()
    if len(adding_command) < 3:
        return "Invalid amount of parameters"
    elif adding_command[1] in commands:
        return "That command already exists"
    else:
        if message.content.find("#random") != -1:
            try:
                number = int(message.content[message.content.find("#random")+7])
            except ValueError:
                return "Invalid #random value"
            except IndexError:
                return "Invalid #random value"
        command = adding_command[1]
        if "#" in command:
            command = command.replace("#", " ")
        if len(adding_command) == 3:
            pass
        else:
            for i in range(3,len(adding_command)):
                adding_command[2] += " " + adding_command[i]

        command_text = adding_command[2]
        commands[command] = command_text
        commands_array.append(command)

        pickle.dump(commands, open("{}/commands.txt".format(str(message.server)), "wb"))
        pickle.dump(commands_array, open("{}/commands_array.txt".format(str(message.server)), "wb"))
        return "Command added"

#Deleting commands
def delete_command(message, command):

    commands = pickle.load(open("{}/commands.txt".format(str(message.server)),"rb"))
    commands_array = pickle.load(open("{}/commands_array.txt".format(str(message.server)),"rb"))
    """
    There are times I may want to delete a command, when the user hasn't specified so.
    E.g. if a user creates an invalid command (such as using #random without a number), it will be deleted.
    """
    message.content = message.content.lower()
    if "#" in command:
        command = command.replace("#", " ")
    if command not in commands:
        pass#yield from client.send_message(message.channel, "Command does not exist.")
    else:
        del commands[command]
        commands_array.remove(command)
        pickle.dump(commands, open("{}/commands.txt".format(str(message.server)), "wb"))
        pickle.dump(commands_array, open("{}/commands_array.txt".format(str(message.server)),"wb"))

#Editing/replacing commands
def edit_command(message):

    commands = pickle.load(open("{}/commands.txt".format(str(message.server)),"rb"))
    commands_array = pickle.load(open("{}/commands_array.txt".format(str(message.server)),"rb"))
    """
    Consistency with the command addition/deletion features.
    """
    rep_command = message.content.split()
    if rep_command[1] not in commands:
        return "That command does not exist to be replaced"
    else:
        if len(rep_command) < 3:
            return "Invalid amount of parameters"
        else:
            command = rep_command[1]
            if len(rep_command) == 3:
                pass
            else:
                for i in range(3,len(rep_command)):
                    rep_command[2] += " " + rep_command[i]

            command_text = rep_command[2]
            commands[command] = command_text

            pickle.dump(commands, open("{}/commands.txt".format(str(message.server)), "wb"))
            pickle.dump(commands_array, open("{}/commands_array.txt".format(str(message.server)), "wb"))

            return "Command replaced"


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="@dimen/activity_horizontal_margin"
    android:padding="@dimen/activity_horizontal_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:showIn="@layout/settings_profile">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/selectableItemBackground"
            android:clickable="true"
            android:padding="@dimen/activity_horizontal_margin">

            <ImageView
                android:id="@+id/ivContactItem1"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/activity_horizontal_margin"
                android:layout_marginRight="@dimen/activity_horizontal_margin"
                android:src="@drawable/ic_account_circle_black_24dp" />

            <TextView
                android:id="@+id/name_account"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_toEndOf="@id/ivContactItem1"
                android:layout_toRightOf="@id/ivContactItem1"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                android:textColor="#212121" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/name_account"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_marginTop="8dp"
                android:layout_toEndOf="@id/ivContactItem1"
                android:layout_toRightOf="@id/ivContactItem1"
                android:text="Benutzername"
                android:textAppearance="@style/TextAppearance.AppCompat.Small"
                android:textColor="#727272" />

            <ToggleButton
                android:id="@+id/chkState1"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:checked="true"
                android:padding="6dp"
                android:visibility="invisible"
                android:textOff=""
                android:textOn="" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/selectableItemBackground"
            android:clickable="true"
            android:padding="@dimen/activity_horizontal_margin">

            <ImageView
                android:id="@+id/ivContactItem2"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/activity_horizontal_margin"
                android:layout_marginRight="@dimen/activity_horizontal_margin"
                android:src="@drawable/ic_email_black_24dp"
                />

            <TextView
                android:id="@+id/email_account"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_toEndOf="@id/ivContactItem2"
                android:layout_toRightOf="@id/ivContactItem2"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                android:textColor="#212121" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/email_account"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_marginTop="8dp"
                android:layout_toEndOf="@id/ivContactItem2"
                android:layout_toRightOf="@id/ivContactItem2"
                android:text="Email"
                android:textAppearance="@style/TextAppearance.AppCompat.Small"
                android:textColor="#727272" />

            <ToggleButton
                android:id="@+id/chkState2"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:checked="false"
                android:padding="6dp"
                android:visibility="invisible"
                android:textOff=""
                android:textOn="" />

        </RelativeLayout>

        <include layout="@layout/item_divider" />

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/selectableItemBackground"
            android:clickable="true"
            android:padding="@dimen/activity_horizontal_margin">

            <ImageView
                android:id="@+id/ivContactItem3"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/activity_horizontal_margin"
                android:layout_marginRight="@dimen/activity_horizontal_margin"
                android:src="@drawable/ic_local_library_black_24dp" />

            <TextView
                android:id="@+id/major_account"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_toEndOf="@id/ivContactItem3"
                android:layout_toLeftOf="@+id/chkState3"
                android:layout_toRightOf="@id/ivContactItem3"
                android:layout_toStartOf="@+id/chkState3"
                android:ellipsize="end"
                android:maxLines="1"
                android:text="Nicht angegeben"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                android:textColor="#212121" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/major_account"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_marginTop="8dp"
                android:layout_toEndOf="@id/ivContactItem3"
                android:layout_toRightOf="@id/ivContactItem3"
                android:text="Studiengang"
                android:textAppearance="@style/TextAppearance.AppCompat.Small"
                android:textColor="#727272" />

            <ToggleButton
                android:id="@+id/chkState3"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:background="@drawable/placeholder"
                android:checked="true"
                android:padding="6dp"
                android:visibility="invisible"
                android:textOff=""
                android:textOn="" />

        </RelativeLayout>

        <include layout="@layout/item_divider" />

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/selectableItemBackground"
            android:clickable="true"
            android:padding="@dimen/activity_horizontal_margin">

            <ImageView
                android:id="@+id/ivContactItem4"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/activity_horizontal_margin"
                android:layout_marginRight="@dimen/activity_horizontal_margin"
                android:src="@drawable/ic_group_black_24dp" />

            <TextView
                android:id="@+id/groupsCount"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_toEndOf="@id/ivContactItem4"
                android:layout_toLeftOf="@+id/chkState4"
                android:layout_toRightOf="@id/ivContactItem4"
                android:layout_toStartOf="@+id/chkState4"
                android:ellipsize="end"
                android:maxLines="1"
                android:text="0"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                android:textColor="#212121" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/groupsCount"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_marginTop="8dp"
                android:layout_toEndOf="@id/ivContactItem4"
                android:layout_toRightOf="@id/ivContactItem4"
                android:text="Beigetretene Gruppen"
                android:textAppearance="@style/TextAppearance.AppCompat.Small"
                android:textColor="#727272" />

            <ToggleButton
                android:id="@+id/chkState4"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:background="@drawable/placeholder"
                android:checked="true"
                android:padding="6dp"
                android:visibility="invisible"
                android:textOff=""
                android:textOn="" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/selectableItemBackground"
            android:clickable="true"
            android:padding="@dimen/activity_horizontal_margin">

            <ImageView
                android:id="@+id/ivContactItem5"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/activity_horizontal_margin"
                android:layout_marginRight="@dimen/activity_horizontal_margin"
                android:src="@drawable/ic_note_black_24dp" />

            <TextView
                android:id="@+id/notesCount"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_toEndOf="@id/ivContactItem5"
                android:layout_toLeftOf="@+id/chkState5"
                android:layout_toRightOf="@id/ivContactItem5"
                android:layout_toStartOf="@+id/chkState5"
                android:ellipsize="end"
                android:maxLines="1"
                android:text="0"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                android:textColor="#212121" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/notesCount"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_marginTop="8dp"
                android:layout_toEndOf="@id/ivContactItem5"
                android:layout_toRightOf="@id/ivContactItem5"
                android:text="Gepostete Notizen"
                android:textAppearance="@style/TextAppearance.AppCompat.Small"
                android:textColor="#727272" />

            <ToggleButton
                android:id="@+id/chkState5"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:background="@drawable/placeholder"
                android:checked="true"
                android:padding="6dp"
                android:visibility="invisible"
                android:textOff=""
                android:textOn="" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/selectableItemBackground"
            android:clickable="true"
            android:padding="@dimen/activity_horizontal_margin">

            <ImageView
                android:id="@+id/ivContactItem6"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/activity_horizontal_margin"
                android:layout_marginRight="@dimen/activity_horizontal_margin"
                android:src="@drawable/ic_star_black_24dp" />

            <TextView
                android:id="@+id/favCount"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_toEndOf="@id/ivContactItem6"
                android:layout_toLeftOf="@+id/chkState6"
                android:layout_toRightOf="@id/ivContactItem6"
                android:layout_toStartOf="@+id/chkState6"
                android:ellipsize="end"
                android:maxLines="1"
                android:text="0"
                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                android:textColor="#212121" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/favCount"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:layout_marginTop="8dp"
                android:layout_toEndOf="@id/ivContactItem6"
                android:layout_toRightOf="@id/ivContactItem6"
                android:text="Gelikete Notizen"
                android:textAppearance="@style/TextAppearance.AppCompat.Small"
                android:textColor="#727272" />

            <ToggleButton
                android:id="@+id/chkState6"
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_marginStart="@dimen/activity_horizontal_margin"
                android:background="@drawable/placeholder"
                android:checked="true"
                android:padding="6dp"
                android:visibility="invisible"
                android:textOff=""
                android:textOn="" />

        </RelativeLayout>

        <include layout="@layout/item_divider" />

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>


text:
package org.springframework.social.bitbucket.utils;

import java.util.Date;

/**
 * Shared code to manipulate Date objects
 *
 * @author Cyprian Śniegota
 * @since 2.0.0
 */
public final class DateUtils {

    private DateUtils() { }

    /**
     * Clone Date object
     *
     * @param dateToCopy A date to copy (could be null)
     * @return null or copy of the given Date object
     */
    public static Date copyNullable(Date dateToCopy) {
        return dateToCopy == null ? null : new Date(dateToCopy.getTime());
    }
}


text:
<!DOCTYPE html>

	<meta charset="utf-8"/>
	<title>Linked Lists</title>
	<meta name="description" content="" />

Linked Lists

Get Adobe Flash player


text:
#include <thrift/lib/cpp2/server/Cpp2Connection.h>

#include <thrift/lib/cpp/async/TEventConnection.h>
#include <thrift/lib/cpp/async/TAsyncSocket.h>
#include <thrift/lib/cpp2/server/ThriftServer.h>
#include <thrift/lib/cpp2/server/Cpp2Worker.h>
#include <thrift/lib/cpp2/security/SecurityKillSwitch.h>
#include <thrift/lib/cpp2/protocol/BinaryProtocol.h>

#include <assert.h>

namespace apache { namespace thrift {

using namespace apache::thrift::protocol;
using namespace apache::thrift::server;
using namespace apache::thrift::transport;
using namespace apache::thrift::concurrency;
using namespace apache::thrift::async;
using namespace std;
using apache::thrift::TApplicationException;

const std::string Cpp2Connection::loadHeader{"load"};

Cpp2Connection::Cpp2Connection(
  const std::shared_ptr<TAsyncSocket>& asyncSocket,
  const folly::SocketAddress* address,
  Cpp2Worker* worker,
  const std::shared_ptr<HeaderServerChannel>& serverChannel)
    : processor_(worker->getServer()->getCpp2Processor())
    , duplexChannel_(worker->getServer()->isDuplex() ?
        folly::make_unique<DuplexChannel>(
            DuplexChannel::Who::SERVER, asyncSocket) :
        nullptr)
    , channel_(serverChannel ? serverChannel :  // used by client
               duplexChannel_ ? duplexChannel_->getServerChannel() : // server
               std::shared_ptr<HeaderServerChannel>(
                   new HeaderServerChannel(asyncSocket),
                   folly::DelayedDestruction::Destructor()))
    , worker_(worker)
    , context_(address,
               asyncSocket.get(),
               channel_->getSaslServer(),
               worker->getServer()->getEventBaseManager(),
               duplexChannel_ ? duplexChannel_->getClientChannel() : nullptr)
    , socket_(asyncSocket)
    , threadManager_(worker_->getServer()->getThreadManager()) {

  channel_->setQueueSends(worker->getServer()->getQueueSends());
  channel_->setMinCompressBytes(worker_->getServer()->getMinCompressBytes());
  auto observer = worker->getServer()->getObserver();
  if (observer) {
    channel_->setSampleRate(observer->getSampleRate());
  }

  // Process the security kill switch.
  if (isSecurityKillSwitchEnabled() &&
      worker_->getServer()->getSaslPolicy() == "required") {
    // This means we downgrade only from "required" to "permitted, and don't
    // end up upgrading from "disabled" to "permitted"
    worker_->getServer()->setNonSaslEnabled(true);
  } else {
    // This is necessary for the server to revert back to old behavior once
    // kill switch has been removed after being turned on for some time.
    if (worker_->getServer()->getSaslPolicy() == "permitted") {
      worker_->getServer()->setNonSaslEnabled(true);
    } else {
      // sasl_policy is either "required" or "disabled"
      worker_->getServer()->setNonSaslEnabled(false);
    }
  }

  if (asyncSocket) {
    auto factory = worker_->getServer()->getSaslServerFactory();
    if (factory) {
      channel_->setSaslServer(
        unique_ptr<SaslServer>(factory(asyncSocket->getEventBase()))
      );
      // Refresh the saslServer_ pointer in context_
      context_.setSaslServer(channel_->getSaslServer());
    }
  }

  const bool downgradeSaslPolicy = address->isLoopbackAddress() &&
      worker_->getServer()->getAllowInsecureLoopback();

  if (worker_->getServer()->getSaslEnabled() &&
      (worker_->getServer()->getNonSaslEnabled() || downgradeSaslPolicy)) {
    channel_->setSecurityPolicy(THRIFT_SECURITY_PERMITTED);
  } else if (worker_->getServer()->getSaslEnabled()) {
    channel_->setSecurityPolicy(THRIFT_SECURITY_REQUIRED);
  } else {
    // If neither is set, act as if non-sasl was specified.
    channel_->setSecurityPolicy(THRIFT_SECURITY_DISABLED);
  }

  auto handler = worker->getServer()->getEventHandler();
  if (handler) {
    handler->newConnection(&context_);
  }
}

Cpp2Connection::~Cpp2Connection() {
  auto handler = worker_->getServer()->getEventHandler();
  if (handler) {
    handler->connectionDestroyed(&context_);
  }

  channel_.reset();
}

void Cpp2Connection::stop() {
  if (getConnectionManager()) {
    getConnectionManager()->removeConnection(this);
  }

  for (auto req : activeRequests_) {
    VLOG(1) << "Task killed due to channel close: " <<
      context_.getPeerAddress()->describe();
    req->cancelRequest();
    auto observer = worker_->getServer()->getObserver();
    if (observer) {
      observer->taskKilled();
    }
  }

  if (channel_) {
    channel_->setCallback(nullptr);

    // Release the socket to avoid long CLOSE_WAIT times
    channel_->closeNow();
  }

  socket_.reset();

  this_.reset();
}

void Cpp2Connection::timeoutExpired() noexcept {
  // Only disconnect if there are no active requests. No need to set another
  // timeout here because it's going to be set when all the requests are
  // handled.
  if (activeRequests_.empty()) {
    disconnect("idle timeout");
  }
}

void Cpp2Connection::disconnect(const char* comment) noexcept {
  // This must be the last call, it may delete this.
  folly::ScopeGuard guard = folly::makeGuard([&]{
    stop();
  });

  VLOG(1) << "ERROR: Disconnect: " << comment << " on channel: " <<
    context_.getPeerAddress()->describe();
  auto observer = worker_->getServer()->getObserver();
  if (observer) {
    observer->connDropped();
  }
}

void Cpp2Connection::requestTimeoutExpired() {
  VLOG(1) << "ERROR: Task expired on channel: " <<
    context_.getPeerAddress()->describe();
  auto observer = worker_->getServer()->getObserver();
  if (observer) {
    observer->taskTimeout();
  }
}

bool Cpp2Connection::pending() {
  return socket_ ? socket_->isPending() : false;
}

void Cpp2Connection::killRequest(
    ResponseChannel::Request& req,
    TApplicationException::TApplicationExceptionType reason,
    const std::string& errorCode,
    const char* comment) {
  VLOG(1) << "ERROR: Task killed: " << comment
          << ": " << context_.getPeerAddress()->getAddressStr();

  auto server = worker_->getServer();
  auto observer = server->getObserver();
  if (observer) {
    if (reason ==
         TApplicationException::TApplicationExceptionType::LOADSHEDDING) {
      observer->serverOverloaded();
    } else {
      observer->taskKilled();
    }
  }

  // Nothing to do for Thrift oneway request.
  if (req.isOneway()) {
    return;
  }

  auto header_req = static_cast<HeaderServerChannel::HeaderRequest*>(&req);

  // Thrift1 oneway request doesn't use ONEWAY_REQUEST_ID and
  // may end up here. No need to send error back for such requests
  if (!processor_->isOnewayMethod(req.getBuf(), header_req->getHeader())) {
    header_req->sendErrorWrapped(
        folly::make_exception_wrapper<TApplicationException>(reason,
                                                             comment),
        errorCode,
        nullptr);
  } else {
    // Send an empty response so reqId will be handled properly
    req.sendReply(std::unique_ptr<folly::IOBuf>());
  }
}

// Response Channel callbacks
void Cpp2Connection::requestReceived(
  unique_ptr<ResponseChannel::Request>&& req) {
  auto server = worker_->getServer();
  auto observer = server->getObserver();

  auto injectedFailure = server->maybeInjectFailure();
  switch (injectedFailure) {
  case ThriftServer::InjectedFailure::NONE:
    break;
  case ThriftServer::InjectedFailure::ERROR:
    killRequest(*req,
        TApplicationException::TApplicationExceptionType::INJECTED_FAILURE,
        kInjectedFailureErrorCode,
        "injected failure");
    return;
  case ThriftServer::InjectedFailure::DROP:
    VLOG(1) << "ERROR: injected drop: "
            << context_.getPeerAddress()->getAddressStr();
    return;
  case ThriftServer::InjectedFailure::DISCONNECT:
    disconnect("injected failure");
    return;
  }

  auto* hreq = static_cast<HeaderServerChannel::HeaderRequest*>(req.get());
  bool useHttpHandler = false;
  // Any POST not for / should go to the status handler
  if (hreq->getHeader()->getClientType() == THRIFT_HTTP_SERVER_TYPE) {
    auto buf = req->getBuf();
    // 7 == length of "POST / " - we are matching on the path
    if (buf->length() >= 7 &&
        0 == strncmp(reinterpret_cast<const char*>(buf->data()),
                     "POST",
                     4) &&
        buf->data()[6] != ' ') {
      useHttpHandler = true;
    }

    // Any GET should use the handler
    if (buf->length() >= 3 &&
        0 == strncmp(reinterpret_cast<const char*>(buf->data()),
                     "GET",
                     3)) {
      useHttpHandler = true;
    }

    // Any HEAD should use the handler
    if (buf->length() >= 4 &&
        0 == strncmp(reinterpret_cast<const char*>(buf->data()),
                     "HEAD",
                     4)) {
      useHttpHandler = true;
    }
  }

  if (useHttpHandler && worker_->getServer()->getGetHandler()) {
    worker_->getServer()->getGetHandler()(
        worker_->getEventBase(), socket_, req->extractBuf());

    // Close the channel, since the handler now owns the socket.
    channel_->setCallback(nullptr);
    channel_->setTransport(nullptr);
    stop();
    return;
  }

  if (worker_->getServer()->getGetHeaderHandler()) {
    worker_->getServer()->getGetHeaderHandler()(
        hreq->getHeader(), context_.getPeerAddress());
  }

  int activeRequests = worker_->activeRequests_;
  activeRequests += worker_->pendingCount();

  if (server->isOverloaded(activeRequests, hreq->getHeader())) {
    killRequest(*req,
        TApplicationException::TApplicationExceptionType::LOADSHEDDING,
        kOverloadedErrorCode,
        "loadshedding request");
    return;
  }

  server->incActiveRequests();
  if (req->timestamps_.readBegin != 0) {
    // Expensive operations; this happens once every
    // TServerCounters.sampleRate
    req->timestamps_.processBegin =
      apache::thrift::concurrency::Util::currentTimeUsec();
    if (observer) {
      observer->queuedRequests(threadManager_->pendingTaskCount());
      if (server->getIsUnevenLoad()) {
        observer->activeRequests(
          server->getActiveRequests() +
          server->getPendingCount());
      }
    }
  }

  unique_ptr<folly::IOBuf> buf = req->getBuf()->clone();
  unique_ptr<Cpp2Request> t2r(
    new Cpp2Request(std::move(req), this_));
  activeRequests_.insert(t2r.get());
  ++worker_->activeRequests_;

  if (observer) {
    observer->receivedRequest();
  }

  std::chrono::milliseconds softTimeout;
  std::chrono::milliseconds hardTimeout;
  auto differentTimeouts = server->getTaskExpireTimeForRequest(
    *(t2r->req_->getHeader()),
    softTimeout,
    hardTimeout
  );
  if (differentTimeouts) {
    DCHECK(softTimeout > std::chrono::milliseconds(0));
    DCHECK(hardTimeout > std::chrono::milliseconds(0));
    scheduleTimeout(&t2r->softTimeout_, softTimeout);
    scheduleTimeout(&t2r->hardTimeout_, hardTimeout);
  } else if (hardTimeout > std::chrono::milliseconds(0)) {
    scheduleTimeout(&t2r->hardTimeout_, hardTimeout);
  }

  auto reqContext = t2r->getContext();
  reqContext->setRequestTimeout(hardTimeout);

  try {
    auto protoId = static_cast<apache::thrift::protocol::PROTOCOL_TYPES>
      (t2r->req_->getHeader()->getProtocolId());
    processor_->process(std::move(t2r),
                        std::move(buf),
                        protoId,
                        reqContext,
                        worker_->getEventBase(),
                        threadManager_.get());
  } catch (...) {
    LOG(WARNING) << "Process exception: " <<
      folly::exceptionStr(std::current_exception());
    throw;
  }
}

void Cpp2Connection::channelClosed(folly::exception_wrapper&& ex) {
  // This must be the last call, it may delete this.
  folly::ScopeGuard guard = folly::makeGuard([&]{
    stop();
  });

  VLOG(4) << "Channel " <<
    context_.getPeerAddress()->describe() << " closed: " << ex.what();
}

void Cpp2Connection::removeRequest(Cpp2Request *req) {
  activeRequests_.erase(req);
  if (activeRequests_.empty()) {
    resetTimeout();
  }
}

Cpp2Connection::Cpp2Request::Cpp2Request(
    std::unique_ptr<ResponseChannel::Request> req,
    std::shared_ptr<Cpp2Connection> con)
  : req_(static_cast<HeaderServerChannel::HeaderRequest*>(req.release()))
  , connection_(con)
  , reqContext_(&con->context_, req_->getHeader()) {
  RequestContext::create();

  softTimeout_.request_ = this;
  hardTimeout_.request_ = this;

  const auto& headers = req_->getHeader()->getHeaders();
  auto it = headers.find(Cpp2Connection::loadHeader);
  if (it != headers.end()) {
    loadHeader_ = it->second;
  }
}

MessageChannel::SendCallback*
Cpp2Connection::Cpp2Request::prepareSendCallback(
    MessageChannel::SendCallback* sendCallback,
    apache::thrift::server::TServerObserver* observer) {
  // If we are sampling this call, wrap it with a Cpp2Sample, which also
  // implements MessageChannel::SendCallback. Callers of sendReply/sendError
  // are responsible for cleaning up their own callbacks.
  MessageChannel::SendCallback* cb = sendCallback;
  if (req_->timestamps_.readBegin != 0) {
    req_->timestamps_.processEnd =
      apache::thrift::concurrency::Util::currentTimeUsec();
    // Cpp2Sample will delete itself when it's callback is called.
    cb = new Cpp2Sample(
      std::move(req_->timestamps_),
      observer,
      sendCallback);
  }
  return cb;
}

void Cpp2Connection::Cpp2Request::setLoadHeader() {
  // Set load header, based on the received load header
  if (!loadHeader_) {
    return;
  }

  auto load =
      connection_->getWorker()->getServer()->getLoad(*loadHeader_);
  req_->getHeader()->setHeader(Cpp2Connection::loadHeader,
                               folly::to<std::string>(load));
}

void Cpp2Connection::Cpp2Request::sendReply(
    std::unique_ptr<folly::IOBuf>&& buf,
    MessageChannel::SendCallback* sendCallback) {
  if (req_->isActive()) {
    setLoadHeader();
    auto observer = connection_->getWorker()->getServer()->getObserver().get();
    req_->sendReply(
      std::move(buf),
      prepareSendCallback(sendCallback, observer));
    cancelTimeout();
    if (observer) {
      observer->sentReply();
    }
  }
}

void Cpp2Connection::Cpp2Request::sendErrorWrapped(
    folly::exception_wrapper ew,
    std::string exCode,
    MessageChannel::SendCallback* sendCallback) {
  if (req_->isActive()) {
    setLoadHeader();
    auto observer = connection_->getWorker()->getServer()->getObserver().get();
    req_->sendErrorWrapped(std::move(ew),
                           std::move(exCode),
                           prepareSendCallback(sendCallback, observer));
    cancelTimeout();
  }
}

void Cpp2Connection::Cpp2Request::sendTimeoutResponse() {
  auto observer = connection_->getWorker()->getServer()->getObserver().get();
  std::map<std::string, std::string> headers;
  if (loadHeader_) {
    auto load =
      connection_->getWorker()->getServer()->getLoad(*loadHeader_);
    headers[Cpp2Connection::loadHeader] = folly::to<std::string>(load);
  }
  req_->sendTimeoutResponse(prepareSendCallback(nullptr, observer), headers);
  cancelTimeout();
}

void Cpp2Connection::Cpp2Request::HardTimeout::timeoutExpired() noexcept {
  request_->req_->cancel();
  request_->sendTimeoutResponse();
  request_->connection_->requestTimeoutExpired();
}

void Cpp2Connection::Cpp2Request::SoftTimeout::timeoutExpired() noexcept {
  if (!request_->reqContext_.getStartedProcessing()) {
    request_->hardTimeout_.timeoutExpired();
  }
}

Cpp2Connection::Cpp2Request::~Cpp2Request() {
  connection_->removeRequest(this);
  cancelTimeout();
  connection_->getWorker()->activeRequests_--;
  connection_->getWorker()->getServer()->decActiveRequests();
}

// Cancel request is usually called from a different thread than sendReply.
void Cpp2Connection::Cpp2Request::cancelRequest() {
  cancelTimeout();
  req_->cancel();
}

Cpp2Connection::Cpp2Sample::Cpp2Sample(
    apache::thrift::server::TServerObserver::CallTimestamps&& timestamps,
    apache::thrift::server::TServerObserver* observer,
    MessageChannel::SendCallback* chainedCallback)
  : timestamps_(timestamps)
  , observer_(observer)
  , chainedCallback_(chainedCallback) {
  DCHECK(observer != nullptr);
}

void Cpp2Connection::Cpp2Sample::sendQueued() {
  if (chainedCallback_ != nullptr) {
    chainedCallback_->sendQueued();
  }
  timestamps_.writeBegin =
    apache::thrift::concurrency::Util::currentTimeUsec();
}

void Cpp2Connection::Cpp2Sample::messageSent() {
  if (chainedCallback_ != nullptr) {
    chainedCallback_->messageSent();
  }
  timestamps_.writeEnd =
    apache::thrift::concurrency::Util::currentTimeUsec();
  delete this;
}

void Cpp2Connection::Cpp2Sample::messageSendError(
    folly::exception_wrapper&& e) {
  if (chainedCallback_ != nullptr) {
    chainedCallback_->messageSendError(std::move(e));
  }
  timestamps_.writeEnd =
    apache::thrift::concurrency::Util::currentTimeUsec();
  delete this;
}

Cpp2Connection::Cpp2Sample::~Cpp2Sample() {
  if (observer_) {
    observer_->callCompleted(timestamps_);
  }
}

}} // apache::thrift


text:
var gulp = require('gulp');
var gutil = require('gulp-util');
var clean = require('gulp-clean');
var uglify = require('gulp-uglify');
var es = require('event-stream');
var runSync = require('run-sequence');
var browserSync = require('browser-sync').create();
var concat = require('gulp-concat');
var insert = require('gulp-insert');
var replace = require('gulp-replace');
var git = require('git-rev');
var q = require('q');
var jsdoc = require('gulp-jsdoc3');
var run = require('gulp-run');
var rename = require('gulp-rename');

var paths = {
  startCode: './src/pluginStart.js',
  endCode: './src/pluginEnd.js',
  exportCode: './src/export.js',
  interfaces: './src/interfaces/*.js',
  models: './src/models/*.js',
  deferredModel: './src/models/deferred.js',
  store: './src/storage/**/*.js',
  apiWrappers: './src/APIs/**/*.js',
  utilities: './src/utils/*.js',
  context: './src/context/**/*.js',
  analytics: './src/analytics/**/*.js',
  main: './src/main.js',
  distro: './dist',
  tmp: './.tmp',
  docs: './docs'
};
var codePaths = [paths.startCode, paths.main, paths.deferredModel, paths.utilities, paths.interfaces, paths.models, paths.store, paths.context, paths.analytics, paths.apiWrappers, paths.exportCode, paths.endCode];

var pluginName = "flybits.js";
var pluginMinifiedName = "flybits.min.js";

var startLiveReloadServer = function(){
  browserSync.init({
    open: false,
    server: {
      baseDir: ''
    }
  });
  console.log("> started live reload server");
};

var changeDetected = function(file){
  console.log('> change detected',file);

  runSync('build','jsdoc',function(){
    browserSync.reload();
  });
};

gulp.task('clean',function(){
  return es.concat(
    gulp.src(paths.tmp).pipe(clean()),
    gulp.src(paths.distro).pipe(clean()),
    gulp.src(paths.docs).pipe(clean())
  );
});

gulp.task('default', ['build']);

gulp.task('combine',function(){
  return es.concat(
    gulp.src(codePaths)
      .pipe(concat(pluginMinifiedName))
      .pipe(uglify())
      .pipe(gulp.dest(paths.tmp)),
    gulp.src(codePaths)
      .pipe(concat(pluginName))
      .pipe(gulp.dest(paths.tmp))
  );
});

gulp.task('injectVersion',function(){
  var deferred = q.defer();
  git.branch(function(branchStr){
    git.short(function(hash){
      var versionStr = branchStr+":"+hash;
      var header = "// @author Justin Lam\n" +
                   "// @version " +versionStr+"\n";
      gutil.log("@branch",branchStr);
      gutil.log("@version",versionStr);

      gulp.src(paths.tmp+"/"+pluginName)
        .pipe(insert.prepend(header))
        .pipe(replace(/--flbversion/i, versionStr))
        .pipe(gulp.dest(paths.distro));
      gulp.src(paths.tmp+"/"+pluginMinifiedName)
        .pipe(insert.prepend(header))
        .pipe(replace(/--flbversion/i, versionStr))
        .pipe(gulp.dest(paths.distro));

      deferred.resolve();
    });
  });

  return deferred.promise;
});

gulp.task('watchChanges',function(){
  startLiveReloadServer();
  var paths = codePaths.slice(1);
  paths.unshift('README.md');
  gulp.watch(paths,changeDetected);
});

gulp.task('dev',function(callback){
  runSync('build','jsdoc','watchChanges',callback);
});

gulp.task('build',function(callback){
  runSync('clean','combine','injectVersion',callback);
});

gulp.task('test',function(callback){
  return run('npm run testnocolor').exec()
    .pipe(rename('testrun_'+new Date().getTime()))
    .pipe(gulp.dest('testResults'));
});

gulp.task('jsdoc',function(callback){
  var deferred = q.defer();
  var paths = codePaths.slice(1,codePaths.length-1);
  paths.unshift('README.md');
  gulp.src(paths,{read:false})
    .pipe(jsdoc(function(){
      deferred.resolve();
    }));
  return deferred.promise;
});


text:
<?= t('Add a comment') ?>

<form method="post" action="<?= $this->url->href('comment', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => isset($ajax))) ?>" autocomplete="off" class="form-comment">
    <?= $this->form->csrf() ?>
    <?= $this->form->hidden('task_id', $values) ?>
    <?= $this->form->hidden('user_id', $values) ?>

                <?= t('Write') ?>

                <?= t('Preview') ?>

            <?= $this->form->textarea('comment', $values, $errors, array(! isset($skip_cancel) ? 'autofocus' : '', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?>

<?= t('Write your text in Markdown') ?>

        <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
        <?php if (! isset($skip_cancel)): ?>
            <?= t('or') ?>
            <?php if (isset($ajax)): ?>
                <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
            <?php else: ?>
                <?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
            <?php endif ?>
        <?php endif ?>

</form>


text:
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">

            </button>

                MyApp

                Section1

                Section2

                Login

That was fun

Now - dream it, then build it!

This template uses the Appstax User Management module and provides user login and user signup out of the box.

                    Signup

Powered by AngularJS

                This template uses the AngularJS as its front-end engine. With angular you can build modern and scalable web apps extremely fast.

                Read more

Effortless CSS with Bootstrap and SASS

                The latest versions of SASS and Boostrap are included in this template and both packages are also included in the Gulp build script.

Beautiful Ion-icons ready to go

                Ion icons are included and that you can use it like &lti class="your icon class">

See all icons here.

Sass

Boostrap

Ion icons

Build servers with NodeJS and Express

                If you need server logic in your app no sweat. Just add a server module to you app and code NodeJS servers without any restrictions on run time.

NodeJS

Express

Add your footer here

<ui-view></ui-view>


text:
package org.hisp.dhis.system.math;

/**
 * JEP function which returns 1 if the argument is a zero or positive number, 0
 * otherwise.
 *
 * @author Lars Helge Overland
 */
public class OneIfZeroOrPositiveFunction
    extends UnaryDoubleFunction
{
    public static final String NAME = "oizp";

    public OneIfZeroOrPositiveFunction()
    {
        super();
    }

    @Override
    public Double eval( double arg )
    {
        return ( arg >= 0 ) ? 1d : 0d;
    }
}


text:
package org.jasig.cas.ticket.registry;

/**
 * Describes important state information that may be optionally exposed by
 * {@link org.jasig.cas.ticket.registry.TicketRegistry} components that might
 * be of interest to monitors.
 *
 * @author Marvin S. Addison
 * @since 3.5.0
 */
public interface TicketRegistryState {
    /**
     * Computes the number of SSO sessions stored in the ticket registry.
     *
     * @return Number of ticket-granting tickets in the registry at time of invocation
     *         or {@link Integer#MIN_VALUE} if unknown.
     */
    int sessionCount();

    /**
     * Computes the number of service tickets stored in the ticket registry.
     *
     * @return Number of service tickets in the registry at time of invocation
     *         or {@link Integer#MIN_VALUE} if unknown.
     */
    int serviceTicketCount();
}


text:
#import "EC2CreateVolumeRequest.h"

@implementation EC2CreateVolumeRequest

@synthesize dryRun;
@synthesize dryRunIsSet;
@synthesize size;
@synthesize snapshotId;
@synthesize availabilityZone;
@synthesize volumeType;
@synthesize iops;

-(id)init
{
    if (self = [super init]) {
        dryRun           = NO;
        dryRunIsSet      = NO;
        size             = nil;
        snapshotId       = nil;
        availabilityZone = nil;
        volumeType       = nil;
        iops             = nil;
    }

    return self;
}

-(id)initWithSize:(NSNumber *)theSize andAvailabilityZone:(NSString *)theAvailabilityZone
{
    if (self = [self init]) {
        self.size             = theSize;
        self.availabilityZone = theAvailabilityZone;
    }

    return self;
}

-(id)initWithSnapshotId:(NSString *)theSnapshotId andAvailabilityZone:(NSString *)theAvailabilityZone
{
    if (self = [self init]) {
        self.snapshotId       = theSnapshotId;
        self.availabilityZone = theAvailabilityZone;
    }

    return self;
}

-(NSString *)description
{
    NSMutableString *buffer = [[NSMutableString alloc] initWithCapacity:256];

    [buffer appendString:@"{"];
    [buffer appendString:[[[NSString alloc] initWithFormat:@"DryRun: %d,", dryRun] autorelease]];
    [buffer appendString:[[[NSString alloc] initWithFormat:@"Size: %@,", size] autorelease]];
    [buffer appendString:[[[NSString alloc] initWithFormat:@"SnapshotId: %@,", snapshotId] autorelease]];
    [buffer appendString:[[[NSString alloc] initWithFormat:@"AvailabilityZone: %@,", availabilityZone] autorelease]];
    [buffer appendString:[[[NSString alloc] initWithFormat:@"VolumeType: %@,", volumeType] autorelease]];
    [buffer appendString:[[[NSString alloc] initWithFormat:@"Iops: %@,", iops] autorelease]];
    [buffer appendString:[super description]];
    [buffer appendString:@"}"];

    return [buffer autorelease];
}

-(void)setDryRun:(BOOL)theValue
{
    dryRun      = theValue;
    dryRunIsSet = YES;
}

-(void)dealloc
{
    [size release];
    [snapshotId release];
    [availabilityZone release];
    [volumeType release];
    [iops release];

    [super dealloc];
}

@end


text:
package com.google.cloud.bigtable.config;

import java.io.Serializable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;

/**
 * Experimental options to turn on timeout options. {@link io.grpc.CallOptions} supports other settings as
 * well, which this configuration object could help set.
 *
 * @author sduskis
 * @version $Id: $Id
 */
public class CallOptionsConfig implements Serializable {

  private static final long serialVersionUID = 1L;

  /** Constant USE_TIMEOUT_DEFAULT=false */
  public static final boolean USE_TIMEOUT_DEFAULT = false;

  /**
   * The default duration to wait before timing out RPCs. 1 minute is probably too long for most
   * RPCs, but the intent is to have a conservative timeout by default and aim for user overrides.
   */
  public static final int SHORT_TIMEOUT_MS_DEFAULT = 60_000;

  /**
   * The default duration to wait before timing out RPCs. 10 minute is probably too long for most
   * RPCs, but the intent is to have a conservative timeout by default and aim for user overrides.
   * There could very well be 10 minute scans, so keep the value conservative for most cases and
   * allow user overrides as needed.
   */
  public static final int LONG_TIMEOUT_MS_DEFAULT = 600_000;

  public static class Builder {
    private boolean useTimeout = USE_TIMEOUT_DEFAULT;
    private int shortRpcTimeoutMs = SHORT_TIMEOUT_MS_DEFAULT;
    private int longRpcTimeoutMs = LONG_TIMEOUT_MS_DEFAULT;

    public Builder() {
    }

    private Builder(CallOptionsConfig original) {
      this.useTimeout = original.useTimeout;
      this.shortRpcTimeoutMs = original.shortRpcTimeoutMs;
      this.longRpcTimeoutMs = original.longRpcTimeoutMs;
    }

    /**
     * If true, turn on timeouts for unary RPCS like mutations, and single row readRows.
     * @param useTimeout
     * @return this for chaining
     */
    public Builder setUseTimeout(boolean useTimeout) {
      this.useTimeout = useTimeout;
      return this;
    }

    /**
     * The amount of milliseconds to wait before issuing a client side timeout for short RPCs.
     * @param timeoutMs
     * @return this for chaining
     */
    @Deprecated
    public Builder setTimeoutMs(int timeoutMs) {
      return setShortRpcTimeoutMs(timeoutMs);
    }

   /**
     * The amount of milliseconds to wait before issuing a client side timeout for short RPCs.
     * @param shortRpcTimeoutMs
    * @return this for chaining
    */
    public Builder setShortRpcTimeoutMs(int shortRpcTimeoutMs) {
      Preconditions.checkArgument(shortRpcTimeoutMs > 0, "Short Timeout ms has to be greater than 0.");
      this.shortRpcTimeoutMs = shortRpcTimeoutMs;
      return this;
    }

    /**
     * The amount of milliseconds to wait before issuing a client side timeout for long RPCs.
     * @param longRpcTimeoutMs
     * @return this for chaining
     */
    public Builder setLongRpcTimeoutMs(int longRpcTimeoutMs) {
      Preconditions.checkArgument(longRpcTimeoutMs > 0, "Long Timeout ms has to be greater than 0");
      this.longRpcTimeoutMs = longRpcTimeoutMs;
      return this;
    }

    public CallOptionsConfig build() {
      return new CallOptionsConfig(useTimeout, shortRpcTimeoutMs, longRpcTimeoutMs);
    }
  }

  private final boolean useTimeout;
  private final int shortRpcTimeoutMs;
  private final int longRpcTimeoutMs;

  /**
   *
Constructor for CallOptionsConfig.

   *
   * @param useTimeout a boolean.
   * @param unaryRpcTimeoutMs an int.
   * @param longRpcTimeoutMs an int.
   */
  public CallOptionsConfig(boolean useTimeout, int unaryRpcTimeoutMs, int longRpcTimeoutMs) {
    this.useTimeout = useTimeout;
    this.shortRpcTimeoutMs = unaryRpcTimeoutMs;
    this.longRpcTimeoutMs = longRpcTimeoutMs;
  }

  /**
   *
isUseTimeout.

   *
   * @return a boolean.
   */
  public boolean isUseTimeout() {
    return useTimeout;
  }

  /**
   *

   * Getter for the field shortRpcTimeoutMs. Use {@link #getShortRpcTimeoutMs()}
   * instead.
   *

   * @return an int.
   */
  @Deprecated
  public int getTimeoutMs() {
    return getShortRpcTimeoutMs();
  }

  /**
   *
Getter for the field shortRpcTimeoutMs.

   *
   * @return an int.
   */
  public int getShortRpcTimeoutMs() {
    return shortRpcTimeoutMs;
  }

  /**
   *
Getter for the field longRpcTimeoutMs.

   *
   * @return an int.
   */
  public int getLongRpcTimeoutMs() {
    return longRpcTimeoutMs;
  }

  /** {@inheritDoc} */
  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj == null || obj.getClass() != CallOptionsConfig.class) {
      return false;
    }
    CallOptionsConfig other = (CallOptionsConfig) obj;
    return useTimeout == other.useTimeout
        && shortRpcTimeoutMs == other.shortRpcTimeoutMs
        && longRpcTimeoutMs == other.longRpcTimeoutMs;
  }

  /** {@inheritDoc} */
  @Override
  public String toString() {
    return MoreObjects.toStringHelper(this)
        .add("useTimeout", useTimeout)
        .add("shortRpcTimeoutMs", shortRpcTimeoutMs)
        .add("longRpcTimeoutMs", longRpcTimeoutMs)
        .toString();
  }

  /**
   *
toBuilder.

   *
   * @return a {@link com.google.cloud.bigtable.config.CallOptionsConfig.Builder} object.
   */
  public Builder toBuilder() {
    return new Builder(this);
  }
}


text:
@interface BracketViewController : BaseViewController <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>

@end


text:
Commons
=======

Common utility methods and classes.

Usage
-----

### Add Dependency

Determine the latest version of the commons in [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.arpnetworking.commons%22%20a%3A%22commons%22).

#### Maven

Add a dependency to your pom:

```xml
<dependency>
    <groupId>com.arpnetworking.commons</groupId>
    <artifactId>commons</artifactId>
    <version>VERSION</version>
</dependency>
```

The Maven Central repository is included by default.

#### Gradle

Add a dependency to your build.gradle:

    compile group: 'com.arpnetworking.commons', name: 'commons', version: 'VERSION'

Add the Maven Central Repository into your *build.gradle*:

```groovy
repositories {
    mavenCentral()
}
```

#### SBT

Add a dependency to your project/Build.scala:

```scala
val appDependencies = Seq(
    "com.arpnetworking.commons" % "commons" % "VERSION"
)
```

The Maven Central repository is included by default.

### Transitive Dependencies

The project does not declare any non-essential transitive dependencies. For example, it does declare a dependency on
[SLF4J](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22slf4j-api%22); however, most other dependencies are marked as
provided and should be declared by users of the library. This allows clients to declare only the dependencies of the
features that they use, instead of automatically inheriting all dependencies of commons. Each component documents its
dependencies and the version defined in the pom for testing should be considered the minimum version of each dependency.
As the library grows we may consider splitting it into a multi-module project with each submodule explicitly declaring
its dependencies.

### Object Mapper Factory

The factory exposes a global singleton Jackson's ```ObjectMapper``` via the ```getInstance``` method to reduce memory
footprint and to ensure a consistent global configuration for ```ObjectMapper```. The global instance is read-only and
is protected by a dynamic proxy which prevents modification. The factory can also create new modifiable instances with
the same base configuration via the ```createInstance``` method.

If these modules are available they are registered with ```ObjectMapper```:

* com.fasterxml.jackson.datatype.guava.GuavaModule (from: com.fasterxml.jackson.datatype:jackson-datatype-guava)
* com.fasterxml.jackson.datatype.jdk8.Jdk8Module (from: com.fasterxml.jackson.datatype:jackson-datatype-jdk8)
* com.fasterxml.jackson.datatype.joda.JodaModule (from: com.fasterxml.jackson.datatype:jackson-datatype-joda)
* com.fasterxml.jackson.datatype.jsr310.JavaTimeModule (from: com.fasterxml.jackson.datatype:jackson-datatype-jsr310)

Additionally, you may specify a comma separated list of additional module class names to register using the system
property _commons.object-mapper-additional-module-class-names_. For example:

```
-Dcommons.object-mapper-additional-module-class-names=com.example.MyModule,com.fasterxml.jackson.module.afterburner.AfterburnerModule
```

### Builder Validation Class Processor

Add the [Maven Javassist Plugin](https://github.com/ArpNetworking/maven-javassist) to your project and configure it to execute the _ValidationProcessor_. Optionally, enable
processing of test classes with the _test-process_ goal.

```xml
<plugin>
  <groupId>com.arpnetworking.commons</groupId>
  <artifactId>javassist-maven-plugin</artifactId>
  <version>0.1.0</version>
  <executions>
    <execution>
      <id>javassist-process</id>
      <goals>
        <goal>process</goal>
      </goals>
      <configuration>
        <processor>com.arpnetworking.commons.builder.ValidationProcessor</processor>
      </configuration>
    </execution>
  </executions>
</plugin>
```

Next, add a dependency on maven-javassist-core:

```xml
<dependency>
   <groupId>com.arpnetworking.commons</groupId>
   <artifactId>javassist-maven-core</artifactId>
   <version>0.1.0</version>
</dependency>
```

Processing the validation rules into your classes instead of using OVal's built-in reflective processing can greatly
improve the performance of your application.

Building
--------

Prerequisites:
* [JDK8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) (Or Invoke with JDKW)

Building:

    commons> ./jdk-wrapper.sh ./mvnw verify

To use the local version you must first install it locally:

    commons> ./jdk-wrapper.sh ./mvnw install

You can determine the version of the local build from the pom file.  Using the local version is intended only for testing or development.

You may also need to add the local repository to your build in order to pick-up the local version:

* Maven - Included by default.
* Gradle - Add *mavenLocal()* to *build.gradle* in the *repositories* block.
* SBT - Add *resolvers += Resolver.mavenLocal* into *project/plugins.sbt*.

Performance Test
----------------

Running:

    commons> ./jdk-wrapper.sh ./mvnw test -PunitPerformanceTest

Results:

* JSON formatted performance results are generated into `target/perf` as specified in each test's `JsonBenchmarkConsumer`.
* Each JSON performance result file references an [HPROF](https://docs.oracle.com/javase/8/docs/technotes/samples/hprof.html) cpu profile generated during the test in `profileFile` field.
* The performance profiles are text files and have been prefiltered using [performance-test](https://github.com/ArpNetworking/performance-test).

License
-------

Published under Apache Software License 2.0, see LICENSE

© Groupon Inc., 2015


text:
<?php

// This demo connect table product

use Phalcon\Mvc\Model;

class Products extends Model
{

	public function initialize()
	{
		$this->setSource('products');
	}
}