text:
!function (a) {
    function b(b, d) {
        function e() {
            if (w) {
                $canvas = a('<canvas class="pg-canvas"></canvas>'), v.prepend($canvas), p = $canvas[0], q = p.getContext("2d"), f();
                for (var b = Math.round(p.width * p.height / d.density), c = 0; b > c; c++) {
                    var e = new l;
                    e.setStackPos(c), x.push(e)
                }
                a(window).on("resize", function () {
                    h()
                }), a(document).on("mousemove", function (a) {
                    y = a.pageX, z = a.pageY
                }), B && !A && window.addEventListener("deviceorientation", function () {
                    D = Math.min(Math.max(-event.beta, -30), 30), C = Math.min(Math.max(-event.gamma, -30), 30)
                }, !0), g(), o("onInit")
            }
        }

        function f() {
            p.width = v.width(), p.height = v.height(), q.fillStyle = d.dotColor, q.strokeStyle = d.lineColor, q.lineWidth = d.lineWidth
        }

        function g() {
            if (w) {
                s = a(window).width(), t = a(window).height(), q.clearRect(0, 0, p.width, p.height);
                for (var b = 0; b < x.length; b++)x[b].updatePosition();
                for (var b = 0; b < x.length; b++)x[b].draw();
                E || (r = requestAnimationFrame(g))
            }
        }

        function h() {
            for (f(), i = x.length - 1; i >= 0; i--)(x[i].position.x > v.width() || x[i].position.y > v.height()) && x.splice(i, 1);
            var a = Math.round(p.width * p.height / d.density);
            if (a > x.length)for (; a > x.length;) {
                var b = new l;
                x.push(b)
            } else a < x.length && x.splice(a);
            for (i = x.length - 1; i >= 0; i--)x[i].setStackPos(i)
        }

        function j() {
            E = !0
        }

        function k() {
            E = !1, g()
        }

        function l() {
            switch (this.stackPos, this.active = !0, this.layer = Math.ceil(3 * Math.random()), this.parallaxOffsetX = 0, this.parallaxOffsetY = 0, this.position = {
                x: Math.ceil(Math.random() * p.width),
                y: Math.ceil(Math.random() * p.height)
            }, this.speed = {}, d.directionX) {
                case"left":
                    this.speed.x = +(-d.maxSpeedX + Math.random() * d.maxSpeedX - d.minSpeedX).toFixed(2);
                    break;
                case"right":
                    this.speed.x = +(Math.random() * d.maxSpeedX + d.minSpeedX).toFixed(2);
                    break;
                default:
                    this.speed.x = +(-d.maxSpeedX / 2 + Math.random() * d.maxSpeedX).toFixed(2), this.speed.x += this.speed.x > 0 ? d.minSpeedX : -d.minSpeedX
            }
            switch (d.directionY) {
                case"up":
                    this.speed.y = +(-d.maxSpeedY + Math.random() * d.maxSpeedY - d.minSpeedY).toFixed(2);
                    break;
                case"down":
                    this.speed.y = +(Math.random() * d.maxSpeedY + d.minSpeedY).toFixed(2);
                    break;
                default:
                    this.speed.y = +(-d.maxSpeedY / 2 + Math.random() * d.maxSpeedY).toFixed(2), this.speed.x += this.speed.y > 0 ? d.minSpeedY : -d.minSpeedY
            }
        }

        function m(a, b) {
            return b ? void(d[a] = b) : d[a]
        }

        function n() {
            v.find(".pg-canvas").remove(), o("onDestroy"), v.removeData("plugin_" + c)
        }

        function o(a) {
            void 0 !== d[a] && d[a].call(u)
        }

        var p, q, r, s, t, u = b, v = a(b), w = !!document.createElement("canvas").getContext, x = [], y = 0, z = 0, A = !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|mobi|tablet|opera mini|nexus 7)/i), B = !!window.DeviceOrientationEvent, C = 0, D = 0, E = !1;
        return d = a.extend({}, a.fn[c].defaults, d), l.prototype.draw = function () {
            q.beginPath(), q.arc(this.position.x + this.parallaxOffsetX, this.position.y + this.parallaxOffsetY, d.particleRadius / 2, 0, 2 * Math.PI, !0), q.closePath(), q.fill(), q.beginPath();
            for (var a = x.length - 1; a > this.stackPos; a--) {
                var b = x[a], c = this.position.x - b.position.x, e = this.position.y - b.position.y, f = Math.sqrt(c * c + e * e).toFixed(2);
                f < d.proximity && (q.moveTo(this.position.x + this.parallaxOffsetX, this.position.y + this.parallaxOffsetY), d.curvedLines ? q.quadraticCurveTo(Math.max(b.position.x, b.position.x), Math.min(b.position.y, b.position.y), b.position.x + b.parallaxOffsetX, b.position.y + b.parallaxOffsetY) : q.lineTo(b.position.x + b.parallaxOffsetX, b.position.y + b.parallaxOffsetY))
            }
            q.stroke(), q.closePath()
        }, l.prototype.updatePosition = function () {
            if (d.parallax) {
                if (B && !A) {
                    var a = (s - 0) / 60;
                    pointerX = (C - -30) * a + 0;
                    var b = (t - 0) / 60;
                    pointerY = (D - -30) * b + 0
                } else pointerX = y, pointerY = z;
                this.parallaxTargX = (pointerX - s / 2) / (d.parallaxMultiplier * this.layer), this.parallaxOffsetX += (this.parallaxTargX - this.parallaxOffsetX) / 10, this.parallaxTargY = (pointerY - t / 2) / (d.parallaxMultiplier * this.layer), this.parallaxOffsetY += (this.parallaxTargY - this.parallaxOffsetY) / 10
            }
            switch (d.directionX) {
                case"left":
                    this.position.x + this.speed.x + this.parallaxOffsetX < 0 && (this.position.x = v.width() - this.parallaxOffsetX);
                    break;
                case"right":
                    this.position.x + this.speed.x + this.parallaxOffsetX > v.width() && (this.position.x = 0 - this.parallaxOffsetX);
                    break;
                default:
                    (this.position.x + this.speed.x + this.parallaxOffsetX > v.width() || this.position.x + this.speed.x + this.parallaxOffsetX < 0) && (this.speed.x = -this.speed.x)
            }
            switch (d.directionY) {
                case"up":
                    this.position.y + this.speed.y + this.parallaxOffsetY < 0 && (this.position.y = v.height() - this.parallaxOffsetY);
                    break;
                case"down":
                    this.position.y + this.speed.y + this.parallaxOffsetY > v.height() && (this.position.y = 0 - this.parallaxOffsetY);
                    break;
                default:
                    (this.position.y + this.speed.y + this.parallaxOffsetY > v.height() || this.position.y + this.speed.y + this.parallaxOffsetY < 0) && (this.speed.y = -this.speed.y)
            }
            this.position.x += this.speed.x, this.position.y += this.speed.y
        }, l.prototype.setStackPos = function (a) {
            this.stackPos = a
        }, e(), {option: m, destroy: n, start: k, pause: j}
    }

    var c = "particleground";
    a.fn[c] = function (d) {
        if ("string" == typeof arguments[0]) {
            var e, f = arguments[0], g = Array.prototype.slice.call(arguments, 1);
            return this.each(function () {
                a.data(this, "plugin_" + c) && "function" == typeof a.data(this, "plugin_" + c)[f] && (e = a.data(this, "plugin_" + c)[f].apply(this, g))
            }), void 0 !== e ? e : this
        }
        return "object" != typeof d && d ? void 0 : this.each(function () {
            a.data(this, "plugin_" + c) || a.data(this, "plugin_" + c, new b(this, d))
        })
    }, a.fn[c].defaults = {
        minSpeedX: .1,
        maxSpeedX: .7,
        minSpeedY: .1,
        maxSpeedY: .7,
        directionX: "center",
        directionY: "center",
        density: 1e4,
        dotColor: "#666666",
        lineColor: "#666666",
        particleRadius: 7,
        lineWidth: 1,
        curvedLines: !1,
        proximity: 100,
        parallax: !0,
        parallaxMultiplier: 5,
        onInit: function () {
        },
        onDestroy: function () {
        }
    }
}(jQuery), /**
 * requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
 * @see: http://paulirish.com/2011/requestanimationframe-for-smart-animating/
 * @see: http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
 * @license: MIT license
 */
    function () {
        for (var a = 0, b = ["ms", "moz", "webkit", "o"], c = 0; c < b.length && !window.requestAnimationFrame; ++c)window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"];
        window.requestAnimationFrame || (window.requestAnimationFrame = function (b) {
            var c = (new Date).getTime(), d = Math.max(0, 16 - (c - a)), e = window.setTimeout(function () {
                b(c + d)
            }, d);
            return a = c + d, e
        }), window.cancelAnimationFrame || (window.cancelAnimationFrame = function (a) {
            clearTimeout(a)
        })
    }();

$(function () {

    $('#particles').particleground({
        minSpeedX: 0.1,
        maxSpeedX: 0.7,
        minSpeedY: 0.1,
        maxSpeedY: 0.7,
        directionX: 'center', // 'center', 'left' or 'right'. 'center' = dots bounce off edges
        directionY: 'center', // 'center', 'up' or 'down'. 'center' = dots bounce off edges
        density: 10000, // How many particles will be generated: one particle every n pixels
        dotColor: '#eee',
        lineColor: '#eee',
        particleRadius: 7, // Dot size
        lineWidth: 1,
        curvedLines: true,
        proximity: 100, // How close two dots need to be before they join
        parallax: false
    });

});


text:
class Transit::ContextsController < TransitController

  respond_to :js
  belongs_to :post, :page
  actions :new, :destroy

  def new
    ptype = symbols_for_association_chain.first.to_s
    @parent = ptype.classify.constantize.find(params["#{ptype}_id"])
    set_resource_ivar(@parent)
    @context = @parent.contexts.build({}, params[:type].classify.constantize)
    respond_with(@context)
  end

  def destroy
    ptype = symbols_for_association_chain.first.to_s
    @parent = ptype.classify.constantize.find(params["#{ptype}_id"])
    @context = @parent.contexts.find(params[:id])
    set_resource_ivar(@parent)
    @context.destroy
    flash[:success] = "The selected field has been removed."
    respond_with(@context)
  end

end

redpajama_set_name: RedPajamaGithub


text:
@interface SShowPageShapeView : UIView

@property (nonatomic, assign) NSInteger pageSize;
@property (nonatomic, assign) NSInteger currentPage;
@property (nonatomic, assign) CGFloat currentPercentage_X;
@property (nonatomic, assign) CGFloat pageWidth;
@property (nonatomic, assign) CGFloat pageSpace;
@property (nonatomic, assign) CGFloat origin_Y;
@property (nonatomic, assign, readonly) CGFloat origin_X;
@property (nonatomic, assign, readonly) CGFloat sunWidth;

@property (nonatomic, strong) UIColor *selectedItemColor;
@property (nonatomic, strong) UIColor *normalItemColor;

- (void)showPage;

@end


text:
({
	loadingState: "Indlæser...",
	errorState: "Der er opstået en fejl"
})


text:
using UnityEngine;

/// <summary>
/// Tween the widget's size.
/// </summary>

[RequireComponent(typeof(UIWidget))]
[AddComponentMenu("NGUI/Tween/Tween Height")]
public class TweenHeight : UITweener
{
	public int from = 100;
	public int to = 100;
	public bool updateTable = false;

	UIWidget mWidget;
	UITable mTable;

	public UIWidget cachedWidget { get { if (mWidget == null) mWidget = GetComponent<UIWidget>(); return mWidget; } }

	[System.Obsolete("Use 'value' instead")]
	public int height { get { return this.value; } set { this.value = value; } }

