text:
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.6">
  <compounddef id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew" kind="class" prot="public">
    <compoundname>boost::geometry::strategy::convex_hull::graham_andrew</compoundname>
    <includes local="no">hull_graham_andrew.hpp</includes>
    <innerclass refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1_1partitions" prot="private">boost::geometry::strategy::convex_hull::graham_andrew::partitions</innerclass>
    <templateparamlist>
      <param>
        <type>typename InputGeometry</type>
      </param>
      <param>
        <type>typename OutputPoint</type>
      </param>
    </templateparamlist>
      <sectiondef kind="public-type">
      <memberdef kind="typedef" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a456c123d0655ecf2c4409b38b95668c7" prot="public" static="no">
        <type>InputGeometry</type>
        <definition>typedef InputGeometry boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::geometry_type</definition>
        <argsstring></argsstring>
        <name>geometry_type</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="205" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="205" bodyend="-1"/>
      </memberdef>
      <memberdef kind="typedef" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a2678e51becdbb307f68bccc89f2f62c0" prot="public" static="no">
        <type>OutputPoint</type>
        <definition>typedef OutputPoint boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::point_type</definition>
        <argsstring></argsstring>
        <name>point_type</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="204" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="204" bodyend="-1"/>
      </memberdef>
      <memberdef kind="typedef" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a550176a736837847b6df1b46ef6f6b3f" prot="public" static="no">
        <type>partitions</type>
        <definition>typedef partitions boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::state_type</definition>
        <argsstring></argsstring>
        <name>state_type</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="227" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="227" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="private-type">
      <memberdef kind="typedef" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a20c858057ff4ecebc2218b6ea7eb13c7" prot="private" static="no">
        <type>std::vector< <ref refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a2678e51becdbb307f68bccc89f2f62c0" kindref="member">point_type</ref> ></type>
        <definition>typedef std::vector<point_type> boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::container_type</definition>
        <argsstring></argsstring>
        <name>container_type</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="211" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="211" bodyend="-1"/>
      </memberdef>
      <memberdef kind="typedef" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a4dbfc79ce66b03dd91332e97e4d5804e" prot="private" static="no">
        <type>cs_tag< <ref refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a2678e51becdbb307f68bccc89f2f62c0" kindref="member">point_type</ref> >::type</type>
        <definition>typedef cs_tag<point_type>::type boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::cs_tag</definition>
        <argsstring></argsstring>
        <name>cs_tag</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="209" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="209" bodyend="-1"/>
      </memberdef>
      <memberdef kind="typedef" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a8c59e7ca676836e65861080cc3663e3e" prot="private" static="no">
        <type>std::vector< <ref refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a2678e51becdbb307f68bccc89f2f62c0" kindref="member">point_type</ref> >::const_iterator</type>
        <definition>typedef std::vector<point_type>::const_iterator boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::iterator</definition>
        <argsstring></argsstring>
        <name>iterator</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="212" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="212" bodyend="-1"/>
      </memberdef>
      <memberdef kind="typedef" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a677299f59be4a384a044dc04e3ee7561" prot="private" static="no">
        <type>std::vector< <ref refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a2678e51becdbb307f68bccc89f2f62c0" kindref="member">point_type</ref> >::const_reverse_iterator</type>
        <definition>typedef std::vector<point_type>::const_reverse_iterator boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::rev_iterator</definition>
        <argsstring></argsstring>
        <name>rev_iterator</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="213" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="213" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="public-func">
      <memberdef kind="function" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1ab8fbeb9a58c503ac5803a27eedab9f12" prot="public" static="no" const="yes" explicit="no" inline="yes" virt="non-virtual">
        <type>void</type>
        <definition>void boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::apply</definition>
        <argsstring>(InputGeometry const &geometry, partitions &state) const </argsstring>
        <name>apply</name>
        <param>
          <type>InputGeometry const &</type>
          <declname>geometry</declname>
        </param>
        <param>
          <type>partitions &</type>
          <declname>state</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="230" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="230" bodyend="286"/>
      </memberdef>
      <memberdef kind="function" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a354c3eb0a5083c5695e7225ac431f588" prot="public" static="no" const="yes" explicit="no" inline="yes" virt="non-virtual">
        <templateparamlist>
          <param>
            <type>typename OutputIterator</type>
          </param>
        </templateparamlist>
        <type>void</type>
        <definition>void boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::result</definition>
        <argsstring>(partitions const &state, OutputIterator out, bool clockwise, bool closed) const </argsstring>
        <name>result</name>
        <param>
          <type>partitions const &</type>
          <declname>state</declname>
        </param>
        <param>
          <type>OutputIterator</type>
          <declname>out</declname>
        </param>
        <param>
          <type>bool</type>
          <declname>clockwise</declname>
        </param>
        <param>
          <type>bool</type>
          <declname>closed</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="290" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="290" bodyend="303"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="private-static-func">
      <memberdef kind="function" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a6558a1cbbeeced98850f670bdf4ace2f" prot="private" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <templateparamlist>
          <param>
            <type>int</type>
            <declname>Factor</declname>
            <defname>Factor</defname>
          </param>
        </templateparamlist>
        <type>void</type>
        <definition>static void boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::add_to_hull</definition>
        <argsstring>(point_type const &p, container_type &output)</argsstring>
        <name>add_to_hull</name>
        <param>
          <type><ref refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a2678e51becdbb307f68bccc89f2f62c0" kindref="member">point_type</ref> const &</type>
          <declname>p</declname>
        </param>
        <param>
          <type>container_type &</type>
          <declname>output</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="323" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="323" bodyend="349"/>
      </memberdef>
      <memberdef kind="function" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1ae79906f82e7ae5074bc0d5052bbef4f4" prot="private" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <templateparamlist>
          <param>
            <type>int</type>
            <declname>Factor</declname>
            <defname>Factor</defname>
          </param>
        </templateparamlist>
        <type>void</type>
        <definition>static void boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::build_half_hull</definition>
        <argsstring>(container_type const &input, container_type &output, point_type const &left, point_type const &right)</argsstring>
        <name>build_half_hull</name>
        <param>
          <type>container_type const &</type>
          <declname>input</declname>
        </param>
        <param>
          <type>container_type &</type>
          <declname>output</declname>
        </param>
        <param>
          <type><ref refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a2678e51becdbb307f68bccc89f2f62c0" kindref="member">point_type</ref> const &</type>
          <declname>left</declname>
        </param>
        <param>
          <type><ref refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a2678e51becdbb307f68bccc89f2f62c0" kindref="member">point_type</ref> const &</type>
          <declname>right</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="309" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="309" bodyend="319"/>
      </memberdef>
      <memberdef kind="function" id="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a99154140187312486137f992a03e06f7" prot="private" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <templateparamlist>
          <param>
            <type>typename OutputIterator</type>
          </param>
        </templateparamlist>
        <type>void</type>
        <definition>static void boost::geometry::strategy::convex_hull::graham_andrew< InputGeometry, OutputPoint >::output_ranges</definition>
        <argsstring>(container_type const &first, container_type const &second, OutputIterator out, bool closed)</argsstring>
        <name>output_ranges</name>
        <param>
          <type>container_type const &</type>
          <declname>first</declname>
        </param>
        <param>
          <type>container_type const &</type>
          <declname>second</declname>
        </param>
        <param>
          <type>OutputIterator</type>
          <declname>out</declname>
        </param>
        <param>
          <type>bool</type>
          <declname>closed</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="353" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="353" bodyend="373"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
<para>Graham scan strategy to calculate convex hull. </para>    </briefdescription>
    <detaileddescription>
<para><simplesect kind="note"><para>Completely reworked version inspired on the sources listed below </para></simplesect>
<simplesect kind="see"><para><ulink url="http://www.ddj.com/architect/201806315">http://www.ddj.com/architect/201806315</ulink> </para><simplesectsep/><para><ulink url="http://marknelson.us/2007/08/22/convex">http://marknelson.us/2007/08/22/convex</ulink> </para></simplesect>
</para>    </detaileddescription>
    <location file="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" line="202" column="1" bodyfile="/home/ubuntu/boost/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp" bodystart="201" bodyend="374"/>
    <listofallmembers>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a6558a1cbbeeced98850f670bdf4ace2f" prot="private" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>add_to_hull</name></member>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1ab8fbeb9a58c503ac5803a27eedab9f12" prot="public" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>apply</name></member>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1ae79906f82e7ae5074bc0d5052bbef4f4" prot="private" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>build_half_hull</name></member>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a20c858057ff4ecebc2218b6ea7eb13c7" prot="private" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>container_type</name></member>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a4dbfc79ce66b03dd91332e97e4d5804e" prot="private" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>cs_tag</name></member>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a456c123d0655ecf2c4409b38b95668c7" prot="public" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>geometry_type</name></member>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a8c59e7ca676836e65861080cc3663e3e" prot="private" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>iterator</name></member>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a99154140187312486137f992a03e06f7" prot="private" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>output_ranges</name></member>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a2678e51becdbb307f68bccc89f2f62c0" prot="public" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>point_type</name></member>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a354c3eb0a5083c5695e7225ac431f588" prot="public" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>result</name></member>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a677299f59be4a384a044dc04e3ee7561" prot="private" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>rev_iterator</name></member>
      <member refid="classboost_1_1geometry_1_1strategy_1_1convex__hull_1_1graham__andrew_1a550176a736837847b6df1b46ef6f6b3f" prot="public" virt="non-virtual"><scope>boost::geometry::strategy::convex_hull::graham_andrew</scope><name>state_type</name></member>
    </listofallmembers>
  </compounddef>
</doxygen>


text:
<!DOCTYPE html>
<html>
<head>
	<title>Attach to input</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<style>
		#calendar,
		#calendar2,
		#calendar3 {
			border: 1px solid #dfdfdf;
			font-family: Roboto, Arial, Helvetica;
			font-size: 14px;
			color: #404040;
		}
	</style>
	<script>
		var myCalendar;
		function doOnLoad() {
			myCalendar = new dhtmlXCalendarObject(["cal_1","cal_2","cal_3"]);
		}
	</script>
