text:
require "spec_helper"

describe "List all public structures" do
  context "without filter" do
    context "when etag not set" do
      before { VCR.insert_cassette "esi/universe/structures" }

      after { VCR.eject_cassette }

      subject { EveOnline::ESI::UniverseStructures.new }

      specify { expect(subject.scope).to eq(nil) }

      specify { expect(subject.not_modified?).to eq(false) }

      specify { expect(subject.structure_ids.size).to eq(3654) }

      specify { expect(subject.structure_ids.first).to eq(1_027_528_548_355) }

      specify { expect(subject.etag).to eq("1b64f9a8268bb3ba350acc7d7116bfd75dd9f88defb1bbc61771aec7") }

      specify { expect(subject.error_limit_remain).to eq(100) }

      specify { expect(subject.error_limit_reset).to eq(35) }
    end

    context "when etag is set" do
      before { VCR.insert_cassette "esi/universe/structures_with_etag" }

      after { VCR.eject_cassette }

      subject { EveOnline::ESI::UniverseStructures.new(etag: "1b64f9a8268bb3ba350acc7d7116bfd75dd9f88defb1bbc61771aec7") }

      specify { expect(subject.not_modified?).to eq(true) }

      specify { expect(subject.etag).to eq("1b64f9a8268bb3ba350acc7d7116bfd75dd9f88defb1bbc61771aec7") }

      specify { expect(subject.error_limit_remain).to eq(100) }

      specify { expect(subject.error_limit_reset).to eq(18) }
    end
  end

  context "with filter" do
    context "when etag not set" do
      before { VCR.insert_cassette "esi/universe/structures_with_filter" }

      after { VCR.eject_cassette }

      subject { EveOnline::ESI::UniverseStructures.new(filter: "market") }

      specify { expect(subject.not_modified?).to eq(false) }

      specify { expect(subject.structure_ids.size).to eq(108) }

      specify { expect(subject.structure_ids.first).to eq(1_030_490_622_468) }

      specify { expect(subject.etag).to eq("2a825ab50413f1efe5f558b8d093e1299389b2f2ce3fa191907f7209") }

      specify { expect(subject.error_limit_remain).to eq(100) }

      specify { expect(subject.error_limit_reset).to eq(55) }
    end

    context "when etag is set" do
      let(:options) do
        {
          filter: "market",
          etag: "2a825ab50413f1efe5f558b8d093e1299389b2f2ce3fa191907f7209"
        }
      end

      before { VCR.insert_cassette "esi/universe/structures_with_filter_and_etag" }

      after { VCR.eject_cassette }

      subject { EveOnline::ESI::UniverseStructures.new(options) }

      specify { expect(subject.not_modified?).to eq(true) }

      specify { expect(subject.etag).to eq("2a825ab50413f1efe5f558b8d093e1299389b2f2ce3fa191907f7209") }

      specify { expect(subject.error_limit_remain).to eq(100) }

      specify { expect(subject.error_limit_reset).to eq(1) }
    end
  end
end


text:
ComponentTransform::ComponentTransform(GameObject* g) : Component(COMP_TRANSFORM, g)
{
	previous_world_transform.SetIdentity();
	world_transform.SetIdentity();
	local_transform.SetIdentity();

	CalculateWorldTransform();
}
ComponentTransform::~ComponentTransform()
{

}

void ComponentTransform::Update()
{

}

void ComponentTransform::OnEditor()
{
	if (ImGui::CollapsingHeader("Transform"))
	{
		bool tmp_bool = go->IsStatic();
		if(ImGui::Checkbox("Static", &tmp_bool))
		{
			go->SetStatic(tmp_bool);
		}

		//Transform operation

		ImGui::Text("Operation:");
		tmp_bool = (operation == TRANSLATE);
		if (ImGui::Checkbox("Translation", &tmp_bool))
		{
			if (tmp_bool)
			{
				operation = TRANSLATE;
			}
		}

		ImGui::SameLine();
		tmp_bool = (operation == ROTATE);
		if (ImGui::Checkbox("Rotation", &tmp_bool))
		{
			if (tmp_bool)
			{
				operation = ROTATE;
			}
		}

		ImGui::SameLine();
		tmp_bool = (operation == SCALE);
		if (ImGui::Checkbox("Scale", &tmp_bool))
		{
			if (tmp_bool)
			{
				operation = SCALE;
			}
		}

		//Transform mode
		ImGui::Text("Mode:");
		tmp_bool = (mode == WORLD);
		if (ImGui::Checkbox("World", &tmp_bool))
		{
			if (tmp_bool)
			{
				mode = WORLD;
			}
		}

		tmp_bool = (mode == LOCAL);
		if (ImGui::Checkbox("Local", &tmp_bool))
		{
			if (tmp_bool)
			{
				mode = LOCAL;
			}
		}

		//Position
		ImGui::Text("Position: ");
		ImGui::SameLine();

		if (ImGui::DragFloat3("###position", position.ptr(), 0.1f))
		{
			SetPosition(position);
		}

		float3 rot = rotation.ToEulerXYZ();
		rot = math::RadToDeg(rot);

		//Rotation
		ImGui::Text("Rotation :");
		ImGui::SameLine();
		if (ImGui::DragFloat3("###rotation", rot.ptr(), 0.1f))
		{
			SetRotation(rot);
		}

		//Scale
		ImGui::Text("Scale :");
		ImGui::SameLine();
		if (ImGui::DragFloat3("###scale", scale.ptr(), 0.1f))
		{
			SetScale(scale);
		}

		float4x4 t = local_transform;

		ImGui::Text("Local transform: ");
		ImGui::Text(" %.3f  %.3f  %.3f  %.3f", t.v[0][0], t.v[0][1], t.v[0][2], t.v[0][3]);
		ImGui::Text(" %.3f  %.3f  %.3f  %.3f", t.v[1][0], t.v[1][1], t.v[1][2], t.v[1][3]);
		ImGui::Text(" %.3f  %.3f  %.3f  %.3f", t.v[2][0], t.v[2][1], t.v[2][2], t.v[2][3]);
		ImGui::Text(" %.3f  %.3f  %.3f  %.3f", t.v[3][0], t.v[3][1], t.v[3][2], t.v[3][3]);

		t = world_transform;
		ImGui::Text("World transform: ");
		ImGui::Text(" %.3f  %.3f  %.3f  %.3f", t.v[0][0], t.v[0][1], t.v[0][2], t.v[0][3]);
		ImGui::Text(" %.3f  %.3f  %.3f  %.3f", t.v[1][0], t.v[1][1], t.v[1][2], t.v[1][3]);
		ImGui::Text(" %.3f  %.3f  %.3f  %.3f", t.v[2][0], t.v[2][1], t.v[2][2], t.v[2][3]);
		ImGui::Text(" %.3f  %.3f  %.3f  %.3f", t.v[3][0], t.v[3][1], t.v[3][2], t.v[3][3]);
	}

}

