text:
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#include <assert.h>
#include <stdlib.h>
#include <string.h>

#include "debug.h"
#include "log.h"
#include "protocol.h"

/*
 * Initializes the comm_element with any given type of data
 */
void
init_comm_element(struct comm_element *element, enum comm_element_t type)
{

	TRACE_IN(init_comm_element);
	memset(element, 0, sizeof(struct comm_element));

	switch (type) {
	case CET_WRITE_REQUEST:
		init_cache_write_request(&element->c_write_request);
		break;
	case CET_WRITE_RESPONSE:
		init_cache_write_response(&element->c_write_response);
		break;
	case CET_READ_REQUEST:
		init_cache_read_request(&element->c_read_request);
		break;
	case CET_READ_RESPONSE:
		init_cache_read_response(&element->c_read_response);
		break;
	case CET_TRANSFORM_REQUEST:
		init_cache_transform_request(&element->c_transform_request);
		break;
	case CET_TRANSFORM_RESPONSE:
		init_cache_transform_response(&element->c_transform_response);
		break;
	case CET_MP_WRITE_SESSION_REQUEST:
		init_cache_mp_write_session_request(&element->c_mp_ws_request);
		break;
	case CET_MP_WRITE_SESSION_RESPONSE:
		init_cache_mp_write_session_response(&element->c_mp_ws_response);
		break;
	case CET_MP_WRITE_SESSION_WRITE_REQUEST:
		init_cache_mp_write_session_write_request(
			&element->c_mp_ws_write_request);
		break;
	case CET_MP_WRITE_SESSION_WRITE_RESPONSE:
		init_cache_mp_write_session_write_response(
			&element->c_mp_ws_write_response);
		break;
	case CET_MP_READ_SESSION_REQUEST:
		init_cache_mp_read_session_request(&element->c_mp_rs_request);
		break;
	case CET_MP_READ_SESSION_RESPONSE:
		init_cache_mp_read_session_response(&element->c_mp_rs_response);
		break;
	case CET_MP_READ_SESSION_READ_RESPONSE:
		init_cache_mp_read_session_read_response(
			&element->c_mp_rs_read_response);
		break;
	case CET_UNDEFINED:
		break;
	default:
		LOG_ERR_2("init_comm_element", "invalid communication element");
		TRACE_OUT(init_comm_element);
	return;
	}

	element->type = type;
	TRACE_OUT(init_comm_element);
}

void
finalize_comm_element(struct comm_element *element)
{

	TRACE_IN(finalize_comm_element);
	switch (element->type) {
	case CET_WRITE_REQUEST:
		finalize_cache_write_request(&element->c_write_request);
		break;
	case CET_WRITE_RESPONSE:
		finalize_cache_write_response(&element->c_write_response);
		break;
	case CET_READ_REQUEST:
		finalize_cache_read_request(&element->c_read_request);
		break;
	case CET_READ_RESPONSE:
		finalize_cache_read_response(&element->c_read_response);
		break;
	case CET_TRANSFORM_REQUEST:
		finalize_cache_transform_request(&element->c_transform_request);
		break;
	case CET_TRANSFORM_RESPONSE:
		finalize_cache_transform_response(
			&element->c_transform_response);
		break;
	case CET_MP_WRITE_SESSION_REQUEST:
		finalize_cache_mp_write_session_request(
			&element->c_mp_ws_request);
		break;
	case CET_MP_WRITE_SESSION_RESPONSE:
		finalize_cache_mp_write_session_response(
			&element->c_mp_ws_response);
		break;
	case CET_MP_WRITE_SESSION_WRITE_REQUEST:
		finalize_cache_mp_write_session_write_request(
			&element->c_mp_ws_write_request);
		break;
	case CET_MP_WRITE_SESSION_WRITE_RESPONSE:
		finalize_cache_mp_write_session_write_response(
			&element->c_mp_ws_write_response);
		break;
	case CET_MP_READ_SESSION_REQUEST:
		finalize_cache_mp_read_session_request(
			&element->c_mp_rs_request);
		break;
	case CET_MP_READ_SESSION_RESPONSE:
		finalize_cache_mp_read_session_response(
			&element->c_mp_rs_response);
		break;
	case CET_MP_READ_SESSION_READ_RESPONSE:
		finalize_cache_mp_read_session_read_response(
			&element->c_mp_rs_read_response);
		break;
	case CET_UNDEFINED:
		break;
	default:
	break;
	}

	element->type = CET_UNDEFINED;
	TRACE_OUT(finalize_comm_element);
}

void
init_cache_write_request(struct cache_write_request *write_request)
{

	TRACE_IN(init_cache_write_request);
	memset(write_request, 0, sizeof(struct cache_write_request));
	TRACE_OUT(init_cache_write_request);
}

void
finalize_cache_write_request(struct cache_write_request *write_request)
{

	TRACE_IN(finalize_cache_write_request);
	free(write_request->entry);
	free(write_request->cache_key);
	free(write_request->data);
	TRACE_OUT(finalize_cache_write_request);
}

struct cache_write_request *
get_cache_write_request(struct comm_element *element)
{

	TRACE_IN(get_cache_write_request);
	assert(element->type == CET_WRITE_REQUEST);
	TRACE_OUT(get_cache_write_request);
	return (&element->c_write_request);
}

void
init_cache_write_response(struct cache_write_response *write_response)
{

	TRACE_IN(init_cache_write_response);
	memset(write_response, 0, sizeof(struct cache_write_response));
	TRACE_OUT(init_cache_write_response);
}

void
finalize_cache_write_response(struct cache_write_response *write_response)
{

	TRACE_IN(finalize_cache_write_response);
	TRACE_OUT(finalize_cache_write_response);
}

struct cache_write_response *
get_cache_write_response(struct comm_element *element)
{

	TRACE_IN(get_cache_write_response);
	assert(element->type == CET_WRITE_RESPONSE);
	TRACE_OUT(get_cache_write_response);
	return (&element->c_write_response);
}

void
init_cache_read_request(struct cache_read_request *read_request)
{

	TRACE_IN(init_cache_read_request);
	memset(read_request, 0, sizeof(struct cache_read_request));
	TRACE_OUT(init_cache_read_request);
}

void
finalize_cache_read_request(struct cache_read_request *read_request)
{

	TRACE_IN(finalize_cache_read_request);
	free(read_request->entry);
	free(read_request->cache_key);
	TRACE_OUT(finalize_cache_read_request);
}

struct cache_read_request *
get_cache_read_request(struct comm_element *element)
{

	TRACE_IN(get_cache_read_request);
	assert(element->type == CET_READ_REQUEST);
	TRACE_OUT(get_cache_read_request);
	return (&element->c_read_request);
}

void
init_cache_read_response(struct cache_read_response *read_response)
{

	TRACE_IN(init_cache_read_response);
	memset(read_response, 0, sizeof(struct cache_read_response));
	TRACE_OUT(init_cache_read_response);
}

void
finalize_cache_read_response(struct cache_read_response *read_response)
{

	TRACE_IN(finalize_cache_read_response);
	free(read_response->data);
	TRACE_OUT(finalize_cache_read_response);
}

struct cache_read_response *
get_cache_read_response(struct comm_element *element)
{

	TRACE_IN(get_cache_read_response);
	assert(element->type == CET_READ_RESPONSE);
	TRACE_OUT(get_cache_read_response);
	return (&element->c_read_response);
}

void
init_cache_transform_request(struct cache_transform_request *transform_request)
{

	TRACE_IN(init_cache_transform_request);
	memset(transform_request, 0, sizeof(struct cache_transform_request));
	TRACE_OUT(init_cache_transform_request);
}

void
finalize_cache_transform_request(
	struct cache_transform_request *transform_request)
{

	TRACE_IN(finalize_cache_transform_request);
	free(transform_request->entry);
	TRACE_OUT(finalize_cache_transform_request);
}

struct cache_transform_request *
get_cache_transform_request(struct comm_element *element)
{

	TRACE_IN(get_cache_transform_request);
	assert(element->type == CET_TRANSFORM_REQUEST);
	TRACE_OUT(get_cache_transform_request);
	return (&element->c_transform_request);
}

void
init_cache_transform_response(
	struct cache_transform_response *transform_response)
{

	TRACE_IN(init_cache_transform_request);
	memset(transform_response, 0, sizeof(struct cache_transform_response));
	TRACE_OUT(init_cache_transform_request);
}

void
finalize_cache_transform_response(
	struct cache_transform_response *transform_response)
{

	TRACE_IN(finalize_cache_transform_response);
	TRACE_OUT(finalize_cache_transform_response);
}

struct cache_transform_response *
get_cache_transform_response(struct comm_element *element)
{

	TRACE_IN(get_cache_transform_response);
	assert(element->type == CET_TRANSFORM_RESPONSE);
	TRACE_OUT(get_cache_transform_response);
	return (&element->c_transform_response);
}

void
init_cache_mp_write_session_request(
	struct cache_mp_write_session_request *mp_ws_request)
{

	TRACE_IN(init_cache_mp_write_session_request);
	memset(mp_ws_request, 0,
    		sizeof(struct cache_mp_write_session_request));
	TRACE_OUT(init_cache_mp_write_session_request);
}

void
finalize_cache_mp_write_session_request(
	struct cache_mp_write_session_request *mp_ws_request)
{

	TRACE_IN(finalize_cache_mp_write_session_request);
	free(mp_ws_request->entry);
	TRACE_OUT(finalize_cache_mp_write_session_request);
}

struct cache_mp_write_session_request *
get_cache_mp_write_session_request(struct comm_element *element)
{

	TRACE_IN(get_cache_mp_write_session_request);
	assert(element->type == CET_MP_WRITE_SESSION_REQUEST);
	TRACE_OUT(get_cache_mp_write_session_request);
	return (&element->c_mp_ws_request);
}

void
init_cache_mp_write_session_response(
	struct cache_mp_write_session_response *mp_ws_response)
{

	TRACE_IN(init_cache_mp_write_session_response);
	memset(mp_ws_response, 0,
    		sizeof(struct cache_mp_write_session_response));
	TRACE_OUT(init_cache_mp_write_session_response);
}

void
finalize_cache_mp_write_session_response(
	struct cache_mp_write_session_response *mp_ws_response)
{

	TRACE_IN(finalize_cache_mp_write_session_response);
	TRACE_OUT(finalize_cache_mp_write_session_response);
}

struct cache_mp_write_session_response *
get_cache_mp_write_session_response(struct comm_element *element)
{

	TRACE_IN(get_cache_mp_write_session_response);
	assert(element->type == CET_MP_WRITE_SESSION_RESPONSE);
	TRACE_OUT(get_cache_mp_write_session_response);
	return (&element->c_mp_ws_response);
}

void
init_cache_mp_write_session_write_request(
	struct cache_mp_write_session_write_request *mp_ws_write_request)
{

	TRACE_IN(init_cache_mp_write_session_write_request);
	memset(mp_ws_write_request, 0,
		sizeof(struct cache_mp_write_session_write_request));
	TRACE_OUT(init_cache_mp_write_session_write_response);
}