</head>
<body onload="doOnLoad();">
	<div style="position:relative;height:350px;">
		<input type="text" id="cal_1">
		<input type="text" id="cal_2">
		<input type="text" id="cal_3">
	</div>
</body>
</html>

redpajama_set_name: RedPajamaGithub


text:
Changelog
=========

Version 1.2.3 (2012.07.30): Fixed exception when the viewer appeared under the mouse cursor.

Version 1.2.2 (2012.06.04):

- Made image mouse position reporting more robust when the change is
due to something other than mouse movement (synthetic mouse movement events).
- Viewer synchronization is now usable when the images have different sizes.
- Added `ImageViewerUtil.synchronizedViewer(Collection<ImageViewer>)`.
- Added option to disable default popup menu.
- Exposed the default popup menu as class `DefaultViewerPopup`.

Version 1.2.1 (2012.03.29): Fixed image mouse events when viewer had overlay.

Version 1.2.0 (2012.03.29):

- Fix synchronization of viewers when some of them were empty.
- Added PixelInfoStatusBar which displays information on an image pixel.
- Added ImageViewerUtil.synchronizePixelInfoStatusBars.
- Fixed image mouse motion events caused by non-mouse-motion changes (e.g. when the resize strategy is changed).
- Fixed flicker when the viewer rescrolls after a resize.

Version 1.1.1 (2012.03.01):