float4x4 ComponentTransform::SetTransform(float3 &pos, Quat &rot, float3 &s)
{
	position = pos;
	rotation = rot;
	scale = s;

    local_transform = local_transform.FromTRS(pos, rot, s);

	CalculateWorldTransform();

	return local_transform;
}

void ComponentTransform::SetTransform(float4x4 &mat)
{
	local_transform = mat;
	local_transform.Decompose(position, rotation, scale);

	CalculateWorldTransform();
}

void ComponentTransform::SetPosition(float3 &p)
{
	position = p;

	local_transform.SetTranslatePart(p);

	CalculateWorldTransform();
}

void ComponentTransform::SetRotation(float3 &r)
{
	float3 rot = math::DegToRad(r);

	rotation = rotation.FromEulerXYZ(rot.x, rot.y, rot.z);

	local_transform = local_transform.FromTRS(position, rotation, scale);

	CalculateWorldTransform();
}
void ComponentTransform::SetScale(float3 &s)
{
	scale = s;

	//NOTE: Theres Scale() but not sure it will overlap the local_transform
	local_transform = local_transform.FromTRS(position, rotation, scale);

	CalculateWorldTransform();
}

float4x4 ComponentTransform::GetLocalTransform() const
{
	return local_transform;
}

float4x4 ComponentTransform::GetWorldTransform() const
{
	return world_transform;
}

float4x4 ComponentTransform::GetPreviousWorldTransform() const
{
	return previous_world_transform;
}

float4x4 ComponentTransform::GetFinalTransformMatrix() const
{
	return world_transform.Transposed();
}

void ComponentTransform::CalculateWorldTransform()
{

	//NOTE: do it more secure
	if (go->GetParent() && go->GetParent()->GetComponentTransform())
	{
		ComponentTransform* parent_transform = go->GetParent()->GetComponentTransform();

		//NOTE: if errors, check this
		world_transform = parent_transform->GetWorldTransform() * local_transform;
	}
	else
		world_transform = local_transform;

	if (!go->children.empty())
	{
		for (uint i = 0, size = go->children.size(); i < size; i++)
		{
			go->children[i]->GetComponentTransform()->CalculateWorldTransform();
		}
	}

	go->OnTransform();

	//Better here so i don't have to transfer much info
	go->SetOBB(world_transform, previous_world_transform);

	previous_world_transform = world_transform;
}

redpajama_set_name: RedPajamaGithub


text:
<?php

defined('_JEXEC') or die('Restricted access');
?><?php
$my = JFactory::getUser();
if(empty($my->id)){
	$usercomp = !ACYMAILING_J16 ? 'com_user' : 'com_users';
	$uri = JFactory::getURI();
	$url = 'index.php?option='.$usercomp.'&view=login&return='.base64_encode($uri->toString());
	$app = JFactory::getApplication();
	$app->redirect($url, acymailing_translation('ACY_NOTALLOWED'), 'error');
	return false;
}

$config = acymailing_config();
if(!acymailing_isAllowed($config->get('acl_statistics_manage', 'all'))) die(acymailing_translation('ACY_NOTALLOWED'));

$frontHelper = acymailing_get('helper.acyfront');
include(ACYMAILING_BACK.'controllers'.DS.'bounces.php');

class FrontbouncesController extends BouncesController{

	function __construct($config = array()){
		parent::__construct($config);
		$task = JRequest::getCmd('task');
		if($task != 'chart') die(acymailing_translation('ACY_NOTALLOWED'));
	}

	function chart(){
		JRequest::setVar('layout', 'chart');
		return parent::display();
	}
}


text:
//
//  FDDTextFeildCell.h
//  SecondHouseBroker
//
//  Created by lingyohunl on 14/10/30.
//  Copyright (c) 2014年 房多多. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "FDDUITableViewCell.h"
#import "FddKeyBoardToolBar.h"
@interface FDDTextFeildCell : FDDUITableViewCell

@property (nonatomic,weak)id<FddKeyBoardToolBarDelegate> actionDelegate;
/**
 *  标题文本,距离左边的边距,默认为15
 */
@property (nonatomic,assign)CGFloat textOriginX;

/**
 *  标题文本的宽度,默认为80
 */
@property (nonatomic,assign)CGFloat textWidth;

/**
 *  textField起始位置距离textLabel的间距.默认为34
 */
@property (nonatomic,assign)CGFloat fieldSpace;

@property (nonatomic, readonly) UILabel * textLabel;
@property (nonatomic, readonly) UITextField * textField;

@property (nonatomic, strong) FddKeyBoardToolBar *actionBar;
@property (nonatomic,assign) BOOL keyboardBarFlag;

@end


text:
.. _dashboard:

The django-admin-tools dashboard and dashboard modules API
==========================================================

This section describe the API of the django-admin-tools dashboard and
dashboard modules.
Make sure you read this before creating your custom dashboard and
custom modules.

.. module:: admin_tools.dashboard

The ``Dashboard`` class
-----------------------

.. autoclass:: admin_tools.dashboard.Dashboard
    :members:

The ``AppIndexDashboard`` class
-------------------------------