void
finalize_cache_mp_write_session_write_request(
	struct cache_mp_write_session_write_request *mp_ws_write_request)
{

	TRACE_IN(finalize_cache_mp_write_session_write_request);
	free(mp_ws_write_request->data);
	TRACE_OUT(finalize_cache_mp_write_session_write_request);
}

struct cache_mp_write_session_write_request *
get_cache_mp_write_session_write_request(struct comm_element *element)
{

	TRACE_IN(get_cache_mp_write_session_write_request);
	assert(element->type == CET_MP_WRITE_SESSION_WRITE_REQUEST);
	TRACE_OUT(get_cache_mp_write_session_write_request);
	return (&element->c_mp_ws_write_request);
}

void
init_cache_mp_write_session_write_response(
	struct cache_mp_write_session_write_response *mp_ws_write_response)
{

	TRACE_IN(init_cache_mp_write_session_write_response);
	memset(mp_ws_write_response, 0,
		sizeof(struct cache_mp_write_session_write_response));
	TRACE_OUT(init_cache_mp_write_session_write_response);
}

void
finalize_cache_mp_write_session_write_response(
	struct cache_mp_write_session_write_response *mp_ws_write_response)
{

	TRACE_IN(finalize_cache_mp_write_session_write_response);
	TRACE_OUT(finalize_cache_mp_write_session_write_response);
}

struct cache_mp_write_session_write_response *
get_cache_mp_write_session_write_response(struct comm_element *element)
{

	TRACE_IN(get_cache_mp_write_session_write_response);
	assert(element->type == CET_MP_WRITE_SESSION_WRITE_RESPONSE);
	TRACE_OUT(get_cache_mp_write_session_write_response);
	return (&element->c_mp_ws_write_response);
}

void
init_cache_mp_read_session_request(
	struct cache_mp_read_session_request *mp_rs_request)
{

	TRACE_IN(init_cache_mp_read_session_request);
	memset(mp_rs_request, 0, sizeof(struct cache_mp_read_session_request));
	TRACE_OUT(init_cache_mp_read_session_request);
}

void
finalize_cache_mp_read_session_request(
	struct cache_mp_read_session_request *mp_rs_request)
{

	TRACE_IN(finalize_cache_mp_read_session_request);
	free(mp_rs_request->entry);
	TRACE_OUT(finalize_cache_mp_read_session_request);
}

struct cache_mp_read_session_request *
get_cache_mp_read_session_request(struct comm_element *element)
{

	TRACE_IN(get_cache_mp_read_session_request);
	assert(element->type == CET_MP_READ_SESSION_REQUEST);
	TRACE_OUT(get_cache_mp_read_session_request);
	return (&element->c_mp_rs_request);
}

void
init_cache_mp_read_session_response(
	struct cache_mp_read_session_response *mp_rs_response)
{

	TRACE_IN(init_cache_mp_read_session_response);
	memset(mp_rs_response, 0,
    		sizeof(struct cache_mp_read_session_response));
	TRACE_OUT(init_cache_mp_read_session_response);
}

void
finalize_cache_mp_read_session_response(
	struct cache_mp_read_session_response *mp_rs_response)
{

	TRACE_IN(finalize_cache_mp_read_session_response);
	TRACE_OUT(finalize_cache_mp_read_session_response);
}

struct cache_mp_read_session_response *
get_cache_mp_read_session_response(struct comm_element *element)
{

	TRACE_IN(get_cache_mp_read_session_response);
	assert(element->type == CET_MP_READ_SESSION_RESPONSE);
	TRACE_OUT(get_cache_mp_read_session_response);
	return (&element->c_mp_rs_response);
}

void
init_cache_mp_read_session_read_response(
	struct cache_mp_read_session_read_response *mp_ws_read_response)
{

	TRACE_IN(init_cache_mp_read_session_read_response);
	memset(mp_ws_read_response, 0,
		sizeof(struct cache_mp_read_session_read_response));
	TRACE_OUT(init_cache_mp_read_session_read_response);
}

void
finalize_cache_mp_read_session_read_response(
	struct cache_mp_read_session_read_response *mp_rs_read_response)
{

	TRACE_IN(finalize_cache_mp_read_session_read_response);
	free(mp_rs_read_response->data);
	TRACE_OUT(finalize_cache_mp_read_session_read_response);
}

struct cache_mp_read_session_read_response *
get_cache_mp_read_session_read_response(struct comm_element *element)
{

	TRACE_IN(get_cache_mp_read_session_read_response);
	assert(element->type == CET_MP_READ_SESSION_READ_RESPONSE);
	TRACE_OUT(get_cache_mp_read_session_read_response);
	return (&element->c_mp_rs_read_response);
}


text:
function PlaneView(handle, player, homography)
{
    var me = this;

    this.drawimage = false;
    this.handle = handle;
    this.canvas = null;
    this.ctx = null;
    this.player = player;
    this.homography = homography;
    this.ready = false;
    this.backgroundimg = null;
    this.tracks = null;

    this.initializetracks = function(tracks) {
        this.tracks = tracks;
        tracks.onnewobject.push(function(track) {
            me.drawalltrajectories(tracks);
            track.onupdate.push(function() {
                me.clear();
                me.drawalltrajectories(tracks);
            });
        });
    }

    this.player.onupdate.push(function() {
        me.clear();
        me.drawalltrajectories(me.tracks);
    });

    this.clear = function() {
        if (!this.canvas) {
            return;
        }
        var width = this.canvas.width();
        var height = this.canvas.height();
        this.ctx.clearRect(0, 0, width, height);

        if (this.drawimage) {
            this.ctx.drawImage(this.backgroundimg, 0, 0, width, height);
        }
    }

    this.drawalltrajectories = function(tracks) {
        for (var i in tracks.tracks)
        {
            //this.drawtrajectory(tracks.tracks[i]);
        }
    }

    this.drawtrajectory = function(track) {
        if (!this.ready) return;
        this.ctx.beginPath();
        this.ctx.strokeStyle = track.color;

        var curframe = this.player.frame;
        var start = Math.max(this.player.job.start, curframe - 70);
        var stop = Math.min(this.player.job.stop, curframe + 70);

        var pos = track.estimate(start);
        var newpos = this.transformposition([pos.xbr, pos.ybr]);
        var newx = newpos[0] / newpos[2];
        var newy = newpos[1] / newpos[2];

        this.ctx.moveTo(newx, newy);

        for (var i = start; i < stop; i+=1) {
            pos = track.estimate(i);
            if (pos.outside) continue;

            newpos = this.transformposition([pos.xbr, pos.ybr]);
            newx = newpos[0] / newpos[2];
            newy = newpos[1] / newpos[2];
            this.ctx.lineTo(newx, newy);
        }

        this.ctx.stroke();
    }

    this.setupcanvas = function(width, height) {
        this.canvas = $("<canvas />").attr('height', height).attr('width', width);
        this.handle.append(this.canvas);
        this.ctx = this.canvas[0].getContext('2d');
        this.clear();
        this.ready = true;
    }

    this.transformposition = function(coord) {
        return numeric.dot(this.homography, [coord[0], coord[1], 1]);
    }

    this.invtransformposition = function(coord) {
        return numeric.dot(numeric.inv(this.homography), [coord[0], coord[1], 1]);
    }

    this.backgroundimg = new Image();
    this.backgroundimg.onload = function() {
        var height = me.backgroundimg.height;
        var width = me.backgroundimg.width;
        me.drawimage = true;
        me.setupcanvas(width, height);
    }

    this.backgroundimg.onerror = function() {
        var height = 240;
        var width = 320;
        me.drawimage = false;
        me.setupcanvas(width, height);
    }

    this.backgroundimg.src = player.job.topimageurl;
}

redpajama_set_name: RedPajamaGithub


text:
package org.conqat.engine.code_clones.core.report;

import org.conqat.engine.code_clones.core.CloneClass;
import org.conqat.engine.core.core.ConQATException;
import org.conqat.lib.commons.test.CCSMTestCaseBase;

/**
 * Tests the {@link CloneReportReader}.
 *
 * @author $Author: hummelb $
 * @version $Rev: 37613 $
 * @ConQAT.Rating GREEN Hash: B22BA76331164B0C090AFE20BE54938A
 */
public class CloneReportReaderTest extends CCSMTestCaseBase {

	/** Tests a basic read operation. */
	public void testRead() throws ConQATException {
		CloneReportReader reportReader = new CloneReportReader(
				useTestFile("Clones.xml"));

		assertTrue(reportReader.getRootValues().containsValue("foo"));
		assertEquals(42, reportReader.getRootValues().getInt("foo"));

		assertEquals(5, reportReader.getSourceElementDescriptors().size());

		SourceElementDescriptor descriptor = reportReader
				.getSourceElementDescriptors().get(4);
		assertEquals(212, descriptor.getLength());
		assertEquals("F127", descriptor.getFingerprint());
		assertEquals("UNRATED", descriptor.getString("rating"));
		assertEquals(42, descriptor.getInt("foo"));

		assertEquals(2, reportReader.getCloneClasses().size());

		CloneClass cloneClass = reportReader.getCloneClasses().get(1);
		assertEquals(4, cloneClass.size());
		assertEquals("UNRATED", cloneClass.getString("rating"));
	}

}


text:
METRO_CITIES = ['Toronto', 'Mississauga', 'Vancouver', 'Surrey', 'Burnaby', 'Ottawa',
  'Calgary', 'Edmonton', 'Winnipeg', 'Hamilton', 'Burlington', 'London', 'Kitchener',
  'Cambridge', 'Waterloo', 'Welland', 'Halifax', 'Oshawa', 'Whitby', 'Clarington',
  'Victoria', 'Saanich', 'Windsor', 'Saskatoon', 'LaSalle', 'Lakeshore', 'Tecumseh',
  'Regina', 'Barrie', 'Innisfil', 'Kelowna', 'Abbotsford'].sort


text:
package me.jeremy.ccst.transforms;

import android.view.View;

public class FlipHorizontalTransformer extends ABaseTransformer {

	@Override
	protected void onTransform(View view, float position) {
		final float rotation = 180f * position;

		view.setAlpha(rotation > 90f || rotation < -90f ? 0 : 1);
		view.setPivotX(view.getWidth() * 0.5f);
		view.setPivotY(view.getHeight() * 0.5f);
		view.setRotationY(rotation);
	}

}


text:
package de.bigprak.transform.flatmap;

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

import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.java.tuple.Tuple;
import org.apache.flink.types.NullFieldException;
import org.apache.flink.util.Collector;

public final class Splitter<T extends Tuple> implements FlatMapFunction<T, T>
{
	/**
	 *
	 */
	private static final long serialVersionUID = 2867536301386194426L;

	private int index;

	public Splitter(int index) {
		super();
		this.index = index;
	}

