text:
<?php

/**
 * This is a collection of utility functions that are too small to merit their
 * own class, or even their own file, so they're aggregated here. They include:
 *
 * - `info()` - Dumps a formatted data structure for quick debugging.
 * - `conf()` - Retrieves a value from the global configuration.
 * - `simple_auth()` - Provides a means of implementing custom auth schemes
 *   (includes built-in HTTP Basic support).
 * - `sql_split()` - Parses SQL data, removes comments, and splits it into
 *   individual queries.
 * - `format_filesize()` - Formats a byte value into more readable output.
 * - `detect()` - Simpel browser and browser type (e.g., mobile) detection.
 */

/**
 * Wraps a `print_r()` or `var_dump()` of the given `$value` with a set of `<pre></pre>`
 * tags around it, and echoes it.
 */
function info ($value, $full = false) {
	if (php_sapi_name () !== 'cli') {
		echo '<pre>';
		if ($full) {
			var_dump ($value);
		} else {
			print_r ($value);
		}
		echo '</pre>';
	} else {
		if ($full) {
			var_dump ($value);
		} else {
			print_r ($value);
		}
	}
}

/**
 * Get any global configuration section or individual setting value.
 * Lazy loads the configuration upon first use, and stores it privately
 * to avoid polluting the global space. Useful in templates as well.
 * Note: Uses ELEFANT_ENV, defined in the front controller, to determine
 * which configuration file to load, allowing for alternate dev, staging,
 * and production configurations in a single codebase.
 *
 * To update a value after the initial configuration has been loaded,
 * pass the new value as a third parameter, e.g.:
 *
 *     // Enable debugging
 *     conf ('General', 'debug', true);
 */
function conf ($section = false, $value = false, $update = null) {
	static $conf;
	static $env = [];

	// Read the settings on the first request
	if ($conf === null) {
		if (isset ($GLOBALS['conf'])) {
			$conf =& $GLOBALS['conf'];
		} elseif (defined ('ELEFANT_ENV') && ELEFANT_ENV !== 'config') {
			$conf = parse_ini_file ('conf/config.php', true);
			$conf = file_exists ('conf/' . ELEFANT_ENV . '.php')
				? array_replace_recursive (
					$conf,
					parse_ini_file ('conf/' . ELEFANT_ENV . '.php', true)
				  )
				: $conf;
		} else {
			$conf = parse_ini_file ('conf/config.php', true);
		}

		// Load any environment variable alternate mapping
		$map = file_exists ('conf/envmap.php')
			? parse_ini_file ('conf/envmap.php', false)
			: [
				'ELEFANT_SITE_NAME' => 'ELEFANT_SITE_NAME',
				'ELEFANT_EMAIL_FROM' => 'ELEFANT_EMAIL_FROM',
				'ELEFANT_DOMAIN' => 'ELEFANT_DOMAIN',
				'ELEFANT_DB_DRIVER' => 'ELEFANT_DB_DRIVER',
				'ELEFANT_DB_FILE' => 'ELEFANT_DB_FILE',
				'ELEFANT_DB_HOST' => 'ELEFANT_DB_HOST',
				'ELEFANT_DB_NAME' => 'ELEFANT_DB_NAME',
				'ELEFANT_DB_USER' => 'ELEFANT_DB_USER',
				'ELEFANT_DB_PASS' => 'ELEFANT_DB_PASS',
				'ELEFANT_TIMEZONE' => 'ELEFANT_TIMEZONE',
				'ELEFANT_UPDATES' => 'ELEFANT_UPDATES',
				'ELEFANT_SITE_KEY' => 'ELEFANT_SITE_KEY',
				'ELEFANT_SESSION_NAME' => 'ELEFANT_SESSION_NAME',
				'ELEFANT_SESSION_HANDLER' => 'ELEFANT_SESSION_HANDLER',
				'ELEFANT_SESSION_DOMAIN' => 'ELEFANT_SESSION_DOMAIN',
				'ELEFANT_SESSION_DURATION' => 'ELEFANT_SESSION_DURATION'
			];

		// Read environment variables for setting overrides
		if (getenv ($map['ELEFANT_SITE_NAME'])) {
			$conf['General']['site_name'] = getenv ($map['ELEFANT_SITE_NAME']);
			$env['General']['site_name'] = true;
		}

		if (getenv ($map['ELEFANT_EMAIL_FROM'])) {
			$conf['General']['email_from'] = getenv ($map['ELEFANT_EMAIL_FROM']);
			$env['General']['email_from'] = true;
		}

		if (getenv ($map['ELEFANT_DOMAIN'])) {
			$conf['General']['site_domain'] = getenv ($map['ELEFANT_DOMAIN']);
			$env['General']['site_domain'] = true;
		}

		if (getenv ($map['ELEFANT_DB_DRIVER'])) {
			$conf['Database']['master']['driver'] = getenv ($map['ELEFANT_DB_DRIVER']);
		}

		if (getenv ($map['ELEFANT_DB_FILE'])) {
			$conf['Database']['master']['file'] = getenv ($map['ELEFANT_DB_FILE']);
		}

		if (getenv ($map['ELEFANT_DB_HOST'])) {
			$conf['Database']['master']['host'] = getenv ($map['ELEFANT_DB_HOST']);
		}

		if (getenv ($map['ELEFANT_DB_NAME'])) {
			$conf['Database']['master']['name'] = getenv ($map['ELEFANT_DB_NAME']);
		}

		if (getenv ($map['ELEFANT_DB_USER'])) {
			$conf['Database']['master']['user'] = getenv ($map['ELEFANT_DB_USER']);
		}

		if (getenv ($map['ELEFANT_DB_PASS'])) {
			$conf['Database']['master']['pass'] = getenv ($map['ELEFANT_DB_PASS']);
		}

		if (getenv ($map['ELEFANT_TIMEZONE'])) {
			$conf['General']['timezone'] = getenv ($map['ELEFANT_TIMEZONE']);
			$env['General']['timezone'] = true;
		}

		if (getenv ($map['ELEFANT_UPDATES'])) {
			$conf['General']['check_for_updates'] = getenv ($map['ELEFANT_UPDATES']);
			$env['General']['check_for_updates'] = true;
		}

		if (getenv ($map['ELEFANT_SITE_KEY'])) {
			$conf['General']['site_key'] = getenv ($map['ELEFANT_SITE_KEY']);
			$env['General']['site_key'] = true;
		}

		if (getenv ($map['ELEFANT_SESSION_NAME'])) {
			$conf['General']['session_name'] = getenv ($map['ELEFANT_SESSION_NAME']);
			$env['General']['session_name'] = true;
		}

		if (getenv ($map['ELEFANT_SESSION_HANDLER'])) {
			$conf['General']['session_save_handler'] = getenv ($map['ELEFANT_SESSION_HANDLER']);
			$env['General']['session_save_handler'] = true;
		}

		if (getenv ($map['ELEFANT_SESSION_DOMAIN'])) {
			$conf['General']['session_domain'] = getenv ($map['ELEFANT_SESSION_DOMAIN']);
			$env['General']['session_domain'] = true;
		}

		if (getenv ($map['ELEFANT_SESSION_DURATION'])) {
			$conf['General']['session_duration'] = getenv ($map['ELEFANT_SESSION_DURATION']);
			$env['General']['session_duration'] = true;
		}
	}

	// Get or set a setting
	if ($value) {
		if ($update !== null) {
			// Only update values if they haven't been set via environment variables
			$set_from_env = (isset ($env[$section]) && isset ($env[$section][$value]) && $env[$section][$value] == true);
			if (! $set_from_env) {
				$conf[$section][$value] = $update;
			}
		}

		return (isset ($conf[$section]) && isset ($conf[$section][$value])) ? $conf[$section][$value] : null;
	}

	if ($section) {
		return isset ($conf[$section]) ? $conf[$section] : null;
	}

	return $conf;
}

/**
 * Wrapper for `conf()` that checks for an equivalent environment variable
 * and returns that first if found. The naming of the environment variables
 * are the concatenated names of the section and setting name. For example:
 *
 *     <?php
 *
 *     // Returns $_ENV['GENERAL_SITE_NAME'] if set.
 *     // Otherwise, returns conf ('General', 'site_name')
 *     $site_name = envconf ('General', 'site_name');
 *
 * Note that, unlike `conf()`, this function can only be used to read
 * individual values, and cannot be used to update them either.
 */
function envconf ($section, $value) {
	$envkey = strtoupper ($section . '_' . $value);

	$env = getenv ($envkey);

	if ($env !== false) {
		return $env;
	}

	return conf ($section, $value);
}

/**
 * Implements a simple authentication mechanism based on callbacks.
 * You provide a verifier function and a communication method function.
 * It then returns them like this:
 *
 *     method(verifier(user, pass));
 *
 * Implements HTTP Basic auth as a default method if none is given, and
 * uses the master account defined in `conf/global.php` if no verifier is
 * given.
 */