- Enhanced DefaultStatusBar to display alpha too, and to use a shorter display format when there's not enough room.
- Added a message about the error when saving the image failed.
- Fixed exception when calling certain methods on a viewer before it is shown.
- Fixed ImageViewerUtil.synchronizeViewers. (It didn't use to synchronize current state, only future changes.)

Version 1.1.0 (2012.02.28):

- **Changed the default resize strategy to SHRINK_TO_FIT.**
- Enhancements to the 'save image' dialog: help text and image file filter.
- New property: interpolationType.
- Various performance improvements.

Version 1.0.1 (2012.02.07): Fixed removeOverlay.

Version 1.0.0 (2012.01.26):

- Moved everything to package `hu.kazocsaba.imageviewer`.
- Renamed ImageMouseMove to ImageMouseMotion for consistency with Java API.
- ImageSequenceViewer no longer extends JPanel.
- An overlay can now be added to more than one viewer at once.

Legacy changes
--------------

*These are the changes from the time before the library made it into the central Maven repository and had different group ID and artifact ID.*

Version 1.2.5 (2011.10.20): Fix handling of large images or large zoom. Add PixelMarkerOverlay.

Version 1.2.4 (2011.09.23): Fix DefaultStatusBar so that it updates when the image is changed.

Version 1.2.3 (2011.09.07): Add support for custom zoom factors.

Version 1.2.2 (2011.09.06): Add new property: pixelatedZoom; fix small background color bug.

Version 1.2.1 (2011.07.22): No changes, project metadata update.

Version 1.2.0 (2011.04.27): Modify ImageViewerUtil.synchronizeViewers to allow multiple viewers; use bicubic interpolation when resizing

Version 1.1.5 (2011.03.01): Add "Save image" menu item to popup menu

Version 1.1.4 (2011.03.01): Fix the viewer not updating when overlays are added and removed

Version 1.1.3 (2011.02.21): New function: ImageViewer.pointToPixel

Version 1.1.2 (2011.02.21): Add support for mouse drag event

Version 1.1.1 (2010.07.22): Fix subpixel position calculation

Version 1.1.0 (2010.07.19): Remove legacy package; new RESIZE_TO_FIT strategy, other small fixes

Version 1.0.5 (2009.04.23): Make the original MouseEvent accessible from ImageMouseEvent

Version 1.0.4 (2008.09.19): Make ImageViewer the source of events

Version 1.0.3 (2008.09.08): Add ImageSequenceViewer

Version 1.0.2 (2008.08.11):

- Fix image viewer synchronization when one of the viewers doesn't have an image making the other one unscrollable.
- Allow adding mouse listeners to the image viewer.
- Make the image transformation accessible on the public image viewer interface.

Version 1.0.0 (2008.08.08)


text:
package com.hazelcast.sql.impl;

import com.hazelcast.test.HazelcastParallelClassRunner;
import com.hazelcast.test.annotation.ParallelJVMTest;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import java.util.UUID;

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

@RunWith(HazelcastParallelClassRunner.class)
@Category({QuickTest.class, ParallelJVMTest.class})
public class QueryIdTest extends SqlTestSupport {
    @Test
    public void testIds() {
        UUID memberId = UUID.randomUUID();
        UUID localId = UUID.randomUUID();

        QueryId id = create(memberId, localId);

        assertEquals(memberId, id.getMemberId());
        assertEquals(localId, id.getLocalId());
    }

    @Test
    public void testEquals() {
        UUID memberId1 = UUID.randomUUID();
        UUID memberId2 = UUID.randomUUID();
        UUID localId1 = UUID.randomUUID();
        UUID localId2 = UUID.randomUUID();

        checkEquals(create(memberId1, localId1), create(memberId1, localId1), true);
        checkEquals(create(memberId1, localId1), create(memberId1, localId2), false);
        checkEquals(create(memberId1, localId1), create(memberId2, localId1), false);
        checkEquals(create(memberId1, localId1), create(memberId2, localId2), false);
    }

    @Test
    public void testMemberId() {
        UUID memberId = UUID.randomUUID();

        QueryId id1 = QueryId.create(memberId);
        QueryId id2 = QueryId.create(memberId);

        assertEquals(memberId, id2.getMemberId());
        assertEquals(id1.getMemberId(), id2.getMemberId());
        assertNotEquals(id1.getLocalId(), id2.getLocalId());
    }

    @Test
    public void testSerialization() {
        QueryId original = QueryId.create(UUID.randomUUID());
        QueryId restored = serializeAndCheck(original, SqlDataSerializerHook.QUERY_ID);

        assertEquals(original, restored);
    }

    @Test
    public void testParsing() {
        QueryId original = QueryId.create(UUID.randomUUID());
        QueryId restored = QueryId.parse(original.toString());
        assertEquals(original, restored);

        assertThrows(IllegalArgumentException.class, () -> {
            QueryId.parse(UUID.randomUUID().toString());
        });

        assertThrows(IllegalArgumentException.class, () -> {
            QueryId.parse(UUID.randomUUID() + "_");
        });

        assertThrows(IllegalArgumentException.class, () -> {
            QueryId.parse(UUID.randomUUID() + "!_" + UUID.randomUUID());
        });

        assertThrows(IllegalArgumentException.class, () -> {
            QueryId.parse(UUID.randomUUID() + "_" + UUID.randomUUID() + "!");
        });

        assertThrows(IllegalArgumentException.class, () -> {
            QueryId.parse(UUID.randomUUID() + "_" + UUID.randomUUID() + "_");
        });

        assertThrows(IllegalArgumentException.class, () -> {
            QueryId.parse(UUID.randomUUID() + "_" + UUID.randomUUID() + "_" + UUID.randomUUID());
        });
    }

    private static QueryId create(UUID memberId, UUID localId) {
        return new QueryId(memberId.getMostSignificantBits(), memberId.getLeastSignificantBits(),
            localId.getMostSignificantBits(), localId.getLeastSignificantBits());
    }
}


text:
package models.field_visit;

import com.fasterxml.jackson.annotation.JsonProperty;
import helpers.DB;
import org.sql2o.Connection;

import java.util.Date;
import java.util.List;

/**
 * Created by lenovo on 11/23/2015.
 */
public class PlantStageEnd {
    @JsonProperty("farmer_field_visit_id")
    public int farmerFieldVisitId;

    @JsonProperty("plant_stage_type")
    public String plantStageType;

    @JsonProperty("end_date")
    public Date endDate;

    public static List<PlantStageEnd> select (String plantStageType, int farmerFieldVisitId) {
        try (Connection con = DB.sql2o.open()) {
            String sql =
                "SELECT farmer_field_visit_id AS farmerFieldVisitId, plant_stage_type AS plantStageType, end_date AS endDate " +
                "FROM plant_stage_end WHERE " +
                    "farmer_field_visit_id = :farmerFieldVisitId AND " +
                    "(:plantStageType IS NULL OR lower(plant_stage_type) = lower(:plantStageType))";
            return con.createQuery(sql)
                    .addParameter("farmerFieldVisitId", farmerFieldVisitId)
                    .addParameter("plantStageType", plantStageType)
                    .executeAndFetch(PlantStageEnd.class);
        }
    }

    public static int insert (PlantStageEnd plantStageEnd) {
        try (Connection con = DB.sql2o.open()) {
            String sql = "INSERT INTO plant_stage_end VALUES (:farmerFieldVisitId, :plantStageType, :endDate)";
            return con.createQuery(sql)
                    .addParameter("farmerFieldVisitId", plantStageEnd.farmerFieldVisitId)
                    .addParameter("plantStageType", plantStageEnd.plantStageType.toLowerCase())
                    .addParameter("endDate", plantStageEnd.endDate)
                    .executeUpdate().getResult();
        }
    }

    public static int update (PlantStageEnd plantStageEnd) {
        try (Connection con = DB.sql2o.open()) {
            String sql =
                    "UPDATE plant_stage_end SET end_date = :endDate WHERE " +
                            "farmer_field_visit_id = :farmerFieldVisitId AND plant_stage_type = :plantStageType";
            return con.createQuery(sql)
                    .addParameter("farmerFieldVisitId", plantStageEnd.farmerFieldVisitId)
                    .addParameter("plantStageType", plantStageEnd.plantStageType)
                    .addParameter("endDate", plantStageEnd.endDate)
                    .executeUpdate().getResult();
        }
    }

    public static int delete (PlantStageEnd plantStageEnd) {
        try (Connection con = DB.sql2o.open()) {
            String sql =
                    "DELETE FROM plant_stage_end WHERE farmer_field_visit_id = :farmerFieldVisitId AND " +
                            "plant_stage_type = :plantStageType";
            return con.createQuery(sql)
                    .addParameter("farmerFieldVisitId", plantStageEnd.farmerFieldVisitId)
                    .addParameter("plantStageType", plantStageEnd.plantStageType)
                    .executeUpdate().getResult();
        }
    }
}


text:
package org.kie.workbench.common.forms.common.rendering.client.util.valueConverters;

import org.jboss.errai.databinding.client.api.Converter;

public class ShortToLongConverter implements Converter<Short, Long> {

    @Override
    public Class<Short> getModelType() {
        return Short.class;
    }

    @Override
    public Class<Long> getComponentType() {
        return Long.class;
    }

    @Override
    public Short toModelValue(Long widgetValue) {
        return widgetValue != null ? widgetValue.shortValue() : null;
    }

    @Override
    public Long toWidgetValue(Short modelValue) {
        return modelValue != null ? modelValue.longValue() : null;
    }
}


text:
/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package org.apache.hadoop.mapreduce.jobhistory;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class JhCounters extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"JhCounters\",\"namespace\":\"org.apache.hadoop.mapreduce.jobhistory\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"groups\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"JhCounterGroup\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"displayName\",\"type\":\"string\"},{\"name\":\"counts\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"JhCounter\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"displayName\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"long\"}]}}}]}}}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  @Deprecated public java.lang.CharSequence name;
  @Deprecated public java.util.List<org.apache.hadoop.mapreduce.jobhistory.JhCounterGroup> groups;

  /**
   * Default constructor.
   */
  public JhCounters() {}

  /**
   * All-args constructor.
   */
  public JhCounters(java.lang.CharSequence name, java.util.List<org.apache.hadoop.mapreduce.jobhistory.JhCounterGroup> groups) {
    this.name = name;
    this.groups = groups;
  }

  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  // Used by DatumWriter.  Applications should not call.
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return name;
    case 1: return groups;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }
  // Used by DatumReader.  Applications should not call.
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value$) {
    switch (field$) {
    case 0: name = (java.lang.CharSequence)value$; break;
    case 1: groups = (java.util.List<org.apache.hadoop.mapreduce.jobhistory.JhCounterGroup>)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'name' field.
   */
  public java.lang.CharSequence getName() {
    return name;
  }

  /**
   * Sets the value of the 'name' field.
   * @param value the value to set.
   */
  public void setName(java.lang.CharSequence value) {
    this.name = value;
  }

  /**
   * Gets the value of the 'groups' field.
   */
  public java.util.List<org.apache.hadoop.mapreduce.jobhistory.JhCounterGroup> getGroups() {
    return groups;
  }

  /**
   * Sets the value of the 'groups' field.
   * @param value the value to set.
   */
  public void setGroups(java.util.List<org.apache.hadoop.mapreduce.jobhistory.JhCounterGroup> value) {
    this.groups = value;
  }

  /** Creates a new JhCounters RecordBuilder */
  public static org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder newBuilder() {
    return new org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder();
  }

  /** Creates a new JhCounters RecordBuilder by copying an existing Builder */
  public static org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder newBuilder(org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder other) {
    return new org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder(other);
  }

  /** Creates a new JhCounters RecordBuilder by copying an existing JhCounters instance */
  public static org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder newBuilder(org.apache.hadoop.mapreduce.jobhistory.JhCounters other) {
    return new org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder(other);
  }

  /**
   * RecordBuilder for JhCounters instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<JhCounters>
    implements org.apache.avro.data.RecordBuilder<JhCounters> {

    private java.lang.CharSequence name;
    private java.util.List<org.apache.hadoop.mapreduce.jobhistory.JhCounterGroup> groups;

    /** Creates a new Builder */
    private Builder() {
      super(org.apache.hadoop.mapreduce.jobhistory.JhCounters.SCHEMA$);
    }

    /** Creates a Builder by copying an existing Builder */
    private Builder(org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder other) {
      super(other);
    }

    /** Creates a Builder by copying an existing JhCounters instance */
    private Builder(org.apache.hadoop.mapreduce.jobhistory.JhCounters other) {
            super(org.apache.hadoop.mapreduce.jobhistory.JhCounters.SCHEMA$);
      if (isValidValue(fields()[0], other.name)) {
        this.name = data().deepCopy(fields()[0].schema(), other.name);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.groups)) {
        this.groups = data().deepCopy(fields()[1].schema(), other.groups);
        fieldSetFlags()[1] = true;
      }
    }

    /** Gets the value of the 'name' field */
    public java.lang.CharSequence getName() {
      return name;
    }

    /** Sets the value of the 'name' field */
    public org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder setName(java.lang.CharSequence value) {
      validate(fields()[0], value);
      this.name = value;
      fieldSetFlags()[0] = true;
      return this;
    }

    /** Checks whether the 'name' field has been set */
    public boolean hasName() {
      return fieldSetFlags()[0];
    }

    /** Clears the value of the 'name' field */
    public org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder clearName() {
      name = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'groups' field */
    public java.util.List<org.apache.hadoop.mapreduce.jobhistory.JhCounterGroup> getGroups() {
      return groups;
    }

    /** Sets the value of the 'groups' field */
    public org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder setGroups(java.util.List<org.apache.hadoop.mapreduce.jobhistory.JhCounterGroup> value) {
      validate(fields()[1], value);
      this.groups = value;
      fieldSetFlags()[1] = true;
      return this;
    }

    /** Checks whether the 'groups' field has been set */
    public boolean hasGroups() {
      return fieldSetFlags()[1];
    }

    /** Clears the value of the 'groups' field */
    public org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder clearGroups() {
      groups = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    @Override
    public JhCounters build() {
      try {
        JhCounters record = new JhCounters();
        record.name = fieldSetFlags()[0] ? this.name : (java.lang.CharSequence) defaultValue(fields()[0]);
        record.groups = fieldSetFlags()[1] ? this.groups : (java.util.List<org.apache.hadoop.mapreduce.jobhistory.JhCounterGroup>) defaultValue(fields()[1]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}


text:
<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Hackathon
 * @package     Hackathon_MageMonitoring
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

class Hackathon_MageMonitoring_Block_Widget_Button extends Mage_Adminhtml_Block_Widget_Button
{

    /**
     * Set onClick data for button display.
     *
     * @param string $widgetId
     * @param string $controller_action
     * @param array $url_params
     * @param string $confirm_message
     *
     * @return string
     */
    public function setOnClick($widget, $controller_action, $url_params = null, $confirm_message = null)
    {
        $onClick = '';
        // check if this is an ajax call with callback
        $cbMarker = Hackathon_MageMonitoring_Model_Widget_Abstract::CALLBACK;
        if (!strncmp($controller_action, $cbMarker, strlen($cbMarker))) {
            $callback = substr($controller_action, strlen($cbMarker));
            $widgetId = $widget->getConfigId();
            $tabId = $widget->getTabId();
            $widgetName = $widget->getName();
            $callbackUrl = Mage::helper('magemonitoring')->getWidgetUrl('*/widgetAjax/execCallback', $widget);
            $refreshUrl = 'null';
            // check if refresh flag is set
            if (isset($url_params['refreshAfter']) && $url_params['refreshAfter']) {
                $refreshUrl = '\'' . Mage::helper('magemonitoring')->getWidgetUrl(
                        '*/widgetAjax/refreshWidget',
                        $widget
                ) . '\'';
            }
            // add callback js
            $onClick .= "execWidgetCallback('$tabId-$widgetId', '$widgetName', '$callback', '$callbackUrl', $refreshUrl);";
            // add confirm dialog?
            if ($confirm_message) {
                $onClick = "var r=confirm('$confirm_message'); if (r==true) {" . $onClick . "}";
            }
            return parent::setOnClick($onClick);
        }
        $url = Mage::getSingleton('adminhtml/url')->getUrl($controller_action, $url_params);
        if ($confirm_message) {
            $onClick = "confirmSetLocation('$confirm_message','$url')";
        } else {
            $onClick = "setLocation('$url')";
        }
        return parent::setOnClick($onClick);
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using AecCloud.WebAPI.Tests;
using AutofacOwinAuth.AuthorizationServer.Controllers;
using NUnit.Framework;

namespace AutofacOwinAuth.WebAPI.Tests
{
    public class TestAuthControllerRoutes
    {
        [Test]
        public void TestResetPassword()
        {
            var dummyUrl = "http://test.com/api/Auth/ResetPassword";
            var ok = dummyUrl.ShouldMapTo<AuthController>("ResetPassword", HttpMethod.Post);
            Assert.AreEqual(true, ok);
        }

        [Test]
        public void TestSetPassword()
        {
            var dummyUrl = "http://test.com/api/Auth/SetPassword";
            var ok = dummyUrl.ShouldMapTo<AuthController>("SetPassword", HttpMethod.Post);
            Assert.AreEqual(true, ok);
        }

        [Test]
        public void TestChangePassword()
        {
            var dummyUrl = "http://test.com/api/Auth/ChangePassword";
            var ok = dummyUrl.ShouldMapTo<AuthController>("ChangePassword", HttpMethod.Post);
            Assert.AreEqual(true, ok);
        }
    }
}


text:
<?php

if ( ! class_exists( 'Debug_Bar_Shortcode_Info_Caption' ) ) :

	/**
	 * Information on the standard WP [caption] shortcode.
	 */
	class Debug_Bar_Shortcode_Info_Caption extends Debug_Bar_Shortcode_Info_Defaults {

		/**
		 * Whether the shortcode is self-closing or not.
		 *
		 * @var bool|null $self_closing
		 */
		public $self_closing = false;

		/**
		 * Info URL.
		 *
		 * @var string $info_url
		 */
		public $info_url = 'http://codex.wordpress.org/Caption_Shortcode';

		/**
		 * Constructor - set some properties which need to be translated.
		 */
		public function __construct() {
			$this->name        = __( 'Wrap captions around content', 'debug-bar-shortcodes' );
			$this->description = __( 'The Caption feature allows you to wrap captions around content. This is primarily used with individual images.', 'debug-bar-shortcodes' );

			$this->parameters['required'] = array(
				'caption' => __( 'The actual text of your caption.', 'debug-bar-shortcodes' ),
				'width'   => __( 'How wide the caption should be in pixels.', 'debug-bar-shortcodes' ),
			);

			$this->parameters['optional'] = array(
				'id'    => __( 'A unique HTML ID that you can change to use within your CSS.', 'debug-bar-shortcodes' ),
				'align' => __( 'The alignment of the caption within the post. Valid values are: alignnone (default), aligncenter, alignright, and alignleft.', 'debug-bar-shortcodes' ),
			);
		}
	} // End of class.

endif; // End of if class_exists.


text:
<?php include_once __DIR__ . '/header.php'; ?>

Login with

                        <a id="google_login" class="circle google" href="<?= $authUrl ?>">

                        <a id="facebook_login" class="circle facebook" href="<?= $facebookUrl; ?>">

                        <form method="post" action="<?= site_url('user_login') ?>" accept-charset="UTF-8">
                            <input id="email"  type="text" placeholder="Email" name="login">
                            <input id="password"  type="password" placeholder="Password"
                                   name="password">
                            <button class="btn  btn-register" type="submit">Login</button>
                        </form>

                        <?php
                        $attributes = array(
                            'data-remote' => 'true',
                            'accept-charset' => 'UTF-8',
                            'class' => 'loginbox',
                            'method' => 'post');
                        echo form_open_multipart('user_login/save_info', $attributes)
                        ?>
                        <input id="email" type="text" placeholder="Email" name="email">
                        <input id="email" type="text" placeholder="Username" name="username">
                        Picture :
                        <input type="file" name="user_image">
                        <input id="password"  type="password" placeholder="Password"
                               name="password">
                        <input id="password_confirmation"  type="password"
                               placeholder="Repeat Password" name="confirm_password">
                        Gender :
                            <input type="radio" name="gender" id="inlineRadio1" value="male"> Male

                            <input type="radio" name="gender" id="inlineRadio2" value="female"> Female

                        Dob : <select name="dd" id="dd">
                            <option value="">-Day-</option>
                            <?php for($i = 1;$i <= 31 ; $i++ ){?>
                            <option value="<?=$i?>"><?=$i?></option>
                            <?php }?>
                        </select>
                        <select name="mm" id="mm">
                            <option value="">-Month-</option>
                            <option value="January">January</option>
                            <option value="February">February</option>
                            <option value="March">March</option>
                            <option value="April">April</option>
                            <option value="May">May</option>
                            <option value="June">June</option>
                            <option value="July">July</option>
                            <option value="August">August</option>
                            <option value="September">September</option>
                            <option value="October">October</option>
                            <option value="November">November</option>
                            <option value="December">December</option>
                        </select>
                        <select name="yy" id="yy">
                            <option value="">-Year-</option>
                            <?php for($i = date('Y');$i >= 1940; $i--){?>
                            <option value="<?= $i?>"><?= $i?></option>
                            <?php }?>
                        </select>

                        <input id="age" type="text" placeholder="Age" name="age">
                        <button class="btn  btn-register" type="submit">Create account</button>
                        <?= form_close(); ?>

                    Looking to
                        create an account
                        ?

                    Already have an account?
                    Login

<?php include_once __DIR__ . '/footer.php'; ?>


text:
namespace baidu {
namespace galaxy {
namespace util {
typedef enum {
    kErrorOk = 0,
    kErrorFailed = -1,
    kErrorRepeated = 1,
    kErrorNotAllowed = 2
} ErrorNum;

class ErrorCode {
public:

    ErrorCode() : code_(-1) {
    }

    ErrorCode(int code, const std::string& msg) :
        code_(code),
        message_(msg) {
    }

    ErrorCode(const char* file, const char* function, uint32_t line, int code, const char* format, ...) : code_(code) {
        assert(NULL != file);
        assert(NULL != function);
        assert(NULL != format);
        std::stringstream ss;
        ss << "[" << file << ":" << function << ":" << line << "] ";
        header_ = ss.str();

        char buf[2048];
        va_list va;
        va_start(va, format);
        vsnprintf(buf, sizeof buf, format, va);
        va_end(va);
        ss.str("");
        ss << buf;
        message_ = ss.str();
    }

    ErrorCode(const char* file,
            const char* function,
            uint32_t line,
            int code,
            int errnum,
            const char* format) : code_(code) {
        assert(NULL != file);
        assert(NULL != function);
        assert(NULL != format);
        std::stringstream ss;
        ss << "[" << file << ":" << function << ":" << line << "] ";
        header_ = ss.str();

        char buf[2048];
        va_list va;
        va_start(va, format);
        vsnprintf(buf, sizeof buf, format, va);
        va_end(va);
        ss.str("");
        ss << buf << ": " << strerror(errnum);
        message_ = ss.str();
    }

    int Code() const {
        return code_;
    }

    const std::string Message() const {
        return header_ + message_;
    }

    const std::string ShortMessage() const {
        return message_;
    }

private:
    int code_;
    std::string message_;
    std::string header_;
};
}
}
}

#define SET_ERRORCODE_MSG(obj, format, args...) obj.SetMessage(__FILE__, __FUNCTION__, __LINE__, format, ##args);
#define ERRORCODE(code, format, args...) baidu::galaxy::util::ErrorCode(__FILE__, __FUNCTION__, __LINE__, code, format, ##args)
#define PERRORCODE(code, errnum, format, args...) baidu::galaxy::util::ErrorCode(__FILE__, __FUNCTION__, __LINE__, code, format, ##args)
#define ERRORCODE_OK baidu::galaxy::util::ErrorCode(0, "")


text:
package org.deeplearning4j.aws.ec2.provision;

public class DistributedDeepLearningTrainer {

	private DistributedDeepLearningTrainer() {
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ClusterSetup clusterSet = new ClusterSetup(args);

	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
<!-- for some information on what you could do (e.g. targets to override). -->
<!-- If you delete this file and reopen the project it will be recreated. -->
<project name="it.unibas.bartgui.controlegt" default="netbeans" basedir=".">
    <description>Builds, tests, and runs the project it.unibas.bartgui.controlegt.</description>
    <import file="nbproject/build-impl.xml"/>
</project>


text:
'use strict';

var path = require('path');
var os = require('os');

var expect = require('expect');

var replaceExt = require('../');

describe('replace-ext', function () {
  it('returns a valid replaced extension on long path', function (done) {
    var fname = path.join(__dirname, './fixtures/test.coffee');
    var expected = path.join(__dirname, './fixtures/test.js');
    var result = replaceExt(fname, '.js');
    expect(result).toEqual(expected);
    done();
  });

  it('returns a valid replaced extension on basename', function (done) {
    var fname = 'test.coffee';
    var expected = 'test.js';
    var result = replaceExt(fname, '.js');
    expect(result).toEqual(expected);
    done();
  });

  it('should not return a valid replaced extension on empty string', function (done) {
    var fname = '';
    var expected = '';
    var result = replaceExt(fname, '.js');
    expect(result).toEqual(expected);
    done();
  });

  it('returns a valid removed extension on long path', function (done) {
    var fname = path.join(__dirname, './fixtures/test.coffee');
    var expected = path.join(__dirname, './fixtures/test');
    var result = replaceExt(fname, '');
    expect(result).toEqual(expected);
    done();
  });

  it('returns a valid added extension on long path', function (done) {
    var fname = path.join(__dirname, './fixtures/test');
    var expected = path.join(__dirname, './fixtures/test.js');
    var result = replaceExt(fname, '.js');
    expect(result).toEqual(expected);
    done();
  });

  it('should not replace when 1st arg is not a string (null)', function (done) {
    var result = replaceExt(null, '.js');
    expect(result).toEqual(null);
    done();
  });

  it('should not replace when 1st arg is not a string (object)', function (done) {
    var obj = {};
    var result = replaceExt(obj, '.js');
    expect(result).toEqual(obj);
    done();
  });

  it('Should preserve the first dot of relative dir name.', function (done) {
    if (os.platform() === 'win32') {
      expect(replaceExt('a/b/c.js', '.ts')).toEqual('a\\b\\c.ts');
      expect(replaceExt('./a/b/c.js', '.ts')).toEqual('.\\a\\b\\c.ts');
      expect(replaceExt('../a/b/c.js', '.ts')).toEqual('..\\a\\b\\c.ts');
      expect(replaceExt('/a/b/c.js', '.ts')).toEqual('\\a\\b\\c.ts');

      expect(replaceExt('C:/a/b/c.js', '.ts')).toEqual('C:\\a\\b\\c.ts');

      expect(replaceExt('a\\b\\c.js', '.ts')).toEqual('a\\b\\c.ts');
      expect(replaceExt('.\\a\\b\\c.js', '.ts')).toEqual('.\\a\\b\\c.ts');
      expect(replaceExt('..\\a\\b\\c.js', '.ts')).toEqual('..\\a\\b\\c.ts');
      expect(replaceExt('\\a\\b\\c.js', '.ts')).toEqual('\\a\\b\\c.ts');

      expect(replaceExt('C:\\a\\b\\c.js', '.ts')).toEqual('C:\\a\\b\\c.ts');
    } else {
      expect(replaceExt('a/b/c.js', '.ts')).toEqual('a/b/c.ts');
      expect(replaceExt('./a/b/c.js', '.ts')).toEqual('./a/b/c.ts');
      expect(replaceExt('../a/b/c.js', '.ts')).toEqual('../a/b/c.ts');
      expect(replaceExt('/a/b/c.js', '.ts')).toEqual('/a/b/c.ts');
    }
    done();
  });
});


text:
package pl.pdfviewer.client.ui;

public interface VoidListener {
	public void listener();
}


text:
<!--
  ~ Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="org.wso2.carbon.identity.data.publisher.authentication.analytics.login" verbose="1">
    <test name="org.wso2.carbon.identity.data.publisher.authentication.analytics.login" preserve-order="false" parallel="false">
        <!--<parameter name="log-level" value="debug"/>-->
        <classes>
            <class name="org.wso2.carbon.identity.data.publisher.authentication.analytics.login.AnalyticsLoginDataPublishHandlerTest"/>
            <class name="org.wso2.carbon.identity.data.publisher.authentication.analytics.login.AnalyticsLoginDataPublisherUtilsTest"/>
        </classes>
    </test>
</suite>


text:
<?php

return array(
    'required'       => "es obligatorio",
    'equals'         => "debe ser igual a '%s'",
    'different'      => "debe ser diferente a '%s'",
    'accepted'       => "debe ser aceptado",
    'numeric'        => "debe ser numérico",
    'integer'        => "debe ser un entero",
    'length'         => "debe ser mas largo de %d",
    'min'            => "debe ser mayor de %s",
    'max'            => "debe ser menor de %s",
    'in'             => "contiene un valor inválido",
    'notIn'          => "contiene un valor inválido",
    'ip'             => "no es una dirección IP",
    'email'          => "no es un correo electrónico válido",
    'url'            => "no es una URL",
    'urlActive'      => "debe ser un dominio activo",
    'alpha'          => "debe contener solo letras a-z",
    'alphaNum'       => "debe contener solo letras a-z o números 0-9",
    'slug'           => "debe contener solo letras a-z, números 0-9, barras y guiones bajos",
    'regex'          => "contiene caracteres inválidos",
    'date'           => "no es una fecha válida",
    'dateFormat'     => "debe ser una fecha con formato '%s'",
    'dateBefore'     => "debe ser una fecha antes de '%s'",
    'dateAfter'      => "debe ser una fecha después de '%s'",
    'contains'       => "debe contener %s",
    'boolean'        => "debe ser booleano",
    'lengthBetween'  => "debe tener entre %d y %d caracteres",
    'creditCard'     => "debe ser un numero de tarjeta de crédito válido",
    "lengthMin"      => "debe tener al menos %d caracteres",
    "lengthMax"      => "debe tener menos de %d caracteres",
    "instanceOf"     => "debe ser una instancia de '%s'",
    'containsUnique' => "debe contener solo valores únicos",
    'subset'         => "contiene un elemento que no está en la lista",
    'arrayHasKeys'   => "no contiene todas las claves requeridas"
);


text:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    <solid android:color="#303030" />

    <stroke
        android:width="2dp"
        android:color="#303030" />

    <padding
        android:bottom="10dp"
        android:left="10dp"
        android:right="10dp"
        android:top="10dp" />

    <corners android:radius="50dp" />

</shape>


text:
order: 1
zh-CN:
	title: 基本用法,第二行是 `Portal` 插入的,可以在浏览器里审查元素观察Html结构
	originalContent: 这里是原来就有的内容
	portalContent: 这里是 Portal 动态插入的内容
	purePortalContent: 这里是 PurePortal 动态插入的内容, 覆盖容器内原有内容
	bodyPortalContent: 默认插入到body最后,并设置为拥有遮罩用于关闭
	bodyPortalButton: 添加带遮罩的Portal到body
en-US:
	title: Basic usage
	originalContent: Original content
	portalContent: Content that Portal inserts dynamically
	purePortalContent: Content that PurePortal inserts dynamically, overwrites the original content inside the container
	bodyPortalContent: The content is appended to body by default, and a curtain is set for closing
	bodyPortalButton: Append a Portal with curtain to body

---

```jsx
import { Portal, Button, PurePortal } from 'zent';

// const WrappedPortal = Portal.withNonScrollable(Portal.withESCToClose(Portal));

class PortalBasic extends Component {
	state = {
		bodyPortalVisible: false,
		purePortalVisible: false,
	};
	togglePurePortal = () =>
		this.setState({ purePortalVisible: !this.state.purePortalVisible });
	showBodyPortal = () => this.setState({ bodyPortalVisible: true });
	hideBodyPortal = () => this.setState({ bodyPortalVisible: false });
	render() {
		return (
			<div className="zent-doc-portal-container">
				<div className="zent-doc-portal-mount-node">{i18n.originalContent}</div>
				<Portal selector=".zent-doc-portal-mount-node">
					<div className="zent-doc-portal-content">{i18n.portalContent}</div>
				</Portal>
				<div className="zent-doc-pure-portal-mount-node">
					content to be overwritten
				</div>
				{this.state.purePortalVisible ? (
					<PurePortal selector=".zent-doc-pure-portal-mount-node">
						<div className="zent-doc-portal-content">
							{i18n.purePortalContent}
						</div>
					</PurePortal>
				) : null}
				<Button onClick={this.togglePurePortal}>Toggle PurePortal</Button>
				<Button onClick={this.showBodyPortal}>{i18n.bodyPortalButton}</Button>
				<Portal
					visible={this.state.bodyPortalVisible}
					onClose={this.hideBodyPortal}
					className="layer"
					style={{ background: 'rgba(0, 0, 0, 0.2)' }}
					useLayerForClickAway
					closeOnClickOutside
					closeOnESC
					blockPageScroll
				>
					<div
						className="zent-doc-portal-content"
						style={{
							position: 'absolute',
							left: '50%',
							top: '50%',
							transform: 'translate3d(-50%, -50%, 0)',
							border: '1px solid #d3d3d3',
							borderRadius: '3px',
							padding: '50px',
							background: 'white',
						}}
					>
						{i18n.bodyPortalContent}
					</div>
				</Portal>
			</div>
		);
	}
}

ReactDOM.render(<PortalBasic />, mountNode);
```


text:
//
// Documentation of conditional compilation symbols used in PDFsharp 1.1.
// Checks correct settings and obsolete conditional compilation symbols.
//

#if MIGRADOC
// empira internal only: Some hacks that make PDFsharp behave like PDFlib when used with Asc.RenderContext.
// Applies to MigraDoc 1.2 only. The Open Source MigraDoc lite does not need this define.
#endif

#if NET_ZIP  // obsolete
// In .NET 2.0 GZipStream is used instead of SharpZipLib
// This does not work.
#error Undefine 'NET_ZIP' because it has no effect anymore
#endif

#if NET_2_0  // obsolete
#error Undefine 'NET_2_0' because earlier versions are not supported anymore
#endif

#if Gdip  // obsolete
#error Conditional compilation symbol 'Gdip' was renamed to 'GDI'
#endif

#if GdipUseGdiObjects
#error Conditional compilation symbol 'GdipUseGdiObjects' was renamed to 'UseGdiObjects'
#endif

#if GDI && WPF
// PDFsharp based on both System.Drawing and System.Windows classes
// This is for developing and cross testing only
#elif GDI
// PDFsharp based on System.Drawing classes
#if GdipUseGdiObjects
#error Conditional compilation symbol 'GdipUseGdiObjects' was renamed to 'UseGdiObjects'
#endif

#if UseGdiObjects
// PDFsharp X graphics classes have implicit cast operators for GDI+ objects.
// Define this to make it easier to use older code with PDFsharp.
// Undefine this to prevent dependencies to GDI+
#endif

#elif WPF
// PDFsharp based on Windows Presentation Foundation
#elif SILVERLIGHT
// PDFsharp based on Silverlight
#if !WPF
#error 'SILVERLIGHT' must be defined together with 'WPF'
#endif
#else
#error Either 'GDI', 'WPF' or 'SILVERLIGHT' must be defined
#endif


text:
<?php

class DivisionModel extends CI_Model {
	protected $table = 'division';

	public function getDivision($id)
	{
		return $this->db->limit(1)->get_where('division', ['id_division' => $id])->unbuffered_row();
	}

	// Fonction qui retourne toutes les divisions d'un département (id en parametre) dans un array
	public function liste_divisions($departement) {

		$divisions = $this->db->select('*')
					->where('id_dept', null)
					->or_where('id_dept', $departement)
					->order_by('nom')
					->get($this->table)
					->result_array();

		foreach ($divisions as &$division) {
			$division['groupes'] = $this->db->select('*')
											->where('id_division', $division['id_division'])
											->order_by('nom')
											->get('groupe')
											->result_array();
		}

		return $divisions;
	}

	// Fonction qui retourne tous les groupes d'une division (id en parametre) dans un array
	public function liste_groupes($division) {

		$query = "SELECT * FROM groupe WHERE id_division=? ORDER BY nom";
		$groupes = $this->db->query($query, array($division));
		$groupes = $groupes->result_array();

		return $groupes;
	}

	/*
	 * Si nécessaire je rajouterais des fonctions
	 */
}
?>


text:
function note_waveform = generate_note(note_opts)
%% Default values for note options
note_opts = fill_note_opts(note_opts);

% Initialization to zero
nSamples = round(4 * note_opts.duration * note_opts.sample_rate);
note_waveform = zeros(nSamples, 1);
time_range = (0:(nSamples-1)).' / note_opts.sample_rate;

% Synthesis of partials
for partial_index = 1:note_opts.nPartials
    frequency = note_opts.fundamental_frequency * partial_index;
    amplitude = partial_index^(note_opts.spectral_exponent);
    log_final_amplitude = - 4 * (1 + ...
        note_opts.timbre_velocity * (partial_index-1));
    amplitude_profile = logspace(0, log_final_amplitude, nSamples).';
    note_waveform = note_waveform + ...
        amplitude * amplitude_profile .* cos(2 * pi * frequency * time_range);
end

note_waveform = 0.1 * note_waveform / max(abs(note_waveform));
end


text:
// Copyright (c) Christof Senn. All rights reserved. See license.txt in the project root for license information.

namespace Remote.Linq.EntityFrameworkCore.ExpressionExecution
{
    using Microsoft.EntityFrameworkCore;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Security;

    internal sealed class CastingEntityFrameworkCoreAsyncStreamExpressionExecutor<TResult> : EntityFrameworkCoreAsyncStreamExpressionExecutor<TResult?>
        where TResult : class
    {
        [SecuritySafeCritical]
        public CastingEntityFrameworkCoreAsyncStreamExpressionExecutor(DbContext dbContext, IExpressionFromRemoteLinqContext? context = null)
            : base(dbContext, context)
        {
        }

        public CastingEntityFrameworkCoreAsyncStreamExpressionExecutor(Func<Type, IQueryable> queryableProvider, IExpressionFromRemoteLinqContext? context = null)
            : base(queryableProvider, context)
        {
        }

        protected override async IAsyncEnumerable<TResult?> ConvertResult(IAsyncEnumerable<object?> queryResult)
        {
            await foreach (var item in queryResult)
            {
                yield return item as TResult;
            }
        }
    }
}


text:
package org.apache.ambari.server.controller;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * Represents a user maintenance request.
 */
@ApiModel
public class UserRequest {
  private String userName;
  private String password;
  private String oldPassword;
  private Boolean active;
  private Boolean admin;

  @ApiModelProperty(name = "Users/user_name",hidden = true)
  public String getUsername() {
    return userName;
  }

  public UserRequest(String name) {
    this.userName = name;
  }

  @ApiModelProperty(name = "Users/password")
  public String getPassword() {
    return password;
  }

  public void setPassword(String userPass) {
    password = userPass;
  }

  @ApiModelProperty(name = "Users/old_password")
  public String getOldPassword() {
    return oldPassword;
  }

  public void setOldPassword(String oldUserPass) {
    oldPassword = oldUserPass;
  }

  @ApiModelProperty(name = "Users/active")
  public Boolean isActive() {
    return active;
  }

  public void setActive(Boolean active) {
    this.active = active;
  }

  @ApiModelProperty(name = "Users/admin")
  public Boolean isAdmin() {
    return admin;
  }

  public void setAdmin(Boolean admin) {
    this.admin = admin;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("User, username=").append(userName);
    return sb.toString();
  }

}


text:
CREATE OR REPLACE FUNCTION _add_migration_info(p_m_low_v TEXT, p_m_high_v TEXT)
    RETURNS VOID AS
$BODY$
---
-- @description
-- Adds migration info migrations log table
--
-- @param p_m_low_v
-- lower border of version that is applicaple for this migration
--
-- @param p_m_high_v
-- package type: either version (with version suffix at the end of the name) or basic (without)
--
-- @param p_pkg_old_rev
-- higher border of version that is applicaple for this migration
--
---
BEGIN

    BEGIN
        INSERT INTO migrations_log (m_low_v, m_high_v)
        VALUES (p_m_low_v, p_m_high_v);
        EXCEPTION
        WHEN SQLSTATE '42P01'
            THEN
                RAISE WARNING 'Can''t log migration from % to % as migrations_log is not defined yet', p_m_low_v, p_m_high_v;
    END;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE SECURITY DEFINER;


text:
package cz.blahami2.mipaa.knapsack.model.sat;

import cz.blahami2.mipaa.knapsack.model.sat.formulas.Literal;
import cz.blahami2.mipaa.knapsack.model.sat.formulas.AbstractFormula;

/**
 *
 * @author Michael Bláha
 */
public class SatSolver {

    public Configuration solve( Sat sat ) {
        Configuration configuration = new Configuration( sat.literals.length );
        return solve( configuration, sat.formula, sat.literals, 0 );
    }

    private Configuration solve( Configuration configuration, AbstractFormula formula, Literal[] literals, int swapIndex ) {
        if ( swapIndex == literals.length ) {
            configuration.configureLiterals( literals );
//            System.out.println( "trying configuration[" + swapIndex + "]: " + configuration.getPrintable() + " with result: " + formula.getValue() );
            if ( formula.getValue() ) {
                return configuration;
            } else {
                return null;
            }
        } else {
//            System.out.println( "calling configuration[" + swapIndex + "]: " + configuration.getPrintable() + " with result: " + formula.getValue() );
            Configuration result = solve( configuration.set( swapIndex, true ), formula, literals, swapIndex + 1 );
            if ( result != null ) {
                return result;
            }
            result = solve( configuration.set( swapIndex, false ), formula, literals, swapIndex + 1 );
            return result;
        }
    }

}


text:
package com.hpe.caf.worker.core;

import com.hpe.caf.api.Codec;
import com.hpe.caf.api.CodecException;
import com.hpe.caf.api.DecodeMethod;
import com.hpe.caf.api.worker.*;
import com.hpe.caf.naming.ServicePath;
import com.hpe.caf.util.rabbitmq.RabbitHeaders;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.*;

/**
 * WorkerCore represents the main logic of the microservice worker. It is responsible for accepting
 * new tasks from a WorkerQueue, handing them off to a backend Worker and executing them upon a thread pool.
 * It will then accept a result from the Worker it executed and hand the TaskResult back to the WorkerQueue
 * for publishing.
 */
final class WorkerCore
{
    private final WorkerThreadPool threadPool;
    private final ManagedWorkerQueue workerQueue;
    private final WorkerStats stats = new WorkerStats();
    private final TaskCallback callback;
    private static final Logger LOG = LoggerFactory.getLogger(WorkerCore.class);

    public WorkerCore(final Codec codec, final WorkerThreadPool pool, final ManagedWorkerQueue queue, final WorkerFactory factory, final ServicePath path)
    {
        WorkerCallback taskCallback =  new CoreWorkerCallback(codec, queue, stats);
        this.threadPool = Objects.requireNonNull(pool);
        this.callback = new CoreTaskCallback(codec, stats, new WorkerExecutor(path, taskCallback, factory, pool), pool, queue);
        this.workerQueue = Objects.requireNonNull(queue);
    }

    /**
     * Begin accepting tasks to process.
     * @throws QueueException if the queues cannot be started
     */
    public void start()
        throws QueueException
    {
        workerQueue.start(callback);
    }

    /**
     * The current idle time for the worker. If there are any active threads, this is 0. Otherwise it is the
     * difference between the current time and completion time of the last completed task.
     * @return the current idle time in milliseconds
     */
    public long getCurrentIdleTime()
    {
        if ( threadPool.isIdle() ) {
            return System.currentTimeMillis() - stats.getLastTaskFinishedTime();
        } else {
            return 0;   // if we are working, then we are not idle
        }
    }

    public ManagedWorkerQueue getWorkerQueue()
    {
        return this.workerQueue;
    }

    /**
     * @return the current number of tasks accepted by the worker but are not in progress
     */
    public int getBacklogSize()
    {
        return threadPool.getBacklogSize();
    }

    public WorkerStats getStats()
    {
        return this.stats;
    }

    /**
     * Called by the queue component to register a new task incoming.
     */
    private static class CoreTaskCallback implements TaskCallback
    {
        private final Codec codec;
        private final WorkerStats stats;
        private final WorkerExecutor executor;
        private final WorkerThreadPool threadPool;
        private final ManagedWorkerQueue workerQueue;

        public CoreTaskCallback(final Codec codec, final WorkerStats stats, final WorkerExecutor executor, final WorkerThreadPool pool, final ManagedWorkerQueue workerQueue)
        {
            this.codec = Objects.requireNonNull(codec);
            this.stats = Objects.requireNonNull(stats);
            this.executor = Objects.requireNonNull(executor);
            this.threadPool = Objects.requireNonNull(pool);
            this.workerQueue = Objects.requireNonNull(workerQueue);
        }

        /**
         * {@inheritDoc}
         *
         * Use the factory to get a new worker to handle the task, wrap this in a handler
         * and hand it off to the thread pool.
         */
        @Override
        public void registerNewTask(final String queueMsgId, final byte[] taskMessage, Map<String, Object> headers)
                throws InvalidTaskException, TaskRejectedException
        {
            Objects.requireNonNull(queueMsgId);
            stats.incrementTasksReceived();
            stats.getInputSizes().update(taskMessage.length);

            try {
                registerNewTaskImpl(queueMsgId, taskMessage, headers);
            } catch (InvalidTaskException e) {
                stats.incrementTasksRejected();
                throw e;
            }
        }

        private void registerNewTaskImpl(final String queueMsgId, final byte[] taskMessage, Map<String, Object> headers)
                 throws InvalidTaskException, TaskRejectedException
        {
            try {
                TaskMessage tm = codec.deserialise(taskMessage, TaskMessage.class, DecodeMethod.LENIENT);

                LOG.debug("Received task {} (message id: {})", tm.getTaskId(), queueMsgId);

                boolean poison = isTaskPoisoned(headers);
                validateTaskMessage(tm);
                boolean taskIsActive = checkStatus(tm);
                if (taskIsActive) {
                    if (tm.getTo() == null || tm.getTo().equalsIgnoreCase(workerQueue.getInputQueue())) {
                        LOG.debug("Task {} (message id: {}) on input queue {} {}", tm.getTaskId(), queueMsgId, workerQueue.getInputQueue(), (tm.getTo() != null) ? "is intended for this worker" : "has no explicit destination, therefore assuming it is intended for this worker");
                        executor.executeTask(tm, queueMsgId, poison);
                    } else {
                        LOG.debug("Task {} (message id: {}) is not intended for this worker: input queue {} does not match message destination queue {}", tm.getTaskId(), queueMsgId, workerQueue.getInputQueue(), tm.getTo());
                        executor.forwardTask(tm, queueMsgId, headers);
                    }
                } else {
                    LOG.debug("Task {} is no longer active. The task message (message id: {}) will not be executed", tm.getTaskId(), queueMsgId);
                    executor.discardTask(tm, queueMsgId);
                }
            } catch (CodecException e) {
                throw new InvalidTaskException("Queue data did not deserialise to a TaskMessage", e);
            } catch (InvalidJobTaskIdException ijte) {
                throw new InvalidTaskException("TaskMessage contains an invalid job task identifier", ijte);
            }
        }

        /**
         * Check the headers for retry limit and retry count. If retry count is greater than
         * or equal to retry limit, mark the message as poisoned.
         * @param headers Map<String, Object> of headers associated with the current message
         * @return boolean true if message is determined to be poisoned
         */
        private boolean isTaskPoisoned(Map<String, Object> headers)
        {
            int retryLimit = 0;
            if (null != headers.get(RabbitHeaders.RABBIT_HEADER_CAF_WORKER_RETRY_LIMIT)) {
                retryLimit = Integer.parseInt(headers.get(RabbitHeaders.RABBIT_HEADER_CAF_WORKER_RETRY_LIMIT).toString());
            }
            int retries = 0;
            if (null != headers.get(RabbitHeaders.RABBIT_HEADER_CAF_WORKER_RETRY)) {
                retries = Integer.parseInt(headers.get(RabbitHeaders.RABBIT_HEADER_CAF_WORKER_RETRY).toString());
            }
            boolean poison = false;
            if (retryLimit > 0 && retries > 0 && retries >= retryLimit) {
                poison = true;
            }
            return poison;
        }

        private void validateTaskMessage(TaskMessage tm) throws InvalidTaskException {
            // The task message must be present so that the framework can
            // callback with a valid message
            final String taskId = tm.getTaskId();
            if (taskId == null) {
                throw new InvalidTaskException("Task identifier not specified");
            }
        }

        /**
         * Cancel all the Future objects in our Map of running tasks. If the task is not yet
         * running it will just be thrown out of the queue. If it has completed this has no
         * effect. If it is running the Thread will be interrupted.
         */
        @Override
        public void abortTasks()
        {
            LOG.warn("Aborting all current queued and in-progress tasks");
            final int numberOfTasksAborted = threadPool.abortTasks();
            stats.incrementTasksAborted(numberOfTasksAborted);
        }

        /**
         * Checks whether a task is still active.
         * If a status check cannot be performed then the task is assumed to be active.
         * Checking status may result in a change to the tracking info on the supplied task message.
         * @param tm task message to be checked to verify whether the task is still active
         * @return true if the task is still active, false otherwise
         */
        private boolean checkStatus(TaskMessage tm) throws InvalidJobTaskIdException {
            Objects.requireNonNull(tm);

            TrackingInfo tracking = tm.getTracking();
            if (tracking != null) {
                Date statusCheckTime = tracking.getStatusCheckTime();
                if (statusCheckTime == null || statusCheckTime.getTime() <= System.currentTimeMillis()) {
                    return performJobStatusCheck(tm);
                }
                LOG.debug("Task {} active status is not being checked - it is not yet time for the status check to be performed: status check due at {}", tm.getTaskId(), statusCheckTime);
            } else {
                LOG.debug("Task {} active status is not being checked - the task message does not have tracking info", tm.getTaskId());
            }

            //By default a task is considered to be active.
            return true;
        }

        /**
         * Checks the current active status of the job to which the task belongs.
         * If this check can be made successfully then the status check time of the supplied task message is updated.
         * @param tm the task message whose job status will be verified
         * @return true if the task's job is active or the job status could not be checked, false if the status could be checked and the job is found to be inactive (aborted, cancelled, etc.)
         */
        private boolean performJobStatusCheck(TaskMessage tm) throws InvalidJobTaskIdException {
            Objects.requireNonNull(tm);
            TrackingInfo tracking = tm.getTracking();
            Objects.requireNonNull(tracking);

            String statusCheckUrl = tracking.getStatusCheckUrl();
            if (statusCheckUrl == null) {
                //If statusCheckUrl is null then we can't perform the status check so we have to assume the job is active.
                return true;
            }

            String jobId = tracking.getJobId();
            LOG.debug("Task {} (job {}) - attempting to check job status", tm.getTaskId(), jobId);
            JobStatusResponse jobStatus = getJobStatus(jobId, statusCheckUrl);
            long newStatusCheckTime = System.currentTimeMillis() + jobStatus.getStatusCheckIntervalMillis();
            LOG.debug("Task {} (job {}) - updating status check time from {} to {}", tm.getTaskId(), jobId, tracking.getStatusCheckTime(), new Date(newStatusCheckTime));
            tracking.setStatusCheckTime(new Date(newStatusCheckTime));
            return jobStatus.isActive();
        }

        /**
         * Makes a call to the status check URL to determine whether the job is active.
         * This should make implicit use of JobStatusResponseCache.
         * @param jobId checks the active status of this job
         * @param statusCheckUrl full path that can be used to check job status
         * @return job status response including active status of job - true if the job is active or if the check could not be performed, false if the job is inactive
         */
        private JobStatusResponse getJobStatus(String jobId, String statusCheckUrl) {
            JobStatusResponse jobStatusResponse = new JobStatusResponse();
            try {
                URL url = new URL(statusCheckUrl);
                URLConnection connection = url.openConnection();
                long statusCheckIntervalMillis = JobStatusResponseCache.getStatusCheckIntervalMillis(connection);
                try (BufferedReader response = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
                    String responseValue;
                    if ((responseValue = response.readLine()) != null) {
                        LOG.debug("Job {} : retrieved active status '{}' from status check URL {}.", jobId, responseValue, statusCheckUrl);
                        jobStatusResponse.setActive(Boolean.parseBoolean(responseValue));
                    } else {
                        LOG.warn("Job {} : assuming that job is active - no suitable response from status check URL {}.", jobId, statusCheckUrl);
                        jobStatusResponse.setActive(true);
                    }
                } catch (Exception ex) {
                    LOG.warn("Job {} : assuming that job is active - failed to perform status check using URL {}. ", jobId, statusCheckUrl, ex);
                    jobStatusResponse.setActive(true);
                }

                jobStatusResponse.setStatusCheckIntervalMillis(statusCheckIntervalMillis);
            } catch (Exception e) {
                LOG.warn("Job {} : assuming that job is active - failed to perform status check using URL {}. ", jobId, statusCheckUrl, e);
                jobStatusResponse.setActive(true);
            }
            return jobStatusResponse;
        }

        private static class JobStatusResponse {
            private boolean isActive;
            private long statusCheckIntervalMillis;

            public JobStatusResponse() {
                this(true, JobStatusResponseCache.getDefaultJobStatusCheckIntervalMillis());
            }

            public JobStatusResponse(boolean isActive, long statusCheckInterval) {
                this.isActive = isActive;
                this.statusCheckIntervalMillis = statusCheckInterval;
            }

            public boolean isActive() {
                return isActive;
            }

            public void setActive(boolean active) {
                isActive = active;
            }

            public long getStatusCheckIntervalMillis() {
                return statusCheckIntervalMillis;
            }

            public void setStatusCheckIntervalMillis(long statusCheckIntervalMillis) {
                this.statusCheckIntervalMillis = statusCheckIntervalMillis;
            }
        }
    }

    /**
     * Called by a WorkerWrapper to indicate a task was completed by a worker.
     */
    private static class CoreWorkerCallback implements WorkerCallback
    {
        private final Codec codec;
        private final WorkerQueue workerQueue;
        private final WorkerStats stats;

        public CoreWorkerCallback(final Codec codec, final WorkerQueue queue, final WorkerStats stats)
        {
            this.codec = Objects.requireNonNull(codec);
            this.workerQueue = queue;  // workerQueue can be null for a dead end worker
            this.stats = Objects.requireNonNull(stats);
        }

        /**
         * {@inheritDoc}
         *
         * Hand off the serialised result from a worker with its status to the queue. If the result cannot
         * be serialised for any reason, we reject the task.
         */
        @Override
        public void complete(final String queueMsgId, final String queue, final TaskMessage responseMessage)
        {
            Objects.requireNonNull(queueMsgId);
            Objects.requireNonNull(responseMessage);
            // queue can be null for a dead end worker
            LOG.debug("Task {} complete (message id: {})", responseMessage.getTaskId(), queueMsgId);
            LOG.debug("Setting destination {} in task {} (message id: {})", queue, responseMessage.getTaskId(), queueMsgId);
            responseMessage.setTo(queue);
            String targetQueue = getTargetQueue(queueMsgId, responseMessage, queue);
            checkForTrackingTermination(queueMsgId, targetQueue, responseMessage);
            try {
                if (null == targetQueue) {
                    // **** Dead End Worker ****
                    // If targetQueue is not set i.e. is null for a dead end worker. There remains a
                    // need to acknowledge the message is processed and removed from the queue. This
                    // is how a dead end worker will operate.
                    workerQueue.acknowledgeTask(queueMsgId);
                } else {
                    // **** Normal Worker ****
                    // A worker with an input and output queue.
                    byte[] output = codec.serialise(responseMessage);
                    workerQueue.publish(queueMsgId, output, targetQueue, Collections.emptyMap());
                    stats.getOutputSizes().update(output.length);
                }
                stats.updatedLastTaskFinishedTime();
                if ( TaskStatus.isSuccessfulResponse(responseMessage.getTaskStatus()) ) {
                    stats.incrementTasksSucceeded();
                } else {
                    stats.incrementTasksFailed();
                }
            } catch (CodecException | QueueException e) {
                LOG.error("Cannot publish data for task {}, rejecting", responseMessage.getTaskId(), e);
                abandon(queueMsgId);
            }
        }

        @Override
        public void abandon(final String queueMsgId)
        {
            LOG.debug("Rejecting message id {}", queueMsgId);
            workerQueue.rejectTask(queueMsgId);
            stats.incrementTasksRejected();
        }

        @Override
        public void forward(String queueMsgId, String queue, TaskMessage forwardedMessage, Map<String, Object> headers) {
            Objects.requireNonNull(queueMsgId);
            Objects.requireNonNull(queue);
            Objects.requireNonNull(forwardedMessage);
            LOG.debug("Task {} (message id: {}) being forwarded to queue {}", forwardedMessage.getTaskId(), queueMsgId, queue);
            checkForTrackingTermination(queueMsgId, queue, forwardedMessage);
            try {
                byte[] output = codec.serialise(forwardedMessage);
                workerQueue.publish(queueMsgId, output, queue, headers);
                stats.incrementTasksForwarded();
                //TODO - I'm guessing this stat should not be updated for forwarded messages:
                // stats.getOutputSizes().update(output.length);
            } catch (CodecException | QueueException e) {
                LOG.error("Cannot publish data for forwarded task {}, rejecting", forwardedMessage.getTaskId(), e);
                abandon(queueMsgId);
            }
        }

        @Override
        public void discard(String queueMsgId) {
            Objects.requireNonNull(queueMsgId);
            LOG.debug("Discarding message id {}", queueMsgId);
            workerQueue.discardTask(queueMsgId);
            stats.incrementTasksDiscarded();
        }

        /**
         * Checks whether tracking of this task message should end when publishing to the specified queue.
         * If tracking is to end then this method removes and returns the tracking info from the task message.
         * @param queueMsgId the reference to the message this task arrived on
         * @param queueToSend the queue to which the message is to be published
         * @param tm task message whose tracking info is to be checked
         * @return if tracking of the message terminates on publishing to the specified queue then the removed tracking info is returned; otherwise null is returned and the tracking info is not removed from the message
         */
        private TrackingInfo checkForTrackingTermination(final String queueMsgId, final String queueToSend, TaskMessage tm) {
            Objects.requireNonNull(queueMsgId);
            Objects.requireNonNull(tm);
            // queueToSend can be null for a dead end worker

            TrackingInfo tracking = tm.getTracking();
            if (tracking != null) {
                String trackTo = tracking.getTrackTo();
                if (trackTo != null && trackTo.equalsIgnoreCase(queueToSend)) {
                    LOG.debug("Task {} (message id: {}): removing tracking info from this message as tracking ends on publishing to the queue {}.", tm.getTaskId(), queueMsgId, queueToSend);
                    tm.setTracking(null);
                }
            }
            return tracking;
        }

        /**
         * Attempts to derive the target queue (the queue that the task message is to be sent out to)
         * from the tracking info on the task message. If the message has no tracking info specifying
         * a tracking destination then the default target queue is used.
         * @param queueMsgId the reference to the message this task arrived on
         * @param tm the task message being dispatched to the target queue
         * @param defaultTargetQueue dispatch the message to this queue if the message has no tracking info specifying a tracking destination
         * @return the queue to which the message should be dispatched
         */
        private String getTargetQueue(String queueMsgId, TaskMessage tm, String defaultTargetQueue) {
            Objects.requireNonNull(tm);
            TrackingInfo tracking = tm.getTracking();
            String trackingPipe = tracking == null ? null : tracking.getTrackingPipe();
            if (isInputQueue(trackingPipe)) {
                // If this worker is the tracking destination then there's no point redirecting to self!
                LOG.debug("Task {} (message id: {}) tracking pipe matches the current input queue - this worker is the tracking destination for this message", tm.getTaskId(), queueMsgId);
                return defaultTargetQueue;
            }
            return trackingPipe == null ? defaultTargetQueue : trackingPipe;
        }

        private boolean isInputQueue(final String queue) {
            return queue == null ? false : queue.equalsIgnoreCase(workerQueue.getInputQueue());
        }
    }
}


text:
package org.jboss.resteasy.test.smoke;

import org.jboss.resteasy.auth.oauth.OAuthException;
import org.jboss.resteasy.auth.oauth.OAuthMemoryProvider;

public class MyProvider extends OAuthMemoryProvider {

	public final static String Consumer1Key = "dpf43f3p2l4k3l03";
	public final static String Consumer1Secret = "kd94hf93k423kf44";
	public final static String Consumer1Request1Key = "q2efd58opw30t";
	public final static String Consumer1Request1Secret = "k9aw43q2ou934";
	public final static String Consumer1Request1Callback = "http://callback.net";
	public static final String Consumer1Request1Verifier = "q2r59kilj1pw9087";
	public final static String Consumer1Request2Key = "po0825epq2p09wi";
	public final static String Consumer1Request2Secret = "laiu49w8up3io5";
	public final static String Consumer1Request2Callback = "http://callback.net";

	public static final String[] Consumer1Access1Roles = {"admin"};
	public static final String Consumer1Access1Key = "o5i4eukolw9y8i65e25";
	public static final String Consumer1Access1Secret = "p0w394dk5uqoirej";

	public final static String Realm = "My realm";
	public MyProvider(){
		super(Realm);
		addConsumer(Consumer1Key, Consumer1Secret);
		try {
			addRequestKey(Consumer1Key, Consumer1Request1Key, Consumer1Request1Secret, Consumer1Request1Callback, new String[]{});
			authoriseRequestToken(Consumer1Key, Consumer1Request1Key, Consumer1Request1Verifier);
			addRequestKey(Consumer1Key, Consumer1Request2Key, Consumer1Request2Secret, Consumer1Request2Callback, new String[]{});
			addAccessKey(Consumer1Key, Consumer1Access1Key, Consumer1Access1Secret, Consumer1Access1Roles);
		} catch (OAuthException e) {
			// should not happen
			throw new RuntimeException(e);
		}
	}

}


text:
module Shoulda
  module Matchers
    module ActiveModel
      class AllowValueMatcher
        # @private
        class SuccessfulSetting
          def successful?
            true
          end
        end
      end
    end
  end
end


text:
A state container

## Usage

```js
import { PromisedState } from 'promised-state';

const state = { name: 'bouzuya' };
const promised = new PromisedState(state);
promised.update(({ name }) => {
  return { name: name + '!' };
});
promised.update(({ name }) => {
  return { name: name + '?' };
});
promised
  .value()
  .then(({ name }) => {
    console.log(name); // bouzuya!?
  });
```

## License

[MIT](LICENSE)

## Author

[bouzuya][user] <[m@bouzuya.net][email]> ([http://bouzuya.net][url])

[user]: https://github.com/bouzuya
[email]: mailto:m@bouzuya.net
[url]: http://bouzuya.net


text:
<?php

namespace DTS\eBaySDK\MerchantData\Types;

/**
 *
 * @property string $PictureName
 * @property \DTS\eBaySDK\MerchantData\Enums\PictureSetCodeType $PictureSet
 * @property \DTS\eBaySDK\MerchantData\Enums\PictureFormatCodeType $PictureFormat
 * @property string $FullURL
 * @property string $BaseURL
 * @property \DTS\eBaySDK\MerchantData\Types\PictureSetMemberType[] $PictureSetMember
 * @property string $ExternalPictureURL
 * @property \DateTime $UseByDate
 */
class SiteHostedPictureDetailsType extends \DTS\eBaySDK\Types\BaseType
{
    /**
     * @var array Properties belonging to objects of this class.
     */
    private static $propertyTypes = array(
        'PictureName' => array(
            'type' => 'string',
            'unbound' => false,
            'attribute' => false,
            'elementName' => 'PictureName'
        ),
        'PictureSet' => array(
            'type' => 'string',
            'unbound' => false,
            'attribute' => false,
            'elementName' => 'PictureSet'
        ),
        'PictureFormat' => array(
            'type' => 'string',
            'unbound' => false,
            'attribute' => false,
            'elementName' => 'PictureFormat'
        ),
        'FullURL' => array(
            'type' => 'string',
            'unbound' => false,
            'attribute' => false,
            'elementName' => 'FullURL'
        ),
        'BaseURL' => array(
            'type' => 'string',
            'unbound' => false,
            'attribute' => false,
            'elementName' => 'BaseURL'
        ),
        'PictureSetMember' => array(
            'type' => 'DTS\eBaySDK\MerchantData\Types\PictureSetMemberType',
            'unbound' => true,
            'attribute' => false,
            'elementName' => 'PictureSetMember'
        ),
        'ExternalPictureURL' => array(
            'type' => 'string',
            'unbound' => false,
            'attribute' => false,
            'elementName' => 'ExternalPictureURL'
        ),
        'UseByDate' => array(
            'type' => 'DateTime',
            'unbound' => false,
            'attribute' => false,
            'elementName' => 'UseByDate'
        )
    );

    /**
     * @param array $values Optional properties and values to assign to the object.
     */
    public function __construct(array $values = array())
    {
        list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);

        parent::__construct($parentValues);

        if (!array_key_exists(__CLASS__, self::$properties)) {
            self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
        }

        if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) {
            self::$xmlNamespaces[__CLASS__] = 'urn:ebay:apis:eBLBaseComponents';
        }

        $this->setValues(__CLASS__, $childValues);
    }
}


text:
Snapchat First Technical Interview. Front End Engineer Role

10 min Intro
20 min Resume Project Talk
  - Asked for detailed information on (Stack, challenges, decisions, etc..)
30 min on algorithm

// jQuery selector
// $(selector) => list[elements]
// selector:
// .class
// .class1.class2
// .class1 .class2 .class3.class4
// $('.class1.class2.class3') => returns elements

// Given a srtring (selector), Create a function that implements jQuery's hierarchy class selector

// dom: <elem class1 ><... > <elem class2>  <elem class3>     < >  <... ></elem>
// var selector = '.class1.class2.class3'

// Input: String
// Output: list of elments

var $ = function(selector) {
        // Enter code here
};


text:
<?php

namespace Oro\Bundle\ReminderBundle\Tests\Unit\Fixtures;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Oro\Bundle\ReminderBundle\Entity\RemindableInterface;
use Oro\Bundle\ReminderBundle\Model\ReminderData;
use Oro\Bundle\ReminderBundle\Model\ReminderDataInterface;

class RemindableEntity implements RemindableInterface
{
    /** @var ArrayCollection */
    protected $reminders;

    public function __construct()
    {
        $this->reminders = new ArrayCollection();
    }

    /**
     * @return Collection
     */
    public function getReminders()
    {
        return $this->reminders;
    }

    /**
     * @param Collection $reminders
     */
    public function setReminders(Collection $reminders)
    {
        $this->reminders = $reminders;
    }

    /**
     * @return ReminderDataInterface
     */
    public function getReminderData()
    {
        return new ReminderData();
    }
}