	/**
	 * split data like authors or cites
	 */
	@Override
	public void flatMap(T value, Collector<T> out) throws Exception {
		T newValue = value;
		List<String> splittedValues = Arrays.asList(value.getField(index).toString().split("[|]"));
		for(String splittedValue : splittedValues)
		{
			newValue.setField(splittedValue, index);
			out.collect(newValue);
		}
	}
}


text:
ActiveRecord::Schema.define(version: 20160930191850) do

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"

  create_table "bookmarks", force: :cascade do |t|
    t.integer  "user_id",       null: false
    t.string   "user_type"
    t.string   "document_id"
    t.string   "document_type"
    t.string   "title"
    t.datetime "created_at",    null: false
    t.datetime "updated_at",    null: false
  end

  add_index "bookmarks", ["document_id"], name: "index_bookmarks_on_document_id", using: :btree
  add_index "bookmarks", ["user_id"], name: "index_bookmarks_on_user_id", using: :btree

  create_table "checksum_audit_logs", force: :cascade do |t|
    t.string   "file_set_id"
    t.string   "file_id"
    t.string   "version"
    t.integer  "pass"
    t.string   "expected_result"
    t.string   "actual_result"
    t.datetime "created_at",      null: false
    t.datetime "updated_at",      null: false
  end

  add_index "checksum_audit_logs", ["file_set_id", "file_id"], name: "by_file_set_id_and_file_id", using: :btree

  create_table "content_blocks", force: :cascade do |t|
    t.string   "name"
    t.text     "value"
    t.datetime "created_at",   null: false
    t.datetime "updated_at",   null: false
    t.string   "external_key"
  end

  create_table "curation_concerns_operations", force: :cascade do |t|
    t.string   "status"
    t.string   "operation_type"
    t.string   "job_class"
    t.string   "job_id"
    t.string   "type"
    t.text     "message"
    t.integer  "user_id"
    t.integer  "parent_id"
    t.integer  "lft",                        null: false
    t.integer  "rgt",                        null: false
    t.integer  "depth",          default: 0, null: false
    t.integer  "children_count", default: 0, null: false
    t.datetime "created_at",                 null: false
    t.datetime "updated_at",                 null: false
  end

  add_index "curation_concerns_operations", ["lft"], name: "index_curation_concerns_operations_on_lft", using: :btree
  add_index "curation_concerns_operations", ["parent_id"], name: "index_curation_concerns_operations_on_parent_id", using: :btree
  add_index "curation_concerns_operations", ["rgt"], name: "index_curation_concerns_operations_on_rgt", using: :btree
  add_index "curation_concerns_operations", ["user_id"], name: "index_curation_concerns_operations_on_user_id", using: :btree

  create_table "domain_terms", force: :cascade do |t|
    t.string "model"
    t.string "term"
  end

  add_index "domain_terms", ["model", "term"], name: "terms_by_model_and_term", using: :btree

  create_table "domain_terms_local_authorities", id: false, force: :cascade do |t|
    t.integer "domain_term_id"
    t.integer "local_authority_id"
  end

  add_index "domain_terms_local_authorities", ["domain_term_id", "local_authority_id"], name: "dtla_by_ids2", using: :btree
  add_index "domain_terms_local_authorities", ["local_authority_id", "domain_term_id"], name: "dtla_by_ids1", using: :btree

  create_table "featured_collections", force: :cascade do |t|
    t.integer  "order",         default: 5
    t.string   "collection_id"
    t.datetime "created_at",                null: false
    t.datetime "updated_at",                null: false
  end

  add_index "featured_collections", ["collection_id"], name: "index_featured_collections_on_collection_id", using: :btree
  add_index "featured_collections", ["order"], name: "index_featured_collections_on_order", using: :btree

  create_table "featured_works", force: :cascade do |t|
    t.integer  "order",      default: 5
    t.string   "work_id"
    t.datetime "created_at",             null: false
    t.datetime "updated_at",             null: false
  end

  add_index "featured_works", ["order"], name: "index_featured_works_on_order", using: :btree
  add_index "featured_works", ["work_id"], name: "index_featured_works_on_work_id", using: :btree

  create_table "file_download_stats", force: :cascade do |t|
    t.datetime "date"
    t.integer  "downloads"
    t.string   "file_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer  "user_id"
  end

  add_index "file_download_stats", ["file_id"], name: "index_file_download_stats_on_file_id", using: :btree
  add_index "file_download_stats", ["user_id"], name: "index_file_download_stats_on_user_id", using: :btree

  create_table "file_view_stats", force: :cascade do |t|
    t.datetime "date"
    t.integer  "views"
    t.string   "file_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer  "user_id"
  end

  add_index "file_view_stats", ["file_id"], name: "index_file_view_stats_on_file_id", using: :btree
  add_index "file_view_stats", ["user_id"], name: "index_file_view_stats_on_user_id", using: :btree

  create_table "follows", force: :cascade do |t|
    t.integer  "followable_id",                   null: false
    t.string   "followable_type",                 null: false
    t.integer  "follower_id",                     null: false
    t.string   "follower_type",                   null: false
    t.boolean  "blocked",         default: false, null: false
    t.datetime "created_at",                      null: false
    t.datetime "updated_at",                      null: false
  end

  add_index "follows", ["followable_id", "followable_type"], name: "fk_followables", using: :btree
  add_index "follows", ["follower_id", "follower_type"], name: "fk_follows", using: :btree

  create_table "identities", force: :cascade do |t|
    t.string   "uid",        null: false
    t.string   "provider",   null: false
    t.integer  "user_id",    null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "identities", ["provider", "uid"], name: "index_identities_on_provider_and_uid", unique: true, using: :btree
  add_index "identities", ["user_id"], name: "index_identities_on_user_id", using: :btree

  create_table "import_field_mappings", force: :cascade do |t|
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "key"
    t.integer  "import_id"
    t.string   "value"
  end

  add_index "import_field_mappings", ["import_id"], name: "index_import_field_mappings_on_import_id", using: :btree

  create_table "imported_records", force: :cascade do |t|
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "import_id"
    t.string   "generic_work_pid"
    t.integer  "csv_row"
    t.boolean  "success"
    t.text     "message"
    t.string   "has_image"
    t.string   "has_watermark"
    t.string   "folder_name"
  end

  add_index "imported_records", ["import_id"], name: "index_imported_records_on_import_id", using: :btree

  create_table "imports", force: :cascade do |t|
    t.string   "name"
    t.boolean  "includes_headers",            default: true
    t.integer  "status",                      default: 0
    t.integer  "user_id"
    t.string   "server_import_location_name"
    t.string   "import_type"
    t.string   "rights"
    t.string   "preservation_level"
    t.string   "visibility"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "csv_file_name"
    t.string   "csv_content_type"
    t.integer  "csv_file_size"
    t.datetime "csv_updated_at"
    t.integer  "unit_id"
    t.string   "collection_id"
  end

  add_index "imports", ["unit_id"], name: "index_imports_on_unit_id", using: :btree
  add_index "imports", ["user_id"], name: "index_imports_on_user_id", using: :btree

  create_table "local_authorities", force: :cascade do |t|
    t.string "name"
  end

  create_table "local_authority_entries", force: :cascade do |t|
    t.integer "local_authority_id"
    t.string  "label"
    t.string  "uri"
  end

  add_index "local_authority_entries", ["local_authority_id", "label"], name: "entries_by_term_and_label", using: :btree
  add_index "local_authority_entries", ["local_authority_id", "uri"], name: "entries_by_term_and_uri", using: :btree

  create_table "mailboxer_conversation_opt_outs", force: :cascade do |t|
    t.integer "unsubscriber_id"
    t.string  "unsubscriber_type"
    t.integer "conversation_id"
  end

  add_index "mailboxer_conversation_opt_outs", ["conversation_id"], name: "index_mailboxer_conversation_opt_outs_on_conversation_id", using: :btree
  add_index "mailboxer_conversation_opt_outs", ["unsubscriber_id", "unsubscriber_type"], name: "index_mailboxer_conversation_opt_outs_on_unsubscriber_id_type", using: :btree

  create_table "mailboxer_conversations", force: :cascade do |t|
    t.string   "subject",    default: ""
    t.datetime "created_at",              null: false
    t.datetime "updated_at",              null: false
  end

  create_table "mailboxer_notifications", force: :cascade do |t|
    t.string   "type"
    t.text     "body"
    t.string   "subject",              default: ""
    t.integer  "sender_id"
    t.string   "sender_type"
    t.integer  "conversation_id"
    t.boolean  "draft",                default: false
    t.string   "notification_code"
    t.integer  "notified_object_id"
    t.string   "notified_object_type"
    t.string   "attachment"
    t.datetime "updated_at",                           null: false
    t.datetime "created_at",                           null: false
    t.boolean  "global",               default: false
    t.datetime "expires"
  end

  add_index "mailboxer_notifications", ["conversation_id"], name: "index_mailboxer_notifications_on_conversation_id", using: :btree
  add_index "mailboxer_notifications", ["notified_object_id", "notified_object_type"], name: "index_mailboxer_notifications_on_notified_object_id_and_type", using: :btree
  add_index "mailboxer_notifications", ["sender_id", "sender_type"], name: "index_mailboxer_notifications_on_sender_id_and_sender_type", using: :btree
  add_index "mailboxer_notifications", ["type"], name: "index_mailboxer_notifications_on_type", using: :btree

  create_table "mailboxer_receipts", force: :cascade do |t|
    t.integer  "receiver_id"
    t.string   "receiver_type"
    t.integer  "notification_id",                            null: false
    t.boolean  "is_read",                    default: false
    t.boolean  "trashed",                    default: false
    t.boolean  "deleted",                    default: false
    t.string   "mailbox_type",    limit: 25
    t.datetime "created_at",                                 null: false
    t.datetime "updated_at",                                 null: false
  end

  add_index "mailboxer_receipts", ["notification_id"], name: "index_mailboxer_receipts_on_notification_id", using: :btree
  add_index "mailboxer_receipts", ["receiver_id", "receiver_type"], name: "index_mailboxer_receipts_on_receiver_id_and_receiver_type", using: :btree

  create_table "memberships", force: :cascade do |t|
    t.integer  "unit_id"
    t.integer  "user_id"
    t.string   "level",      null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "memberships", ["level"], name: "index_memberships_on_level", using: :btree
  add_index "memberships", ["unit_id"], name: "index_memberships_on_unit_id", using: :btree
  add_index "memberships", ["user_id"], name: "index_memberships_on_user_id", using: :btree

  create_table "osul_import_imported_items", force: :cascade do |t|
    t.string   "fid"
    t.string   "got_image"
    t.string   "object_type"
    t.string   "gw_relation"
    t.text     "message"
    t.datetime "created_at",  null: false
    t.datetime "updated_at",  null: false
  end

  create_table "osul_import_items", force: :cascade do |t|
    t.string   "fid"
    t.string   "unit"
    t.string   "date_uploaded"
    t.string   "identifier"
    t.string   "resource_type"
    t.text     "title"
    t.string   "creator"
    t.string   "contributor"
    t.text     "description"
    t.text     "bibliographic_citation"
    t.text     "tag"
    t.text     "rights"
    t.text     "provenance"
    t.text     "publisher"
    t.text     "date_created"
    t.text     "subject"
    t.text     "language"
    t.text     "based_near"
    t.text     "related_url"
    t.text     "work_type"
    t.text     "spatial"
    t.text     "alternative"
    t.text     "temporal"
    t.text     "format"
    t.text     "staff_notes"
    t.text     "source"
    t.text     "part_of"
    t.string   "preservation_level_rationale"
    t.string   "preservation_level"
    t.string   "collection_identifier"
    t.string   "visibility"
    t.string   "collection_id"
    t.string   "depositor"
    t.string   "handle"
    t.string   "batch_id"
    t.string   "admin_policy_id"
    t.text     "materials"
    t.text     "measurements"
    t.string   "filename"
    t.string   "image_uri"
    t.datetime "created_at",                   null: false
    t.datetime "updated_at",                   null: false
  end

  create_table "proxy_deposit_requests", force: :cascade do |t|
    t.string   "work_id",                               null: false
    t.integer  "sending_user_id",                       null: false
    t.integer  "receiving_user_id",                     null: false
    t.datetime "fulfillment_date"
    t.string   "status",            default: "pending", null: false
    t.text     "sender_comment"
    t.text     "receiver_comment"
    t.datetime "created_at",                            null: false
    t.datetime "updated_at",                            null: false
  end

  add_index "proxy_deposit_requests", ["receiving_user_id"], name: "index_proxy_deposit_requests_on_receiving_user_id", using: :btree
  add_index "proxy_deposit_requests", ["sending_user_id"], name: "index_proxy_deposit_requests_on_sending_user_id", using: :btree

  create_table "proxy_deposit_rights", force: :cascade do |t|
    t.integer  "grantor_id"
    t.integer  "grantee_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "proxy_deposit_rights", ["grantee_id"], name: "index_proxy_deposit_rights_on_grantee_id", using: :btree
  add_index "proxy_deposit_rights", ["grantor_id"], name: "index_proxy_deposit_rights_on_grantor_id", using: :btree

  create_table "searches", force: :cascade do |t|
    t.text     "query_params"
    t.integer  "user_id"
    t.string   "user_type"
    t.datetime "created_at",   null: false
    t.datetime "updated_at",   null: false
  end

  add_index "searches", ["user_id"], name: "index_searches_on_user_id", using: :btree

  create_table "single_use_links", force: :cascade do |t|
    t.string   "downloadKey"
    t.string   "path"
    t.string   "itemId"
    t.datetime "expires"
    t.datetime "created_at",  null: false
    t.datetime "updated_at",  null: false
  end

  create_table "subject_local_authority_entries", force: :cascade do |t|
    t.string "label"
    t.string "lowerLabel"
    t.string "url"
  end

  add_index "subject_local_authority_entries", ["lowerLabel"], name: "entries_by_lower_label", using: :btree

  create_table "tinymce_assets", force: :cascade do |t|
    t.string   "file"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "trophies", force: :cascade do |t|
    t.integer  "user_id"
    t.string   "work_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "units", force: :cascade do |t|
    t.string   "name",                              null: false
    t.text     "description"
    t.string   "key",                               null: false
    t.datetime "created_at",                        null: false
    t.datetime "updated_at",                        null: false
    t.string   "image_file_name"
    t.string   "image_content_type"
    t.integer  "image_file_size"
    t.datetime "image_updated_at"
    t.string   "admin_policy_id"
    t.string   "contact_person"
    t.string   "address"
    t.string   "phone"
    t.string   "fax"
    t.string   "email"
    t.string   "url"
    t.boolean  "visible",            default: true
  end

  add_index "units", ["key"], name: "index_units_on_key", using: :btree

  create_table "uploaded_files", force: :cascade do |t|
    t.string   "file"
    t.integer  "user_id"
    t.string   "file_set_uri"
    t.datetime "created_at",   null: false
    t.datetime "updated_at",   null: false
  end

  add_index "uploaded_files", ["file_set_uri"], name: "index_uploaded_files_on_file_set_uri", using: :btree
  add_index "uploaded_files", ["user_id"], name: "index_uploaded_files_on_user_id", using: :btree

  create_table "user_stats", force: :cascade do |t|
    t.integer  "user_id"
    t.datetime "date"
    t.integer  "file_views"
    t.integer  "file_downloads"
    t.datetime "created_at",     null: false
    t.datetime "updated_at",     null: false
    t.integer  "work_views"
  end

  add_index "user_stats", ["user_id"], name: "index_user_stats_on_user_id", using: :btree

  create_table "users", force: :cascade do |t|
    t.string   "email",                  default: "",    null: false
    t.string   "encrypted_password",     default: "",    null: false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",          default: 0,     null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip"
    t.string   "last_sign_in_ip"
    t.datetime "created_at",                             null: false
    t.datetime "updated_at",                             null: false
    t.boolean  "guest",                  default: false
    t.string   "facebook_handle"
    t.string   "twitter_handle"
    t.string   "googleplus_handle"
    t.string   "display_name"
    t.string   "address"
    t.string   "admin_area"
    t.string   "department"
    t.string   "title"
    t.string   "office"
    t.string   "chat_id"
    t.string   "website"
    t.string   "affiliation"
    t.string   "telephone"
    t.string   "avatar_file_name"
    t.string   "avatar_content_type"
    t.integer  "avatar_file_size"
    t.datetime "avatar_updated_at"
    t.string   "linkedin_handle"
    t.string   "orcid"
    t.string   "arkivo_token"
    t.string   "arkivo_subscription"
    t.binary   "zotero_token"
    t.string   "zotero_userid"
    t.boolean  "admin",                  default: false
  end

  add_index "users", ["admin"], name: "index_users_on_admin", using: :btree
  add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
  add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree

  create_table "version_committers", force: :cascade do |t|
    t.string   "obj_id"
    t.string   "datastream_id"
    t.string   "version_id"
    t.string   "committer_login"
    t.datetime "created_at",      null: false
    t.datetime "updated_at",      null: false
  end

  create_table "work_view_stats", force: :cascade do |t|
    t.datetime "date"
    t.integer  "work_views"
    t.string   "work_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer  "user_id"
  end

  add_index "work_view_stats", ["user_id"], name: "index_work_view_stats_on_user_id", using: :btree
  add_index "work_view_stats", ["work_id"], name: "index_work_view_stats_on_work_id", using: :btree

  add_foreign_key "curation_concerns_operations", "users"
  add_foreign_key "identities", "users"
  add_foreign_key "mailboxer_conversation_opt_outs", "mailboxer_conversations", column: "conversation_id", name: "mb_opt_outs_on_conversations_id"
  add_foreign_key "mailboxer_notifications", "mailboxer_conversations", column: "conversation_id", name: "notifications_on_conversation_id"
  add_foreign_key "mailboxer_receipts", "mailboxer_notifications", column: "notification_id", name: "receipts_on_notification_id"
  add_foreign_key "memberships", "units"
  add_foreign_key "memberships", "users"
  add_foreign_key "uploaded_files", "users"