	/// <summary>
	/// Tween's current value.
	/// </summary>

	public int value { get { return cachedWidget.height; } set { cachedWidget.height = value; } }

	/// <summary>
	/// Tween the value.
	/// </summary>

	protected override void OnUpdate (float factor, bool isFinished)
	{
		value = Mathf.RoundToInt(from * (1f - factor) + to * factor);

		if (updateTable)
		{
			if (mTable == null)
			{
				mTable = NGUITools.FindInParents<UITable>(gameObject);
				if (mTable == null) { updateTable = false; return; }
			}
			mTable.repositionNow = true;
		}
	}

	/// <summary>
	/// Start the tweening operation.
	/// </summary>

	static public TweenHeight Begin (UIWidget widget, float duration, int height)
	{
		TweenHeight comp = UITweener.Begin<TweenHeight>(widget.gameObject, duration);
		comp.from = widget.height;
		comp.to = height;

		if (duration <= 0f)
		{
			comp.Sample(1f, true);
			comp.enabled = false;
		}
		return comp;
	}

	[ContextMenu("Set 'From' to current value")]
	public override void SetStartToCurrentValue () { from = value; }

	[ContextMenu("Set 'To' to current value")]
	public override void SetEndToCurrentValue () { to = value; }

	[ContextMenu("Assume value of 'From'")]
	void SetCurrentValueToStart () { value = from; }

	[ContextMenu("Assume value of 'To'")]
	void SetCurrentValueToEnd () { value = to; }
}


text:
#include "DomainParticipant.h"
#include "CdrTypeSupport.h"
#include "ReportUtils.h"

#include "c_base.h"
#include "c_metabase.h"
#include "sd_cdr.h"
#include "os_abstract.h"

#ifdef PA_LITTLE_ENDIAN
#define PLATFORM_IS_LITTLE_ENDIAN 1
#else
#define PLATFORM_IS_LITTLE_ENDIAN 0
#endif

namespace DDS
{
    namespace OpenSplice
    {
        class CdrSerializedDataImpl : public DDS::OpenSplice::CdrSerializedData
        {
        public:
            CdrSerializedDataImpl(
               struct sd_cdrSerdata *serdata)
            {
                _serdata = serdata;
                if (serdata) {
                    const void *blob;
                    _size = sd_cdrSerdataBlob(&blob, _serdata);

                } else {
                    _size = 0;
                }
            }

            virtual ~CdrSerializedDataImpl()
            {
                if (_serdata) {
                    sd_cdrSerdataFree(_serdata);
                }
            }

            virtual unsigned int get_size()
            {
                return _size + 4;
            }

            virtual void get_data(void *buffer)
            {
                unsigned char *data = (unsigned char *)buffer;
                const void *blob;
                unsigned int sz;

                sz = sd_cdrSerdataBlob(&blob, _serdata);

                memcpy(&data[4], blob, sz);
                data[0] = 0;
                data[1] = PLATFORM_IS_LITTLE_ENDIAN;
                data[2] = 0;
                data[3] = 0;
            }

        private:
            unsigned int _size;
            struct sd_cdrSerdata *_serdata;
        };
    }
}

DDS::ReturnCode_t
DDS::OpenSplice::CdrTypeSupport::serialize(
    const void *message,
    CdrSerializedData **cdrdata)
{
    ReturnCode_t result = RETCODE_OK;
    struct sd_cdrSerdata *serdata;
    struct sd_cdrInfo *marshaler;
    c_type ctype;
    c_base cbase;
    c_object obj;

    CPP_REPORT_STACK();

    if (!message || !cdrdata) {
        result =  DDS::RETCODE_BAD_PARAMETER;
        CPP_REPORT(result, "message or serdata incorrect");
    } else {
        result = tsMetaHolder->init_cdr();
        if (result == DDS::RETCODE_OK) {
            marshaler = static_cast<struct sd_cdrInfo *>(tsMetaHolder->get_cdrMarshaler());
            ctype = static_cast<c_type>(tsMetaHolder->get_ctype());

            /* copy message in */
            cxxCopyIn copyIn = tsMetaHolder->get_copy_in();

            obj = c_new_s(ctype);
            cbase = c_getBase(c_object(ctype));
            copyIn(cbase, message, obj);

            c_free(ctype);

            serdata = sd_cdrSerialize(marshaler, obj);
            if (serdata) {
                *cdrdata = new CdrSerializedDataImpl(serdata);
            } else {
                result = DDS::RETCODE_BAD_PARAMETER;
                CPP_REPORT(result, "could not serialize data");
            }
            c_free(obj);
        }
    }

    CPP_REPORT_FLUSH_NO_ID(result != DDS::RETCODE_OK);

    return result;
}

DDS::ReturnCode_t
DDS::OpenSplice::CdrTypeSupport::deserialize(
    const void *serialized_message,
    unsigned int message_size,
    void *message)
{
    DDS::ReturnCode_t result;
    c_object obj;
    struct sd_cdrInfo *marshaler;
    int swap = 0;

    CPP_REPORT_STACK();

    const unsigned char *header = (const unsigned char *)serialized_message;
    if (message_size < 4) {
        return DDS::RETCODE_BAD_PARAMETER;
    }

    if ((header[1] & 0x01) == 0) {
        swap = PLATFORM_IS_LITTLE_ENDIAN;
    } else {
        swap = !PLATFORM_IS_LITTLE_ENDIAN;
    }

    result = tsMetaHolder->init_cdr();
    if (result == DDS::RETCODE_OK) {
        int cdrResult;

        marshaler = static_cast<struct sd_cdrInfo *>(tsMetaHolder->get_cdrMarshaler());

        if (!swap) {
            cdrResult = sd_cdrDeserializeObject(&obj, marshaler, message_size - 4, &header[4]);
        } else {
            cdrResult = sd_cdrDeserializeObjectBSwap(&obj, marshaler, message_size - 4, &header[4]);
        }
        if (cdrResult == SD_CDR_OK) {
            cxxCopyOut copyOut = tsMetaHolder->get_copy_out();
            copyOut(obj, message);
            result = DDS::RETCODE_OK;
        } else if (cdrResult == SD_CDR_OUT_OF_MEMORY) {
            CPP_REPORT(result, "could allocate enough resources");
            result = DDS::RETCODE_OUT_OF_RESOURCES;
        } else {
            result = DDS::RETCODE_BAD_PARAMETER;
            CPP_REPORT(result, "could not deserialize data");
        }
    }

    CPP_REPORT_FLUSH_NO_ID(result != DDS::RETCODE_OK);

    return result;
}

DDS::OpenSplice::CdrTypeSupport::CdrTypeSupport(DDS::TypeSupport& ts)
{
   DDS::OpenSplice::TypeSupport *tss = dynamic_cast<DDS::OpenSplice::TypeSupport *>(&ts);
   tsMetaHolder = tss->get_metaHolder();
}

DDS::OpenSplice::CdrTypeSupport::~CdrTypeSupport()
{
}


text:
// Generated by LiveScript 1.4.0

(function(){
  Polymer({
    'is': 'cs-blogs-post',
    'extends': 'article',
    behaviors: [cs.Polymer.behaviors.Language('blogs_')],
    properties: {
      can_edit: false,
      can_delete: false,
      show_comments: false,
      preview: false,
      url_prefix: location.pathname.indexOf('/' + cs.Language.clang) === 0 ? '/' + cs.Language.clang : ''
    },
    ready: function(){
      var this$ = this;
      this.jsonld = JSON.parse(this.children[0].innerHTML);
      cs.api(['get_settings	api/Blogs', 'get			api/System/profile']).then(function(arg$){
        var profile;
        this$.settings = arg$[0], profile = arg$[1];
        this$.can_edit = !this$.preview && (this$.settings.admin_edit || this$.jsonld.user === profile.id);
        this$.can_delete = !this$.preview && this$.settings.admin_edit;
        this$.show_comments = !this$.preview && this$.settings.comments_enabled;
      });
    },
    sections_path: function(index){
      return this.jsonld.sections_paths[index];
    },
    tags_path: function(index){
      return this.jsonld.tags_paths[index];
    },
    _delete: function(){
      var this$ = this;
      cs.ui.confirm(this.L.sure_to_delete_post(this.jsonld.title)).then(function(){
        return cs.api('delete api/Blogs/posts/' + this$.jsonld.id);
      }).then(function(result){
        this$._remove_close_tab_handler();
        location.href = 'Blogs';
      });
    }
  });
}).call(this);


text:
using namespace BOSS;

CombatSearchResults::CombatSearchResults()
    : solved(false)
    , timedOut(false)
    , solutionLength(-1)
    , upperBound(-1)
    , lowerBound(-1)
    , nodesExpanded(0)
    , timeElapsed(0)
    , avgBranch(0)
    , minerals(0)
    , gas(0)
    , frameCompleted(0)
    , winner(Races::None)
    , highestEval(0)
{
}

void CombatSearchResults::printResults(bool pbo)
{
    printf("%12d%12d%12d%14llu%12.4lf%12.2lf%12.2lf       ",upperBound,lowerBound,solutionLength,nodesExpanded,avgBranch,timeElapsed,(nodesExpanded/(timeElapsed/1000.0)));

    if (pbo)
    {
        printBuildOrder();
    }

    printf("\n");
}

void CombatSearchResults::printBuildOrder()
{
    for (size_t i(0); i<buildOrder.size(); ++i)
    {
        printf("%d ", buildOrder[buildOrder.size()-1-i].ID());
    }
}


text:
package com.parse;

import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.Test;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.SimpleTimeZone;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

public class ParseObjectCurrentCoderTest {

  // These magic strings are copied from ParseObjectCurrentCoder, since we do not want to make
  // the magic strings in ParseObjectCurrentCoder to be package for tests.
  /*
  /2 format JSON Keys
  */
  private static final String KEY_OBJECT_ID = "objectId";
  private static final String KEY_CLASS_NAME = "classname";
  private static final String KEY_CREATED_AT = "createdAt";
  private static final String KEY_UPDATED_AT = "updatedAt";
  private static final String KEY_DATA = "data";

  /*
  Old serialized JSON keys
   */
  private static final String KEY_OLD_OBJECT_ID = "id";
  private static final String KEY_OLD_CREATED_AT = "created_at";
  private static final String KEY_OLD_UPDATED_AT = "updated_at";
  private static final String KEY_OLD_POINTERS = "pointers";

  @Test
  public void testEncodeSuccess() throws Exception {
    Date createAt = new Date(1000);
    Date updateAt = new Date(2000);
    ParseObject.State state = new ParseObject.State.Builder("Test")
        .createdAt(createAt)
        .updatedAt(updateAt)
        .objectId("objectId")
        .put("key", "value")
        .build();

    ParseObjectCurrentCoder coder = ParseObjectCurrentCoder.get();
    JSONObject objectJson = coder.encode(state, null, PointerEncoder.get());

    assertEquals("Test", objectJson.getString(KEY_CLASS_NAME));
    JSONObject dataJson = objectJson.getJSONObject(KEY_DATA);
    String createAtStr = ParseDateFormat.getInstance().format(createAt);
    assertEquals(createAtStr, dataJson.getString(KEY_CREATED_AT));
    String updateAtStr = ParseDateFormat.getInstance().format(updateAt);
    assertEquals(updateAtStr, dataJson.getString(KEY_UPDATED_AT));
    assertEquals("objectId", dataJson.getString(KEY_OBJECT_ID));
    assertEquals("value", dataJson.getString("key"));
  }