function simple_auth ($verifier = false, $method = false) {
	$verifier = ($verifier) ? $verifier : 'simple_auth_verifier';
	$method = ($method) ? $method : 'simple_auth_basic';
	return call_user_func ($method, $verifier);
}

/**
 * Default verifier for `simple_auth()`. This is meant to serve
 * as an example, and should be overridden with your own
 * implementation. Note its use of `conf()` variables that are
 * likely not set in a default Elefant installation.
 */
function simple_auth_verifier ($user, $pass) {
	if ($user == conf ('General', 'master_username') && $pass == conf ('General', 'master_password')) {
		return true;
	}
	return false;
}

/**
 * Default method for `simple_auth()`. Implements an HTTP basic
 * protocol.
 */
function simple_auth_basic ($callback) {
	if (! isset ($_SERVER['PHP_AUTH_USER']) || ! call_user_func ($callback, $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
		header ('WWW-Authenticate: Basic realm="This Website"');
		header ('HTTP/1.0 401 Unauthorized');
		return false;
	}
	return true;
}

/**
 * Splits an SQL script into distinct queries which can be evaluated or
 * manipulated individually.
 */
function sql_split ($sql) {
	$out = array ('');
	$broken = preg_split ('/[\n\r]+/s', $sql);
	foreach ($broken as $row) {
		$row = trim ($row);
		if (strpos ($row, '#') === 0 || strpos ($row, '--') === 0 || empty ($row)) {
			continue;
		} elseif (preg_match ('/;$/', $row)) {
			$out[count ($out) - 1] .= substr ($row, 0, strlen ($row) - 1) . "\n";
			$out[] = '';
		} else {
			$out[count ($out) - 1] .= $row . "\n";
		}
	}
	if (empty ($out[count ($out) - 1])) {
		array_pop ($out);
	}
	return $out;
}

/**
 * Returns a file size formatted in a more human-friendly format, rounded
 * to the nearest GB, MB, KB, or byte.
 */
function format_filesize ($size = 0) {
	if ($size >= 1073741824) {
		return round ($size / 1073741824 * 10) / 10 . " GB";
	} elseif ($size >= 1048576) {
		return round ($size / 1048576 * 10) / 10 . " MB";
	} elseif ($size >= 1024) {
		return round ($size / 1024) . " KB";
	} else {
		return $size . " b";
	}
}

/**
 * Very basic browser detection. `$browser` can be one of:
 *
 * - msie, ie
 * - firefox, ff, moz
 * - chrome
 * - safari
 * - webkit
 * - opera
 * - opera mini
 * - opera mobi
 * - ios
 * - iphone
 * - ipad
 * - android
 * - iemobile
 * - webos
 * - blackberry
 * - googlebot
 * - bot
 * - mobile
 * - tablet
 * - desktop
 *
 * Notes:
 *
 * - `mobile` and `tablet` matches are not exhaustive, they only list the common
 *   platforms.
 *
 * - `desktop` means not a mobile or tablet device, and may be Linux, Mac, or Windows.
 *
 * - iPad and iPod are both reported as mobile devices in the user agent string,
 *   but `detect()` corrects for this in the case of the iPad.
 *
 * - Android reports as true for both mobile and tablet currently.
 *
 * - Some matches might be seen as false-positives, such as Chrome matching Safari.
 *   In these cases, look at other detection options. For example with Chrome, the
 *   rendering engine is Webkit, so better to simply use that.
 *
 * - No version detection. For IE version-specific needs, use conditional comments
 *   in your HTML, or use a string like `msie 10`.
 *
 * - Other lowercase strings that are not listed above can be used as well,
 *   for example `wap`, or `smartphone`.
 */
function detect ($browser) {
	$ua = strtolower ($_SERVER['HTTP_USER_AGENT']);
	$ver = '';

	// Normalize names
	$browser = ($browser === 'ie') ? 'msie' : $browser;
	$browser = ($browser === 'ff') ? 'firefox' : $browser;
	$browser = ($browser === 'moz') ? 'firefox' : $browser;

	if ($browser === 'mobile') {
		if (! preg_match ('/(iphone|ipod|android|opera mini|opera mobi|symb|phone|webos|blackberry|mobile)/', $ua)) {
			// No common mobile platform
			return false;
		} elseif (strpos ($ua, 'ipad') !== false) {
			// iPad should be separate from mobile
			return false;
		}
		return true;
	} elseif ($browser === 'tablet') {
		if (! preg_match ('/(ipad|android|tablet)/', $ua)) {
			// Not iPad, Android, or tablet
			return false;
		}
		return true;
	} elseif ($browser === 'ios') {
		if (! preg_match ('/(ipad|iphone|ipod)/', $ua)) {
			// Not iOS
			return false;
		}
		return true;
	} elseif ($browser === 'desktop') {
		if (detect ('mobile') || detect ('tablet')) {
			// Tablet or mobile
			return false;
		}
		return true;
	} elseif (strpos ($ua, $browser) === false) {
		return false;
	}
	return true;
}

/**
 * Recursively delete a folder and all its contents.
 * Handles hidden dot-files as well as regular files.
 */
function rmdir_recursive ($path) {
	if (preg_match ('|/\.+$|', $path)) {
		return;
	}
	return is_file ($path)
		? unlink ($path)
		: array_map ('rmdir_recursive', glob ($path . '/{,.}*', GLOB_BRACE)) == rmdir ($path);
}

/**
 * Fetch a remote URL using either cURL or fopen, depending
 * on which is available.
 */
function fetch_url ($url) {
	if (extension_loaded ('curl')) {
		$ch = curl_init ();
		curl_setopt ($ch, CURLOPT_HEADER, 0);
		curl_setopt ($ch, CURLOPT_VERBOSE, 0);
		curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
		curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
		curl_setopt ($ch, CURLOPT_FAILONERROR, 0);
		curl_setopt ($ch, CURLOPT_URL, $url);
		curl_setproxy ($ch, $url);
		$res = curl_exec ($ch);
		curl_close ($ch);
		return $res;
	}
	return file_get_contents ($url);
}

/**
 * Sets proxy for a curl call using global settings.
 *
 * @param resource $ch
 * @param string $url
 */
function curl_setproxy ($ch, $url) {

	$set_proxy = true;
	if (conf ('Proxy', 'url') && intval (conf ('Proxy', 'port'))) {
		if (conf ('Proxy', 'skip_urls')) {
			if (($domain = parse_url ($url, PHP_URL_HOST))) {
				if (in_array ($domain, explode (',', conf ('Proxy', 'skip_urls')))) {
					$set_proxy = false;
				}
			}
		}
		if (conf ('Proxy', 'skip_ips')) {
			if (($domain = parse_url ($url, PHP_URL_HOST))) {
				if (($ip = gethostbyname ($domain))) {
					if (in_array ($ip, explode (',', conf ('Proxy', 'skip_ips')))) {
						$set_proxy = false;
					}
				}
			}
		}
		if ($set_proxy) {
			curl_setopt ($ch, CURLOPT_PROXY,
				conf ('Proxy', 'url') . ':' . intval (conf ('Proxy', 'port'))
			);
		}
	}
}

/**
 * Returns URL without protocol and domain, just path, query and fragment:
 *	https://www.elefantcms.com/docs/2.0?param=value#top => /docs/2.0?param=value#top
 *
 * @param string $url
 * @return string
 */
function url_get_fullpath ($url) {

	$url = parse_url ($url);
	$return = $url['path'];
	if ($url['query']) {
		$return .= '?' . $url[query];
	}
	if ($url['fragment']) {
		$return .= '#' . $url[fragment];
	}
	return $return;
}


text:
package net.canang.cfi.web.dd.client.model;

import net.canang.cfi.web.client.model.CodedModel;

/**
 * @author rafizan.baharum
 * @since 10/21/13
 */
public class PositionCodeModel extends CodedModel {

    public static final String GRADE = "grade";

    private Integer grade;

    public Integer getGrade() {
        return get(GRADE);
    }

    public void setGrade(Integer grade) {
        set(GRADE, grade);
    }

}

redpajama_set_name: RedPajamaGithub


text:
<Record>
<Term>Coagulants</Term>
<SemanticType>Pharmacologic Substance</SemanticType>
<ParentTerm>Hematologic Agents</ParentTerm>
<ClassificationPath>Chemical Actions and Uses/Pharmacologic Actions/Therapeutic Uses/Hematologic Agents/Coagulants</ClassificationPath>
<BroaderTerm>Therapeutic Uses</BroaderTerm>
<BroaderTerm>Pharmacologic Actions</BroaderTerm>
<BroaderTerm>Coagulants</BroaderTerm>
<BroaderTerm>Hematologic Agents</BroaderTerm>
<BroaderTerm>Chemical Actions and Uses</BroaderTerm>
<ChildTerm>Hemostatics</ChildTerm>
<ChildTerm>Heparin Antagonists</ChildTerm>
<Synonym>Coagulants</Synonym>
<Description>Exogenous substances used to promote blood coagulation. The endogenous BLOOD COAGULATION FACTORS are considered to be coagulants only when administered as drugs.</Description>
<Source>MeSH</Source>
</Record>


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

    <string name="app_name">Accelerometer</string>
    <string name="btnStart_text">Start</string>
    <string name="activity_title">Accelerometer</string>
    <string name="btnStop_text">Stop</string>
    <string name="alpha_hint">0.1</string>
    <string name="high_pass">High-pass filter</string>
	<string name="low_pass">Low-pass</string>
	<string name="alpha_label">Alpha filter coeficient:</string>
    <string name="pref_alpha">pref_alpha</string>
	<string name="pref_highpass">pref_highpass</string>
	<string name="pref_sampling_rate">Sensors sampling rate</string>

</resources>


text:
layout: post
title: "invert binary tree"
date: 2016-02-29 14:11:33
description: leetcode algorithms - easy
---

<pre>
Invert a binary tree.

     4
   /   \
  2     7
 / \   / \
1   3 6   9

to

     4
   /   \
  7     2
 / \   / \
9   6 3   1
</pre>

#### Approach
This problem isn't that bad if you notice that the left and right children of each node are reversed at each level. First the root's children are reversed, then it goes to those children and reverses their children, and so on.

Therefore we can just use a Depth-First Search and rotate the children at each node we encounter. This can be done easily with recursion by reversing on each recursive call, then calling the function again with its children. We return the root at the end and in the base case since we want the top level root to be returned in the end.

#### Solution
{% highlight javascript %}
var invertTree = function(root) {
    if(root === null) {
        return root;
    }

    var temp = root.left;
    root.left = root.right;
    root.right = temp;

    invertTree(root.left);
    invertTree(root.right);
    return root;
};
{% endhighlight %}


text:
from django.test import TestCase, Client
from django.conf import settings
from django.contrib.auth.models import User

## DRF:
from rest_framework.reverse import reverse

## Tangent:
from tokenauth.authbackends import TokenAuthBackend
from api.models import {{model_name}}

## Global:
import requests, responses, json

{{model_name|upper}}_LIST = '{{model_name|lower}}-list'
{{model_name|upper}}_DETAIL = '{{model_name|lower}}-detail'

def mock_auth_success():

	url = '{0}/api/v1/users/me/' . format(settings.USERSERVICE_BASE_URL)
	response_string = '{"username": "TEST"}'
	responses.add(responses.GET, url,
              body=response_string, status=200,
              content_type='application/json')

def mock_auth_failure():

	url = '{0}/api/v1/users/me/' . format(settings.USERSERVICE_BASE_URL)
	responses.add(responses.GET, url,
              body='', status=401,
              content_type='application/json')

class TokenAuthBackendTestCase(TestCase):

	def setUp(self):
		self.c = Client(Authorization='Token 123')

	@responses.activate
	def test_token_auth_works(self):

		mock_auth_success()
		url = reverse({{model_name}}_LIST)
		response = self.c.get(url)
		assert response.status_code == 200, 'Expect 200 OK'

class {{model_name}}EndpointTestCase(TestCase):

	def setUp(self):
		self.c = Client(Authorization='Token 123')

		self.joe = User.objects.create_user(username='joe_normal', password='test')
		self.joe_admin = User.objects.create_superuser(username='joe_admin', email='joe@example.com', password='test')

	@responses.activate
	def test_get_{{model_name|lower}}_list_requires_auth(self):

		mock_auth_failure()
		url = reverse({{model_name}}_LIST)
		response = self.c.get(url)
		assert response.status_code == 403, 'Expect permission denied'

	def test_get_{{model_name|lower}}_list_returns_only_logged_in_users_details(self):

		{{model_name}}.quick_create(user=self.joe.pk)
		{{model_name}}.quick_create(user=self.joe_admin.pk)

		self.c.login(username="joe_normal", password="test")

		url = reverse({{model_name}}_LIST)
		response = self.c.get(url)
		assert response.status_code == 200, 'Expect 200 OK'

		jresponse = json.loads(response.content)
		assert len(jresponse) == 1, 'Should only return a single result'
		assert jresponse[0].get("user") == str(self.joe.pk), 'Only return Joe normal\'s Expenses'

	def test_get_{{model_name|lower}}_list_returns_all_expenses_if_admin(self):

		{{model_name}}.quick_create(user=self.joe.pk)
		{{model_name}}.quick_create(user=self.joe_admin.pk)

		self.c.login(username="joe_admin", password="test")

		url = reverse({{model_name}}_LIST)
		response = self.c.get(url)
		assert response.status_code == 200, 'Expect 200 OK'

		jresponse = json.loads(response.content)
		assert len(jresponse) == 2, 'Should return all results'


text:
package study.ejb2.lifecycle.stateless;

import java.rmi.RemoteException;

import javax.ejb.CreateException;
import javax.ejb.EJBHome;

/**
 * The home interface must have the method ejbCreate().
 * Every method must declare CreateException
 */
public interface EjbStatelessHome extends EJBHome {

	public EjbStatelessComponent create()
			throws CreateException, RemoteException;
}


text:
class OwnershipsController < ApplicationController
  before_action :logged_in_user

  def create
    if params[:asin]
      @item = Item.find_or_initialize_by(asin: params[:asin])
    else
      @item = Item.find(params[:item_id])
    end

    # itemsテーブルに存在しない場合はAmazonのデータを登録する。
    if @item.new_record?
      begin
        # TODO 商品情報の取得 Amazon::Ecs.item_lookupを用いてください
        response = Amazon::Ecs.item_lookup(params[:asin],
                                  :response_group => 'Medium' ,
                                  :country => 'jp')
      rescue Amazon::RequestError => e
        return render :js => "alert('#{e.message}')"
      end

      amazon_item       = response.items.first
      @item.title        = amazon_item.get('ItemAttributes/Title')
      @item.small_image  = amazon_item.get("SmallImage/URL")
      @item.medium_image = amazon_item.get("MediumImage/URL")
      @item.large_image  = amazon_item.get("LargeImage/URL")
      @item.detail_page_url = amazon_item.get("DetailPageURL")
      @item.raw_info        = amazon_item.get_hash
      @item.save!
    end

    # TODO ユーザにwant or haveを設定する
    # params[:type]の値ににHaveボタンが押された時には「Have」,
    # Wantボタンがされた時には「Want」が設定されています。
    if params[:type] == "Have"
      current_user.have(@item)
    elsif params[:type] == "Want"
      current_user.want(@item)
    end
  end

  def destroy
    @item = Item.find(params[:item_id])

    # TODO 紐付けの解除。
    # params[:type]の値ににHavedボタンが押された時には「Have」,
    # Wantedボタンがされた時には「Want」が設定されています。

    if params[:type] == "Have"
      current_user.unhave(@item)
    elsif params[:type] == "Want"
      current_user.unwant(@item)
    end
  end
end


text:
Aria.classDefinition({
    $classpath : "test.aria.templates.section.asContainer.SectionAsContainerTest",
    $extends : "aria.jsunit.RobotTestCase",
    dependencies : ["aria.utils.Dom", "aria.utils.Json"],
    $constructor : function () {
        this.$RobotTestCase.constructor.call(this);

        this.setTestEnv({
            template : "test.aria.templates.section.asContainer.SimpleTemplateForErrorLogging"
        });
    },
    $prototype : {
        runTemplateTest : function () {
            var errorObj = this.assertErrorInLogs(aria.core.MultiLoader.LOAD_ERROR).objOrErr;
            if (errorObj.logDetails) {
                errorObj.logDetails();
            }
            var error = (errorObj.message || errorObj.description || errorObj) + "";
            var expectedError = aria.templates.ClassGenerator.UNEXPECTED_CONTAINER.replace("%1", "section").replace("%2", "21");
            this.assertTrue(error.indexOf(expectedError) > -1, "Expected some details about the error ("
                    + expectedError + "), found: " + error);

            aria.core.AppEnvironment.setEnvironment({
                templateSettings : {
                    allowSectionsAsContainers : true
                }
            });

            this.assertErrorInLogs(aria.templates.Statements.SECTIONS_AS_CONTAINERS);

            this._replaceTestTemplate({
                template : "test.aria.templates.section.asContainer.TestTemplate"
            }, this._afterSecondTemplateLoaded);

        },
        _afterSecondTemplateLoaded : function () {

            var viewData = this.templateCtxt._tpl.viewData;

            // test that local variables defined in the section are not added to the global scope
            this.assertEquals(this.testWindow.secondVar, undefined);
            this.assertEquals(this.testWindow.thirdVar, undefined);

            this._testHTML("0", "0", "0", null, "thirdVar");

            viewData.value++;
            this.templateCtxt.$refresh();

            this._testHTML("1", "1", "1", null, "thirdVar");

            viewData.value++;
            this.templateCtxt.$refresh({
                section : "sectionThree"
            });

            this._testHTML("1", "1", "2");

            viewData.value++;
            this.templateCtxt.$refresh({
                section : "sectionTwo"
            });

            this._testHTML("1", "3", "2");

            aria.utils.Json.setValue(viewData, "value", 4);

            this._testHTML("4", "4", "2");

            this.synEvent.click(this.getElementById("buttonOne"), {
                fn : this._afterFirstClick,
                scope : this
            });
        },

        _afterFirstClick : function () {

            this._testHTML("5", "5", "2");

            this.synEvent.click(this.getElementById("buttonTwo"), {
                fn : this._afterSecondClick,
                scope : this
            });
        },

        _afterSecondClick : function () {

            this._testHTML("5", "5", "2", "macrolibvalue1");

            aria.core.AppEnvironment.setEnvironment({
                templateSettings : {
                    allowSectionsAsContainers : false
                }
            });
            this.end();
        },

        _testHTML : function (first, second, third, macroLibValue, thirdVar11) {
            thirdVar11 = thirdVar11 || "overriddenThirdVar";
            macroLibValue = macroLibValue || "macrolibvalue";
            this._testDivHTML("testDiv1", first);
            this._testDivHTML("testDiv2", "maintemplatevar");
            this._testDivHTML("testDiv3", "mainscriptvalue");
            this._testDivHTML("testDiv4", second);
            this._testDivHTML("testDiv5", "maintemplatevar");
            this._testDivHTML("testDiv6", "mainscriptvalue");
            this._testDivHTML("testDiv7", third);
            this._testDivHTML("testDiv8", "testforlocalVar");
            this._testDivHTML("testDiv9", "testforlocalVar");
            this._testDivHTML("testDiv10", "thirdVar");
            this._testDivHTML("testDiv11", thirdVar11);
            this._testDivHTML("testDiv13", "overriddenThirdVar");
            this._testDivHTML("testDiv12", "differentValue");

            this._testDivHTML("macroDiv1", second);
            this._testDivHTML("macroDiv2", "macrolibvar");
            this._testDivHTML("macroDiv3", "macrolibvalue");
            this._testDivHTML("macroDiv4", second);
            this._testDivHTML("macroDiv5", "macrolibvar");
            this._testDivHTML("macroDiv6", "macrolibvalue");
            this._testDivHTML("macroDiv7", second);
            this._testDivHTML("macroDiv8", "macrolibvar");
            this._testDivHTML("macroDiv9", macroLibValue);

        },

        _testDivHTML : function (id, innerHTML) {
            this.assertEquals(aria.utils.Dom.getElementById(id).innerHTML, innerHTML);
        }

    }
});


text:
There are several options to use Aiakos very easily using docker. These are (in order of complexity):

- _"Have everything automatically done for me"_. See Section **1. The Fastest Way** (recommended).
- _"Check the unit tests associated to the component"_. See Section **2. Run Unit Test of Aiakos**.
- _"Check the acceptance tests are running properly"_ or _"I want to check that my Aiakos instance run properly"_ . See Section **3. Run Acceptance tests**.

You do not need to do all of them, just use the first one if you want to have a fully operational Aiakos instance and maybe third one to check if your Aiakos instance run properly.

You do need to have docker in your machine. See the [documentation](https://docs.docker.com/installation/) on how to do this. Additionally, you can use the proper FIWARE Lab docker functionality to deploy dockers image there. See the [documentation](https://docs.docker.com/installation/)

----
## 1. The Fastest Way

Docker allows you to deploy an Aiakos container in a few minutes. This method requires that you have installed docker or can deploy container into the FIWARE Lab (see previous details about it).

Consider this method if you want to try Aiakos and do not want to bother about losing data.

Follow these steps:

1. Download [Aiakos' source code](https://github.com/telefonicaid/fiware-aiakos) from GitHub (`git clone https://github.com/telefonicaid/fiware-aiakos.git`)
2. `cd fiware-aiakos/docker`
3. Using the command-line and within the directory you created type: `docker build -t fiware-aiakos -f Dockerfile .`.

After a few seconds you should have your Aiakos image created. Just run the command `docker images` and you see the following response:

    REPOSITORY          TAG                 IMAGE ID            CREATED              SIZE
    fiware-aiakos       latest              bd78d006c2ea        About a minute ago   480.8 MB
    centos              7                   904d6c400333        2 weeks ago          196.8 MB
    ...

To execute the Aiakos image, execute the command `docker run -p 3001:3001 -d fiware-aiakos`. It will launch the Aiakos service listening on port `3001`.

Check that everything works with

	curl <IP address of a machine>:3001

You can obtain the IP address of the machine just executing `docker-machine ip`. What you have done with this method is the creation of the [Aiakos](https://hub.docker.com/r/fiware/aiakos/) image from the public repository of images called [Docker Hub](https://hub.docker.com/).

If you want to stop the scenario you have to execute `docker ps` and you see something like this:

    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
    b8e1de41deb5        fiware-aiakos       "/bin/sh -c ./start.s"   6 minutes ago       Up 6 minutes        0.0.0.0:3001->3001/tcp   fervent_davinci

Take the Container ID and execute `docker stop b8e1de41deb5` or `docker kill b8e1de41deb5`. Note that you will lose any data that was being used in Aiakos using this method.

----
## 2. Run Unit Test of Aiakos

Taking into account that you download the repository from GitHub (See Section **1. The Fastest Way**), this method will launch a container running Aiakos, and execute the unit tests associated to the component. You should move to the UnitTests folder `./UnitTests`. Just create a new docker image executind `docker build -t fiware-aiakos-unittests -f Dockerfile .`. Please keep in mind that if you do not change the name of the image it will automatically create a new one for unit tests and change the previous one to tag none.

To see that the image is created run `docker images` and you see something like this:

    REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
    fiware-aiakos-unittests   latest              103464a8ede0        30 seconds ago      551.3 MB
    centos                    latest              904d6c400333        2 weeks ago         196.8 MB

To execute the unit tests of this component, just execute `docker run --name fiware-aiakos-unittests fiware-aiakos-unittests`. Finally you can extract the information of the executed tests just executing `docker cp fiware-aiakos-unittests:/opt/fiware-aiakos/report .`

> TIP: If you are trying these methods or run them more than once and come across an error saying that the container already exists you can delete it with `docker rm fiware-aiakos-unittests`. If you have to stop it first do `docker stop fiware-aiakos-unittests`.

Keep in mind that if you use these commands you get access to the tags and specific versions of Aiakos. If you do not specify a version you are pulling from `latest` by default.

----
## 3. Run Acceptance tests

Taking into account that you download the repository from GitHub (See Section **1. The Fastest Way**). This method will launch a container to run the E2E tests of the Aiakos component, previously you should launch or configure a FIWARE Lab access. You have to define the following environment variables:

    export BRANCH=develop
    export KEYSTONE_IP=<IP of the keystone instance>
    export ADM_TENANT_ID=<admin tenant id in the OpenStack environment>
    export USER_TENANT_ID=<admin tenant id in the OpenStack environment>
    export ADM_TENANT_NAME=<admin tenant name>
    export USER_TENANT_NAME=<user tenant name>
    export ADM_USERNAME=<admin username>
    export USER_USERNAME=<username>
    export ADM_PASSWORD=<admin password>
    export USER_PASSWORD=<user password>
    export Region1=qaregion
    export OS_USER_DOMAIN_NAME=<OpenStack user domain name>
    export OS_PROJECT_DOMAIN_NAME=<OpenStack project domain name>

Take it, You should move to the UnitTests folder `./AcceptanceTests`. Just create a new docker image executing `docker build -t fiware-aiakos-acceptance .`. To see that the image is created run `docker images` and you see something like this:

    REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
    fiware-aiakos-acceptance   latest              eadbe0b2e186        About an hour ago   579.3 MB
    fiware-aiakos              latest              a46ffad45e60        4 hours ago         480.8 MB
    centos                     latest              904d6c400333        2 weeks ago         196.8 MB
    ...

Now is time to execute the container. This time, we take advantage of the docker compose. Just execute `docker-compose up` to launch the architecture. You can take a look to the log generated executing `docker-compose logs`. If you want to get the result of the acceptance tests, just execute `docker cp docker_fiware-aiakos-aceptance_1:/opt/fiware-aiakos/test/acceptance/testreport .`

Please keep in mind that if you do not change the name of the image it will automatically create a new one for unit tests and change the previous one to tag none.

> TIP: you can launch a FIWARE Lab testbed container to execute the Aiakos E2E test. Just follow the indications in [FIWARE Testbed Deploy](https://hub.docker.com/r/fiware/testbed-deploy/). It will launch a virtual machine in which a reproduction of the FIWARE Lab is installed. Keep in mind that in that case Region1 have to be configured with the value qaregion.

----
## 4. Other info

Things to keep in mind while working with docker containers and Aiakos.

### 4.1 Data persistence
Everything you do with Aiakos when dockerized is non-persistent. *You will lose all your data* if you turn off the Aiakos container. This will happen with either method presented in this README.

### 4.2 Using `sudo`

If you do not want to have to use `sudo` follow [these instructions](http://askubuntu.com/questions/477551/how-can-i-use-docker-without-sudo).


text:
// MESSAGE SERIAL_UDB_EXTRA_F8 PACKING

#define MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F8 176

typedef struct __mavlink_serial_udb_extra_f8_t
{
 float sue_HEIGHT_TARGET_MAX; ///< Serial UDB Extra HEIGHT_TARGET_MAX
 float sue_HEIGHT_TARGET_MIN; ///< Serial UDB Extra HEIGHT_TARGET_MIN
 float sue_ALT_HOLD_THROTTLE_MIN; ///< Serial UDB Extra ALT_HOLD_THROTTLE_MIN
 float sue_ALT_HOLD_THROTTLE_MAX; ///< Serial UDB Extra ALT_HOLD_THROTTLE_MAX
 float sue_ALT_HOLD_PITCH_MIN; ///< Serial UDB Extra ALT_HOLD_PITCH_MIN
 float sue_ALT_HOLD_PITCH_MAX; ///< Serial UDB Extra ALT_HOLD_PITCH_MAX
 float sue_ALT_HOLD_PITCH_HIGH; ///< Serial UDB Extra ALT_HOLD_PITCH_HIGH
} mavlink_serial_udb_extra_f8_t;

#define MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F8_LEN 28
#define MAVLINK_MSG_ID_176_LEN 28

#define MAVLINK_MESSAGE_INFO_SERIAL_UDB_EXTRA_F8 { \
	"SERIAL_UDB_EXTRA_F8", \
	7, \
	{  { "sue_HEIGHT_TARGET_MAX", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_serial_udb_extra_f8_t, sue_HEIGHT_TARGET_MAX) }, \
         { "sue_HEIGHT_TARGET_MIN", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_serial_udb_extra_f8_t, sue_HEIGHT_TARGET_MIN) }, \
         { "sue_ALT_HOLD_THROTTLE_MIN", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_serial_udb_extra_f8_t, sue_ALT_HOLD_THROTTLE_MIN) }, \
         { "sue_ALT_HOLD_THROTTLE_MAX", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_serial_udb_extra_f8_t, sue_ALT_HOLD_THROTTLE_MAX) }, \
         { "sue_ALT_HOLD_PITCH_MIN", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_serial_udb_extra_f8_t, sue_ALT_HOLD_PITCH_MIN) }, \
         { "sue_ALT_HOLD_PITCH_MAX", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_serial_udb_extra_f8_t, sue_ALT_HOLD_PITCH_MAX) }, \
         { "sue_ALT_HOLD_PITCH_HIGH", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_serial_udb_extra_f8_t, sue_ALT_HOLD_PITCH_HIGH) }, \
         } \
}