end


text:
package persistence

import (
	"errors"
	"golang.org/x/net/context"
	"gopkg.in/olivere/elastic.v5"
	"home24/core/provider"
)

type ElasticProvider struct {
	elasticClient *elastic.Client
	queryBuilder  QueryBuilder
}

/*NewElasticProvider is a factory method*/
func NewElasticProvider() ElasticProvider {
	client, err := elastic.NewClient()

	if err != nil {
		panic(err)
	}

	return ElasticProvider{
		elasticClient: client,
		queryBuilder:  QueryBuilder{},
	}
}

func (elasticProvider ElasticProvider) Get(request provider.Request) (interface{}, error) {
	query := elasticProvider.queryBuilder.Build(elasticProvider.elasticClient, request)

	searchResult, searchErr := query.
		Sort("_score", false).
		From(request.Index).
		Size(request.NumItems).
		Do(context.Background())

	if searchErr != nil {
		return nil, errors.New("There was an error while performing the search")
	}

	transformer, tranErr := Create(request.Typ)

	if tranErr != nil {
		return nil, tranErr
	}

	var items []interface{}

	for _, hit := range searchResult.Hits.Hits {
		result, transformErr := transformer.Transform(hit)

		if transformErr != nil {
			return nil, transformErr
		}

		items = append(items, result)
	}

	return items, nil
}


text:
using System;
using System.Threading.Tasks;
using Autofac;
using AzureRepositories.Assets;
using AzureRepositories.TransactionOutputs;
using AzureStorage.Queue;
using AzureStorage.Tables;
using Core;
using Core.Bitcoin;
using Core.Enums;
using Core.QBitNinja;
using Core.Repositories.Assets;
using Core.Repositories.TransactionOutputs;
using Core.Repositories.Wallets;
using Core.Settings;
using LkeServices.Bitcoin;
using LkeServices.QBitNinja;
using Lykke.SettingsReader;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using MongoDB.Driver;
using MongoRepositories.Mongo;
using MongoRepositories.TransactionOutputs;
using MongoRepositories.Walelts;
using NBitcoin;
using QBitNinja.Client;
using BroadcastedOutputEntity = MongoRepositories.TransactionOutputs.BroadcastedOutputEntity;
using BroadcastedOutputRepository = MongoRepositories.TransactionOutputs.BroadcastedOutputRepository;
using OutputEntity = MongoRepositories.TransactionOutputs.OutputEntity;
using SpentOutputRepository = MongoRepositories.TransactionOutputs.SpentOutputRepository;

namespace EnqueueFees
{
    public class DependencyBinder
    {
        public static IServiceProvider BindAndBuild(IConfigurationRoot configuration)
        {
            var mongoClient = new MongoClient(configuration.GetConnectionString("mongo"));
            var collection = new ServiceCollection();

            collection.AddTransient<EnqueueFeesJob>();
            collection.AddSingleton<Func<string, IQueueExt>>(x => AzureQueueExt.Create(new FakeReloadingManager(configuration.GetConnectionString("default")), x));
            collection.AddSingleton<IPregeneratedOutputsQueueFactory, PregeneratedOutputsQueueFactory>();

            collection.AddSingleton<IAssetRepository>(new AssetRepository(AzureTableStorage<AssetEntity>.Create(new FakeReloadingManager(configuration.GetConnectionString("dicts")), "Dictionaries", log: null)));

            collection.AddSingleton<ISpentOutputRepository>(
                new SpentOutputRepository(new MongoStorage<OutputEntity>(mongoClient, "SpentOutputs")));
            collection.AddSingleton<IWalletAddressRepository>(
                new WalletAddressRepository(new MongoStorage<WalletAddressEntity>(mongoClient, "Wallets")));

            collection.AddSingleton<ISegwitPrivateWalletRepository>(
                new SegwitPrivateWalletRepository(new MongoStorage<SegwitPrivateWalletEntity>(mongoClient, "SegwitWallets")));

            collection.AddSingleton<IBroadcastedOutputRepository>(
                new BroadcastedOutputRepository(new MongoStorage<BroadcastedOutputEntity>(mongoClient, "BroadcastedOutputs")));

            collection.AddSingleton<IInternalSpentOutputRepository>(
                new InternalSpentOutputRepository(new MongoStorage<InternalSpentOutput>(mongoClient, "InternalSpentOutputs")));
            var network = (NetworkType)configuration.GetValue<int>("BitcoinConfig:Network");

            var rpcConnectionParams = new RpcConnectionParams(new BaseSettings() { NetworkType = network });
            collection.AddSingleton(rpcConnectionParams);

            collection.AddSingleton<Func<QBitNinjaClient>>(x =>
            {
                return () => new QBitNinjaClient(configuration.GetValue<string>("BitcoinConfig:QBitNinjaBaseUrl"), rpcConnectionParams.Network);
            });
            collection.AddSingleton<IConfiguration>(configuration);
            collection.AddTransient<IQBitNinjaApiCaller, QBitNinjaApiCaller>();
            collection.AddTransient<IBitcoinOutputsService, BitcoinOutputsService>();
            return collection.BuildServiceProvider();
        }
    }