  @Test
  public void testEncodeSuccessWithEmptyState() throws Exception {
    ParseObject.State state = new ParseObject.State.Builder("Test")
        .build();

    ParseObjectCurrentCoder coder = ParseObjectCurrentCoder.get();
    JSONObject objectJson = coder.encode(state, null, PointerEncoder.get());

    assertEquals("Test", objectJson.getString(KEY_CLASS_NAME));
    JSONObject dataJson = objectJson.getJSONObject(KEY_DATA);
    assertFalse(dataJson.has(KEY_CREATED_AT));
    assertFalse(dataJson.has(KEY_UPDATED_AT));
    assertFalse(dataJson.has(KEY_OBJECT_ID));
  }

  @Test(expected = IllegalArgumentException.class)
  public void testEncodeFailureWithNotNullParseOperationSet() throws Exception {
    ParseObject.State state = new ParseObject.State.Builder("Test")
        .build();

    ParseObjectCurrentCoder coder = ParseObjectCurrentCoder.get();
    coder.encode(state, new ParseOperationSet(), PointerEncoder.get());
  }

  @Test
  public void testDecodeSuccessWithoutOldFormatJson() throws Exception {
    Date createAt = new Date(1000);
    Date updateAt = new Date(2000);
    String createAtStr = ParseDateFormat.getInstance().format(createAt);
    String updateAtStr = ParseDateFormat.getInstance().format(updateAt);
    JSONObject dataJson = new JSONObject()
        .put(KEY_OBJECT_ID, "objectId")
        .put(KEY_CREATED_AT, createAtStr)
        .put(KEY_UPDATED_AT, updateAtStr)
        .put("key", "value");
    JSONObject objectJson = new JSONObject();
    objectJson.put(KEY_DATA, dataJson);

    ParseObjectCurrentCoder coder = ParseObjectCurrentCoder.get();
    ParseObject.State.Builder  builder =
        coder.decode(new ParseObject.State.Builder("Test"), objectJson, ParseDecoder.get());

    // We use the builder to build a state to verify the content in the builder
    ParseObject.State state = builder.build();
    assertEquals(createAt.getTime(), state.createdAt());
    assertEquals(updateAt.getTime(), state.updatedAt());
    assertEquals("objectId", state.objectId());
    assertEquals("value", state.get("key"));
  }

  @Test
  public void testDecodeSuccessWithOldFormatJson() throws Exception {
    Date createAt = new Date(1000);
    Date updateAt = new Date(2000);
    String createAtStr = ParseImpreciseDateFormat.getInstance().format(createAt);
    String updateAtStr = ParseImpreciseDateFormat.getInstance().format(updateAt);
    JSONObject pointerJson = new JSONObject();
    JSONArray innerObjectJson = new JSONArray()
        .put(0, "innerObject")
        .put(1, "innerObjectId");
    pointerJson.put("inner", innerObjectJson);
    JSONObject oldObjectJson = new JSONObject()
        .put(KEY_OLD_OBJECT_ID, "objectId")
        .put(KEY_OLD_CREATED_AT, createAtStr)
        .put(KEY_OLD_UPDATED_AT, updateAtStr)
        .put(KEY_OLD_POINTERS, pointerJson);

    ParseObjectCurrentCoder coder = ParseObjectCurrentCoder.get();
    ParseObject.State.Builder  builder =
        coder.decode(new ParseObject.State.Builder("Test"), oldObjectJson, ParseDecoder.get());

    // We use the builder to build a state to verify the content in the builder
    ParseObject.State state = builder.build();
    assertEquals(createAt.getTime(), state.createdAt());
    assertEquals(updateAt.getTime(), state.updatedAt());
    assertEquals("objectId", state.objectId());
    ParseObject innerObject = (ParseObject) state.get("inner");
    assertEquals("innerObject", innerObject.getClassName());
    assertEquals("innerObjectId", innerObject.getObjectId());
  }

  @Test
  public void testObjectSerializationFormat() throws Exception {
    ParseObject childObject = new ParseObject("child");
    childObject.setObjectId("childObjectId");

    DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
    format.setTimeZone(new SimpleTimeZone(0, "GMT"));

    String dateString = "2011-08-12T01:06:05Z";
    Date date = format.parse(dateString);

    String jsonString = "{" +
        "'id':'wnAiJVI3ra'," +
        "'updated_at':'" + dateString + "'," +
        "'pointers':{'child':['child','" + childObject.getObjectId() + "']}," +
        "'classname':'myClass'," +
        "'dirty':true," +
        "'data':{'foo':'bar'}," +
        "'created_at':'2011-08-12T01:06:05Z'," +
        "'deletedKeys':['toDelete']" +
        "}";

    ParseObjectCurrentCoder coder = ParseObjectCurrentCoder.get();
    JSONObject json = new JSONObject(jsonString);
    ParseObject.State state = coder.decode(
        new ParseObject.State.Builder("Test"), json, ParseDecoder.get()).build();

    assertEquals("wnAiJVI3ra", state.objectId());
    assertEquals("bar", state.get("foo"));
    assertEquals(date.getTime(), state.createdAt());
    assertEquals(((ParseObject) state.get("child")).getObjectId(), childObject.getObjectId());

    // Test that objects can be serialized and deserialized without timestamps
    String jsonStringWithoutTimestamps = "{" +
        "'id':'wnAiJVI3ra'," +
        "'pointers':{'child':['child','" + childObject.getObjectId() + "']}," +
        "'classname':'myClass'," +
        "'dirty':true," +
        "'data':{'foo':'bar'}," +
        "'deletedKeys':['toDelete']" +
        "}";

    json = new JSONObject(jsonStringWithoutTimestamps);
    state = coder.decode(
        new ParseObject.State.Builder("Test"), json, ParseDecoder.get()).build();
    assertEquals("wnAiJVI3ra", state.objectId());
  }
}


text:
package com.thoughtworks.go.agent.functional;

import java.io.File;
import java.util.List;

import com.thoughtworks.go.agent.service.SslInfrastructureService;
import com.thoughtworks.go.agent.testhelpers.FakeBuildRepositoryRemote;
import com.thoughtworks.go.agent.testhelpers.FakeGoServer;
import com.thoughtworks.go.agent.testhelpers.LongWorkCreator;
import com.thoughtworks.go.domain.AgentRuntimeStatus;
import com.thoughtworks.go.util.SystemEnvironment;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import static com.thoughtworks.go.domain.AgentRuntimeStatus.Building;
import static com.thoughtworks.go.utils.Assertions.assertWillHappen;
import static org.apache.commons.io.FileUtils.deleteDirectory;
import static org.hamcrest.CoreMatchers.hasItem;

@Ignore
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/applicationContext.xml"})
public class AgentStatusReportingFunctionalTest {
    private static final String SERVER_URL = "https://localhost:8443/go";
    private static FakeGoServer fakeGoServer;

    @BeforeClass
    public static void systemProperties() throws Exception {
        new SystemEnvironment().setProperty("serviceUrl", SERVER_URL);
        new SystemEnvironment().setProperty("WORKCREATOR", LongWorkCreator.class.getCanonicalName());
        SslInfrastructureService.AGENT_CERTIFICATE_FILE.delete();
        SslInfrastructureService.AGENT_TRUST_FILE.delete();
        fakeGoServer = new FakeGoServer(9090, 8443);
        fakeGoServer.start();
        FakeBuildRepositoryRemote.AGENT_STATUS.clear();
    }

    @AfterClass
    public static void tearDown() throws Exception {
        fakeGoServer.stop();
        deleteDirectory(new File("config"));
    }

    @Test
    public void shouldRunBuildWhenWorkAssigned() throws Exception {
        assertWillHappen(FakeBuildRepositoryRemote.AGENT_STATUS, hasItem(Building));
        FakeBuildRepositoryRemote.AGENT_STATUS.clear();
        restartGoServer();
        assertWillHappen(FakeBuildRepositoryRemote.AGENT_STATUS, firstMessageIs(AgentRuntimeStatus.Idle));
    }

    private void restartGoServer() throws Exception {
        fakeGoServer.stop();
        fakeGoServer.start();
    }

    private TypeSafeMatcher<List<AgentRuntimeStatus>> firstMessageIs(final AgentRuntimeStatus expected) {
        return new TypeSafeMatcher<List<AgentRuntimeStatus>>() {
            @Override public boolean matchesSafely(List<AgentRuntimeStatus> actual) {
                if (actual.isEmpty()) { return false; }
                return actual.get(0).equals(expected);
            }

            public void describeTo(Description description) {
                description.appendText(expected.toString());
            }
        };
    }
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911
// .1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.07.16 at 03:24:22 PM EEST
//

package org.ecloudmanager.tmrk.cloudapi.model;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for UserReferenceType complex type.
 *

 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <complexType name="UserReferenceType">
 *   <complexContent>
 *     <extension base="{}ReferenceType">
 *       <sequence>
 *         <element name="FirstName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="LastName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "UserReferenceType", propOrder = {
    "firstName",
    "lastName"
})
public class UserReferenceType
    extends ReferenceType {

    /**
     *
     */
    private static final long serialVersionUID = -1346758289553821747L;
    @XmlElementRef(name = "FirstName", type = JAXBElement.class, required = false)
    protected JAXBElement<String> firstName;
    @XmlElementRef(name = "LastName", type = JAXBElement.class, required = false)
    protected JAXBElement<String> lastName;

    /**
     * Gets the value of the firstName property.
     *
     * @return possible object is
     * {@link JAXBElement }{@code <}{@link String }{@code >}
     */
    public JAXBElement<String> getFirstName() {
        return firstName;
    }

    /**
     * Sets the value of the firstName property.
     *
     * @param value allowed object is
     *              {@link JAXBElement }{@code <}{@link String }{@code >}
     */
    public void setFirstName(JAXBElement<String> value) {
        this.firstName = value;
    }

    /**
     * Gets the value of the lastName property.
     *
     * @return possible object is
     * {@link JAXBElement }{@code <}{@link String }{@code >}
     */
    public JAXBElement<String> getLastName() {
        return lastName;
    }

    /**
     * Sets the value of the lastName property.
     *
     * @param value allowed object is
     *              {@link JAXBElement }{@code <}{@link String }{@code >}
     */
    public void setLastName(JAXBElement<String> value) {
        this.lastName = value;
    }

}


text:
layout: figure
order: 3
label: Screenshot 3
title: "Ulm"
description: "Public Transit of Ulm"
image: "data/screenshots/ulm.png"
---
<img src="{{ site.baseurl }}/data/screenshots/ulm.png">


text:
package com.toshkin.activtrades.feed;

import com.toshkin.activtrades.app.mvp.BasePresenter;
import com.toshkin.activtrades.network.Callback;
import com.toshkin.activtrades.network.pojos.Post;

import java.util.ArrayList;

class PostsPresenter extends BasePresenter<PostsView> {

    private PostsManager manager;

    PostsPresenter(PostsManager manager) {
        this.manager = manager;
    }

    void getPosts() {
        if (isOperational()) {
            getView().showLoadingIndicator();
        }
        manager.getPosts(new Callback<ArrayList<Post>, String>() {
            @Override
            public void onSuccess(ArrayList<Post> response) {
                if (isOperational()) {
                    getView().hideLoadingIndicator();
                    getView().onNewPosts(response);
                }
            }

            @Override
            public void onError(String error) {
                if (isOperational()) {
                    getView().hideLoadingIndicator();
                    getView().onError(error);
                }
            }
        });
    }

    void deletePost(Post post) {
        if (isOperational()) {
            getView().showLoadingIndicator();
        }
        manager.deletePost(post.getId(), new Callback<Integer, String>() {
            @Override
            public void onSuccess(Integer postId) {
                if (isOperational()) {
                    getView().hideLoadingIndicator();
                    getView().onPostDeleted(postId);
                }
            }

            @Override
            public void onError(String error) {
                if (isOperational()) {
                    getView().hideLoadingIndicator();
                    getView().onError(error);
                }
            }
        });
    }