/**
 * @brief Pack a serial_udb_extra_f8 message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param sue_HEIGHT_TARGET_MAX Serial UDB Extra HEIGHT_TARGET_MAX
 * @param sue_HEIGHT_TARGET_MIN Serial UDB Extra HEIGHT_TARGET_MIN
 * @param sue_ALT_HOLD_THROTTLE_MIN Serial UDB Extra ALT_HOLD_THROTTLE_MIN
 * @param sue_ALT_HOLD_THROTTLE_MAX Serial UDB Extra ALT_HOLD_THROTTLE_MAX
 * @param sue_ALT_HOLD_PITCH_MIN Serial UDB Extra ALT_HOLD_PITCH_MIN
 * @param sue_ALT_HOLD_PITCH_MAX Serial UDB Extra ALT_HOLD_PITCH_MAX
 * @param sue_ALT_HOLD_PITCH_HIGH Serial UDB Extra ALT_HOLD_PITCH_HIGH
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_serial_udb_extra_f8_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
						       float sue_HEIGHT_TARGET_MAX, float sue_HEIGHT_TARGET_MIN, float sue_ALT_HOLD_THROTTLE_MIN, float sue_ALT_HOLD_THROTTLE_MAX, float sue_ALT_HOLD_PITCH_MIN, float sue_ALT_HOLD_PITCH_MAX, float sue_ALT_HOLD_PITCH_HIGH)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
	char buf[28];
	_mav_put_float(buf, 0, sue_HEIGHT_TARGET_MAX);
	_mav_put_float(buf, 4, sue_HEIGHT_TARGET_MIN);
	_mav_put_float(buf, 8, sue_ALT_HOLD_THROTTLE_MIN);
	_mav_put_float(buf, 12, sue_ALT_HOLD_THROTTLE_MAX);
	_mav_put_float(buf, 16, sue_ALT_HOLD_PITCH_MIN);
	_mav_put_float(buf, 20, sue_ALT_HOLD_PITCH_MAX);
	_mav_put_float(buf, 24, sue_ALT_HOLD_PITCH_HIGH);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
	mavlink_serial_udb_extra_f8_t packet;
	packet.sue_HEIGHT_TARGET_MAX = sue_HEIGHT_TARGET_MAX;
	packet.sue_HEIGHT_TARGET_MIN = sue_HEIGHT_TARGET_MIN;
	packet.sue_ALT_HOLD_THROTTLE_MIN = sue_ALT_HOLD_THROTTLE_MIN;
	packet.sue_ALT_HOLD_THROTTLE_MAX = sue_ALT_HOLD_THROTTLE_MAX;
	packet.sue_ALT_HOLD_PITCH_MIN = sue_ALT_HOLD_PITCH_MIN;
	packet.sue_ALT_HOLD_PITCH_MAX = sue_ALT_HOLD_PITCH_MAX;
	packet.sue_ALT_HOLD_PITCH_HIGH = sue_ALT_HOLD_PITCH_HIGH;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif

	msg->msgid = MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F8;
	return mavlink_finalize_message(msg, system_id, component_id, 28, 142);
}

/**
 * @brief Pack a serial_udb_extra_f8 message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message was sent over
 * @param msg The MAVLink message to compress the data into
 * @param sue_HEIGHT_TARGET_MAX Serial UDB Extra HEIGHT_TARGET_MAX
 * @param sue_HEIGHT_TARGET_MIN Serial UDB Extra HEIGHT_TARGET_MIN
 * @param sue_ALT_HOLD_THROTTLE_MIN Serial UDB Extra ALT_HOLD_THROTTLE_MIN
 * @param sue_ALT_HOLD_THROTTLE_MAX Serial UDB Extra ALT_HOLD_THROTTLE_MAX
 * @param sue_ALT_HOLD_PITCH_MIN Serial UDB Extra ALT_HOLD_PITCH_MIN
 * @param sue_ALT_HOLD_PITCH_MAX Serial UDB Extra ALT_HOLD_PITCH_MAX
 * @param sue_ALT_HOLD_PITCH_HIGH Serial UDB Extra ALT_HOLD_PITCH_HIGH
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_serial_udb_extra_f8_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
							   mavlink_message_t* msg,
						           float sue_HEIGHT_TARGET_MAX,float sue_HEIGHT_TARGET_MIN,float sue_ALT_HOLD_THROTTLE_MIN,float sue_ALT_HOLD_THROTTLE_MAX,float sue_ALT_HOLD_PITCH_MIN,float sue_ALT_HOLD_PITCH_MAX,float sue_ALT_HOLD_PITCH_HIGH)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
	char buf[28];
	_mav_put_float(buf, 0, sue_HEIGHT_TARGET_MAX);
	_mav_put_float(buf, 4, sue_HEIGHT_TARGET_MIN);
	_mav_put_float(buf, 8, sue_ALT_HOLD_THROTTLE_MIN);
	_mav_put_float(buf, 12, sue_ALT_HOLD_THROTTLE_MAX);
	_mav_put_float(buf, 16, sue_ALT_HOLD_PITCH_MIN);
	_mav_put_float(buf, 20, sue_ALT_HOLD_PITCH_MAX);
	_mav_put_float(buf, 24, sue_ALT_HOLD_PITCH_HIGH);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
#else
	mavlink_serial_udb_extra_f8_t packet;
	packet.sue_HEIGHT_TARGET_MAX = sue_HEIGHT_TARGET_MAX;
	packet.sue_HEIGHT_TARGET_MIN = sue_HEIGHT_TARGET_MIN;
	packet.sue_ALT_HOLD_THROTTLE_MIN = sue_ALT_HOLD_THROTTLE_MIN;
	packet.sue_ALT_HOLD_THROTTLE_MAX = sue_ALT_HOLD_THROTTLE_MAX;
	packet.sue_ALT_HOLD_PITCH_MIN = sue_ALT_HOLD_PITCH_MIN;
	packet.sue_ALT_HOLD_PITCH_MAX = sue_ALT_HOLD_PITCH_MAX;
	packet.sue_ALT_HOLD_PITCH_HIGH = sue_ALT_HOLD_PITCH_HIGH;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
#endif

	msg->msgid = MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F8;
	return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 142);
}

/**
 * @brief Encode a serial_udb_extra_f8 struct into a message
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param serial_udb_extra_f8 C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_serial_udb_extra_f8_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_serial_udb_extra_f8_t* serial_udb_extra_f8)
{
	return mavlink_msg_serial_udb_extra_f8_pack(system_id, component_id, msg, serial_udb_extra_f8->sue_HEIGHT_TARGET_MAX, serial_udb_extra_f8->sue_HEIGHT_TARGET_MIN, serial_udb_extra_f8->sue_ALT_HOLD_THROTTLE_MIN, serial_udb_extra_f8->sue_ALT_HOLD_THROTTLE_MAX, serial_udb_extra_f8->sue_ALT_HOLD_PITCH_MIN, serial_udb_extra_f8->sue_ALT_HOLD_PITCH_MAX, serial_udb_extra_f8->sue_ALT_HOLD_PITCH_HIGH);
}

/**
 * @brief Send a serial_udb_extra_f8 message
 * @param chan MAVLink channel to send the message
 *
 * @param sue_HEIGHT_TARGET_MAX Serial UDB Extra HEIGHT_TARGET_MAX
 * @param sue_HEIGHT_TARGET_MIN Serial UDB Extra HEIGHT_TARGET_MIN
 * @param sue_ALT_HOLD_THROTTLE_MIN Serial UDB Extra ALT_HOLD_THROTTLE_MIN
 * @param sue_ALT_HOLD_THROTTLE_MAX Serial UDB Extra ALT_HOLD_THROTTLE_MAX
 * @param sue_ALT_HOLD_PITCH_MIN Serial UDB Extra ALT_HOLD_PITCH_MIN
 * @param sue_ALT_HOLD_PITCH_MAX Serial UDB Extra ALT_HOLD_PITCH_MAX
 * @param sue_ALT_HOLD_PITCH_HIGH Serial UDB Extra ALT_HOLD_PITCH_HIGH
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_serial_udb_extra_f8_send(mavlink_channel_t chan, float sue_HEIGHT_TARGET_MAX, float sue_HEIGHT_TARGET_MIN, float sue_ALT_HOLD_THROTTLE_MIN, float sue_ALT_HOLD_THROTTLE_MAX, float sue_ALT_HOLD_PITCH_MIN, float sue_ALT_HOLD_PITCH_MAX, float sue_ALT_HOLD_PITCH_HIGH)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
	char buf[28];
	_mav_put_float(buf, 0, sue_HEIGHT_TARGET_MAX);
	_mav_put_float(buf, 4, sue_HEIGHT_TARGET_MIN);
	_mav_put_float(buf, 8, sue_ALT_HOLD_THROTTLE_MIN);
	_mav_put_float(buf, 12, sue_ALT_HOLD_THROTTLE_MAX);
	_mav_put_float(buf, 16, sue_ALT_HOLD_PITCH_MIN);
	_mav_put_float(buf, 20, sue_ALT_HOLD_PITCH_MAX);
	_mav_put_float(buf, 24, sue_ALT_HOLD_PITCH_HIGH);

	_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F8, buf, 28, 142);
#else
	mavlink_serial_udb_extra_f8_t packet;
	packet.sue_HEIGHT_TARGET_MAX = sue_HEIGHT_TARGET_MAX;
	packet.sue_HEIGHT_TARGET_MIN = sue_HEIGHT_TARGET_MIN;
	packet.sue_ALT_HOLD_THROTTLE_MIN = sue_ALT_HOLD_THROTTLE_MIN;
	packet.sue_ALT_HOLD_THROTTLE_MAX = sue_ALT_HOLD_THROTTLE_MAX;
	packet.sue_ALT_HOLD_PITCH_MIN = sue_ALT_HOLD_PITCH_MIN;
	packet.sue_ALT_HOLD_PITCH_MAX = sue_ALT_HOLD_PITCH_MAX;
	packet.sue_ALT_HOLD_PITCH_HIGH = sue_ALT_HOLD_PITCH_HIGH;

	_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F8, (const char *)&packet, 28, 142);
#endif
}

#endif

// MESSAGE SERIAL_UDB_EXTRA_F8 UNPACKING

/**
 * @brief Get field sue_HEIGHT_TARGET_MAX from serial_udb_extra_f8 message
 *
 * @return Serial UDB Extra HEIGHT_TARGET_MAX
 */