    public class FakeReloadingManager : IReloadingManager<string>
    {
        private readonly string _value;

        public FakeReloadingManager(string value)
        {
            _value = value;
        }

        public Task<string> Reload() => Task.FromResult(_value);

        public bool WasReloadedFrom(DateTime dateTime)
        {
            return true;
        }

        public bool HasLoaded => true;
        public string CurrentValue => _value;
    }
}


text:
namespace c74::min::lib {

    /// Defines several methods for interpolating between discrete data points such
    /// as those found in an array or matrix. These methods are commonly used in digital audio whenever we alter the rate at which a signal
    /// is read. These functions require known discrete values to be passed by reference along with a double between 0 and 1 representing
    /// the fractional location desired. They return the interpolated value.

    namespace interpolator {

        ///	Shared base class for all interpolator types.

        template<class T = number>
        class base {
        protected:
            MIN_CONSTEXPR base() noexcept {}

        public:
            virtual ~base() {}

            virtual T operator()(T x1, T x2, double delta) noexcept {
                return x1;
            }
            virtual T operator()(T x0, T x1, T x2, T x3, double delta) noexcept {
                return x1;
            }
            virtual void bias(double new_bias) {
                ;
            }
            virtual double bias() {
                return 0.0;
            }
            virtual void tension(double new_tension) {
                ;
            }
            virtual double tension() {
                return 0.0;
            }
        };

        ///	No interpolation always returns the first sample passed to it.
        ///	@tparam	T		The data type to interpolate. By default this is the number type.

        template<class T = number>
        class none : public base<T> {
        public:
            static const int delay = 0;

            /// Interpolate based on 2 samples of input.
            /// @param x1		Sample value that will be returned
            /// @param x2		Unused sample value
            /// @param delta	Unused fractional location
            /// @return         The interpolated value

            MIN_CONSTEXPR T operator()(T x1, T x2, double delta) noexcept {
                return x1;
            }

            /// Interpolate based on 4 samples of input.
            /// @param x0		Unused sample value
            /// @param x1		Sample value that will be returned
            /// @param x2		Unused sample value
            /// @param x3		Unused sample value
            /// @param delta	Unused fractional location
            /// @return         The interpolated value

            MIN_CONSTEXPR T operator()(T x0, T x1, T x2, T x3, double delta) noexcept {
                return x1;
            }
        };

        /// Nearest interpolator returns the closest sample by rounding the delta up or down.
        ///	@tparam	T		The data type to interpolate. By default this is the number type.

        template<class T = number>
        class nearest : public base<T> {
        public:
            static const int delay = 0;

            /// Interpolate based on 2 samples of input.
            /// @param x1		Returned sample value when rounding down
            /// @param x2		Returned sample value when rounding up
            /// @param delta	Fractional location between x1 and x2 @n
            ///                 delta < 0.5 => x1 @n
            ///                 delta >= 0.5 => x2
            /// @return         The interpolated value

            MIN_CONSTEXPR T operator()(T x1, T x2, double delta) noexcept {
                T out = delta < 0.5 ? x1 : x2;
                return out;
            }

            /// Interpolate based on 4 samples of input.
            /// @param x0		Unused sample value
            /// @param x1		Returned sample value when rounding down
            /// @param x2		Returned sample value when rounding up
            /// @param x3		Unused sample value
            /// @param delta	Fractional location between x1 and x2 @n
            ///                 delta < 0.5 => x1 @n
            ///                 delta >= 0.5 => x2
            /// @return         The interpolated value

            MIN_CONSTEXPR T operator()(T x0, T x1, T x2, T x3, double delta) noexcept {
                T out = delta < 0.5 ? x1 : x2;
                return out;
            }
        };

        /// Linear interpolator.
        ///	@tparam	T		The data type to interpolate. By default this is the number type.

        template<class T = number>
        class linear : public base<T> {
        public:
            static const int delay = 1;

            /// Interpolate based on 2 samples of input.
            /// @param x1		Sample value at prior integer index
            /// @param x2		Sample value at next integer index
            /// @param delta 	Fractional location between x1 (delta=0) and x2 (delta=1)
            /// @return			The interpolated value

            MIN_CONSTEXPR T operator()(T x1, T x2, double delta) noexcept {
                return x1 + delta * (x2 - x1);
            }

            /// Interpolate based on 4 samples of input.
            /// @param x0		Unused sample value
            /// @param x1		Sample value at prior integer index
            /// @param x2		Sample value at next integer index
            /// @param x3		Unused sample value
            /// @param delta 	Fractional location between x1 (delta=0) and x2 (delta=1)
            /// @return			The interpolated value

            MIN_CONSTEXPR T operator()(T x0, T x1, T x2, T x3, double delta) noexcept {
                return (*this)(x1, x2, delta);
            }
        };

        /// Allpass interpolator
        /// Testing shows this algorithm will become less accurate the more points it computes between two known samples.
        /// Also, because it uses an internal history, the reset() function should be used when switching between non-continuous segments of
        /// sampled audio data.
        ///	@tparam	T		The data type to interpolate. By default this is the number type.

        template<class T = number>
        class allpass : public base<T> {
        public:
            static const int delay = 1;

            /// Interpolate based on 2 samples of input.
            /// @param x1		Sample value at prior integer index
            /// @param x2		Sample value at next integer index
            /// @param delta 	Fractional location between x1 (delta=0) and x2 (delta=1) @n
            ///            		Be aware that delta=1.0 may not return the exact value at x2 given the nature of this algorithm.
            /// @return			The interpolated value

            MIN_CONSTEXPR T operator()(T x1, T x2, double delta) noexcept {
                T out = x1 + delta * (x2 - mY1);
                mY1   = out;
                return out;
            }

            /// Interpolate based on 4 samples of input.
            /// @param x0		Unused sample value
            /// @param x1		Sample value at prior integer index
            /// @param x2		Sample value at next integer index
            /// @param x3		Unused sample value
            /// @param delta 	Fractional location between x1 (delta=0) and x2 (delta=1) @n
            ///            		Be aware that delta=1.0 may not return the exact value at x2 given the nature of this algorithm.
            /// @return			The interpolated value

            MIN_CONSTEXPR T operator()(T x0, T x1, T x2, T x3, double delta) noexcept {
                return (*this)(x1, x2, delta);
            }

            /// Reset the interpolator history.
            /// This interpolator accumulates a history due to being an IIR filter internally.

            void reset() {
                mY1 = T(0.0);
            }

        private:
            T mY1 = T(0.0);
        };

        /// Cosine interpolator
        ///	@tparam	T		The data type to interpolate. By default this is the number type.

        template<class T = number>
        class cosine : public base<T> {
        public:
            static const int delay = 1;

            /// Interpolate based on 2 samples of input.
            /// @param x1		Sample value at prior integer index
            /// @param x2		Sample value at next integer index
            /// @param delta 	Fractional location between x1 (delta=0) and x2 (delta=1)
            /// @return			The interpolated value

            MIN_CONSTEXPR T operator()(T x1, T x2, double delta) noexcept {
                T a = 0.5 * (1.0 - cos(delta * M_PI));
                return x1 + a * (x2 - x1);
            }

            /// Interpolate based on 4 samples of input.
            /// @param x0		Unused sample value
            /// @param x1		Sample value at prior integer index
            /// @param x2		Sample value at next integer index
            /// @param x3		Unused sample value
            /// @param delta 	Fractional location between x1 (delta=0) and x2 (delta=1)
            /// @return			The interpolated value

            MIN_CONSTEXPR T operator()(T x0, T x1, T x2, T x3, double delta) noexcept {
                return (*this)(x1, x2, delta);
            }
        };

        /// Cubic interpolator
        ///	@tparam	T		The data type to interpolate. By default this is the number type.

        template<class T = number>
        class cubic : public base<T> {
        public:
            static const int delay = 3;

            /// Interpolate based on 4 samples of input.
            /// @param x0		Sample value at integer index prior to x0
            /// @param x1		Sample value at prior integer index
            /// @param x2		Sample value at next integer index
            /// @param x3		Sample value at integer index after x2
            /// @param delta	Fractional location between x1 (delta=0) and x2 (delta=1)
            /// @return			The interpolated value

            MIN_CONSTEXPR T operator()(T x0, T x1, T x2, T x3, double delta) noexcept {
                double delta2 = delta * delta;
                T      a      = x3 - x2 - x0 + x1;
                T      b      = x0 - x1 - a;
                T      c      = x2 - x0;
                return a * delta * delta2 + b * delta2 + c * delta + x1;
            }
        };

        /// Spline interpolator based on the Breeuwsma catmull-rom spline
        ///	@tparam	T		The data type to interpolate. By default this is the number type.

        template<class T = number>
        class spline : public base<T> {
        public:
            static const int delay = 3;

            /// Interpolate based on 4 samples of input.
            /// @param x0	Sample value at integer index prior to x
            /// @param x1	Sample value at prior integer index
            /// @param x2	Sample value at next integer index
            /// @param x3	Sample value at integer index after y
            /// @param delta	Fractional location between x1 (delta=0) and x2 (delta=1)
            /// @return		The interpolated value.

            MIN_CONSTEXPR T operator()(T x0, T x1, T x2, T x3, double delta) noexcept {
                T delta2 = delta * delta;
                T f0     = -0.5 * x0 + 1.5 * x1 - 1.5 * x2 + 0.5 * x3;
                T f1     = x0 - 2.5 * x1 + 2.0 * x2 - 0.5 * x3;
                T f2     = -0.5 * x0 + 0.5 * x2;
                return f0 * delta * delta2 + f1 * delta2 + f2 * delta + x1;
            }
        };