    void addPost(String title, String body) {
        if (isOperational()) {
            getView().showLoadingIndicator();
        }
        Post post = new Post(title, body);
        manager.addPost(post, new Callback<Post, String>() {
            @Override
            public void onSuccess(Post post) {
                if (isOperational()) {
                    getView().hideLoadingIndicator();
                    getView().onPostAdded(post);
                }
            }

            @Override
            public void onError(String error) {
                if (isOperational()) {
                    getView().hideLoadingIndicator();
                    getView().onError(error);
                }
            }
        });
    }
}


text:
package main

import (
	"context"
	"fmt"
	"os"

	"github.com/GoogleContainerTools/kpt/internal/errors"
	"github.com/GoogleContainerTools/kpt/internal/errors/resolver"
	"github.com/GoogleContainerTools/kpt/internal/util/cmdutil"
	"github.com/GoogleContainerTools/kpt/run"
	"github.com/spf13/cobra"
	_ "k8s.io/client-go/plugin/pkg/client/auth"
	"k8s.io/component-base/cli"
	"k8s.io/klog/v2"
	k8scmdutil "k8s.io/kubectl/pkg/cmd/util"
)

func main() {
	// Handle all setup in the runMain function so os.Exit doesn't interfere
	// with defer.
	os.Exit(runMain())
}

// runMain does the initial setup in order to run kpt. The return value from
// this function will be the exit code when kpt terminates.
func runMain() int {
	var err error

	ctx := context.Background()

	// Enable commandline flags for klog.
	// logging will help in collecting debugging information from users
	klog.InitFlags(nil)

	cmd := run.GetMain(ctx)

	err = cli.RunNoErrOutput(cmd)
	if err != nil {
		return handleErr(cmd, err)
	}
	return 0
}

// handleErr takes care of printing an error message for a given error.
func handleErr(cmd *cobra.Command, err error) int {
	// First attempt to see if we can resolve the error into a specific
	// error message.
	if re, resolved := resolver.ResolveError(err); resolved {
		if re.Message != "" {
			fmt.Fprintf(cmd.ErrOrStderr(), "%s \n", re.Message)
		}
		return re.ExitCode
	}

	// Then try to see if it is of type *errors.Error
	var kptErr *errors.Error
	if errors.As(err, &kptErr) {
		unwrapped, ok := errors.UnwrapErrors(kptErr)
		if ok && !cmdutil.PrintErrorStacktrace() {
			fmt.Fprintf(cmd.ErrOrStderr(), "Error: %s \n", unwrapped.Error())
			return 1
		}
		fmt.Fprintf(cmd.ErrOrStderr(), "%s \n", kptErr.Error())
		return 1
	}

	// Finally just let the error handler for kubectl handle it. This handles
	// printing of several error types used in kubectl
	// TODO: See if we can handle this in kpt and get a uniform experience
	// across all of kpt.
	k8scmdutil.CheckErr(err)
	return 1
}


text:
int main()
  {

#if BOOST_PP_VARIADICS

  using namespace boost::mpl::placeholders;

  BOOST_TEST((boost::tti::mf_has_template_check_params
                <
                HT_Str<_>,
                BOOST_TTI_MEMBER_TYPE_GEN(AStructType)<AType>
                >
              ::value
            ));

  BOOST_TEST((boost::tti::mf_has_template_check_params
                <
                BOOST_TTI_VM_HAS_TEMPLATE_CHECK_PARAMS_GEN(AnotherMemberTemplate)<_>,
                boost::mpl::identity<AType>
                >
              ::value
            ));

  BOOST_TEST((!boost::tti::mf_has_template_check_params
                <
                WrongParametersForMP<_>,
                boost::mpl::identity<AnotherType>
                >
              ::value
            ));

  BOOST_TEST((boost::tti::mf_has_template_check_params
                <
                BOOST_TTI_VM_HAS_TEMPLATE_CHECK_PARAMS_GEN(CTManyParameters)<_>,
                boost::tti::mf_member_type
                  <
                  BOOST_TTI_MEMBER_TYPE_GEN(CType)<_>,
                  MT_BType<AType>
                  >
                >
              ::value
            ));

  BOOST_TEST((!boost::tti::mf_has_template_check_params
                <
                BOOST_TTI_VM_HAS_TEMPLATE_CHECK_PARAMS_GEN(TemplateNotExist)<_>,
                boost::tti::mf_member_type
                  <
                  BOOST_TTI_MEMBER_TYPE_GEN(CType)<_>,
                  MT_BType<AType>
                  >
                >
              ::value
            ));

  BOOST_TEST((boost::tti::mf_has_template_check_params
                <
                boost::mpl::quote1<HT_Str>,
                BOOST_TTI_MEMBER_TYPE_GEN(AStructType)<AType>
                >
              ::value
            ));

  BOOST_TEST((boost::tti::mf_has_template_check_params
                <
                boost::mpl::quote1<BOOST_TTI_VM_HAS_TEMPLATE_CHECK_PARAMS_GEN(AnotherMemberTemplate)>,
                boost::mpl::identity<AType>
                >
              ::value
            ));

  BOOST_TEST((!boost::tti::mf_has_template_check_params
                <
                boost::mpl::quote1<WrongParametersForMP>,
                boost::mpl::identity<AnotherType>
                >
              ::value
            ));

  BOOST_TEST((boost::tti::mf_has_template_check_params
                <
                boost::mpl::quote1<BOOST_TTI_VM_HAS_TEMPLATE_CHECK_PARAMS_GEN(CTManyParameters)>,
                boost::tti::mf_member_type
                  <
                  BOOST_TTI_MEMBER_TYPE_GEN(CType)<_>,
                  MT_BType<AType>
                  >
                >
              ::value
            ));

  BOOST_TEST((!boost::tti::mf_has_template_check_params
                <
                boost::mpl::quote1<BOOST_TTI_VM_HAS_TEMPLATE_CHECK_PARAMS_GEN(TemplateNotExist)>,
                boost::tti::mf_member_type
                  <
                  boost::mpl::quote1<BOOST_TTI_MEMBER_TYPE_GEN(CType)>,
                  MT_BType<AType>
                  >
                >
              ::value
            ));

#endif // BOOST_PP_VARIADICS

  return boost::report_errors();

  }


text:
All notable changes to `apollo-pages` will be documented in this file.

## 1.3.0 - 2021-09-01

This update includes a number of package workflow features and general cleanup.

- Replaces StyleCI to use PHP CS Fixer for code formatting.
- Replaces TravisCI to use GitHub Workflow actions for running tests and formatting code.
- Code formatting updates thanks to PHP CS Fixer and newly defined rules.
- Other general file/directory updates.
- Most of these updates were inspired from @spatie's helpful [Laravel Package Training course](https://laravelpackage.training/).
- Updating to include Illuminate 7.0.* packages to include support for Laravel 7.0.*.
- Switching out `str_slug` to `Str::slug` since the string helper was removed in Laravel 5.7, but the static method is supported for earlier versions.
- Switching out `or` in Blade edit template to `??` the null coalesce operator since the keyword was removed in Laravel 5.7, but the null coalesce operator should be supported from PHP 7.0+.

## 1.2.0 - 2018-04-06