static inline float mavlink_msg_serial_udb_extra_f8_get_sue_HEIGHT_TARGET_MAX(const mavlink_message_t* msg)
{
	return _MAV_RETURN_float(msg,  0);
}

/**
 * @brief Get field sue_HEIGHT_TARGET_MIN from serial_udb_extra_f8 message
 *
 * @return Serial UDB Extra HEIGHT_TARGET_MIN
 */
static inline float mavlink_msg_serial_udb_extra_f8_get_sue_HEIGHT_TARGET_MIN(const mavlink_message_t* msg)
{
	return _MAV_RETURN_float(msg,  4);
}

/**
 * @brief Get field sue_ALT_HOLD_THROTTLE_MIN from serial_udb_extra_f8 message
 *
 * @return Serial UDB Extra ALT_HOLD_THROTTLE_MIN
 */
static inline float mavlink_msg_serial_udb_extra_f8_get_sue_ALT_HOLD_THROTTLE_MIN(const mavlink_message_t* msg)
{
	return _MAV_RETURN_float(msg,  8);
}

/**
 * @brief Get field sue_ALT_HOLD_THROTTLE_MAX from serial_udb_extra_f8 message
 *
 * @return Serial UDB Extra ALT_HOLD_THROTTLE_MAX
 */
static inline float mavlink_msg_serial_udb_extra_f8_get_sue_ALT_HOLD_THROTTLE_MAX(const mavlink_message_t* msg)
{
	return _MAV_RETURN_float(msg,  12);
}