.. autoclass:: admin_tools.dashboard.AppIndexDashboard
    :members:

.. module:: admin_tools.dashboard.modules

The ``DashboardModule`` class
-----------------------------

.. autoclass:: admin_tools.dashboard.modules.DashboardModule
    :members:

The ``Group`` class
------------------------------------

.. autoclass:: admin_tools.dashboard.modules.Group
    :members:

The ``LinkList`` class
-------------------------------------

.. autoclass:: admin_tools.dashboard.modules.LinkList
    :members:

The ``AppList`` class
------------------------------------

.. autoclass:: admin_tools.dashboard.modules.AppList
    :members:

The ``ModelList`` class
--------------------------------------

.. autoclass:: admin_tools.dashboard.modules.ModelList
    :members:

The ``RecentActions`` class
------------------------------------------

.. autoclass:: admin_tools.dashboard.modules.RecentActions
    :members:

The ``Feed`` class
---------------------------------

.. autoclass:: admin_tools.dashboard.modules.Feed
    :members:


text:
The `receive` package contains the `Receive` class that reflects the functionality documented at at https://blockchain.info/api/api_receive. It allows merchants to create forwarding addresses and be notified upon payment.

Example usage:

```java

package test;
import info.blockchain.api.receive.*;

public class App
{
    public static void main(String[] args) throws Exception
    {
    	ReceiveResponse response = Receive.receive("1KZoUuPWFAeyVySHAGqvTUDoX6P3ntuLNF",
    			"http://your.url.com");

    	System.out.println(String.format("The receiving address is %s. "
    			+ "The payment will be forwarded to %s",
    			response.getInputAddress(),
    			response.getDestinationAddress()));
    }
}

```


text:
package com.mortennobel.imagescaling;