- Adds the [Parsedown](https://github.com/erusev/parsedown) package for handling parsing markdown into markup to save in the `body_markup`.
- Improves the admin interface to use a select dropdown input element if designating a parent page for a new page.
- Updates the `ApolloPage` model to add more convenience accessors and a scope query.
- Adds validation rules to the `update()` method on the Admin Controller.

## 1.1.0 - 2018-03-18

- Adds a series of feature tests for the package.
- Renames the `body_html` column in the `pages` table to `body_markup`, which seems a bit more appropriate.

The change to the column name does not break anything in the package since currently it does not use `body_markup` but is something for a future feature update.

## 1.0.0 - 2017-08-07

- initial release


text:
package org.apache.flink.table.planner.plan.rules.physical.stream

import org.apache.flink.table.planner.calcite.FlinkTypeFactory
import org.apache.flink.table.planner.plan.`trait`.FlinkRelDistribution
import org.apache.flink.table.planner.plan.nodes.FlinkConventions
import org.apache.flink.table.planner.plan.nodes.logical.FlinkLogicalRank
import org.apache.flink.table.planner.plan.nodes.physical.stream.{StreamPhysicalDeduplicate, StreamPhysicalRank}
import org.apache.flink.table.runtime.operators.rank.{ConstantRankRange, RankType}

import org.apache.calcite.plan.{RelOptRule, RelOptRuleCall}
import org.apache.calcite.rel.`type`.RelDataType
import org.apache.calcite.rel.convert.ConverterRule
import org.apache.calcite.rel.{RelCollation, RelNode}

/**
  * Rule that matches [[FlinkLogicalRank]] which is sorted by time attribute and
  * limits 1 and its rank type is ROW_NUMBER, and converts it to [[StreamPhysicalDeduplicate]].
  *
  * NOTES: Queries that can be converted to [[StreamPhysicalDeduplicate]] could be converted to
  * [[StreamPhysicalRank]] too. [[StreamPhysicalDeduplicate]] is more efficient than
  * [[StreamPhysicalRank]] due to mini-batch and less state access.
  *
  * e.g.
  * 1. {{{
  * SELECT a, b, c FROM (
  *   SELECT a, b, c, proctime,
  *          ROW_NUMBER() OVER (PARTITION BY a ORDER BY proctime ASC) as row_num
  *   FROM MyTable
  * ) WHERE row_num <= 1
  * }}} will be converted to StreamExecDeduplicate which keeps first row in proctime.
  *
  * 2. {{{
  * SELECT a, b, c FROM (
  *   SELECT a, b, c, rowtime,
  *          ROW_NUMBER() OVER (PARTITION BY a ORDER BY rowtime DESC) as row_num
  *   FROM MyTable
  * ) WHERE row_num <= 1
  * }}} will be converted to StreamExecDeduplicate which keeps last row in rowtime.
  */
class StreamPhysicalDeduplicateRule
  extends ConverterRule(
    classOf[FlinkLogicalRank],
    FlinkConventions.LOGICAL,
    FlinkConventions.STREAM_PHYSICAL,
    "StreamPhysicalDeduplicateRule") {

  override def matches(call: RelOptRuleCall): Boolean = {
    val rank: FlinkLogicalRank = call.rel(0)
    StreamPhysicalDeduplicateRule.canConvertToDeduplicate(rank)
  }

  override def convert(rel: RelNode): RelNode = {
    val rank = rel.asInstanceOf[FlinkLogicalRank]
    val requiredDistribution = if (rank.partitionKey.isEmpty) {
      FlinkRelDistribution.SINGLETON
    } else {
      FlinkRelDistribution.hash(rank.partitionKey.toList)
    }
    val requiredTraitSet = rel.getCluster.getPlanner.emptyTraitSet()
      .replace(FlinkConventions.STREAM_PHYSICAL)
      .replace(requiredDistribution)
    val convInput: RelNode = RelOptRule.convert(rank.getInput, requiredTraitSet)

    // order by timeIndicator desc ==> lastRow, otherwise is firstRow
    val fieldCollation = rank.orderKey.getFieldCollations.get(0)
    val isLastRow = fieldCollation.direction.isDescending

    val fieldType = rank.getInput().getRowType.getFieldList
      .get(fieldCollation.getFieldIndex).getType
    val isRowtime = FlinkTypeFactory.isRowtimeIndicatorType(fieldType)

    val providedTraitSet = rel.getTraitSet.replace(FlinkConventions.STREAM_PHYSICAL)
    new StreamPhysicalDeduplicate(
      rel.getCluster,
      providedTraitSet,
      convInput,
      rank.partitionKey.toArray,
      isRowtime,
      isLastRow)
  }
}

object StreamPhysicalDeduplicateRule {

  val RANK_INSTANCE = new StreamPhysicalDeduplicateRule

  /**
    * Whether the given rank could be converted to [[StreamPhysicalDeduplicate]].
    *
    * Returns true if the given rank is sorted by time attribute and limits 1
    * and its RankFunction is ROW_NUMBER, else false.
    *
    * @param rank The [[FlinkLogicalRank]] node
    * @return True if the input rank could be converted to [[StreamPhysicalDeduplicate]]
    */
  def canConvertToDeduplicate(rank: FlinkLogicalRank): Boolean = {
    val sortCollation = rank.orderKey
    val rankRange = rank.rankRange

    val isRowNumberType = rank.rankType == RankType.ROW_NUMBER

    val isLimit1 = rankRange match {
      case rankRange: ConstantRankRange =>
        rankRange.getRankStart == 1 && rankRange.getRankEnd == 1
      case _ => false
    }

    val inputRowType = rank.getInput.getRowType
    val isSortOnTimeAttribute = sortOnTimeAttribute(sortCollation, inputRowType)

    !rank.outputRankNumber && isLimit1 && isSortOnTimeAttribute && isRowNumberType
  }

  private def sortOnTimeAttribute(
      sortCollation: RelCollation,
      inputRowType: RelDataType): Boolean = {
    if (sortCollation.getFieldCollations.size() != 1) {
      false
    } else {
      val firstSortField = sortCollation.getFieldCollations.get(0)
      val fieldType = inputRowType.getFieldList.get(firstSortField.getFieldIndex).getType
      FlinkTypeFactory.isProctimeIndicatorType(fieldType) ||
        FlinkTypeFactory.isRowtimeIndicatorType(fieldType)
    }
  }
}


text:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Data;
/// <summary>
/// Summary description for sub_TuyenDung_UngVien_BC_CC
/// </summary>
public class sub_TuyenDung_UngVien_BC_CC : DevExpress.XtraReports.UI.XtraReport
{
	private DevExpress.XtraReports.UI.DetailBand Detail;
	private DevExpress.XtraReports.UI.TopMarginBand TopMargin;
	private DevExpress.XtraReports.UI.BottomMarginBand BottomMargin;
    private PageHeaderBand PageHeader;
    private XRLabel xrLabel1;
    private XRTable xrTable1;
    private XRTableRow xrTableRow1;
    private XRTableCell xrTableCell1;
    private XRTableCell xrTableCell2;
    private XRTableCell xrTableCell3;
    private XRTableCell xrTableCell4;
    private XRTable xrTable2;
    private XRTableRow xrTableRow2;
    private XRTableCell xrt_STT;
    private XRTableCell xrt_TenChungChi;
    private XRTableCell xrt_NoiDaoTao;
    private XRTableCell xrt_XepLoai;
    private XRTableCell xrTableCell5;
    private XRTableCell xrt_NgayCap;
    private XRTableCell xrTableCell7;
    private XRTableCell xrt_NgayHetHan;
	/// <summary>
	/// Required designer variable.
	/// </summary>
	private System.ComponentModel.IContainer components = null;

	public sub_TuyenDung_UngVien_BC_CC()
	{
		InitializeComponent();
		//
		// TODO: Add constructor logic here
		//
	}
    int STT = 1;

    private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
    {
        xrt_STT.Text = STT.ToString();
        STT++;
    }
    public void BindData(string MaUngVien)
    {
        DataTable dt = DataController.DataHandler.GetInstance().ExecuteDataTable("TuyenDung_LayChungChi_UngVien", "@MaUngVien", MaUngVien);
        if (dt.Rows.Count > 0)
        {
            DataSource = dt;
            xrt_TenChungChi.DataBindings.Add("Text", DataSource, "TEN_CHUNG_CHI");
            xrt_NoiDaoTao.DataBindings.Add("Text", DataSource, "NOI_DAO_TAO");
            xrt_XepLoai.DataBindings.Add("Text", DataSource, "XEP_LOAI");
            xrt_NgayCap.DataBindings.Add("Text", DataSource, "NGAY_CAP");
            xrt_NgayHetHan.DataBindings.Add("Text", DataSource, "NGAY_HET_HAN");

        }
    }
	/// <summary>
	/// Clean up any resources being used.
	/// </summary>
	/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
	protected override void Dispose(bool disposing) {
		if (disposing && (components != null)) {
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	#region Designer generated code

	/// <summary>
	/// Required method for Designer support - do not modify
	/// the contents of this method with the code editor.
	/// </summary>
	private void InitializeComponent() {
        string resourceFileName = "sub_TuyenDung_UngVien_BC_CC.resx";
        this.Detail = new DevExpress.XtraReports.UI.DetailBand();
        this.xrTable2 = new DevExpress.XtraReports.UI.XRTable();
        this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow();
        this.xrt_STT = new DevExpress.XtraReports.UI.XRTableCell();
        this.xrt_TenChungChi = new DevExpress.XtraReports.UI.XRTableCell();
        this.xrt_NoiDaoTao = new DevExpress.XtraReports.UI.XRTableCell();
        this.xrt_NgayCap = new DevExpress.XtraReports.UI.XRTableCell();
        this.xrt_NgayHetHan = new DevExpress.XtraReports.UI.XRTableCell();
        this.xrt_XepLoai = new DevExpress.XtraReports.UI.XRTableCell();
        this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand();
        this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand();
        this.PageHeader = new DevExpress.XtraReports.UI.PageHeaderBand();
        this.xrTable1 = new DevExpress.XtraReports.UI.XRTable();
        this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow();
        this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell();
        this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell();
        this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell();
        this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell();
        this.xrTableCell7 = new DevExpress.XtraReports.UI.XRTableCell();
        this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell();
        this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
        ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
        //
        // Detail
        //
        this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
            this.xrTable2});
        this.Detail.HeightF = 39.58333F;
        this.Detail.Name = "Detail";
        this.Detail.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
        this.Detail.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
        //
        // xrTable2
        //
        this.xrTable2.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
                    | DevExpress.XtraPrinting.BorderSide.Bottom)));
        this.xrTable2.Font = new System.Drawing.Font("Times New Roman", 12F);
        this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
        this.xrTable2.Name = "xrTable2";
        this.xrTable2.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
        this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
            this.xrTableRow2});
        this.xrTable2.SizeF = new System.Drawing.SizeF(899.5104F, 39.58333F);
        this.xrTable2.StylePriority.UseBorders = false;
        this.xrTable2.StylePriority.UseFont = false;
        this.xrTable2.StylePriority.UsePadding = false;
        this.xrTable2.StylePriority.UseTextAlignment = false;
        this.xrTable2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
        //
        // xrTableRow2
        //
        this.xrTableRow2.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrt_STT,
            this.xrt_TenChungChi,
            this.xrt_NoiDaoTao,
            this.xrt_NgayCap,
            this.xrt_NgayHetHan,
            this.xrt_XepLoai});
        this.xrTableRow2.Name = "xrTableRow2";
        this.xrTableRow2.Weight = 1D;
        //
        // xrt_STT
        //
        this.xrt_STT.Name = "xrt_STT";
        this.xrt_STT.Weight = 0.1333333295657293D;
        this.xrt_STT.BeforePrint += new System.Drawing.Printing.PrintEventHandler(this.Detail_BeforePrint);
        //
        // xrt_TenChungChi
        //
        this.xrt_TenChungChi.Name = "xrt_TenChungChi";
        this.xrt_TenChungChi.Weight = 0.87333338042836461D;
        //
        // xrt_NoiDaoTao
        //
        this.xrt_NoiDaoTao.Name = "xrt_NoiDaoTao";
        this.xrt_NoiDaoTao.Weight = 0.89333335735180952D;
        //
        // xrt_NgayCap
        //
        this.xrt_NgayCap.Name = "xrt_NgayCap";
        this.xrt_NgayCap.Weight = 0.44443333119521222D;
        //
        // xrt_NgayHetHan
        //
        this.xrt_NgayHetHan.Name = "xrt_NgayHetHan";
        this.xrt_NgayHetHan.Weight = 0.42606667424425326D;
        //
        // xrt_XepLoai
        //
        this.xrt_XepLoai.Name = "xrt_XepLoai";
        this.xrt_XepLoai.Weight = 0.22786784713650587D;
        //
        // TopMargin
        //
        this.TopMargin.Name = "TopMargin";
        this.TopMargin.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
        this.TopMargin.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
        //
        // BottomMargin
        //
        this.BottomMargin.HeightF = 1F;
        this.BottomMargin.Name = "BottomMargin";
        this.BottomMargin.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
        this.BottomMargin.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
        //
        // PageHeader
        //
        this.PageHeader.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
            this.xrTable1,
            this.xrLabel1});
        this.PageHeader.HeightF = 56.00001F;
        this.PageHeader.Name = "PageHeader";
        //
        // xrTable1
        //
        this.xrTable1.Borders = ((DevExpress.XtraPrinting.BorderSide)((((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Top)
                    | DevExpress.XtraPrinting.BorderSide.Right)
                    | DevExpress.XtraPrinting.BorderSide.Bottom)));
        this.xrTable1.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold);
        this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 31.00001F);
        this.xrTable1.Name = "xrTable1";
        this.xrTable1.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 0, 0, 0, 100F);
        this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
            this.xrTableRow1});
        this.xrTable1.SizeF = new System.Drawing.SizeF(899.5104F, 25F);
        this.xrTable1.StylePriority.UseBorders = false;
        this.xrTable1.StylePriority.UseFont = false;
        this.xrTable1.StylePriority.UsePadding = false;
        this.xrTable1.StylePriority.UseTextAlignment = false;
        this.xrTable1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
        //
        // xrTableRow1
        //
        this.xrTableRow1.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
            this.xrTableCell1,
            this.xrTableCell2,
            this.xrTableCell3,
            this.xrTableCell5,
            this.xrTableCell7,
            this.xrTableCell4});
        this.xrTableRow1.Name = "xrTableRow1";
        this.xrTableRow1.Weight = 1D;
        //
        // xrTableCell1
        //
        this.xrTableCell1.Name = "xrTableCell1";
        this.xrTableCell1.Text = "STT";
        this.xrTableCell1.Weight = 0.1333333295657293D;
        //
        // xrTableCell2
        //
        this.xrTableCell2.Name = "xrTableCell2";
        this.xrTableCell2.Text = "Tên chứng chỉ";
        this.xrTableCell2.Weight = 0.87333338042836472D;
        //
        // xrTableCell3
        //
        this.xrTableCell3.Name = "xrTableCell3";
        this.xrTableCell3.Text = "Nơi đào tạo";
        this.xrTableCell3.Weight = 0.89333335735180952D;
        //
        // xrTableCell5
        //
        this.xrTableCell5.Name = "xrTableCell5";
        this.xrTableCell5.Text = "Ngày cấp";
        this.xrTableCell5.Weight = 0.44443333119521222D;
        //
        // xrTableCell7
        //
        this.xrTableCell7.Name = "xrTableCell7";
        this.xrTableCell7.Text = "Ngày hết hạn";
        this.xrTableCell7.Weight = 0.42606667424425326D;
        //
        // xrTableCell4
        //
        this.xrTableCell4.Name = "xrTableCell4";
        this.xrTableCell4.Text = "Xếp loại";
        this.xrTableCell4.Weight = 0.22786784713650587D;
        //
        // xrLabel1
        //
        this.xrLabel1.Font = new System.Drawing.Font("Times New Roman", 12F, System.Drawing.FontStyle.Bold);
        this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
        this.xrLabel1.Name = "xrLabel1";
        this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
        this.xrLabel1.SizeF = new System.Drawing.SizeF(302.0833F, 23.62501F);
        this.xrLabel1.StylePriority.UseFont = false;
        this.xrLabel1.StylePriority.UseTextAlignment = false;
        this.xrLabel1.Text = "BẰNG CẤP CHỨNG CHỈ";
        this.xrLabel1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
        //
        // sub_TuyenDung_UngVien_BC_CC
        //
        this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
            this.Detail,
            this.TopMargin,
            this.BottomMargin,
            this.PageHeader});
        this.Landscape = true;
        this.Margins = new System.Drawing.Printing.Margins(100, 100, 100, 1);
        this.PageHeight = 850;
        this.PageWidth = 1100;
        this.Version = "10.1";
        ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this)).EndInit();

	}

	#endregion
}