/**
 * @brief Get field sue_ALT_HOLD_PITCH_MIN from serial_udb_extra_f8 message
 *
 * @return Serial UDB Extra ALT_HOLD_PITCH_MIN
 */
static inline float mavlink_msg_serial_udb_extra_f8_get_sue_ALT_HOLD_PITCH_MIN(const mavlink_message_t* msg)
{
	return _MAV_RETURN_float(msg,  16);
}

/**
 * @brief Get field sue_ALT_HOLD_PITCH_MAX from serial_udb_extra_f8 message
 *
 * @return Serial UDB Extra ALT_HOLD_PITCH_MAX
 */
static inline float mavlink_msg_serial_udb_extra_f8_get_sue_ALT_HOLD_PITCH_MAX(const mavlink_message_t* msg)
{
	return _MAV_RETURN_float(msg,  20);
}

/**
 * @brief Get field sue_ALT_HOLD_PITCH_HIGH from serial_udb_extra_f8 message
 *
 * @return Serial UDB Extra ALT_HOLD_PITCH_HIGH
 */
static inline float mavlink_msg_serial_udb_extra_f8_get_sue_ALT_HOLD_PITCH_HIGH(const mavlink_message_t* msg)
{
	return _MAV_RETURN_float(msg,  24);
}

/**
 * @brief Decode a serial_udb_extra_f8 message into a struct
 *
 * @param msg The message to decode
 * @param serial_udb_extra_f8 C-struct to decode the message contents into
 */