import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Based on work from Java Image Util ( http://schmidt.devlib.org/jiu/ )
 *
 * Note that the filter method is not thread safe
 *
 * @author Morten Nobel-Joergensen
 * @author Heinz Doerr
 */
public class ResampleOp extends AdvancedResizeOp
{
	private final int MAX_CHANNEL_VALUE= 255;

	private int nrChannels;
	private int srcWidth;
	private int srcHeight;
	private int dstWidth;
	private int dstHeight;

	static class SubSamplingData{
		private final int[] arrN; // individual - per row or per column - nr of contributions
		private final int[] arrPixel;  // 2Dim: [wid or hei][contrib]
		private final float[] arrWeight; // 2Dim: [wid or hei][contrib]
		private final int numContributors; // the primary index length for the 2Dim arrays : arrPixel and arrWeight

		private SubSamplingData(int[] arrN, int[] arrPixel, float[] arrWeight, int numContributors) {
			this.arrN = arrN;
			this.arrPixel = arrPixel;
			this.arrWeight = arrWeight;
			this.numContributors = numContributors;
		}

		public int getNumContributors() {
			return numContributors;
		}

		public int[] getArrN() {
			return arrN;
		}

		public int[] getArrPixel() {
			return arrPixel;
		}

		public float[] getArrWeight() {
			return arrWeight;
		}
	}

	private SubSamplingData horizontalSubsamplingData;
	private SubSamplingData verticalSubsamplingData;

	private int processedItems;
	private float totalItems;

	private int numberOfThreads = Runtime.getRuntime().availableProcessors();

	private AtomicInteger multipleInvocationLock = new AtomicInteger();

	private ResampleFilter filter = ResampleFilters.getLanczos3Filter();

	public ResampleOp(int destWidth, int destHeight) {
		this(DimensionConstrain.createAbsolutionDimension(destWidth, destHeight));
	}

	public ResampleOp(DimensionConstrain dimensionConstrain) {
		super(dimensionConstrain);
	}

	public ResampleFilter getFilter() {
		return filter;
	}

	public void setFilter(ResampleFilter filter) {
		this.filter = filter;
	}

	public int getNumberOfThreads() {
		return numberOfThreads;
	}

	public void setNumberOfThreads(int numberOfThreads) {
		this.numberOfThreads = numberOfThreads;
	}

	public BufferedImage doFilter(BufferedImage srcImg, BufferedImage dest, int dstWidth, int dstHeight) {
		this.dstWidth = dstWidth;
		this.dstHeight = dstHeight;

		if (dstWidth<3 || dstHeight<3){
			throw new RuntimeException("Error doing rescale. Target size was "+dstWidth+"x"+dstHeight+" but must be at least 3x3.");
		}

		assert multipleInvocationLock.incrementAndGet()==1:"Multiple concurrent invocations detected";

		if (srcImg.getType() == BufferedImage.TYPE_BYTE_BINARY ||
				srcImg.getType() == BufferedImage.TYPE_BYTE_INDEXED ||
				srcImg.getType() == BufferedImage.TYPE_CUSTOM)
			srcImg = ImageUtils.convert(srcImg, srcImg.getColorModel().hasAlpha() ?
					BufferedImage.TYPE_4BYTE_ABGR : BufferedImage.TYPE_3BYTE_BGR);

		this.nrChannels= ImageUtils.nrChannels(srcImg);
		assert nrChannels > 0;
		this.srcWidth = srcImg.getWidth();
        this.srcHeight = srcImg.getHeight();

        byte[][] workPixels = new byte[srcHeight][dstWidth*nrChannels];

        this.processedItems = 0;
		this.totalItems = srcHeight + dstWidth;

		// Pre-calculate  sub-sampling
		horizontalSubsamplingData = createSubSampling(filter, srcWidth, dstWidth);
		verticalSubsamplingData = createSubSampling(filter,srcHeight, dstHeight);

        final BufferedImage scrImgCopy = srcImg;
        final byte[][] workPixelsCopy = workPixels;
        Thread[] threads = new Thread[numberOfThreads-1];
        for (int i=1;i<numberOfThreads;i++){
            final int finalI = i;
            threads[i-1] = new Thread(new Runnable(){
                public void run(){
                    horizontallyFromSrcToWork(scrImgCopy, workPixelsCopy,finalI,numberOfThreads);
                }
            });
            threads[i-1].start();
        }
        horizontallyFromSrcToWork(scrImgCopy, workPixelsCopy,0,numberOfThreads);
        waitForAllThreads(threads);

        byte[] outPixels = new byte[dstWidth*dstHeight*nrChannels];
        // --------------------------------------------------
		// Apply filter to sample vertically from Work to Dst
		// --------------------------------------------------
        final byte[] outPixelsCopy = outPixels;
        for (int i=1;i<numberOfThreads;i++){
            final int finalI = i;
            threads[i-1] = new Thread(new Runnable(){
                public void run(){
					verticalFromWorkToDst(workPixelsCopy, outPixelsCopy, finalI,numberOfThreads);
                }
            });
            threads[i-1].start();
        }
        verticalFromWorkToDst(workPixelsCopy, outPixelsCopy, 0,numberOfThreads);
        waitForAllThreads(threads);

        //noinspection UnusedAssignment
        workPixels = null; // free memory
		BufferedImage out;
		if (dest!=null && dstWidth==dest.getWidth() && dstHeight==dest.getHeight()){
			out = dest;
			int nrDestChannels = ImageUtils.nrChannels(dest);
			if (nrDestChannels != nrChannels){
				String errorMgs = String.format("Destination image must be compatible width source image. Source image had %d channels destination image had %d channels", nrChannels, nrDestChannels);
				throw new RuntimeException(errorMgs);
			}
		}else{
			out = new BufferedImage(dstWidth, dstHeight, getResultBufferedImageType(srcImg));
		}

        ImageUtils.setBGRPixels(outPixels, out, 0, 0, dstWidth, dstHeight);

		assert multipleInvocationLock.decrementAndGet()==0:"Multiple concurrent invocations detected";

		return out;
    }

    private void waitForAllThreads(Thread[] threads) {
        try {
            for (Thread t:threads){
                t.join(Long.MAX_VALUE);
            }
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RuntimeException(e);
        }
    }

    static SubSamplingData createSubSampling(ResampleFilter filter, int srcSize, int dstSize) {
		float scale = (float)dstSize / (float)srcSize;
		int[] arrN= new int[dstSize];
		int numContributors;
		float[] arrWeight;
		int[] arrPixel;

		final float fwidth= filter.getSamplingRadius();

        float centerOffset = 0.5f/scale;

		if (scale < 1.0f) {
			final float width= fwidth / scale;
			numContributors= (int)(width * 2.0f + 2); // Heinz: added 1 to be save with the ceilling
			arrWeight= new float[dstSize * numContributors];
			arrPixel= new int[dstSize * numContributors];

			final float fNormFac= (float)(1f / (Math.ceil(width) / fwidth));
			//
			for (int i= 0; i < dstSize; i++) {
				final int subindex= i * numContributors;
				float center= i / scale + centerOffset;
				int left= (int)Math.floor(center - width);
				int right= (int)Math.ceil(center + width);
				for (int j= left; j <= right; j++) {
					float weight;
					weight= filter.apply((center - j) * fNormFac);

					if (weight == 0.0f) {
						continue;
					}
					int n;
					if (j < 0) {
						n= -j;
					} else if (j >= srcSize) {
						n= srcSize - j + srcSize - 1;
					} else {
						n= j;
					}
					int k= arrN[i];
					//assert k == j-left:String.format("%s = %s %s", k,j,left);
					arrN[i]++;
					if (n < 0 || n >= srcSize) {
						weight= 0.0f;// Flag that cell should not be used
					}
					arrPixel[subindex +k]= n;
					arrWeight[subindex + k]= weight;
				}
				// normalize the filter's weight's so the sum equals to 1.0, very important for avoiding box type of artifacts
				final int max= arrN[i];
				float tot= 0;
				for (int k= 0; k < max; k++)
					tot+= arrWeight[subindex + k];
				if (tot != 0f) { // 0 should never happen except bug in filter
					for (int k= 0; k < max; k++)
						arrWeight[subindex + k]/= tot;
				}
			}
		} else
			// super-sampling
			// Scales from smaller to bigger height
		{
			numContributors= (int)(fwidth * 2.0f + 1);
			arrWeight= new float[dstSize * numContributors];
			arrPixel= new int[dstSize * numContributors];
			//
			for (int i= 0; i < dstSize; i++) {
				final int subindex= i * numContributors;
				float center= i / scale + centerOffset;
				int left= (int)Math.floor(center - fwidth);
				int right= (int)Math.ceil(center + fwidth);
				for (int j= left; j <= right; j++) {
					float weight= filter.apply(center - j);
					if (weight == 0.0f) {
						continue;
					}
					int n;
					if (j < 0) {
						n= -j;
					} else if (j >= srcSize) {
						n= srcSize - j + srcSize - 1;
					} else {
						n= j;
					}
					int k= arrN[i];
					arrN[i]++;
					if (n < 0 || n >= srcSize) {
						weight= 0.0f;// Flag that cell should not be used
					}
					arrPixel[subindex +k]= n;
					arrWeight[subindex + k]= weight;
				}
				// normalize the filter's weight's so the sum equals to 1.0, very important for avoiding box type of artifacts
				final int max= arrN[i];
				float tot= 0;
				for (int k= 0; k < max; k++)
					tot+= arrWeight[subindex + k];
				assert tot!=0:"should never happen except bug in filter";
				if (tot != 0f) {
					for (int k= 0; k < max; k++)
						arrWeight[subindex + k]/= tot;
				}
			}
		}
		return new SubSamplingData(arrN, arrPixel, arrWeight, numContributors);
	}

    private void verticalFromWorkToDst(byte[][] workPixels, byte[] outPixels, int start, int delta) {
		if (nrChannels==1){
			verticalFromWorkToDstGray(workPixels, outPixels, start,numberOfThreads);
			return;
		}
		boolean useChannel3 = nrChannels>3;
		for (int x = start; x < dstWidth; x+=delta)
        {
			final int xLocation = x*nrChannels;
			for (int y = dstHeight-1; y >=0 ; y--)
			{
				final int yTimesNumContributors = y * verticalSubsamplingData.numContributors;
				final int max= verticalSubsamplingData.arrN[y];
				final int sampleLocation = (y*dstWidth+x)*nrChannels;

				float sample0 = 0.0f;
				float sample1 = 0.0f;
				float sample2 = 0.0f;
				float sample3 = 0.0f;
				int index= yTimesNumContributors;
				for (int j= max-1; j >=0 ; j--) {
					int valueLocation = verticalSubsamplingData.arrPixel[index];
					float arrWeight = verticalSubsamplingData.arrWeight[index];
					sample0+= (workPixels[valueLocation][xLocation]&0xff) *arrWeight ;
					sample1+= (workPixels[valueLocation][xLocation+1]&0xff) * arrWeight;
					sample2+= (workPixels[valueLocation][xLocation+2]&0xff) * arrWeight;
					if (useChannel3){
						sample3+= (workPixels[valueLocation][xLocation+3]&0xff) * arrWeight;
					}

					index++;
				}

				outPixels[sampleLocation] = toByte(sample0);
				outPixels[sampleLocation +1] = toByte(sample1);
				outPixels[sampleLocation +2] = toByte(sample2);
				if (useChannel3){
					outPixels[sampleLocation +3] = toByte(sample3);
				}

			}
			processedItems++;
			if (start==0){ // only update progress listener from main thread
            	setProgress();
			}
        }
    }

	private void verticalFromWorkToDstGray(byte[][] workPixels, byte[] outPixels, int start, int delta) {
		for (int x = start; x < dstWidth; x+=delta)
        {
			final int xLocation = x;
			for (int y = dstHeight-1; y >=0 ; y--)
			{
				final int yTimesNumContributors = y * verticalSubsamplingData.numContributors;
				final int max= verticalSubsamplingData.arrN[y];
				final int sampleLocation = (y*dstWidth+x);

				float sample0 = 0.0f;
				int index= yTimesNumContributors;
				for (int j= max-1; j >=0 ; j--) {
					int valueLocation = verticalSubsamplingData.arrPixel[index];
					float arrWeight = verticalSubsamplingData.arrWeight[index];
					sample0+= (workPixels[valueLocation][xLocation]&0xff) *arrWeight ;

					index++;
				}

				outPixels[sampleLocation] = toByte(sample0);
			}
			processedItems++;
			if (start==0){ // only update progress listener from main thread
            	setProgress();
			}
        }
    }

	/**
     * Apply filter to sample horizontally from Src to Work
     * @param srcImg
     * @param workPixels
     */
    private void horizontallyFromSrcToWork(BufferedImage srcImg, byte[][] workPixels, int start, int delta) {
		if (nrChannels==1){
			horizontallyFromSrcToWorkGray(srcImg, workPixels, start, delta);
			return;
		}
		final int[] tempPixels = new int[srcWidth];   // Used if we work on int based bitmaps, later used to keep channel values
		final byte[] srcPixels = new byte[srcWidth*nrChannels]; // create reusable row to minimize memory overhead
		final boolean useChannel3 = nrChannels>3;

		for (int k = start; k < srcHeight; k=k+delta)
        {
			ImageUtils.getPixelsBGR(srcImg, k, srcWidth, srcPixels, tempPixels);

			for (int i = dstWidth-1;i>=0 ; i--)
			{
				int sampleLocation = i*nrChannels;
				final int max = horizontalSubsamplingData.arrN[i];

				float sample0 = 0.0f;
				float sample1 = 0.0f;
				float sample2 = 0.0f;
				float sample3 = 0.0f;
				int index= i * horizontalSubsamplingData.numContributors;
				for (int j= max-1; j >= 0; j--) {
					float arrWeight = horizontalSubsamplingData.arrWeight[index];
					int pixelIndex = horizontalSubsamplingData.arrPixel[index]*nrChannels;

					sample0 += (srcPixels[pixelIndex]&0xff) * arrWeight;
					sample1 += (srcPixels[pixelIndex+1]&0xff) * arrWeight;
					sample2 += (srcPixels[pixelIndex+2]&0xff)  * arrWeight;
					if (useChannel3){
						sample3 += (srcPixels[pixelIndex+3]&0xff)  * arrWeight;
					}
					index++;
				}

				workPixels[k][sampleLocation] = toByte(sample0);
				workPixels[k][sampleLocation +1] = toByte(sample1);
				workPixels[k][sampleLocation +2] = toByte(sample2);
				if (useChannel3){
					workPixels[k][sampleLocation +3] = toByte(sample3);
				}
			}
			processedItems++;
			if (start==0){ // only update progress listener from main thread
				setProgress();
			}
		}
    }

	/**
     * Apply filter to sample horizontally from Src to Work
     * @param srcImg
     * @param workPixels
     */
    private void horizontallyFromSrcToWorkGray(BufferedImage srcImg, byte[][] workPixels, int start, int delta) {
		final int[] tempPixels = new int[srcWidth];   // Used if we work on int based bitmaps, later used to keep channel values
		final byte[] srcPixels = new byte[srcWidth]; // create reusable row to minimize memory overhead

		for (int k = start; k < srcHeight; k=k+delta)
        {
			ImageUtils.getPixelsBGR(srcImg, k, srcWidth, srcPixels, tempPixels);

			for (int i = dstWidth-1;i>=0 ; i--)
			{
				int sampleLocation = i;
				final int max = horizontalSubsamplingData.arrN[i];

				float sample0 = 0.0f;
				int index= i * horizontalSubsamplingData.numContributors;
				for (int j= max-1; j >= 0; j--) {
					float arrWeight = horizontalSubsamplingData.arrWeight[index];
					int pixelIndex = horizontalSubsamplingData.arrPixel[index];

					sample0 += (srcPixels[pixelIndex]&0xff) * arrWeight;
					index++;
				}

				workPixels[k][sampleLocation] = toByte(sample0);
			}
			processedItems++;
			if (start==0){ // only update progress listener from main thread
				setProgress();
			}
		}
    }

	private byte toByte(float f){
		if (f<0){
			return 0;
		}
		if (f>MAX_CHANNEL_VALUE){
			return (byte) MAX_CHANNEL_VALUE;
		}
		return (byte)(f+0.5f); // add 0.5 same as Math.round
	}

	private void setProgress(){
        fireProgressChanged(processedItems/totalItems);
    }

	protected int getResultBufferedImageType(BufferedImage srcImg) {
		return nrChannels == 3 ? BufferedImage.TYPE_3BYTE_BGR :
							(nrChannels == 4 ? BufferedImage.TYPE_4BYTE_ABGR :
								(srcImg.getSampleModel().getDataType() == DataBuffer.TYPE_USHORT ?
										BufferedImage.TYPE_USHORT_GRAY : BufferedImage.TYPE_BYTE_GRAY));
	}
}


text:
package client

import (
	"encoding/json"
	"fmt"

	"github.com/rook/rook/pkg/clusterd"
)

func AuthGetKey(context *clusterd.Context, clusterName, name string) (string, error) {
	args := []string{"auth", "get-key", name}
	buf, err := ExecuteCephCommand(context, clusterName, args)
	if err != nil {
		return "", fmt.Errorf("failed to get key for %s: %+v", name, err)
	}

	return parseAuthKey(buf)
}

func AuthGetOrCreateKey(context *clusterd.Context, clusterName, name string, caps []string) (string, error) {

	args := append([]string{"auth", "get-or-create-key", name}, caps...)
	buf, err := ExecuteCephCommand(context, clusterName, args)
	if err != nil {
		return "", fmt.Errorf("failed get-or-create-key %s: %+v", name, err)
	}

	logger.Infof("Parsing key: %v", string(buf))
	return parseAuthKey(buf)
}

func AuthDelete(context *clusterd.Context, clusterName, name string) error {
	args := []string{"auth", "del", name}
	_, err := ExecuteCephCommand(context, clusterName, args)
	if err != nil {
		return fmt.Errorf("failed to delete auth for %s. %v", name, err)
	}
	return nil
}

func parseAuthKey(buf []byte) (string, error) {
	var resp map[string]interface{}
	if err := json.Unmarshal(buf, &resp); err != nil {
		return "", fmt.Errorf("failed to unmarshal get/create key response: %+v", err)
	}
	return resp["key"].(string), nil
}


text:
[[getTitle_(state_)]]

        [[lastProgressLine_]]

      <paper-progress class="progress-bar" value="[[backupProgress_]]">
      </paper-progress>

      <paper-progress class="progress-bar" value="[[restoreProgress_]]">
      </paper-progress>

      <paper-progress class="progress-bar" indeterminate>
      </paper-progress>

      <paper-progress class="progress-bar" indeterminate></paper-progress>

      <textarea id="error-log" rows="20" cols="80" readonly>[[getErrorLogs_(state_)]]</textarea>

    <cr-checkbox checked="{{backupCheckboxChecked_}}" >

        $i18n{backupCheckboxMessage}

        $i18n{backupChangeLocation}

    </cr-checkbox>

    <cr-button id="cancel-button" on-click="onCancelButtonClick_"
        hidden="[[!canCancel_(state_)]]">
      [[getCancelButtonLabel_(state_)]]
    </cr-button>
    <cr-button class="action-button" on-click="onActionButtonClick_"
        aria-describedby="title" aria-details="prompt-message"
        hidden="[[!canDoAction_(state_)]]">
      [[getActionButtonLabel_(state_)]]
    </cr-button>


text:
package com.amazonaws.services.fms.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.fms.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * NetworkFirewallMissingSubnetViolationMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class NetworkFirewallMissingSubnetViolationMarshaller {

    private static final MarshallingInfo<String> VIOLATIONTARGET_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ViolationTarget").build();
    private static final MarshallingInfo<String> VPC_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("VPC").build();
    private static final MarshallingInfo<String> AVAILABILITYZONE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("AvailabilityZone").build();
    private static final MarshallingInfo<String> TARGETVIOLATIONREASON_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("TargetViolationReason").build();

    private static final NetworkFirewallMissingSubnetViolationMarshaller instance = new NetworkFirewallMissingSubnetViolationMarshaller();

    public static NetworkFirewallMissingSubnetViolationMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(NetworkFirewallMissingSubnetViolation networkFirewallMissingSubnetViolation, ProtocolMarshaller protocolMarshaller) {

        if (networkFirewallMissingSubnetViolation == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(networkFirewallMissingSubnetViolation.getViolationTarget(), VIOLATIONTARGET_BINDING);
            protocolMarshaller.marshall(networkFirewallMissingSubnetViolation.getVPC(), VPC_BINDING);
            protocolMarshaller.marshall(networkFirewallMissingSubnetViolation.getAvailabilityZone(), AVAILABILITYZONE_BINDING);
            protocolMarshaller.marshall(networkFirewallMissingSubnetViolation.getTargetViolationReason(), TARGETVIOLATIONREASON_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
import {authorize} from '../token/tokenActions'

import {
  SIGN_IN_EMAIL_CHANGE,
  SIGN_IN_PASSWORD_CHANGE,
  SIGN_IN_VALIDATION_MESSAGES_VISIBLE,
  SIGN_IN_ERROR,
  SIGN_IN_DISABLED,
  SIGN_IN_RESET
} from './signInConstants'

export function setEmail(email) {
  return {
    type: SIGN_IN_EMAIL_CHANGE,
    email
  }
}

export function setPassword(password) {
  return {
    type: SIGN_IN_PASSWORD_CHANGE,
    password
  }
}

export function setValidationMessagesVisible(visible) {
  return {
    type: SIGN_IN_VALIDATION_MESSAGES_VISIBLE,
    visible
  }
}

export function setError(error) {
  return {
    type: SIGN_IN_ERROR,
    error
  }
}

export function setDisabled(disabled) {
  return {
    type: SIGN_IN_DISABLED,
    disabled
  }
}

export function reset() {
  return {
    type: SIGN_IN_RESET
  }
}

export function submit() {
  return async (dispatch, getState) => {
    const {signIn} = getState()
    const {disabled, validation: {valid}, data} = signIn
    const {email, password} = data

    if (disabled) {
      return
    }

    if (!valid) {
      dispatch(setValidationMessagesVisible(true))
      return
    }

    dispatch(setDisabled(true))
    dispatch(setError(undefined))
    dispatch(setValidationMessagesVisible(false))

    try {
      await dispatch(authorize(
        email,
        password
      ))
      dispatch(reset())
    } catch (error) {
      dispatch(setError(error))
    } finally {
      dispatch(setDisabled(false))
    }
  }
}


text:
module Mongo
  module Operation
    class GetMore

      # Defines custom behavior of results for the get more command.
      #
      # @since 2.2.0
      class Result < Operation::Result

        # Get the cursor id.
        #
        # @example Get the cursor id.
        #   result.cursor_id
        #
        # @return [ Integer ] The cursor id.
        #
        # @since 2.2.0
        def cursor_id
          cursor_document ? cursor_document[CURSOR_ID] : super
        end

        # Get the post batch resume token for the result
        #
        # @return [ BSON::Document | nil ] The post batch resume token
        #
        # @api private
        def post_batch_resume_token
          cursor_document ? cursor_document['postBatchResumeToken'] : nil
        end

        # Get the documents in the result.
        #
        # @example Get the documents.
        #   result.documents
        #
        # @return [ Array<BSON::Document> ] The documents.
        #
        # @since 2.2.0
        def documents
          cursor_document[NEXT_BATCH]
        end

        private

        def cursor_document
          @cursor_document ||= reply.documents[0][CURSOR]
        end

        def first_document
          @first_document ||= reply.documents[0]
        end
      end
    end
  end
end


text:
package org.apache.airavata.xbaya.ui.graph.system;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;

import javax.swing.JTextArea;
import javax.swing.border.EmptyBorder;

import org.apache.airavata.workflow.model.graph.system.MemoNode;
import org.apache.airavata.xbaya.XBayaEngine;
import org.apache.airavata.xbaya.ui.dialogs.graph.system.MemoConfigurationDialog;
import org.apache.airavata.xbaya.ui.graph.NodeGUI;
import org.apache.airavata.xbaya.ui.utils.DrawUtils;

public class MemoNodeGUI extends NodeGUI {

    private static final int BORDER_SIZE = 5;

    private MemoNode node;

    private JTextArea textArea;

    private MemoConfigurationDialog window;

    /**
     * @param node
     */
    public MemoNodeGUI(MemoNode node) {
        super(node);
        this.node = node;

        this.textArea = new JTextArea();
        this.textArea.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
    }

    /**
     * @see org.apache.airavata.xbaya.ui.graph.GraphPieceGUI#mouseClicked(java.awt.event.MouseEvent,
     *      org.apache.airavata.xbaya.XBayaEngine)
     */
    @Override
    public void mouseClicked(MouseEvent event, XBayaEngine engine) {
        if (event.getClickCount() >= 2) {
            showWindow(engine);
        }
    }

    /**
     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#isIn(java.awt.Point)
     */
    @Override
    protected boolean isIn(Point point) {
        Point position = this.node.getPosition();
        Dimension preferredSize = this.textArea.getPreferredSize();
        Rectangle area = new Rectangle(position, preferredSize);
        return area.contains(point);
    }

    /**
     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#paint(java.awt.Graphics2D)
     */
    @Override
    protected void paint(Graphics2D g) {
        Point position = this.node.getPosition();
        this.textArea.setText(this.node.getMemo());
        Dimension preferredSize = this.textArea.getPreferredSize();
        Rectangle bounds = new Rectangle(position.x, position.y, preferredSize.width, preferredSize.height);
        this.textArea.setBounds(bounds);
        Graphics graphics = g.create(position.x, position.y, preferredSize.width, preferredSize.height);
        this.textArea.paint(graphics);
    }

    /**
     * @param engine
     */
    private void showWindow(XBayaEngine engine) {
        if (this.window == null) {
            this.window = new MemoConfigurationDialog(this.node, engine);
        }
        this.window.show();
    }

}


text:
// Template Source: Enum.java.tt
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.  See License in the project root for license information.
// ------------------------------------------------------------------------------

package com.microsoft.graph.models;

/**
 * The Enum Booking Price Type.
*/
public enum BookingPriceType
{
    /**
    * undefined
    */
    UNDEFINED,
    /**
    * fixed Price
    */
    FIXED_PRICE,
    /**
    * starting At
    */
    STARTING_AT,
    /**
    * hourly
    */
    HOURLY,
    /**
    * free
    */
    FREE,
    /**
    * price Varies
    */
    PRICE_VARIES,
    /**
    * call Us
    */
    CALL_US,
    /**
    * not Set
    */
    NOT_SET,
    /**
    * unknown Future Value
    */
    UNKNOWN_FUTURE_VALUE,
    /**
    * For BookingPriceType values that were not expected from the service
    */
    UNEXPECTED_VALUE
}


text:
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.suntektech.com")
package com.bxtel.webservice.dxgz;


text:
import pytest

from selenium import webdriver

def test_w3c_true():
    options = webdriver.ChromeOptions()
    options.add_experimental_option("w3c", True)

    chrome_kwargs = {"options": options}

    with pytest.warns(DeprecationWarning, match="Setting 'w3c: True' is redundant"):
        driver = webdriver.Chrome(**chrome_kwargs)

    driver.quit()

def test_w3c_false():
    options = webdriver.ChromeOptions()
    options.add_experimental_option("w3c", False)

    chrome_kwargs = {"options": options}

    with pytest.raises(AttributeError):
        webdriver.Chrome(**chrome_kwargs)


text:
/*
 *  jquery.loadingimagethingy.js
 *  a plugin that puts a loading icon and overlay into any specified element or window.
 *  @author gehsekky
 *  @version 1.1
 */
;(function ( $, window, document, undefined ) {
	"use strict";

	var pluginName = "loadingimagethingy",
		defaults = {
			overlayBackgroundColor: "rgba(0,0,0,0.5)", // the background color of the overlay in any format you want
			imageType: "css3", // css3|image
			imagePath: "", // either empty string or the path to image file
			imageHeight: 80, // image height as int (normally at 128, bubbling best set at 80, circleg at 32)
			imageWidth: 128, // image width as int (normally 128, circleg best at 150, floatingbarsg best at 103)
			animation: "bubbling", // floatingcircles|circularg|bubbling|circleg|floatingbarsg
			messageHeightOffset: 50, // hack to get text under positioned image
			message: "" // the text under the animation (if any)
		};

	// The actual plugin constructor
	function Plugin ( element, options ) {
		this.element = element;
		$(this.element).addClass("loadingimagethingy-container");

		this.settings = $.extend( {}, defaults, options );
		this._defaults = defaults;
		this._name = pluginName;
		this.init();
	}

	$.extend(Plugin.prototype, {
		init: function () {
			console.log("initializing loadingimagethingy");
		},
		enable: function () {
			var $this = $(this.element),
				template = '',
				$thingy, $overlay, $message, $container;

			// check to see if overlay already exists. if yes, do nothing.
			if ($this.find(".loadingimagethingy-overlay").length === 0) {
				switch(this.settings.imageType) {
					case "css3":
						switch(this.settings.animation) {
							case "floatingcircles":
								template =
									'
 \

 \

 \

 \

 \

 \

 \

 \

 \

';
								break;
							case "circularg":
								template =
									'
 \

 \

 \

 \

 \

 \

 \

 \

 \

';
								break;
							case "bubbling":
								template =
									'
 \
										 \
										 \
										 \

';
								break;
							case "circleg":
								template =
									'
 \

 \

 \

 \

';
								break;
							case "floatingbarsg":
								template =
									'
 \

 \

 \

 \

 \

 \

 \

 \

 \

';
								break;
							default:
								throw new Error("Unknown animation specified: " + this.settings.animation);
						}
						break;
					case "image":
						// quick sanity check
						if (!this.settings.imagePath) {
							throw new Error("Image type is image but there is no path specified.");
						}

						template =
							'

';
						break;
					default:
						throw new Error("Unsupported image type: " + this.settings.imageType);
				}

				// create new overlay and append to container element.
				$thingy = $(document.createElement("div"))
					.addClass("loadingimagethingy-image-container")
					.css("width", this.settings.imageWidth)
					.css("height", this.settings.imageHeight + this.settings.messageHeightOffset)
					.append(template);
				$overlay = $(document.createElement("div")).addClass("loadingimagethingy-overlay").css("background-color", this.settings.overlayBackgroundColor);

				if (this.settings.message !== "") {
					$message = $(document.createElement("div")).addClass("loadingimagethingy-message").append("
" + this.settings.message + "
");
					$thingy.append($message);
				}
				$overlay.append($thingy);
				$this.append($overlay);

				// set height and width
				$this.find(".loadingimagethingy").css("height", this.settings.imageHeight).css("width", this.settings.imageWidth);
			}
		},
		disable: function () {
			// remove plugin html
			$(this.element).find(".loadingimagethingy-overlay").remove();

			// destroy plugin
			this.destroy();
		},
		destroy: function () {
			// erase this plugin from the element data
			$.data(this.element, 'plugin_' + pluginName, null);

			console.log("loadingimagethingy destroyed");
		}
	});

	$.fn[pluginName] = function ( options ) {
		var args = arguments;

		if (options === undefined || typeof options === 'object') {
			return this.each(function () {
				if (!$.data(this, 'plugin_' + pluginName)) {
					$.data(this, 'plugin_' + pluginName, new Plugin( this, options ));
				}
			});
		} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
			return this.each(function () {
				if (!$.data(this, 'plugin_' + pluginName)) {
					$.data(this, 'plugin_' + pluginName, new Plugin( this, options ));
				}
				var instance = $.data(this, 'plugin_' + pluginName);
				if (instance instanceof Plugin && typeof instance[options] === 'function') {
					instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
				}
			});
		}
	};
})( jQuery, window, document );


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace Csla.Test.Authorization
{
#if TESTING
  [DebuggerNonUserCode]
#endif
  public class PerTypeAuthorization : BusinessBase<PerTypeAuthorization>
  {
    public static PropertyInfo<string> TestProperty = RegisterProperty<string>(c => c.Test);
    public string Test
    {
      get { return GetProperty(TestProperty); }
      set { SetProperty(TestProperty, value); }
    }

    public static PropertyInfo<string> NameProperty = RegisterProperty<string>(c => c.Name);
    public string Name
    {
      get { return GetProperty(NameProperty); }
      set { SetProperty(NameProperty, value); }
    }

    protected override void AddBusinessRules()
    {
      BusinessRules.AddRule(new Csla.Rules.CommonRules.IsInRole(Rules.AuthorizationActions.WriteProperty, TestProperty, new List<string> { "Admin" }));
    }

    [Create]
    private void Create()
    {
    }

  }
}


text:
CREATE TABLE [dbo].[PrayerRequestModel] (
	[Id]			VARCHAR(50) NOT NULL DEFAULT (NEWID()),
    [Request]         VARCHAR (8000) NULL,
    [Created]         DATETIME       DEFAULT (getdate()) NOT NULL,
    [Version] TIMESTAMP NOT NULL,
    [CreatedAt] DATETIMEOFFSET NULL DEFAULT SYSDATETIMEOFFSET(),
    [UpdatedAt] DATETIMEOFFSET NULL DEFAULT SYSDATETIMEOFFSET(),
    [Deleted] BIT NOT NULL DEFAULT 0,

    PRIMARY KEY CLUSTERED ([Id] ASC)
);


text: <input type="text" class="cLauncher__search" autofocus placeholder="Enter a Command">


text: export * from './dynamic-form.component';