        /// Hermite interpolator
        /// When bias and tension are both set to 0.0, this algorithm is equivalent to Spline.
        ///	@tparam	T		The data type to interpolate. By default this is the number type.

        template<class T = number>
        class hermite : public base<T> {
        public:
            static const int delay{3};

            /// Set the bias attribute.
            /// @param	new_bias	The new bias value used in interpolating.

            void bias(double new_bias) {
                m_bias = new_bias;
            }

            /// Return the value of the bias attribute
            /// @return The current bias.

            double bias() {
                return m_bias;
            }

            /// Set the tension attribute.
            /// @param	new_tension		The new tension value used in interpolating.

            void tension(double new_tension) {
                m_tension = new_tension;
            }

            /// Return the value of the tension attribute
            /// @return The current tension.

            double tension() {
                return m_tension;
            }

            /// Interpolate based on 4 samples of input.
            /// @param x0	Sample value at integer index prior to x
            /// @param x1	Sample value at prior integer index
            /// @param x2	Sample value at next integer index
            /// @param x3	Sample value at integer index after y
            /// @param delta	Fractional location between x1 (delta=0) and x2 (delta=1)
            /// @return		The interpolated value.

            MIN_CONSTEXPR T operator()(T x0, T x1, T x2, T x3, double delta) noexcept {
                T delta2 = delta * delta;
                T delta3 = delta * delta2;
                T bp     = 1 + m_bias;
                T bm     = 1 - m_bias;
                T mt     = (1 - m_tension) * 0.5;
                T m0     = ((x1 - x0) * bp + (x2 - x1) * bm) * mt;
                T m1     = ((x2 - x1) * bp + (x3 - x2) * bm) * mt;
                T a0     = 2 * delta3 - 3 * delta2 + 1;
                T a1     = delta3 - 2 * delta2 + delta;
                T a2     = delta3 - delta2;
                T a3     = -2 * delta3 + 3 * delta2;
                return a0 * x1 + a1 * m0 + a2 * m1 + a3 * x2;
            }

        private:
            double m_bias{0.0};       // attribute
            double m_tension{0.0};    // attribute
        };

        /// Contains the names of available interpolation algorithms.
        /// Used with proxy::change_interpolation() to select a specific option.
        /// The final definition "type_count" is included to provide a method for querying the size of this enum list.

        enum class type : unsigned int { none, nearest, linear, allpass, cosine, cubic, spline, hermite, type_count };

        /// Proxy that provides means for objects to switch between interpolation types.
        /// @tparam	T		The data type to interpolate. By default this is the number type.

        template<class T = number>
        class proxy {
        public:
            /// Default constructor
            /// @param	first_type	Option from the type enum. By default this is type::none.

            explicit proxy(interpolator::type first_type = type::none) {
                // NW: The order here must match the order in type enum

                std::get<0>(m_type_vector) = std::unique_ptr<interpolator::base<T>>(new interpolator::none<T>);
                std::get<1>(m_type_vector) = std::unique_ptr<interpolator::base<T>>(new interpolator::nearest<T>);
                std::get<2>(m_type_vector) = std::unique_ptr<interpolator::base<T>>(new interpolator::linear<T>);
                std::get<3>(m_type_vector) = std::unique_ptr<interpolator::base<T>>(new interpolator::allpass<T>);
                std::get<4>(m_type_vector) = std::unique_ptr<interpolator::base<T>>(new interpolator::cosine<T>);
                std::get<5>(m_type_vector) = std::unique_ptr<interpolator::base<T>>(new interpolator::cubic<T>);
                std::get<6>(m_type_vector) = std::unique_ptr<interpolator::base<T>>(new interpolator::spline<T>);
                std::get<7>(m_type_vector) = std::unique_ptr<interpolator::base<T>>(new interpolator::hermite<T>);

                m_which_type = static_cast<int>(first_type);
            }

            /// Set the bias attribute on hermite interpolator.
            /// @param	new_bias	The new bias value used in interpolating.

            void bias(double new_bias) {
                m_type_vector[m_hermite_type]->bias(new_bias);
            }

            /// Return the value of the bias attribute on hermite interpolator.
            /// @return The current bias.

            double bias() {
                return m_type_vector[m_hermite_type]->bias();
            }

            /// Set the tension attribute on hermite interpolator.
            /// @param	new_tension		The new tension value used in interpolating.

            void tension(double new_tension) {
                m_type_vector[m_hermite_type]->tension(new_tension);
            }

            /// Return the value of the tension attribute on hermite interpolator.
            /// @return The current tension.

            double tension() {
                return m_type_vector[m_hermite_type]->tension();
            }

            /// Interpolate based on 4 samples of input.
            /// @param x0		Unused sample value
            /// @param x1		Sample value that will be returned
            /// @param x2		Unused sample value
            /// @param x3		Unused sample value
            /// @param delta	Unused fractional locationq
            /// @return         The interpolated value

            MIN_CONSTEXPR T operator()(T x0, T x1, T x2, T x3, double delta) noexcept {
                return m_type_vector[m_which_type]->operator()(x0, x1, x2, x3, delta);
            }

            /// Change the interpolation algorithm used.
            /// @param	new_type	option from the type enum

            void change_interpolation(type new_type) {
                m_which_type = static_cast<int>(new_type);
            }

        private:
            std::array<std::unique_ptr<interpolator::base<T>>, std::size_t(type::type_count)> m_type_vector;    ///< vector with one instance of each interpolator type
            int m_which_type;    ///< index within m_type_vector used for interpolation operator, stored to avoid repeat casting
            static const int m_hermite_type
                = static_cast<int>(type::hermite);    ///< index of the hermite interpolator, stored to avoid repeat casting
        };

    }    // namespace interpolator
}      // namespace c74::min::lib


text:
button {
  background: linear-gradient(top, black, white)
}


text:
/* This C file is generated by NIT to compile module native_interface. */
#include "native_interface._sep.h"
static const char LOCATE_native_interface___MMSrcModule___compile_separate_module[] = "native_interface::MMSrcModule::(compiling::MMModule::compile_separate_module)";
void native_interface___MMSrcModule___compile_separate_module(val_t p0, val_t p1){
  struct {struct stack_frame_t me; val_t MORE_REG[6];} fra;
  val_t REGB0;
  val_t tmp;
    static val_t once_value_1; /* Once value */
    static val_t once_value_2; /* Once value */
    static val_t once_value_3; /* Once value */
  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
  fra.me.file = LOCATE_native_interface;
  fra.me.line = 24;
  fra.me.meth = LOCATE_native_interface___MMSrcModule___compile_separate_module;
  fra.me.has_broke = 0;
  fra.me.REG_size = 7;
  fra.me.nitni_local_ref_head = NULL;
  fra.me.REG[0] = NIT_NULL;
  fra.me.REG[1] = NIT_NULL;
  fra.me.REG[2] = NIT_NULL;
  fra.me.REG[3] = NIT_NULL;
  fra.me.REG[4] = NIT_NULL;
  fra.me.REG[5] = NIT_NULL;
  fra.me.REG[6] = NIT_NULL;
  fra.me.REG[0] = p0;
  fra.me.REG[1] = p1;
  /* native_interface/native_interface.nit:24 */
  fra.me.REG[2] = fra.me.REG[0];
  fra.me.REG[3] = fra.me.REG[1];
  /* native_interface/native_interface.nit:26 */
  REGB0 = CALL_metamodel___abstractmetamodel___MMModule___is_extern_hybrid(fra.me.REG[2])(fra.me.REG[2]);
  if (UNTAG_Bool(REGB0)) {
    /* native_interface/native_interface.nit:27 */
    fra.me.REG[4] = NEW_FrontierVisitor_native_interface___frontier___FrontierVisitor___init(fra.me.REG[2], fra.me.REG[3]);
    /* native_interface/native_interface.nit:28 */
    CALL_native_interface___frontier___MMSrcModule___compile_frontier(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[4]);
    /* native_interface/native_interface.nit:30 */
    REGB0 = TAG_Int(5);
    fra.me.REG[5] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
    if (!once_value_1) {
      fra.me.REG[6] = BOX_NativeString("");
      REGB0 = TAG_Int(0);
      fra.me.REG[6] = NEW_String_standard___string___String___with_native(fra.me.REG[6], REGB0);
      once_value_1 = fra.me.REG[6];
      register_static_object(&once_value_1);
    } else fra.me.REG[6] = once_value_1;
    fra.me.REG[6] = fra.me.REG[6];
    CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
    fra.me.REG[3] = CALL_compiling___compiling_base___CProgram___compdir(fra.me.REG[3])(fra.me.REG[3]);
    CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[3]);
    if (!once_value_2) {
      fra.me.REG[3] = BOX_NativeString("/");
      REGB0 = TAG_Int(1);
      fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB0);
      once_value_2 = fra.me.REG[3];
      register_static_object(&once_value_2);
    } else fra.me.REG[3] = once_value_2;
    fra.me.REG[3] = fra.me.REG[3];
    CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[3]);
    fra.me.REG[2] = CALL_metamodel___abstractmetamodel___MMModule___name(fra.me.REG[2])(fra.me.REG[2]);
    fra.me.REG[2] = CALL_standard___string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]);
    CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]);
    if (!once_value_3) {
      fra.me.REG[2] = BOX_NativeString("");
      REGB0 = TAG_Int(0);
      fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB0);
      once_value_3 = fra.me.REG[2];
      register_static_object(&once_value_3);
    } else fra.me.REG[2] = once_value_3;
    fra.me.REG[2] = fra.me.REG[2];
    CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]);
    fra.me.REG[5] = CALL_standard___string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]);
    /* native_interface/native_interface.nit:31 */
    CALL_native_interface___frontier___FrontierVisitor___write_to_files(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]);
  }
  /* native_interface/native_interface.nit:34 */
  CALL_SUPER_native_interface___MMSrcModule___compile_separate_module(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
  stack_frame_head = fra.me.prev;
  return;
}


text:
/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
#include "proxy_constants.h"

namespace FinagleRegistryProxy {

const proxyConstants g_proxy_constants;

proxyConstants::proxyConstants() {
}

} // namespace


text:
FROM rancher/dind:v0.2.0

MAINTAINER Sangeetha Hariharan "<sangeetha@rancher.com>"

RUN apt-get update && apt-get -y install git openssh-server

RUN sed -i 's/PermitRootLogin\ without-password/PermitRootLogin\ no/' /etc/ssh/sshd_config
RUN mkdir -p /var/run/sshd

RUN useradd -m -d /opt/ranchertest ranchertest
RUN cd /opt/ranchertest && mkdir .ssh && chmod 700 .ssh && chown -R ranchertest:ranchertest .ssh
RUN sudo adduser ranchertest sudo
RUN echo "ranchertest ALL=NOPASSWD: ALL">>/etc/sudoers
RUN echo "PasswordAuthentication no">> /etc/ssh/sshd_config

COPY ./run.sh /scripts/run.sh
RUN chmod 777 /scripts/run.sh

EXPOSE 22

ENTRYPOINT [ "/scripts/run.sh" ]