static inline void mavlink_msg_serial_udb_extra_f8_decode(const mavlink_message_t* msg, mavlink_serial_udb_extra_f8_t* serial_udb_extra_f8)
{
#if MAVLINK_NEED_BYTE_SWAP
	serial_udb_extra_f8->sue_HEIGHT_TARGET_MAX = mavlink_msg_serial_udb_extra_f8_get_sue_HEIGHT_TARGET_MAX(msg);
	serial_udb_extra_f8->sue_HEIGHT_TARGET_MIN = mavlink_msg_serial_udb_extra_f8_get_sue_HEIGHT_TARGET_MIN(msg);
	serial_udb_extra_f8->sue_ALT_HOLD_THROTTLE_MIN = mavlink_msg_serial_udb_extra_f8_get_sue_ALT_HOLD_THROTTLE_MIN(msg);
	serial_udb_extra_f8->sue_ALT_HOLD_THROTTLE_MAX = mavlink_msg_serial_udb_extra_f8_get_sue_ALT_HOLD_THROTTLE_MAX(msg);
	serial_udb_extra_f8->sue_ALT_HOLD_PITCH_MIN = mavlink_msg_serial_udb_extra_f8_get_sue_ALT_HOLD_PITCH_MIN(msg);
	serial_udb_extra_f8->sue_ALT_HOLD_PITCH_MAX = mavlink_msg_serial_udb_extra_f8_get_sue_ALT_HOLD_PITCH_MAX(msg);
	serial_udb_extra_f8->sue_ALT_HOLD_PITCH_HIGH = mavlink_msg_serial_udb_extra_f8_get_sue_ALT_HOLD_PITCH_HIGH(msg);
#else
	memcpy(serial_udb_extra_f8, _MAV_PAYLOAD(msg), 28);
#endif
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MonoGdx.Utils;

namespace MonoGdx.Scene2D
{
    public abstract class SceneAction : IPoolable
    {
        private Actor _actor;
        private Pool _pool;

        public abstract bool Act (float delta);

        public virtual Actor Actor
        {
            get { return _actor; }
            set
            {
                _actor = value;
                if (_actor == null && _pool != null) {
                    _pool.Release(this);
                    _pool = null;
                }
            }
        }

        public Pool Pool
        {
            get { return _pool; }
            set { _pool = value; }
        }

        public virtual void Restart ()
        { }

        public virtual void Reset ()
        {
            Restart();
        }

        public override string ToString ()
        {
            string name = GetType().Name;
            int index = name.LastIndexOf('.');
            if (index != -1)
                name = name.Substring(index + 1);
            if (name.EndsWith("Action"))
                name = name.Substring(0, name.Length - 6);
            return name;
        }
    }
}


text:
<?php

class A_NextGen_Basic_Album_Controller extends Mixin
{

    function initialize()
    {
		$this->albums = array();
        $this->object->add_mixin('Mixin_NextGen_Basic_Pagination');
    }

    /**
     * Renders the front-end for the NextGen Basic Album display type
     *
     * @param $displayed_gallery
     * @param bool $return
     */
    function index_action($displayed_gallery, $return = FALSE)
    {
        $display_settings = $displayed_gallery->display_settings;

		// We need to fetch the album containers selected in the Attach
		// to Post interface. We need to do this, because once we fetch the
		// included entities, we need to iterate over each entity and assign it
		// a parent_id, which is the album that it belongs to. We need to do this
		// because the link to the gallery, is not /nggallery/gallery--id, but
		// /nggallery/album--id/gallery--id

		// Are we to display a gallery?
        if (($gallery = $this->param('gallery')))
        {
            // basic albums only support one per post
            if (isset($GLOBALS['nggShowGallery']))
                return;
            $GLOBALS['nggShowGallery'] = TRUE;

            if (!is_numeric($gallery))
            {
                $mapper = $this->object->get_registry()->get_utility('I_Gallery_Mapper');
                $result = reset($mapper->select()->where(array('slug = %s', $gallery))->limit(1)->run_query());
                $gallery = $result->{$result->id_field};
            }

            $renderer = $this->object->get_registry()->get_utility('I_Displayed_Gallery_Renderer');
            return $renderer->display_images(
                array(
                    'source'				=> 'galleries',
                    'container_ids'			=> array($gallery),
                    'display_type'			=> $display_settings['gallery_display_type'],
					'original_display_type'	=> $displayed_gallery->display_type
                ),
                $return
            );
        }

		// If we're viewing a sub-album, then we use that album as a container instead
		else if (($album = $this->param('album'))) {

			// Are we to display a sub-album?
            if (!is_numeric($album))
            {
                $mapper = $this->object->get_registry()->get_utility('I_Album_Mapper');
                $result = array_pop($mapper->select()->where(array('slug = %s', $album))->limit(1)->run_query());
				$album = $result->{$result->id_field};
            }
            $displayed_gallery->entity_ids = array();
			$displayed_gallery->sortorder = array();
            $displayed_gallery->container_ids = ($album === '0' OR $album === 'all') ? array() : array($album);
		}

		// Get the albums
		$this->albums = $displayed_gallery->get_albums();

        // None of the above: Display the main album. Get the settings required for display
        $current_page = (int)$this->param('page', 1);
        $offset = $display_settings['galleries_per_page'] * ($current_page - 1);
        $entities = $displayed_gallery->get_included_entities($display_settings['galleries_per_page'], $offset);

        // If there are entities to be displayed
        if ($entities)
        {
            if (!empty($display_settings['template']))
            {
                // Add additional parameters
                $pagination_result = $this->object->create_pagination(
                    $current_page,
                    $displayed_gallery->get_entity_count(),
                    $display_settings['galleries_per_page'],
                    urldecode($this->object->param('ajax_pagination_referrer'))
                );
                $this->object->remove_param('ajax_pagination_referrer');
                $display_settings['current_page'] = $current_page;
                $display_settings['entities']     = &$entities;
                $display_settings['pagination_prev'] = $pagination_result['prev'];
                $display_settings['pagination_next'] = $pagination_result['next'];
                $display_settings['pagination']      = $pagination_result['output'];

                // Render legacy template
                $this->object->add_mixin('Mixin_NextGen_Basic_Templates');
                $display_settings = $this->prepare_legacy_album_params($display_settings);
                return $this->object->legacy_render($display_settings['template'], $display_settings, $return, 'album');
            }
            else {
                $params = $display_settings;
                $albums = $this->prepare_legacy_album_params(array('entities' => $entities));;
                $params['galleries'] = $albums['galleries'];
                $params['displayed_gallery'] = $displayed_gallery;
                $params = $this->object->prepare_display_parameters($displayed_gallery, $params);

                switch ($displayed_gallery->display_type) {
                    case NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM:
                        $template = 'compact';
                        break;
                    case NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM:
                        $template = 'extended';
                        break;
                }

                return $this->object->render_view("photocrati-nextgen_basic_album#{$template}", $params, $return);
            }
        }
        else {
            return $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found');
        }
    }

	/**
	 * Gets the parent album for the entity being displayed
	 * @param int $entity_id
	 * @return stdClass (album)
	 */
	function get_parent_album_for($entity_id)
	{
		$retval = NULL;

		foreach ($this->albums as $album) {
			if (in_array($entity_id, $album->sortorder)) {
				$retval = $album;
				break;
			}
		}

		return $retval;
	}

    function prepare_legacy_album_params($params)
    {
        $image_mapper = $this->object->get_registry()->get_utility('I_Image_Mapper');
        $storage      = $this->object->get_registry()->get_utility('I_Gallery_Storage');
        $image_gen    = $this->object->get_registry()->get_utility('I_Dynamic_Thumbnails_Manager');

        // legacy templates expect these dimensions
        $image_gen_params       = array(
            'width'             => 91,
            'height'            => 68,
            'crop'              => TRUE
        );

        // Transform entities
        $params['galleries']    = $params['entities'];
        unset($params['entities']);
        foreach ($params['galleries'] as &$gallery) {

            // Get the preview image url
           $gallery->previewurl = '';
            if ($gallery->previewpic && $gallery->previewpic > 0) {
                if (($image = $image_mapper->find(intval($gallery->previewpic)))) {
                    $gallery->previewurl    = $storage->get_image_url($image, $image_gen->get_size_name($image_gen_params));
                    $gallery->previewname   = $gallery->name;
                }
            }

            // Get the page link. If the entity is an album, then the url will
			// look like /nggallery/album--slug.
            $id_field = $gallery->id_field;
			if ($gallery->is_album) {
                if ($gallery->pageid > 0) $gallery->pagelink = get_post_permalink($gallery->pageid);
                else {
                    $gallery->pagelink = $this->object->set_param_for(
                        $this->object->get_routed_url(TRUE),
                        'album',
                        $gallery->slug
                    );
                }
			}

			// Otherwise, if it's a gallery then it will look like
			// /nggallery/album--slug/gallery--slug
			else {
                if ($gallery->pageid > 0) $gallery->pagelink = get_post_permalink($gallery->pageid);
                else {
                    $pagelink = $this->object->get_routed_url(TRUE);
                    $parent_album = $this->object->get_parent_album_for($gallery->$id_field);
                    if ($parent_album) {
                        $pagelink = $this->object->set_param_for(
                            $pagelink,
                            'album',
                            $parent_album->slug
                        );
                    }
                    $gallery->pagelink = $this->object->set_param_for(
                        $pagelink,
                        'gallery',
                        $gallery->slug
                    );
                }
			}

			// The router by default will generate param segments that look like,
			// /gallery--foobar. We need to convert these to the admittingly
			// nicer links that ngglegacy uses
            if ($gallery->pageid <= 0) $gallery->pagelink = $this->object->prettify_pagelink($gallery->pagelink);

            // Let plugins modify the gallery
            $gallery = apply_filters('ngg_album_galleryobject', $gallery);
        }

        // Clean up
        unset($storage);
        unset($image_mapper);
        unset($image_gen);
        unset($image_gen_params);

        return $params;
    }

	function prettify_pagelink($pagelink)
	{
		$param_separator = C_NextGen_Global_Settings::get_instance()->get('router_param_separator');
		$regex = implode('', array(
			'#',
			'/(gallery|album)',
			preg_quote($param_separator),
			'([^/?]+)',
			'#'
		));

		return preg_replace($regex, '/\2', $pagelink);
	}

    function _get_js_lib_url()
    {
        return $this->object->get_static_url('photocrati-nextgen_basic_album#init.js');
    }

    /**
     * Enqueues all static resources required by this display type
     *
     * @param C_Displayed_Gallery $displayed_gallery
     */
    function enqueue_frontend_resources($displayed_gallery)
    {
        $this->call_parent('enqueue_frontend_resources', $displayed_gallery);

        wp_enqueue_style('nextgen_basic_album_style', $this->object->get_static_url('photocrati-nextgen_basic_album#nextgen_basic_album.css'));
        wp_enqueue_script('jquery.dotdotdot', $this->object->get_static_url('photocrati-nextgen_basic_album#jquery.dotdotdot-1.5.7-packed.js'), array('jquery'));

		$cssfile = C_NextGen_Settings::get_instance()->get('CSSFile');
		wp_enqueue_style('nggallery', NEXTGEN_GALLERY_NGGLEGACY_MOD_URL.'/css/'.$cssfile);

    }

}


text:
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>gfx.js</title>
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="user.css">
    <link rel="stylesheet" href="nvd3/src/nv.d3.css">
    <script src="socket.io/socket.io.js"></script>
    <script src="term.js"></script>
    <script src="options.js"></script>
    <script src="tty.js"></script>
    <script src="user.js"></script>
    <script src="nvd3/lib/d3.v3.js"></script>
    <script src="nvd3/nv.d3.js"></script>
    <script src="saveSvgAsPng.js"></script>
</head>
<body>
    <button id="open">+Term</button>
    <button id="lights">Light</button>
</body>
</html>


text:
package com.communote.server.core.converter.blog;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import org.apache.commons.lang.StringUtils;

import com.communote.server.api.core.blog.BlogRightsManagement;
import com.communote.server.api.core.tag.TagData;
import com.communote.server.core.blog.helper.MailBasedPostingHelper;
import com.communote.server.core.filter.listitems.blog.DetailBlogListItem;
import com.communote.server.core.vo.query.converters.TagToTagDataQueryResultConverter;
import com.communote.server.model.blog.Blog;
import com.communote.server.model.blog.BlogMember;
import com.communote.server.model.blog.BlogRole;
import com.communote.server.model.tag.Tag;
import com.communote.server.model.user.CommunoteEntity;
import com.communote.server.model.user.User;
import com.communote.server.persistence.helper.dao.LazyClassLoaderHelper;

/**
 * Converter for converting a blog entity into a list item.
 *
 * @author Communote GmbH - http://www.communote.com/
 *
 * @param <T>
 *            the target type
 */
public class BlogToDetailBlogListItemConverter<T extends DetailBlogListItem> extends
        BlogToBlogDataConverter<T> {

    private final boolean includeTags;
    private final boolean includeMembers;
    private Locale locale;
    private BlogToDetailBlogListItemConverter<T> childConverter;
    private BlogToDetailBlogListItemConverter<T> parentConverter;
    private BlogRightsManagement topicRightsManagement;

    /**
     * Create a new converter
     *
     * @param clazz
     *            the class of the target type
     * @param includeProperties
     *            whether to add the blog properties to the result. The property key will be
     *            constructed as follows <groupKey>.<propertyKey>
     * @param includeTags
     *            whether to add the tags as a comma separated string
     * @param includeMembers
     *            whether to include the members
     * @param includeChildren
     *            If true, the children of this topic, the user can access will be converted too.
     * @param topicRightsManagement
     *            This is only used when includeChildren is true.
     */
    public BlogToDetailBlogListItemConverter(Class<T> clazz, boolean includeProperties,
            boolean includeTags, boolean includeMembers, boolean includeChildren,
            boolean includeParents,
            BlogRightsManagement topicRightsManagement) {
        this(clazz, includeProperties, includeTags, includeMembers, includeChildren,
                includeParents,
                topicRightsManagement, Locale.ENGLISH);
    }

    /**
     * Create a new converter
     *
     * @param clazz
     *            the class of the target type
     * @param includeProperties
     *            whether to add the blog properties to the result. The property key will be
     *            constructed as follows <groupKey>.<propertyKey>
     * @param includeTags
     *            whether to add the tags as a comma separated string
     * @param includeMembers
     *            whether to include the members
     * @param includeChildren
     *            If true, the direct children of this topic, the user can access will be converted
     *            too.
     * @param includeParents
     *            If true, the direct parents of this topic, the user can access will be converted
     *            too.
     * @param topicRightsManagement
     *            This is only used when includeChildren is true.
     * @param locale
     *            The locale used for translation of tags.
     */
    public BlogToDetailBlogListItemConverter(Class<T> clazz, boolean includeProperties,
            boolean includeTags, boolean includeMembers, boolean includeChildren,
            boolean includeParents, BlogRightsManagement topicRightsManagement, Locale locale) {
        super(clazz, includeProperties);
        this.includeTags = includeTags;
        this.includeMembers = includeMembers;
        this.topicRightsManagement = topicRightsManagement;
        this.locale = locale;
        if (includeChildren) {
            childConverter = new BlogToDetailBlogListItemConverter<T>(clazz, includeProperties,
                    includeTags, includeMembers, false, false, null);
        }
        if (includeParents) {
            parentConverter = new BlogToDetailBlogListItemConverter<T>(clazz, includeProperties,
                    includeTags, includeMembers, false, false, null);
        }
    }

    @Override
    public void convert(Blog source, T target) {
        super.convert(source, target);
        target.setAllCanRead(source.isAllCanRead());
        target.setAllCanWrite(source.isAllCanWrite());
        target.setToplevelTopic(source.isToplevelTopic());
        target.setRootTopic(source.getParents().isEmpty());
        target.setCreateSystemNotes(source.isCreateSystemNotes());
        target.setBlogEmail(MailBasedPostingHelper.getBlogEmailAddress(source.getNameIdentifier()));
        convertChildren(source, target);
        convertParents(source, target);
        if (includeTags && source.getTags() != null) {
            TagToTagDataQueryResultConverter tagConverter =
                    new TagToTagDataQueryResultConverter(locale);
            for (Tag tag : source.getTags()) {
                TagData tagListItem = new TagData();
                tagConverter.convert(tag, tagListItem);
                target.getTagItems().add(tagListItem);
            }
        }
        if (includeMembers) {
            List<String> readers = new ArrayList<String>();
            List<String> writers = new ArrayList<String>();
            List<String> managers = new ArrayList<String>();
            for (BlogMember member : source.getMembers()) {
                CommunoteEntity e = LazyClassLoaderHelper.deproxy(member.getMemberEntity(),
                        CommunoteEntity.class);
                if (e instanceof User) {
                    String memberUserId = e.getId().toString();
                    if (BlogRole.MANAGER.equals(member.getRole())) {
                        managers.add(memberUserId);
                    } else if (BlogRole.MEMBER.equals(member.getRole())) {
                        writers.add(memberUserId);
                    } else if (BlogRole.VIEWER.equals(member.getRole())) {
                        readers.add(memberUserId);
                    }
                }
            }
            target.setManagingUserIds(StringUtils.join(managers, ","));
            target.setReadingUserIds(StringUtils.join(readers, ","));
            target.setWritingUserIds(StringUtils.join(writers, ","));
        }
    }

    /**
     * If requested, this method converts the children of the given topic.
     *
     * @param source
     *            The source topic.
     * @param target
     *            The target item.
     */
    private void convertChildren(Blog source, T target) {
        if (childConverter == null) {
            return;
        }
        for (Blog child : source.getChildren()) {
            if (topicRightsManagement.currentUserHasReadAccess(child.getId(), false)) {
                target.getChildren().add(childConverter.convert(child));
            }
        }
    }

    /**
     * If requested, this method converts the parents of the given topic.
     *
     * @param source
     *            The source topic.
     * @param target
     *            The target item.
     */
    private void convertParents(Blog source, T target) {
        if (parentConverter == null) {
            return;
        }
        for (Blog parent : source.getParents()) {
            if (topicRightsManagement.currentUserHasReadAccess(parent.getId(), false)) {
                target.getParents().add(parentConverter.convert(parent));
            }
        }
    }
}


text:
using System;
using System.Text;
using ReClassNET.Util.Conversion;

namespace ReClassNET.Memory
{
	public interface IRemoteMemoryWriter
	{
		EndianBitConverter BitConverter { get; set; }

		/// <summary>Writes the given <paramref name="data"/> to the <paramref name="address"/> in the remote process.</summary>
		/// <param name="address">The address to write to.</param>
		/// <param name="data">The data to write.</param>
		/// <returns>True if it succeeds, false if it fails.</returns>
		bool WriteRemoteMemory(IntPtr address, byte[] data);
	}
}


text:
@protocol ChromeTableViewConsumer<NSObject>

// Reconfigures the cells corresponding to the given `items` by calling
// `configureCell:` on each cell.
- (void)reconfigureCellsForItems:(NSArray*)items;

// Reloads the cells corresponding to the given `items` by calling
// reloadRowsAtIndexPaths with `rowAnimation` on the tableView for each of the
// `items` indexPath, this will also trigger a `configureCell:` call on each
// cell.
// Use this method over `reconfigureCellsForItems` if the cell should be redrawn
// after calling `configureCell:`.
- (void)reloadCellsForItems:(NSArray*)items
           withRowAnimation:(UITableViewRowAnimation)rowAnimation;

@end

#endif  // IOS_CHROME_BROWSER_UI_TABLE_VIEW_CHROME_TABLE_VIEW_CONSUMER_H_


text:
package edu.tamu.weaver.response;

public class ApiResponseStatusException extends RuntimeException {

    private int status;

    public ApiResponseStatusException(String message, int status) {
        super(message);
        this.status = status;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

}