text:
package replicarpc

type RemoteStorageServer interface {
	Get(*GetArgs, *GetReply) error

	GetList(*GetArgs, *GetListReply) error

	Put(*PutArgs, *PutReply) error

	AppendToList(*PutArgs, *PutReply) error

	RemoveFromList(*PutArgs, *PutReply) error

	AddServers(*AddServersArgs, *AddServersReply) error

	Prepare(*PrepareArgs, *Reply) error

	Accept(*AcceptArgs, *Reply) error

	Commit(*CommitVal, *Reply)error

}

type ReplicaServer struct {
	// Embed all methods into the struct. See the Effective Go section about
	// embedding for more details: golang.org/doc/effective_go.html#embedding
	RemoteStorageServer
}

// Wrap wraps s in a type-safe wrapper struct to ensure that only the desired
// StorageServer methods are exported to receive RPCs.
func Wrap(s RemoteStorageServer) RemoteStorageServer {
	return &ReplicaServer{s}
}


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

-->

<!-- These resources are around just to allow their values to be customized
     for different hardware and product builds. -->
<resources>
    <integer name="status_bar_config_maxNotificationIcons">5</integer>

    <!-- The maximum count of notifications on Keyguard. The rest will be collapsed in an overflow
         card. -->
    <integer name="keyguard_max_notification_count">5</integer>
</resources>


text:
package com.kik.config.ice.internal;

import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.inject.util.Types;
import com.kik.config.ice.annotations.NoDefaultValue;
import com.kik.config.ice.naming.ConfigNamingStrategy;
import com.kik.config.ice.annotations.DefaultValue;
import com.kik.config.ice.exception.ConfigException;
import com.kik.config.ice.internal.annotations.None;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
import rx.Observable;

/**
 * Constructs a {@link ConfigDescriptor} based on the given config interface and injected state.
 */
@Slf4j
@Singleton
public class ConfigDescriptorFactory
{
    private static final ImmutableMap<Class<?>, Class<?>> primitiveToBoxed;

    static {
        ImmutableMap.Builder<Class<?>, Class<?>> builder = ImmutableMap.builder();
        builder.put(byte.class, Byte.class);
        builder.put(char.class, Character.class);
        builder.put(short.class, Short.class);
        builder.put(int.class, Integer.class);
        builder.put(long.class, Long.class);
        builder.put(float.class, Float.class);
        builder.put(double.class, Double.class);
        builder.put(boolean.class, Boolean.class);
        builder.put(void.class, Void.class);

        primitiveToBoxed = builder.build();
    }

    private final ConfigNamingStrategy namingStrategy;

    @Inject
    public ConfigDescriptorFactory(ConfigNamingStrategy namingStrategy)
    {
        this.namingStrategy = namingStrategy;
    }

    /**
     * Build a {@link ConfigDescriptor} given a configuration interface reference.
     *
     * @param configClass config interface to build descriptors for
     * @param scopeOpt    optional scope name to include in config descriptors.
     * @return A list of {@link ConfigDescriptor} instances describing the given config interface and scope name.
     */
    public List<ConfigDescriptor> buildDescriptors(Class<?> configClass, Optional<String> scopeOpt)
    {
        if (!StaticConfigHelper.isValidConfigInterface(configClass)) {
            // condition is already logged.
            throw new ConfigException("Invalid Configuration class.");
        }

        List<ConfigDescriptor> descriptors = Lists.newArrayList();

        for (Method method : configClass.getMethods()) {
            StaticConfigHelper.MethodValidationState validationState = StaticConfigHelper.isValidConfigInterfaceMethod(method);
            switch (validationState) {
                case OK:
                    descriptors.add(internalBuildDescriptor(method, scopeOpt, getMethodDefaultValue(method)));
                case IS_DEFAULT:
                    // Skip default interface methods
                    break;
                default:
                    log.debug("Configuration class {} was found to be invalid: {}",
                        configClass.getName(), validationState.name());
                    throw new ConfigException("Invalid Configuration class: {}", validationState.name());
            }
        }

        return descriptors;
    }

    /**
     * Build a {@link ConfigDescriptor} for a specific Method, and given optional scope.
     *
     * @param method   method to include in config descriptor
     * @param scopeOpt optional scope for the config descriptor
     * @return a {@link ConfigDescriptor} for the given method, to be used internally in the config system.
     */
    public ConfigDescriptor buildDescriptor(Method method, Optional<String> scopeOpt)
    {
        return buildDescriptor(method, scopeOpt, Optional.empty());
    }

    /**
     * Build a {@link ConfigDescriptor} for a specific Method, given optional scope, and given override value.
     *
     * @param method        method to include in config descriptor
     * @param scopeOpt      optional scope for the config descriptor
     * @param overrideValue optional override value used to override the static value in the config descriptor
     * @return a {@link ConfigDescriptor} for the given method, to be used internally in the config system.
     */
    public ConfigDescriptor buildDescriptor(Method method, Optional<String> scopeOpt, Optional<String> overrideValue)
    {
        checkNotNull(method);
        checkNotNull(scopeOpt);
        checkNotNull(overrideValue);
        StaticConfigHelper.MethodValidationState validationState = StaticConfigHelper.isValidConfigInterfaceMethod(method);
        if (validationState != StaticConfigHelper.MethodValidationState.OK) {
            log.debug("Configuration class {} was found to be invalid: {}",
                method.getDeclaringClass().getName(), validationState.name());
            throw new ConfigException("Invalid Configuration class: {}", validationState.name());
        }

        Optional<String> value = getMethodDefaultValue(method);
        if (overrideValue.isPresent()) {
            value = overrideValue;
        }

        return internalBuildDescriptor(method, scopeOpt, value);
    }

    private ConfigDescriptor internalBuildDescriptor(Method method, Optional<String> scopeOpt, Optional<String> defaultValue)
    {
        String configName = namingStrategy.methodToFlatName(method, scopeOpt);

        DefaultValue dv = method.getAnnotation(DefaultValue.class);
        NoDefaultValue ndv = method.getAnnotation(NoDefaultValue.class);
        Class<?> innerClass = null;
        if (dv != null && dv.innerType() != None.class) {
            innerClass = dv.innerType();
        }
        else if (ndv != null && ndv.innerType() != None.class) {
            innerClass = ndv.innerType();
        }

        // Only using the base return type to determine isObservable. Validation is ensuring the other requirements.
        boolean isObservable = Observable.class.isAssignableFrom(method.getReturnType());

        Type configType = innerClass == null
            ? ensureBoxedType(method.getReturnType())
            : Types.newParameterizedType(ensureBoxedType(method.getReturnType()), innerClass);

        return new ConfigDescriptor(method, configName, configType, isObservable, scopeOpt, defaultValue);
    }

    private Class<?> ensureBoxedType(Class<?> input)
    {
        if (!input.isPrimitive()) {
            return input;
        }
        return primitiveToBoxed.get(input);
    }

    private Optional<String> getMethodDefaultValue(Method method)
    {
        DefaultValue defaultValue = method.getAnnotation(DefaultValue.class);
        return defaultValue == null
            ? Optional.empty()
            : Optional.ofNullable(Strings.emptyToNull(defaultValue.value()));
    }
}


text:
**Summary:**
This program allows you to download any manga from the site below, you can use a graphic interface that allows you to choose which chapter/pages you want to download and you can interrupt and resume the download as you wish (keep in mind that it won't survive an application reboot though).

It started as an excercise to understand better the Java language, reflection and some design pattern as the model-view-controller one. It should be relatively easy to support new sites as long they have a Manga>Chapter>Page or Doujinshi>Page structure as they are actually implemented.

**SUPPORTED SITES:** [Batoto] (www.bato.to), [MangaEden](www.mangaeden.com), [MangaLife](www.manga.life), [MangaPark](www.mangapark.me), [HGalleries](www.g.e-hentai.org), [Exhentai] (www.exhentai.org)

**How to start it:**
- Windows: Double click on the jar and it should work if you have Java installed on your pc (compiled with JDK 1.8).
- Linux: launch from command line with 'java -jar MangaRipper.jar'
- Other arguments:
  * log     ---> Write on a file the content of the console

**How to use it:**
The program isn't smart handling the name of the manga (for now) so you should use some precautions like the ones explained here.
* Batoto
  + Put the url of the manga in the first text area es. "http://bato.to/comic/_/comics/black-clover-r15016".
  + Choose a translator to fetch everything made from him/them for the second text area es. "Jaimini's~box~".
* MangaEden
  + Use the name in the url es. "http://www.mangaeden.com/it/it-manga/dimension-w/" becomes "dimension-w".
  + The program will try to trim the text and insert '-' where it finds whitespaces.
* MangaLife
  + Use the name in the url es. "http://manga.life/read-online/OnepunchMan" becomes "OnepunchMan".
  + The program will try to camel case it.
* MangaPark
  + Use the name in the url es. "http://mangapark.me/manga/nanatsu-no-taizai" becomes "nanatsu-no-taizai".
  + The program will try to trim the text and insert '-' where it finds whitespaces.
* HGalleries
  + Just use the full URL of the doujinshi.
* Exhentai
  + After the log-in you can download from the normal domain and the panda by using the full URL of the gallery.
  + If in the gallery is available the option to download HQ images those will be downloaded.

**NOTE:** The interface of methods might change, I'm not satisfied as it is right now. You can find the old "repository" [HERE](http://silentaxv.altervista.org/Java/MangaRipper/sito.htm)

**TODO:**
- [ ] Support other sites
- [ ] Support mac
- [ ] Instruction on how to use it inside the program (tips, or something else)
- [ ] Better handling of textual input in the GUI
- [ ] Handle exceptions so that it doesn't print the full stack on the console (It scares people)
- [x] Use github or something equivalent to use versioning and branching


text: jika ingin import DB buat dulu DB Mysql dengan nama tes_kerja :)