text:
var Node  = require('vega-dataflow/src/Node'),
    chai  = require('chai'),
    spies = require('chai-spies');

global.d3 = require('d3');
global.dl = require('datalib');
global.chai = chai.use(spies);
global.expect = chai.expect;
global.transforms = require('../src/transforms/');
global.parseSpec = require('../src/parse/spec');
global.schema = require('../src/core/schema')();

var tv4 = global.tv4 = require('tv4');
global.validator = function(schema) {
  return function(data) {
    return tv4.validate(data, schema);
  };
};

global.schemaPath = function(path) {
  return dl.extend({ refs: schema.refs, defs: schema.defs }, path);
};

global.modelFactory = function(model) { return (model.fire(), model); };
global.viewFactory = function(model) {
  model.scene(new Node(model)).fire();
  return model;
};


text:
author: Aleksandar Todorović
comments: false
date: 2014-07-12 13:06:57+00:00
layout: post
slug: networking-is-hard
title: Man, Networking is Hard!
categories: en
tags:
- personal
- rant
image:
  feature: abstract-1-3
---

So, I started my college education last October. First semester I wasn't very good. I passed tree of five subjects I was supposed to pass and I got pretty much amazing grades in the subjects I did pass. But now, during the second semester, I started learning for my Cisco CCNA certificate. That certificate was the reason I decided to go on this collage (although, to be honest, my choice was very limited considering my financial situation at the time).

Now, I came to the end of the second semester. In my R&S course (first course in the path to CCNA certificate), I wasn't very active. I didn't go to all of the classes in that course I wasn't very regular in lab exercises. I did not study every week and I had more and more materials to learn. I knew that, but I just didn't pay attention. I took collage for granted and now I have a problem.

Tomorrow is my final test in my R&S course and I'm stuck. I did _try_ to study for it as much as I could in the last ten days. I managed to learn first eight chapters, but I got stuck during the chapter nine. I just can't understand subnetting and it's just a big pain in the butt for me. I lost my concentration and now I have no idea what to do. I studied that chapter yesterday. I've spent pretty much all of my day studying it and I still couldn't finish a basic subnetting in Packet Tracer. Now, I'm trying to do the same, but I just cannot concentrate at all. And, I still have two more chapter to go through after I finish this one.

Passing this exam is not going to be easy at all, but I will give my best. After all, being a cybersecurity specialist is my dream for a couple of years, and I just can't be that if I don't understand how networks actually work. This is going to be a long night.


text:
package com.amazonaws.services.rds.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *

 * This data type is used as a response element in the ModifyDBInstance action.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PendingModifiedValues implements Serializable, Cloneable {

    /**
     *

     * Contains the new DBInstanceClass for the DB instance that will be applied or is in progress.
     *

     */
    private String dBInstanceClass;
    /**
     *

     * Contains the new AllocatedStorage size for the DB instance that will be applied or is in progress.
     *

     */
    private Integer allocatedStorage;
    /**
     *

     * Contains the pending or in-progress change of the master credentials for the DB instance.
     *

     */
    private String masterUserPassword;
    /**
     *

     * Specifies the pending port for the DB instance.
     *

     */
    private Integer port;
    /**
     *

     * Specifies the pending number of days for which automated backups are retained.
     *

     */
    private Integer backupRetentionPeriod;
    /**
     *

     * Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment.
     *

     */
    private Boolean multiAZ;
    /**
     *

     * Indicates the database engine version.
     *

     */
    private String engineVersion;
    /**
     *

     * The license model for the DB instance.
     *

     *

     * Valid values: license-included | bring-your-own-license |
     * general-public-license
     *

     */
    private String licenseModel;
    /**
     *

     * Specifies the new Provisioned IOPS value for the DB instance that will be applied or is being applied.
     *

     */
    private Integer iops;
    /**
     *

     * Contains the new DBInstanceIdentifier for the DB instance that will be applied or is in progress.
     *

     */
    private String dBInstanceIdentifier;
    /**
     *

     * Specifies the storage type to be associated with the DB instance.
     *

     */
    private String storageType;
    /**
     *

     * Specifies the identifier of the CA certificate for the DB instance.
     *

     */
    private String cACertificateIdentifier;
    /**
     *

     * The new DB subnet group for the DB instance.
     *

     */
    private String dBSubnetGroupName;

    /**
     *

     * Contains the new DBInstanceClass for the DB instance that will be applied or is in progress.
     *

     *
     * @param dBInstanceClass
     *        Contains the new DBInstanceClass for the DB instance that will be applied or is in progress.
     */

    public void setDBInstanceClass(String dBInstanceClass) {
        this.dBInstanceClass = dBInstanceClass;
    }

    /**
     *

     * Contains the new DBInstanceClass for the DB instance that will be applied or is in progress.
     *

     *
     * @return Contains the new DBInstanceClass for the DB instance that will be applied or is in progress.
     */

    public String getDBInstanceClass() {
        return this.dBInstanceClass;
    }

    /**
     *

     * Contains the new DBInstanceClass for the DB instance that will be applied or is in progress.
     *

     *
     * @param dBInstanceClass
     *        Contains the new DBInstanceClass for the DB instance that will be applied or is in progress.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withDBInstanceClass(String dBInstanceClass) {
        setDBInstanceClass(dBInstanceClass);
        return this;
    }

    /**
     *

     * Contains the new AllocatedStorage size for the DB instance that will be applied or is in progress.
     *

     *
     * @param allocatedStorage
     *        Contains the new AllocatedStorage size for the DB instance that will be applied or is in
     *        progress.
     */

    public void setAllocatedStorage(Integer allocatedStorage) {
        this.allocatedStorage = allocatedStorage;
    }

    /**
     *

     * Contains the new AllocatedStorage size for the DB instance that will be applied or is in progress.
     *

     *
     * @return Contains the new AllocatedStorage size for the DB instance that will be applied or is in
     *         progress.
     */

    public Integer getAllocatedStorage() {
        return this.allocatedStorage;
    }

    /**
     *

     * Contains the new AllocatedStorage size for the DB instance that will be applied or is in progress.
     *

     *
     * @param allocatedStorage
     *        Contains the new AllocatedStorage size for the DB instance that will be applied or is in
     *        progress.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withAllocatedStorage(Integer allocatedStorage) {
        setAllocatedStorage(allocatedStorage);
        return this;
    }

    /**
     *

     * Contains the pending or in-progress change of the master credentials for the DB instance.
     *

     *
     * @param masterUserPassword
     *        Contains the pending or in-progress change of the master credentials for the DB instance.
     */

    public void setMasterUserPassword(String masterUserPassword) {
        this.masterUserPassword = masterUserPassword;
    }

    /**
     *

     * Contains the pending or in-progress change of the master credentials for the DB instance.
     *

     *
     * @return Contains the pending or in-progress change of the master credentials for the DB instance.
     */

    public String getMasterUserPassword() {
        return this.masterUserPassword;
    }

    /**
     *

     * Contains the pending or in-progress change of the master credentials for the DB instance.
     *

     *
     * @param masterUserPassword
     *        Contains the pending or in-progress change of the master credentials for the DB instance.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withMasterUserPassword(String masterUserPassword) {
        setMasterUserPassword(masterUserPassword);
        return this;
    }

    /**
     *

     * Specifies the pending port for the DB instance.
     *

     *
     * @param port
     *        Specifies the pending port for the DB instance.
     */

    public void setPort(Integer port) {
        this.port = port;
    }

    /**
     *

     * Specifies the pending port for the DB instance.
     *

     *
     * @return Specifies the pending port for the DB instance.
     */

    public Integer getPort() {
        return this.port;
    }

    /**
     *

     * Specifies the pending port for the DB instance.
     *

     *
     * @param port
     *        Specifies the pending port for the DB instance.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withPort(Integer port) {
        setPort(port);
        return this;
    }

    /**
     *

     * Specifies the pending number of days for which automated backups are retained.
     *

     *
     * @param backupRetentionPeriod
     *        Specifies the pending number of days for which automated backups are retained.
     */

    public void setBackupRetentionPeriod(Integer backupRetentionPeriod) {
        this.backupRetentionPeriod = backupRetentionPeriod;
    }

    /**
     *

     * Specifies the pending number of days for which automated backups are retained.
     *

     *
     * @return Specifies the pending number of days for which automated backups are retained.
     */

    public Integer getBackupRetentionPeriod() {
        return this.backupRetentionPeriod;
    }

    /**
     *

     * Specifies the pending number of days for which automated backups are retained.
     *

     *
     * @param backupRetentionPeriod
     *        Specifies the pending number of days for which automated backups are retained.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withBackupRetentionPeriod(Integer backupRetentionPeriod) {
        setBackupRetentionPeriod(backupRetentionPeriod);
        return this;
    }

    /**
     *

     * Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment.
     *

     *
     * @param multiAZ
     *        Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment.
     */

    public void setMultiAZ(Boolean multiAZ) {
        this.multiAZ = multiAZ;
    }

    /**
     *

     * Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment.
     *

     *
     * @return Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment.
     */

    public Boolean getMultiAZ() {
        return this.multiAZ;
    }

    /**
     *

     * Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment.
     *

     *
     * @param multiAZ
     *        Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withMultiAZ(Boolean multiAZ) {
        setMultiAZ(multiAZ);
        return this;
    }

    /**
     *

     * Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment.
     *

     *
     * @return Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment.
     */

    public Boolean isMultiAZ() {
        return this.multiAZ;
    }

    /**
     *

     * Indicates the database engine version.
     *

     *
     * @param engineVersion
     *        Indicates the database engine version.
     */

    public void setEngineVersion(String engineVersion) {
        this.engineVersion = engineVersion;
    }

    /**
     *

     * Indicates the database engine version.
     *

     *
     * @return Indicates the database engine version.
     */

    public String getEngineVersion() {
        return this.engineVersion;
    }

    /**
     *

     * Indicates the database engine version.
     *

     *
     * @param engineVersion
     *        Indicates the database engine version.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withEngineVersion(String engineVersion) {
        setEngineVersion(engineVersion);
        return this;
    }

    /**
     *

     * The license model for the DB instance.
     *

     *

     * Valid values: license-included | bring-your-own-license |
     * general-public-license
     *

     *
     * @param licenseModel
     *        The license model for the DB instance.

     *

     *        Valid values: license-included | bring-your-own-license |
     *        general-public-license
     */

    public void setLicenseModel(String licenseModel) {
        this.licenseModel = licenseModel;
    }

    /**
     *

     * The license model for the DB instance.
     *

     *

     * Valid values: license-included | bring-your-own-license |
     * general-public-license
     *

     *
     * @return The license model for the DB instance.

     *

     *         Valid values: license-included | bring-your-own-license |
     *         general-public-license
     */

    public String getLicenseModel() {
        return this.licenseModel;
    }

    /**
     *

     * The license model for the DB instance.
     *

     *

     * Valid values: license-included | bring-your-own-license |
     * general-public-license
     *

     *
     * @param licenseModel
     *        The license model for the DB instance.

     *

     *        Valid values: license-included | bring-your-own-license |
     *        general-public-license
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withLicenseModel(String licenseModel) {
        setLicenseModel(licenseModel);
        return this;
    }

    /**
     *

     * Specifies the new Provisioned IOPS value for the DB instance that will be applied or is being applied.
     *

     *
     * @param iops
     *        Specifies the new Provisioned IOPS value for the DB instance that will be applied or is being applied.
     */

    public void setIops(Integer iops) {
        this.iops = iops;
    }

    /**
     *

     * Specifies the new Provisioned IOPS value for the DB instance that will be applied or is being applied.
     *

     *
     * @return Specifies the new Provisioned IOPS value for the DB instance that will be applied or is being applied.
     */

    public Integer getIops() {
        return this.iops;
    }

    /**
     *

     * Specifies the new Provisioned IOPS value for the DB instance that will be applied or is being applied.
     *

     *
     * @param iops
     *        Specifies the new Provisioned IOPS value for the DB instance that will be applied or is being applied.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withIops(Integer iops) {
        setIops(iops);
        return this;
    }

    /**
     *

     * Contains the new DBInstanceIdentifier for the DB instance that will be applied or is in progress.
     *

     *
     * @param dBInstanceIdentifier
     *        Contains the new DBInstanceIdentifier for the DB instance that will be applied or is in
     *        progress.
     */

    public void setDBInstanceIdentifier(String dBInstanceIdentifier) {
        this.dBInstanceIdentifier = dBInstanceIdentifier;
    }

    /**
     *

     * Contains the new DBInstanceIdentifier for the DB instance that will be applied or is in progress.
     *

     *
     * @return Contains the new DBInstanceIdentifier for the DB instance that will be applied or is in
     *         progress.
     */

    public String getDBInstanceIdentifier() {
        return this.dBInstanceIdentifier;
    }

    /**
     *

     * Contains the new DBInstanceIdentifier for the DB instance that will be applied or is in progress.
     *

     *
     * @param dBInstanceIdentifier
     *        Contains the new DBInstanceIdentifier for the DB instance that will be applied or is in
     *        progress.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withDBInstanceIdentifier(String dBInstanceIdentifier) {
        setDBInstanceIdentifier(dBInstanceIdentifier);
        return this;
    }

    /**
     *

     * Specifies the storage type to be associated with the DB instance.
     *

     *
     * @param storageType
     *        Specifies the storage type to be associated with the DB instance.
     */

    public void setStorageType(String storageType) {
        this.storageType = storageType;
    }

    /**
     *

     * Specifies the storage type to be associated with the DB instance.
     *

     *
     * @return Specifies the storage type to be associated with the DB instance.
     */

    public String getStorageType() {
        return this.storageType;
    }

    /**
     *

     * Specifies the storage type to be associated with the DB instance.
     *

     *
     * @param storageType
     *        Specifies the storage type to be associated with the DB instance.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withStorageType(String storageType) {
        setStorageType(storageType);
        return this;
    }

    /**
     *

     * Specifies the identifier of the CA certificate for the DB instance.
     *

     *
     * @param cACertificateIdentifier
     *        Specifies the identifier of the CA certificate for the DB instance.
     */

    public void setCACertificateIdentifier(String cACertificateIdentifier) {
        this.cACertificateIdentifier = cACertificateIdentifier;
    }

    /**
     *

     * Specifies the identifier of the CA certificate for the DB instance.
     *

     *
     * @return Specifies the identifier of the CA certificate for the DB instance.
     */

    public String getCACertificateIdentifier() {
        return this.cACertificateIdentifier;
    }

    /**
     *

     * Specifies the identifier of the CA certificate for the DB instance.
     *

     *
     * @param cACertificateIdentifier
     *        Specifies the identifier of the CA certificate for the DB instance.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withCACertificateIdentifier(String cACertificateIdentifier) {
        setCACertificateIdentifier(cACertificateIdentifier);
        return this;
    }

    /**
     *

     * The new DB subnet group for the DB instance.
     *

     *
     * @param dBSubnetGroupName
     *        The new DB subnet group for the DB instance.
     */

    public void setDBSubnetGroupName(String dBSubnetGroupName) {
        this.dBSubnetGroupName = dBSubnetGroupName;
    }

    /**
     *

     * The new DB subnet group for the DB instance.
     *

     *
     * @return The new DB subnet group for the DB instance.
     */

    public String getDBSubnetGroupName() {
        return this.dBSubnetGroupName;
    }

    /**
     *

     * The new DB subnet group for the DB instance.
     *

     *
     * @param dBSubnetGroupName
     *        The new DB subnet group for the DB instance.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public PendingModifiedValues withDBSubnetGroupName(String dBSubnetGroupName) {
        setDBSubnetGroupName(dBSubnetGroupName);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getDBInstanceClass() != null)
            sb.append("DBInstanceClass: ").append(getDBInstanceClass()).append(",");
        if (getAllocatedStorage() != null)
            sb.append("AllocatedStorage: ").append(getAllocatedStorage()).append(",");
        if (getMasterUserPassword() != null)
            sb.append("MasterUserPassword: ").append(getMasterUserPassword()).append(",");
        if (getPort() != null)
            sb.append("Port: ").append(getPort()).append(",");
        if (getBackupRetentionPeriod() != null)
            sb.append("BackupRetentionPeriod: ").append(getBackupRetentionPeriod()).append(",");
        if (getMultiAZ() != null)
            sb.append("MultiAZ: ").append(getMultiAZ()).append(",");
        if (getEngineVersion() != null)
            sb.append("EngineVersion: ").append(getEngineVersion()).append(",");
        if (getLicenseModel() != null)
            sb.append("LicenseModel: ").append(getLicenseModel()).append(",");
        if (getIops() != null)
            sb.append("Iops: ").append(getIops()).append(",");
        if (getDBInstanceIdentifier() != null)
            sb.append("DBInstanceIdentifier: ").append(getDBInstanceIdentifier()).append(",");
        if (getStorageType() != null)
            sb.append("StorageType: ").append(getStorageType()).append(",");
        if (getCACertificateIdentifier() != null)
            sb.append("CACertificateIdentifier: ").append(getCACertificateIdentifier()).append(",");
        if (getDBSubnetGroupName() != null)
            sb.append("DBSubnetGroupName: ").append(getDBSubnetGroupName());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof PendingModifiedValues == false)
            return false;
        PendingModifiedValues other = (PendingModifiedValues) obj;
        if (other.getDBInstanceClass() == null ^ this.getDBInstanceClass() == null)
            return false;
        if (other.getDBInstanceClass() != null && other.getDBInstanceClass().equals(this.getDBInstanceClass()) == false)
            return false;
        if (other.getAllocatedStorage() == null ^ this.getAllocatedStorage() == null)
            return false;
        if (other.getAllocatedStorage() != null && other.getAllocatedStorage().equals(this.getAllocatedStorage()) == false)
            return false;
        if (other.getMasterUserPassword() == null ^ this.getMasterUserPassword() == null)
            return false;
        if (other.getMasterUserPassword() != null && other.getMasterUserPassword().equals(this.getMasterUserPassword()) == false)
            return false;
        if (other.getPort() == null ^ this.getPort() == null)
            return false;
        if (other.getPort() != null && other.getPort().equals(this.getPort()) == false)
            return false;
        if (other.getBackupRetentionPeriod() == null ^ this.getBackupRetentionPeriod() == null)
            return false;
        if (other.getBackupRetentionPeriod() != null && other.getBackupRetentionPeriod().equals(this.getBackupRetentionPeriod()) == false)
            return false;
        if (other.getMultiAZ() == null ^ this.getMultiAZ() == null)
            return false;
        if (other.getMultiAZ() != null && other.getMultiAZ().equals(this.getMultiAZ()) == false)
            return false;
        if (other.getEngineVersion() == null ^ this.getEngineVersion() == null)
            return false;
        if (other.getEngineVersion() != null && other.getEngineVersion().equals(this.getEngineVersion()) == false)
            return false;
        if (other.getLicenseModel() == null ^ this.getLicenseModel() == null)
            return false;
        if (other.getLicenseModel() != null && other.getLicenseModel().equals(this.getLicenseModel()) == false)
            return false;
        if (other.getIops() == null ^ this.getIops() == null)
            return false;
        if (other.getIops() != null && other.getIops().equals(this.getIops()) == false)
            return false;
        if (other.getDBInstanceIdentifier() == null ^ this.getDBInstanceIdentifier() == null)
            return false;
        if (other.getDBInstanceIdentifier() != null && other.getDBInstanceIdentifier().equals(this.getDBInstanceIdentifier()) == false)
            return false;
        if (other.getStorageType() == null ^ this.getStorageType() == null)
            return false;
        if (other.getStorageType() != null && other.getStorageType().equals(this.getStorageType()) == false)
            return false;
        if (other.getCACertificateIdentifier() == null ^ this.getCACertificateIdentifier() == null)
            return false;
        if (other.getCACertificateIdentifier() != null && other.getCACertificateIdentifier().equals(this.getCACertificateIdentifier()) == false)
            return false;
        if (other.getDBSubnetGroupName() == null ^ this.getDBSubnetGroupName() == null)
            return false;
        if (other.getDBSubnetGroupName() != null && other.getDBSubnetGroupName().equals(this.getDBSubnetGroupName()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getDBInstanceClass() == null) ? 0 : getDBInstanceClass().hashCode());
        hashCode = prime * hashCode + ((getAllocatedStorage() == null) ? 0 : getAllocatedStorage().hashCode());
        hashCode = prime * hashCode + ((getMasterUserPassword() == null) ? 0 : getMasterUserPassword().hashCode());
        hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode());
        hashCode = prime * hashCode + ((getBackupRetentionPeriod() == null) ? 0 : getBackupRetentionPeriod().hashCode());
        hashCode = prime * hashCode + ((getMultiAZ() == null) ? 0 : getMultiAZ().hashCode());
        hashCode = prime * hashCode + ((getEngineVersion() == null) ? 0 : getEngineVersion().hashCode());
        hashCode = prime * hashCode + ((getLicenseModel() == null) ? 0 : getLicenseModel().hashCode());
        hashCode = prime * hashCode + ((getIops() == null) ? 0 : getIops().hashCode());
        hashCode = prime * hashCode + ((getDBInstanceIdentifier() == null) ? 0 : getDBInstanceIdentifier().hashCode());
        hashCode = prime * hashCode + ((getStorageType() == null) ? 0 : getStorageType().hashCode());
        hashCode = prime * hashCode + ((getCACertificateIdentifier() == null) ? 0 : getCACertificateIdentifier().hashCode());
        hashCode = prime * hashCode + ((getDBSubnetGroupName() == null) ? 0 : getDBSubnetGroupName().hashCode());
        return hashCode;
    }

    @Override
    public PendingModifiedValues clone() {
        try {
            return (PendingModifiedValues) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}