text:
/*
  Include declarations.
*/
#include "magick/studio.h"
#include "magick/blob.h"
#include "magick/blob-private.h"
#include "magick/cache.h"
#include "magick/colormap.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/image.h"
#include "magick/image-private.h"
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
#include "magick/module.h"

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%  R e a d T I M I m a g e                                                    %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  ReadTIMImage() reads a PSX TIM image file and returns it.  It
%  allocates the memory necessary for the new Image structure and returns a
%  pointer to the new image.
%
%  Contributed by os@scee.sony.co.uk.
%
%  The format of the ReadTIMImage method is:
%
%      Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception)
%
%  A description of each parameter follows:
%
%    o image_info: the image info.
%
%    o exception: return any errors or warnings in this structure.
%
*/
static Image *ReadTIMImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
  typedef struct _TIMInfo
  {
    size_t
      id,
      flag;
  } TIMInfo;

  TIMInfo
    tim_info;

  Image
    *image;

  int
    bits_per_pixel,
    has_clut;

  MagickBooleanType
    status;

  register IndexPacket
    *indexes;

  register ssize_t
    x;

  register PixelPacket
    *q;

  register ssize_t
    i;

  register unsigned char
    *p;

  size_t
    bytes_per_line,
    height,
    image_size,
    pixel_mode,
    width;

  ssize_t
    count,
    y;

  unsigned char
    *tim_data,
    *tim_pixels;

  unsigned short
    word;

  /*
    Open image file.
  */
  assert(image_info != (const ImageInfo *) NULL);
  assert(image_info->signature == MagickSignature);
  if (image_info->debug != MagickFalse)
    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
      image_info->filename);
  assert(exception != (ExceptionInfo *) NULL);
  assert(exception->signature == MagickSignature);
  image=AcquireImage(image_info);
  status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
  if (status == MagickFalse)
    {
      image=DestroyImageList(image);
      return((Image *) NULL);
    }
  /*
    Determine if this a TIM file.
  */
  tim_info.id=ReadBlobLSBLong(image);
  do
  {
    /*
      Verify TIM identifier.
    */
    if (tim_info.id != 0x00000010)
      ThrowReaderException(CorruptImageError,"ImproperImageHeader");
    tim_info.flag=ReadBlobLSBLong(image);
    has_clut=tim_info.flag & (1 << 3) ? 1 : 0;
    pixel_mode=tim_info.flag & 0x07;
    switch ((int) pixel_mode)
    {
      case 0: bits_per_pixel=4; break;
      case 1: bits_per_pixel=8; break;
      case 2: bits_per_pixel=16; break;
      case 3: bits_per_pixel=24; break;
      default: bits_per_pixel=4; break;
    }
    if (has_clut)
      {
        unsigned char
          *tim_colormap;

        /*
          Read TIM raster colormap.
        */
        (void)ReadBlobLSBLong(image);
        (void)ReadBlobLSBShort(image);
        (void)ReadBlobLSBShort(image);
        width=ReadBlobLSBShort(image);
        height=ReadBlobLSBShort(image);
        image->columns=width;
        image->rows=height;
        if (AcquireImageColormap(image,pixel_mode == 1 ? 256UL : 16UL) == MagickFalse)
          ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
        tim_colormap=(unsigned char *) AcquireQuantumMemory(image->colors,
          2UL*sizeof(*tim_colormap));
        if (tim_colormap == (unsigned char *) NULL)
          ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
        count=ReadBlob(image,2*image->colors,tim_colormap);
        if (count != (ssize_t) (2*image->colors))
          ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
        p=tim_colormap;
        for (i=0; i < (ssize_t) image->colors; i++)
        {
          word=(*p++);
          word|=(unsigned short) (*p++ << 8);
          image->colormap[i].blue=ScaleCharToQuantum(
            ScaleColor5to8(1UL*(word >> 10) & 0x1f));
          image->colormap[i].green=ScaleCharToQuantum(
            ScaleColor5to8(1UL*(word >> 5) & 0x1f));
          image->colormap[i].red=ScaleCharToQuantum(
            ScaleColor5to8(1UL*word & 0x1f));
        }
        tim_colormap=(unsigned char *) RelinquishMagickMemory(tim_colormap);
      }
    if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))
      if (image->scene >= (image_info->scene+image_info->number_scenes-1))
        break;
    /*
      Read image data.
    */
    (void) ReadBlobLSBLong(image);
    (void) ReadBlobLSBShort(image);
    (void) ReadBlobLSBShort(image);
    width=ReadBlobLSBShort(image);
    height=ReadBlobLSBShort(image);
    image_size=2*width*height;
    bytes_per_line=width*2;
    width=(width*16)/bits_per_pixel;
    tim_data=(unsigned char *) AcquireQuantumMemory(image_size,
      sizeof(*tim_data));
    if (tim_data == (unsigned char *) NULL)
      ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
    count=ReadBlob(image,image_size,tim_data);
    if (count != (ssize_t) (image_size))
      ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
    tim_pixels=tim_data;
    /*
      Initialize image structure.
    */
    image->columns=width;
    image->rows=height;
    /*
      Convert TIM raster image to pixel packets.
    */
    switch (bits_per_pixel)
    {
      case 4:
      {
        /*
          Convert PseudoColor scanline.
        */
        for (y=(ssize_t) image->rows-1; y >= 0; y--)
        {
          q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
          if (q == (PixelPacket *) NULL)
            break;
          indexes=GetAuthenticIndexQueue(image);
          p=tim_pixels+y*bytes_per_line;
          for (x=0; x < ((ssize_t) image->columns-1); x+=2)
          {
            SetPixelIndex(indexes+x,(*p) & 0x0f);
            SetPixelIndex(indexes+x+1,(*p >> 4) & 0x0f);
            p++;
          }
          if ((image->columns % 2) != 0)
            {
              SetPixelIndex(indexes+x,(*p >> 4) & 0x0f);
              p++;
            }
          if (SyncAuthenticPixels(image,exception) == MagickFalse)
            break;
          if (image->previous == (Image *) NULL)
            {
              status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
                image->rows);
              if (status == MagickFalse)
                break;
            }
        }
        break;
      }
      case 8:
      {
        /*
          Convert PseudoColor scanline.
        */
        for (y=(ssize_t) image->rows-1; y >= 0; y--)
        {
          q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
          if (q == (PixelPacket *) NULL)
            break;
          indexes=GetAuthenticIndexQueue(image);
          p=tim_pixels+y*bytes_per_line;
          for (x=0; x < (ssize_t) image->columns; x++)
            SetPixelIndex(indexes+x,*p++);
          if (SyncAuthenticPixels(image,exception) == MagickFalse)
            break;
          if (image->previous == (Image *) NULL)
            {
              status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
                image->rows);
              if (status == MagickFalse)
                break;
            }
        }
        break;
      }
      case 16:
      {
        /*
          Convert DirectColor scanline.
        */
        for (y=(ssize_t) image->rows-1; y >= 0; y--)
        {
          p=tim_pixels+y*bytes_per_line;
          q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
          if (q == (PixelPacket *) NULL)
            break;
          for (x=0; x < (ssize_t) image->columns; x++)
          {
            word=(*p++);
            word|=(*p++ << 8);
            SetPixelBlue(q,ScaleCharToQuantum(ScaleColor5to8(
              (1UL*word >> 10) & 0x1f)));
            SetPixelGreen(q,ScaleCharToQuantum(ScaleColor5to8(
              (1UL*word >> 5) & 0x1f)));
            SetPixelRed(q,ScaleCharToQuantum(ScaleColor5to8(
              (1UL*word >> 0) & 0x1f)));
            q++;
          }
          if (SyncAuthenticPixels(image,exception) == MagickFalse)
            break;
          if (image->previous == (Image *) NULL)
            {
              status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
                image->rows);
              if (status == MagickFalse)
                break;
            }
        }
        break;
      }
      case 24:
      {
        /*
          Convert DirectColor scanline.
        */
        for (y=(ssize_t) image->rows-1; y >= 0; y--)
        {
          p=tim_pixels+y*bytes_per_line;
          q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
          if (q == (PixelPacket *) NULL)
            break;
          for (x=0; x < (ssize_t) image->columns; x++)
          {
            SetPixelRed(q,ScaleCharToQuantum(*p++));
            SetPixelGreen(q,ScaleCharToQuantum(*p++));
            SetPixelBlue(q,ScaleCharToQuantum(*p++));
            q++;
          }
          if (SyncAuthenticPixels(image,exception) == MagickFalse)
            break;
          if (image->previous == (Image *) NULL)
            {
              status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
                image->rows);
              if (status == MagickFalse)
                break;
            }
        }
        break;
      }
      default:
        ThrowReaderException(CorruptImageError,"ImproperImageHeader");
    }
    if (image->storage_class == PseudoClass)
      (void) SyncImage(image);
    tim_pixels=(unsigned char *) RelinquishMagickMemory(tim_pixels);
    if (EOFBlob(image) != MagickFalse)
      {
        ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
          image->filename);
        break;
      }
    /*
      Proceed to next image.
    */
    tim_info.id=ReadBlobLSBLong(image);
    if (tim_info.id == 0x00000010)
      {
        /*
          Allocate next image structure.
        */
        AcquireNextImage(image_info,image);
        if (GetNextImageInList(image) == (Image *) NULL)
          {
            image=DestroyImageList(image);
            return((Image *) NULL);
          }
        image=SyncNextImageInList(image);
        status=SetImageProgress(image,LoadImagesTag,TellBlob(image),
          GetBlobSize(image));
        if (status == MagickFalse)
          break;
      }
  } while (tim_info.id == 0x00000010);
  (void) CloseBlob(image);
  return(GetFirstImageInList(image));
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   R e g i s t e r T I M I m a g e                                           %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  RegisterTIMImage() adds attributes for the TIM image format to
%  the list of supported formats.  The attributes include the image format
%  tag, a method to read and/or write the format, whether the format
%  supports the saving of more than one frame to the same file or blob,
%  whether the format supports native in-memory I/O, and a brief
%  description of the format.
%
%  The format of the RegisterTIMImage method is:
%
%      size_t RegisterTIMImage(void)
%
*/
ModuleExport size_t RegisterTIMImage(void)
{
  MagickInfo
    *entry;

  entry=SetMagickInfo("TIM");
  entry->decoder=(DecodeImageHandler *) ReadTIMImage;
  entry->description=ConstantString("PSX TIM");
  entry->module=ConstantString("TIM");
  (void) RegisterMagickInfo(entry);
  return(MagickImageCoderSignature);
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   U n r e g i s t e r T I M I m a g e                                       %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  UnregisterTIMImage() removes format registrations made by the
%  TIM module from the list of supported formats.
%
%  The format of the UnregisterTIMImage method is:
%
%      UnregisterTIMImage(void)
%
*/
ModuleExport void UnregisterTIMImage(void)
{
  (void) UnregisterMagickInfo("TIM");
}


text:
websocket/_exceptions.py
########################

The _exceptions.py file

.. automodule:: websocket._exceptions
  :members:


text:
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var BABYLON;
(function (BABYLON) {
    // We're mainly based on the logic defined into the FreeCamera code
    var GamepadCamera = (function (_super) {
        __extends(GamepadCamera, _super);
        //-- end properties for backward compatibility for inputs
        function GamepadCamera(name, position, scene) {
            Tools.Warn("Deprecated. Please use Universal Camera instead.");
            _super.call(this, name, position, scene);
        }
        Object.defineProperty(GamepadCamera.prototype, "gamepadAngularSensibility", {
            //-- Begin properties for backward compatibility for inputs
            get: function () {
                var gamepad = this.inputs.attached["gamepad"];
                if (gamepad)
                    return gamepad.gamepadAngularSensibility;
            },
            set: function (value) {
                var gamepad = this.inputs.attached["gamepad"];
                if (gamepad)
                    gamepad.gamepadAngularSensibility = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(GamepadCamera.prototype, "gamepadMoveSensibility", {
            get: function () {
                var gamepad = this.inputs.attached["gamepad"];
                if (gamepad)
                    return gamepad.gamepadMoveSensibility;
            },
            set: function (value) {
                var gamepad = this.inputs.attached["gamepad"];
                if (gamepad)
                    gamepad.gamepadMoveSensibility = value;
            },
            enumerable: true,
            configurable: true
        });
        GamepadCamera.prototype.getTypeName = function () {
            return "GamepadCamera";
        };
        return GamepadCamera;
    }(BABYLON.UniversalCamera));
    BABYLON.GamepadCamera = GamepadCamera;
})(BABYLON || (BABYLON = {}));


text:
/**
 * openui5-googlemaps - OpenUI5 Google Maps library
 * @version v0.0.19
 * @link http://jasper07.github.io/openui5-googlemaps/
 * @license MIT
 */sap.ui.define(['jquery.sap.global', './Marker' , 'google.maps'],
	function(jQuery, SuperClass, Gmaps) {
		"use strict";

		var libName = SuperClass.getMetadata()._sLibraryName;

		sap.ui.getCore().getEventBus().subscribe(Gmaps.notifyEvent, function(){
			$.sap.require(libName+'.richmarker');
			//RichMarker = window.RichMarker;
		});

		// add style classes for cluster markers
		$.sap.includeStyleSheet($.sap.getModulePath(libName)+'/css/markerclusters.css');

		var Marker = SuperClass.extend('openui5.googlemaps.CompositeMarker', {
			metadata: {
				properties: {
					count:{
						type: 'int',
						defaultValue: 1,
						bindable: 'bindable'
					}
				}
			},
			renderer: {}/*,
			onAfterRendering: function(){
				debugger;
			}*/
		});

		Marker.prototype.setCount = function(oValue) {
            this.setProperty('count', oValue, true);
            if (this.marker) {
                this.marker.set('count', this.getCount());
            }
        };

		Marker.prototype.setIcon = function(oValue){
			if(this.getCount()>1) return;
			/*if(!!this.marker && !this.marker.setIcon){
				this.marker.setMap(null);
				this.marker = null;
				this.rerender();
				return false;
			}else{*/
				SuperClass.prototype.setIcon.apply(this, arguments);
			/*}*/
		};

		var clusterTypes = [
			{
				max:9,
				name:'gmaps-cluster-m1'
			},
			{
				max:99,
				name:'gmaps-cluster-m2'
			},
			{
				max:999,
				name:'gmaps-cluster-m3'
			},
			{
				max:Number.POSITIVE_INFINITY,
				name:'gmaps-cluster-m4'
			},
			{
				max:Number.POSITIVE_INFINITY,
				name:'gmaps-cluster-m5'
			},
		];

		Marker.prototype.setMarker = function() {
			if(!!this.marker){
				this.marker.setMap(null);
				this.marker = null;
			}
			SuperClass.prototype.setMarker.call(this);
		};

		Marker.prototype.createMarker = function(){
			var oMarker;
			var count = this.getCount();
			if(count > 1){
				var clusterStyle = Math.min(count.toString().length, clusterTypes.length);
				var clusterType = clusterTypes[clusterStyle-1].name;
				var $div = $(document.createElement('DIV')).addClass(clusterType).text(count);
				oMarker = window.cmark = new RichMarker(jQuery.extend(this.getOptions(), {
					flat: true,
					anchor: RichMarkerPosition.MIDDLE,
					content: $div[0]
				}));
				oMarker.set('count', this.getCount());
			}else{
				//oMarker = new Gmaps.Marker(this.getOptions());
				oMarker = SuperClass.prototype.createMarker.call(this);
			}
			return oMarker;
		};

		return Marker;

	}, /* bExport= */ true);


text:
import React, { Component, PropTypes } from "react"
import cx from "classnames"
import Helmet from "react-helmet"

import getI18n from "i18n/get"
import AuthorsList from "AuthorsList"
import formatDate from "formatDate"
import ReadingTime from "ReadingTime"

function renderCSSBackground(metadata) {
  let image = metadata.image
  if (
    metadata.image === true ||
    (!metadata.image && metadata.credit)
  ) {
    image = "index.jpg"
  }

  const color = metadata.color || "#c33"

  // default to just the image
  const backgrounds = {
    // "" => no need for prefix, see trick below
    "": [
      [
        `${color} url("${image}")`,
        "no-repeat 50% 50% / cover",
      ],
    ],
  }

  // if there is a modification that need some prefix, we use a trick
  if (metadata.linearGradient || metadata.radialGradient) {
    const prefixes = [ "", "-webkit-" ]
    prefixes.forEach((prefix) => {
      const background = []
      if (metadata.linearGradient) {
        background.push([
          `${prefix}linear-gradient(${metadata.linearGradient})`,
          "repeat 0% 0%",
        ])
      }
      if (metadata.radialGradient) {
        background.push([
          `${prefix}radial-gradient(${metadata.linearGradient})`,
          "repeat 0% 0%",
        ])
      }
      // only need the image if there will be both prefixed and unprefixed
      // versions
      if (image) {
        background.push([
          `${color} url("${image}")`,
          "no-repeat 50% 50% / cover",
        ])
      }
      backgrounds[prefix] = background
    })
  }

  return {
    backgroundColor: color,
    // we can not handle a css fallback with the same property name
    // since a js object doesn't handle that like css rules set
    // so here is the 2cts trick
    // background-image + background-size AND background. Yep.
    ...(
      backgrounds["-webkit-"]
      ? {
        backgroundImage: backgrounds["-webkit-"].map(bg => bg[0]).join(", "),
        backgroundSize: backgrounds["-webkit-"].map(bg => bg[1]).join(", "),
      }
      : {}
    ),
    background: (
      backgrounds[""].map(bg => `${bg[0]} ${bg[1]}`).join(", ")
    ),
    filter: metadata.filter,
  }
}

export default class WithHeroHeader extends Component {

  static propTypes = {
    __url: PropTypes.string.isRequired,
    __filename: PropTypes.string.isRequired,
    head: PropTypes.object.isRequired,
    body: PropTypes.string.isRequired,
    rawBody: PropTypes.string.isRequired,
    meta: PropTypes.bool,
    tags: PropTypes.bool,
  }

  static contextTypes = {
    metadata: PropTypes.object.isRequired,
    location: PropTypes.object.isRequired,
  }

  defaultProps = {
    meta: true,
    tags: true,
  }

  render() {
    const i18n = getI18n(this.context)
    const { metadata } = this.context

    const {
      head,
      rawBody,
      meta,
      tags,
    } = this.props

    const post = head

    const twitterAuthor =
      post.authors && post.authors.length
      ? metadata.contributors.getContributor(post.authors[0]).twitter
      : i18n.twitterUsername

    return (

        <Helmet
          title={ post.title }
          meta={[
            { property: "og:type", content: "article" },
            { property: "og:title", content: post.title },
            { name: "twitter:card", content: "summary" },
            { name: "twitter:title", content: post.title },
            { name: "twitter:creator", content: `@${ twitterAuthor }` },
          ]}
        />

              {
                post.header &&

              }
              {
                post.header && post.header.credit &&

                  {"Crédit photo"}

              }
              {
                post.title &&

                  {post.title}

              }

            {
              (meta && (post.authors || post.date)) &&

                {
                  (post.authors && post.authors.length) &&

                    {`${i18n.writtenBy} `}
                    <AuthorsList authors={post.authors} />

                }
                {
                  (post.authors && post.authors.length && post.date) &&
                  {", "}
                }
                {
                  post.date &&

                    { formatDate(post.date) }

                }
                {". "}

                <ReadingTime
                  text={rawBody}
                  before={i18n.readingTime}
                  templateText={{
                    1: i18n.readingTime1,
                    2: i18n.readingTime2,
                  }}
                  templateTooltip={i18n.readingTimeComment}
                  className="putainde-Post-readingTime"
                />

            }
            {
              tags && post.tags &&

              {
                post.tags.map(tag => (

{tag}

                ))
              }

            }

          { this.props.children }

    )
  }
}


text:
<?php

return [

    'login' => [
        'title' => 'Login',

        'enable-registration' => [
            'title'       => 'Enable self-service registration',
            'description' => 'Everyone can fill out the registration form and become a member. By default they will be member of the "User" group.',
        ],
    ],

    'profile' => [
        'title' => 'Profile',

        'enable-profile' => [
            'title'       => 'Enable user profiles',
            'description' => 'Users can edit own profile and change their password',
        ],
    ],

];


text:
package handlers

import (
	"net/http"

	entities "github.com/gost/core"
	"github.com/gost/server/sensorthings/models"
	"github.com/gost/server/sensorthings/odata"
	"github.com/gost/server/sensorthings/rest/reader"
)

// HandleGetHistoricalLocations ...
func HandleGetHistoricalLocations(w http.ResponseWriter, r *http.Request, endpoint *models.Endpoint, api *models.API) {
	a := *api
	handle := func(q *odata.QueryOptions, path string) (interface{}, error) {
		return a.GetHistoricalLocations(q, path)
	}
	handleGetRequest(w, endpoint, r, &handle, a.GetConfig().Server.IndentedJSON, a.GetConfig().Server.MaxEntityResponse, a.GetConfig().Server.ExternalURI)
}

// HandleGetHistoricalLocationsByThing ...
func HandleGetHistoricalLocationsByThing(w http.ResponseWriter, r *http.Request, endpoint *models.Endpoint, api *models.API) {
	a := *api
	handle := func(q *odata.QueryOptions, path string) (interface{}, error) {
		return a.GetHistoricalLocationsByThing(reader.GetEntityID(r), q, path)
	}
	handleGetRequest(w, endpoint, r, &handle, a.GetConfig().Server.IndentedJSON, a.GetConfig().Server.MaxEntityResponse, a.GetConfig().Server.ExternalURI)
}

// HandleGetHistoricalLocationsByLocation ...
func HandleGetHistoricalLocationsByLocation(w http.ResponseWriter, r *http.Request, endpoint *models.Endpoint, api *models.API) {
	a := *api
	handle := func(q *odata.QueryOptions, path string) (interface{}, error) {
		return a.GetHistoricalLocationsByLocation(reader.GetEntityID(r), q, path)
	}
	handleGetRequest(w, endpoint, r, &handle, a.GetConfig().Server.IndentedJSON, a.GetConfig().Server.MaxEntityResponse, a.GetConfig().Server.ExternalURI)
}

// HandleGetHistoricalLocation ...
func HandleGetHistoricalLocation(w http.ResponseWriter, r *http.Request, endpoint *models.Endpoint, api *models.API) {
	a := *api
	id := reader.GetEntityID(r)
	handle := func(q *odata.QueryOptions, path string) (interface{}, error) {
		return a.GetHistoricalLocation(id, q, path)
	}
	handleGetRequest(w, endpoint, r, &handle, a.GetConfig().Server.IndentedJSON, a.GetConfig().Server.MaxEntityResponse, a.GetConfig().Server.ExternalURI)
}

// HandlePostHistoricalLocation ...
func HandlePostHistoricalLocation(w http.ResponseWriter, r *http.Request, endpoint *models.Endpoint, api *models.API) {
	a := *api
	hl := &entities.HistoricalLocation{}
	handle := func() (interface{}, []error) { return a.PostHistoricalLocation(hl) }
	handlePostRequest(w, endpoint, r, hl, &handle, a.GetConfig().Server.IndentedJSON)
}

// HandlePutHistoricalLocation ...
func HandlePutHistoricalLocation(w http.ResponseWriter, r *http.Request, endpoint *models.Endpoint, api *models.API) {
	a := *api
	hl := &entities.HistoricalLocation{}
	handle := func() (interface{}, []error) { return a.PutHistoricalLocation(reader.GetEntityID(r), hl) }
	handlePutRequest(w, endpoint, r, hl, &handle, a.GetConfig().Server.IndentedJSON)
}

// HandleDeleteHistoricalLocations ...
func HandleDeleteHistoricalLocations(w http.ResponseWriter, r *http.Request, endpoint *models.Endpoint, api *models.API) {
	a := *api
	handle := func() error { return a.DeleteHistoricalLocation(reader.GetEntityID(r)) }
	handleDeleteRequest(w, endpoint, r, &handle, a.GetConfig().Server.IndentedJSON)
}

// HandlePatchHistoricalLocations ...
func HandlePatchHistoricalLocations(w http.ResponseWriter, r *http.Request, endpoint *models.Endpoint, api *models.API) {
	a := *api
	hl := &entities.HistoricalLocation{}
	handle := func() (interface{}, error) { return a.PatchHistoricalLocation(reader.GetEntityID(r), hl) }
	handlePatchRequest(w, endpoint, r, hl, &handle, a.GetConfig().Server.IndentedJSON)
}