text:
set -o nounset # treat unset variables as an error and exit immediately.
set -o errexit # exit immediately when a command fails.
set -E         # needs to be set if we want the ERR trap

readonly CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
readonly TMP_DIR=$(mktemp -d)

source "${CURRENT_DIR}/ci/lib/utilities.sh" || { echo 'Cannot load CI utilities.'; exit 1; }

# Explicitly opt into go modules, even though we're inside a GOPATH directory
export GO111MODULE=on
# Explicitly clear GOFLAGS, since GOFLAGS=-mod=vendor breaks dependency resolution while rebuilding vendor
export GOFLAGS=
# Ensure sort order doesn't depend on locale
export LANG=C
export LC_ALL=C
# Detect problematic GOPROXY settings that prevent lookup of dependencies
if [[ "${GOPROXY:-}" == "off" ]]; then
  echo "Cannot run ./contrib/hack/update-vendor.sh with \$GOPROXY=off"
  exit 1
fi

golang::verify_go_version
require-jq

function group_replace_directives() {
  local local_tmp_dir
  local_tmp_dir=$(mktemp -d "${TMP_DIR}/group_replace.XXXX")
  local go_mod_replace="${local_tmp_dir}/go.mod.replace.tmp"
  local go_mod_noreplace="${local_tmp_dir}/go.mod.noreplace.tmp"
  # separate replace and non-replace directives
  awk "
     # print lines between 'replace (' ... ')' lines
     /^replace [(]/      { inreplace=1; next                   }
     inreplace && /^[)]/ { inreplace=0; next                   }
     inreplace           { print > \"${go_mod_replace}\"; next }

     # print ungrouped replace directives with the replace directive trimmed
     /^replace [^(]/ { sub(/^replace /,\"\"); print > \"${go_mod_replace}\"; next }

     # otherwise print to the noreplace file
     { print > \"${go_mod_noreplace}\" }
  " < go.mod
  {
    cat "${go_mod_noreplace}";
    echo "replace (";
    cat "${go_mod_replace}";
    echo ")";
  } > go.mod

  go mod edit -fmt
}

function add_generated_comments() {
  local local_tmp_dir
  local_tmp_dir=$(mktemp -d "${TMP_DIR}/add_generated_comments.XXXX")
  local go_mod_nocomments="${local_tmp_dir}/go.mod.nocomments.tmp"

  # drop comments before the module directive
  awk "
     BEGIN           { dropcomments=1 }
     /^module /      { dropcomments=0 }
     dropcomments && /^\/\// { next }
     { print }
  " < go.mod > "${go_mod_nocomments}"

  # Add the specified comments
  local comments="${1}"
  {
    echo "${comments}"
    echo ""
    cat "${go_mod_nocomments}"
   } > go.mod

  # Format
  go mod edit -fmt
}

shout "Phase 1: tidying and grouping replace directives"
# resolves/expands references in the root go.mod (if needed)
go mod tidy
# group replace directives
group_replace_directives

shout "Phase 2: adding generated comments"
add_generated_comments "
// This is a generated file. Do not edit directly.
// Run ./contrib/hack/pin-dependency.sh to change pinned dependency versions.
// Run ./contrib/hack/update-vendor.sh to update go.mod files and the vendor directory.
"

shout "Phase 3: rebuild vendor directory"
go mod vendor

# sort recorded packages for a given vendored dependency in modules.txt.
# `go mod vendor` outputs in imported order, which means slight go changes (or different platforms) can result in a differently ordered modules.txt.
# scan                 | prefix comment lines with the module name       | sort field 1  | strip leading text on comment lines
awk '{if($1=="#") print $2 " " $0; else print}' < vendor/modules.txt | sort -k1,1 -s | sed 's/.*#/#/' > "${TMP_DIR}/modules.txt.tmp"
mv "${TMP_DIR}/modules.txt.tmp" vendor/modules.txt


text:
__author__ = 'Dmitriy.Dakhnovskiy'

import itertools
from abc import ABCMeta, abstractmethod

class AbstractSourceParser:
    __metaclass__ = ABCMeta

    def __init__(self, source):
        """
        :param source: исходный код
        """

        self.__type_identificator_funcs = {
            'variable': self.__get_local_variables_from_functions,
            'function': self.__get_functions
        }

        self.__parse_source(source)

    @staticmethod
    @abstractmethod
    def _parse_source(source):
        """
        возвращает разобранный в структуру код
        :param source: исходный код
        """

    def __parse_source(self, source):
        """
        разбирает исходный код, резульат складывает в __parsed_source
        :param source: исходный код
        """
        self.__parsed_source = self._parse_source(source)

    @staticmethod
    @abstractmethod
    def _walk_element(element):
        """
        генератор по элементам переданного элемента
        :param element: элемент разобранной структуры
        """

    def __walk_parsed_source(self):
        """
        генератор по элементам разобранной структуры
        """
        if self.__parsed_source:
            for element in self._walk_element(self.__parsed_source):
                yield element

    @staticmethod
    @abstractmethod
    def _is_variable(element):
        """
        проаверяет является ли элемент структуры переменной
        :param element: элемент
        """

    @staticmethod
    @abstractmethod
    def _is_function(element):
        """
        проаверяет является ли элемент структуры функцией
        :param element: элемент
        """

    def __get_functions(self):
        """
        Генератор по функциям
        """
        for element in self.__walk_parsed_source():
            if self._is_function(element):
                yield element

    def __get_local_variables_from_function(self, function):
        """
        генератор по переменным объявленным внутри функции
        :param function: функция(ast объект)
        """
        for element in self._walk_element(function):
            if self._is_variable(element):
                yield element

    def __get_local_variables_from_functions(self):
        """
        генератор по локальным переменным функций
        """

        # TODO из-за повторного обхода вложенныъ функций приходится выбирать уникальные. Подумать над проблемой
        set_variables = set()
        for function in self.__get_functions():
            for variable in self.__get_local_variables_from_function(function):
                set_variables.add(variable)

        yield from set_variables

    @staticmethod
    @abstractmethod
    def _get_words_from_identificator(identificator):
        """
        получить слова из идентификатора
        :param identificator: идентификатор
        """

    @staticmethod
    @abstractmethod
    def _get_element_name(element):
        """
        получить наименование(идентификатор) элемента разобранной структуры
        :param element: элемент структуры
        """

    def __get_identificators(self, types_identificators):
        """
        генератор по идентификаторам с заданным типом
        :param types_identificators: список типов идентификаторов
        """
        gens = [self.__type_identificator_funcs[types_identificator]() for types_identificator in types_identificators]
        elements = itertools.chain(*gens)
        yield from (self._get_element_name(element) for element in elements)

    def get_words(self, types_identificators):
        """
        генератор по словам идентификаторов с заданным типом
        :param types_identificators: список типов идентификаторов
        """
        assert set(types_identificators).issubset(set(self.__type_identificator_funcs.keys())), \
            'types_identificators must be subset ({0})'.format(', '.join(self.__type_identificator_funcs.keys()))

        for identificator in self.__get_identificators(types_identificators):
            yield from self._get_words_from_identificator(identificator)

redpajama_set_name: RedPajamaGithub


text: Worktracker can be used for recording and calculating work hours and pay.


text:
import abc
import logging
import math

import numpy as np

from . import LoopState

_log = logging.getLogger(__name__)

class StoppingCondition(abc.ABC):
    """Chooses whether to stop the optimization based on the loop state"""

    def __and__(self, other: "StoppingCondition") -> "And":
        """
        Overloads self & other
        """
        return And(self, other)

    def __or__(self, other: "StoppingCondition") -> "Or":
        """
        Overloads self | other
        """
        return Or(self, other)

    @abc.abstractmethod
    def should_stop(self, loop_state: LoopState) -> bool:
        """
        :param loop_state: Object that contains current state of the loop
        :return: Whether to stop collecting new data
        """
        pass

class And(StoppingCondition):
    """
    Logical AND of two stopping conditions
    """

    def __init__(self, left: StoppingCondition, right: StoppingCondition):
        """
        :param left: One stopping condition in AND
        :param right: Another stopping condition in AND
        """
        self.left = left
        self.right = right

    def should_stop(self, loop_state: LoopState) -> bool:
        """
        Evaluate logical AND of two stopping conditions

        :param loop_state: Object that contains current state of the loop
        :return: Whether to stop collecting new data
        """
        return self.left.should_stop(loop_state) and self.right.should_stop(loop_state)

class Or(StoppingCondition):
    """
    Logical OR of two stopping conditions
    """

    def __init__(self, left: StoppingCondition, right: StoppingCondition):
        """
        :param left: One stopping condition in OR
        :param right: Another stopping condition in OR
        """
        self.left = left
        self.right = right

    def should_stop(self, loop_state: LoopState) -> bool:
        """
        Evaluate logical OR of two stopping conditions

        :param loop_state: Object that contains current state of the loop
        :return: Whether to stop collecting new data
        """
        return self.left.should_stop(loop_state) or self.right.should_stop(loop_state)

class FixedIterationsStoppingCondition(StoppingCondition):
    """Stops after a fixed number of iterations"""

    def __init__(self, i_max: int) -> None:
        """
        :param i_max: Maximum number of function
            observations within the loop, excluding initial points
        """
        self.i_max = i_max

    def should_stop(self, loop_state: LoopState) -> bool:
        """
        :param loop_state: Object that contains current state of the loop
        :return: True if maximum number of iterations has been reached
        """
        should_stop = loop_state.iteration >= self.i_max
        if should_stop is True:
            _log.info("Stopped after {} evaluations".format(self.i_max))
        return should_stop

class ConvergenceStoppingCondition(StoppingCondition):
    """Stops once we choose a point within eps of a previous
    point (with respect to euclidean norm). Close evaluations
    can suggest convergence of the optimization for problems
    with low observation noise.
    """

    def __init__(self, eps: float) -> None:
        """
        :param eps: minimum distance between
        two consecutive x's to keep running the model
        """
        self.eps = eps

    def should_stop(self, loop_state: LoopState) -> bool:
        """
        :param loop_state: Object that contains current state of the loop
        :return: True if the euclidean distance between the last two evaluations
                    is smaller than the specified eps.
        """
        if loop_state.iteration < 2:
            # less than 2 evaluations so cannot calculate distance
            return False
        should_stop = np.linalg.norm(loop_state.X[-1, :] - loop_state.X[-2, :]).item() <= self.eps
        if should_stop is True:
            _log.info("Stopped as consecutive evaluations are within {}".format(self.eps))
        return should_stop


text:
$TEAMCITY_HOME = $env:TEAMCITY_HOME

$serverlist = Get-Content $TEAMCITY_HOME\scripts\server_list.txt

foreach ($server in $serverlist) {
	.\import.cmd $server
}


text:
#ifndef SkMaskFilter_DEFINED
#define SkMaskFilter_DEFINED

#include "SkFlattenable.h"
#include "SkMask.h"
#include "SkPaint.h"

class GrContext;
class GrPaint;
class SkBitmap;
class SkBlitter;
class SkBounder;
class SkMatrix;
class SkPath;
class SkRasterClip;
class SkRRect;
class SkStrokeRec;

/** \class SkMaskFilter

    SkMaskFilter is the base class for object that perform transformations on
    an alpha-channel mask before drawing it. A subclass of SkMaskFilter may be
    installed into a SkPaint. Once there, each time a primitive is drawn, it
    is first scan converted into a SkMask::kA8_Format mask, and handed to the
    filter, calling its filterMask() method. If this returns true, then the
    new mask is used to render into the device.

    Blur and emboss are implemented as subclasses of SkMaskFilter.
*/
class SK_API SkMaskFilter : public SkFlattenable {
public:
    SK_DECLARE_INST_COUNT(SkMaskFilter)

    /** Returns the format of the resulting mask that this subclass will return
        when its filterMask() method is called.
    */
    virtual SkMask::Format getFormat() const = 0;

    /** Create a new mask by filter the src mask.
        If src.fImage == null, then do not allocate or create the dst image
        but do fill out the other fields in dstMask.
        If you do allocate a dst image, use SkMask::AllocImage()
        If this returns false, dst mask is ignored.
        @param  dst the result of the filter. If src.fImage == null, dst should not allocate its image
        @param src the original image to be filtered.
        @param matrix the CTM
        @param margin   if not null, return the buffer dx/dy need when calculating the effect. Used when
                        drawing a clipped object to know how much larger to allocate the src before
                        applying the filter. If returning false, ignore this parameter.
        @return true if the dst mask was correctly created.
    */
    virtual bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix&,
                            SkIPoint* margin) const;

#if SK_SUPPORT_GPU
    /**
     *  Returns true if the filter can be expressed a single-pass GrEffect without requiring an
     *  explicit input mask. Per-pixel, the effect receives the incoming mask's coverage as
     *  the input color and outputs the filtered covereage value. This means that each pixel's
     *  filtered coverage must only depend on the unfiltered mask value for that pixel and not on
     *  surrounding values.
     *
     * If effect is non-NULL, a new GrEffect instance is stored in it. The caller assumes ownership
     * of the effect and must unref it.
     */
    virtual bool asNewEffect(GrEffectRef** effect,
                             GrTexture*,
                             const SkMatrix& ctm) const;

    /**
     *  If asNewEffect() fails the filter may be implemented on the GPU by a subclass overriding
     *  filterMaskGPU (declared below). That code path requires constructing a src mask as input.
     *  Since that is a potentially expensive operation, the subclass must also override this
     *  function to indicate whether filterTextureMaskGPU would succeeed if the mask were to be
     *  created.
     *
     *  'maskRect' returns the device space portion of the mask that the filter needs. The mask
     *  passed into 'filterMaskGPU' should have the same extent as 'maskRect' but be translated
     *  to the upper-left corner of the mask (i.e., (maskRect.fLeft, maskRect.fTop) appears at
     *  (0, 0) in the mask).
     */
    virtual bool canFilterMaskGPU(const SkRect& devBounds,
                                  const SkIRect& clipBounds,
                                  const SkMatrix& ctm,
                                  SkRect* maskRect) const;

    /**
     *  Try to directly render the mask filter into the target.  Returns
     *  true if drawing was successful.
     */
    virtual bool directFilterMaskGPU(GrContext* context,
                                     GrPaint* grp,
                                     const SkStrokeRec& strokeRec,
                                     const SkPath& path) const;
    /**
     *  Try to directly render a rounded rect mask filter into the target.  Returns
     *  true if drawing was successful.
     */
    virtual bool directFilterRRectMaskGPU(GrContext* context,
                                          GrPaint* grp,
                                          const SkStrokeRec& strokeRec,
                                          const SkRRect& rrect) const;

    /**
     * This function is used to implement filters that require an explicit src mask. It should only
     * be called if canFilterMaskGPU returned true and the maskRect param should be the output from
     * that call. canOverwriteSrc indicates whether the implementation may treat src as a scratch
     * texture and overwrite its contents. When true it is also legal to return src as the result.
     * Implementations are free to get the GrContext from the src texture in order to create
     * additional textures and perform multiple passes.
     */
    virtual bool filterMaskGPU(GrTexture* src,
                               const SkMatrix& ctm,
                               const SkRect& maskRect,
                               GrTexture** result,
                               bool canOverwriteSrc) const;
#endif

    /**
     * The fast bounds function is used to enable the paint to be culled early
     * in the drawing pipeline. This function accepts the current bounds of the
     * paint as its src param and the filter adjust those bounds using its
     * current mask and returns the result using the dest param. Callers are
     * allowed to provide the same struct for both src and dest so each
     * implementation must accomodate that behavior.
     *
     *  The default impl calls filterMask with the src mask having no image,
     *  but subclasses may override this if they can compute the rect faster.
     */
    virtual void computeFastBounds(const SkRect& src, SkRect* dest) const;

    SK_TO_STRING_PUREVIRT()
    SK_DEFINE_FLATTENABLE_TYPE(SkMaskFilter)

protected:
    SkMaskFilter() {}
    // empty for now, but lets get our subclass to remember to init us for the future
    SkMaskFilter(SkReadBuffer& buffer) : INHERITED(buffer) {}

    enum FilterReturn {
        kFalse_FilterReturn,
        kTrue_FilterReturn,
        kUnimplemented_FilterReturn
    };

    struct NinePatch {
        SkMask      fMask;      // fBounds must have [0,0] in its top-left
        SkIRect     fOuterRect; // width/height must be >= fMask.fBounds'
        SkIPoint    fCenter;    // identifies center row/col for stretching
    };

    /**
     *  Override if your subclass can filter a rect, and return the answer as
     *  a ninepatch mask to be stretched over the returned outerRect. On success
     *  return kTrue_FilterReturn. On failure (e.g. out of memory) return
     *  kFalse_FilterReturn. If the normal filterMask() entry-point should be
     *  called (the default) return kUnimplemented_FilterReturn.
     *
     *  By convention, the caller will take the center rol/col from the returned
     *  mask as the slice it can replicate horizontally and vertically as we
     *  stretch the mask to fit inside outerRect. It is an error for outerRect
     *  to be smaller than the mask's bounds. This would imply that the width
     *  and height of the mask should be odd. This is not required, just that
     *  the caller will call mask.fBounds.centerX() and centerY() to find the
     *  strips that will be replicated.
     */
    virtual FilterReturn filterRectsToNine(const SkRect[], int count,
                                           const SkMatrix&,
                                           const SkIRect& clipBounds,
                                           NinePatch*) const;
    /**
     *  Similar to filterRectsToNine, except it performs the work on a round rect.
     */
    virtual FilterReturn filterRRectToNine(const SkRRect&, const SkMatrix&,
                                           const SkIRect& clipBounds,
                                           NinePatch*) const;

private:
    friend class SkDraw;

    /** Helper method that, given a path in device space, will rasterize it into a kA8_Format mask
     and then call filterMask(). If this returns true, the specified blitter will be called
     to render that mask. Returns false if filterMask() returned false.
     This method is not exported to java.
     */
    bool filterPath(const SkPath& devPath, const SkMatrix& devMatrix,
                    const SkRasterClip&, SkBounder*, SkBlitter* blitter,
                    SkPaint::Style style) const;

    /** Helper method that, given a roundRect in device space, will rasterize it into a kA8_Format
     mask and then call filterMask(). If this returns true, the specified blitter will be called
     to render that mask. Returns false if filterMask() returned false.
     */
    bool filterRRect(const SkRRect& devRRect, const SkMatrix& devMatrix,
                     const SkRasterClip&, SkBounder*, SkBlitter* blitter,
                     SkPaint::Style style) const;

    typedef SkFlattenable INHERITED;
};

#endif


text:
package edu.toronto.cs.sgbhadoop.hadoop220;

import java.io.File;
import java.io.IOException;
import java.util.TreeSet;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.LocalJobRunner;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.MultipleOutputs;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.hadoop.util.GenericOptionsParser;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;

import edu.toronto.cs.sgbhadoop.sortedpackage.Sig;
import edu.toronto.cs.sgbhadoop.util.GeneralUtil;
import edu.toronto.cs.sgbhadoop.util.Timer;

/**
 * Map-focused Hadoop job for computing FWBW, reduce only sorts (in parallel if avail). Flips stmts back and forth and aggregates over a stream of key, emitting the 'join' afterwards.
 */
public class BisimFWBW {
	public static final boolean flagDebug = false;
	//	private final boolean flagfw = false;
	//	private final boolean flagbw = false;
	public static boolean flagInFWModeofFWBW = true;
	public static final boolean flagValidateIRIs = false;

	private static final String fileextgz = ""; // .gz for zip, .bz2 for bzip2, empty for uncompressed
	private static final String fileext = ""; // .gz for zip, .bz2 for bzip2, empty for uncompressed

	private static final String MAPOUT_FILE = "file" + fileext;

	private static final String SORTED_FILE = "filesorted" + fileext;

	private static final String NODES_FILE = "nodes" + fileextgz;

	private static final String EXTENTS_FILE = "extents" + fileextgz;

	private static final String GRAPH_FILE = "graph" + fileextgz;

	private static final String FINAL_FILE = "final" + fileext;

	/**
	 * Mapper used for initializing a dataset for iterative computation
	 *
	 */
	public static class FWBWMapperInitialization extends Mapper<Object, Text, Text, Text> {

		String[] parse;
		private int outnum;

		final Text emptyText = new Text();

		Timer t;

		@Override
		protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException {
			t = new Timer("initializationmapper-" + context.getTaskAttemptID(), true);
		}

		@Override
		protected void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException {
			System.out.println("outnum final:" + outnum);
			System.out.println(t.stop());
		}

		final Text zeroline = new Text();
		final Text oneline = new Text();

		@Override
		protected void map(Object key, Text value, org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException {

			parse = value.toString().split("\t| ");

			if (parse.length != 3 && parse.length != 4 && parse.length != 5) {
				//				logger.finest("skipping line (not at least a triple):" + line);
				// require at least a triple
				return;
			}

			//			// check that it is a valid nt statement
			//			if (parse[parse.length - 1].charAt(0) != '.') {
			//				//				continue;
			//			}

			final String s;
			final String p;
			final String o;

			s = parse[0];
			p = parse[1];
			o = parse[2];

			if (o.charAt(0) != '<' || s.charAt(0) != '<' || p.charAt(0) != '<') {
				// ignore statements with literals, and check that it is somewhat well-formed
				return;
			}

			final String blockidentifier;

			if (parse.length == 3) {
				// assign an initial block identifier
				blockidentifier = "0";
			} else if (parse.length == 4 && parse[3].equals(".")) {
				// assign an initial block identifier
				blockidentifier = "0";
			} else {
				blockidentifier = parse[3];
			}

			final String lastpart = " " + p + " " + blockidentifier + " ";

			//			Text t1 = new Text(s + ". ");
			//			context.write(t1, new Text("n00"));
			//			Text t2 = new Text(o + ". ");
			//			context.write(t2, new Text("n00"));
			zeroline.set(s + "0" + lastpart + o + " .");
			oneline.set(o + "1" + lastpart + s + " .");
			//			}

			context.write(zeroline, emptyText);
			context.write(oneline, emptyText);
			outnum++;

			if (outnum % 1000000 == 0) {
				System.out.println("timer:" + t);
				System.out.println("num of lines:" + outnum);
			}
		}
	}

	/**
	 * Reducer used for sorting
	 *
	 */
	public static class IdentityReducerTask extends Reducer<Text, Text, Text, Text> {
		private MultipleOutputs<Text, Text> multipleOutputs;

		@Override
		protected void setup(Context context) throws IOException, InterruptedException {
			multipleOutputs = new MultipleOutputs<Text, Text>(context);
		}

		@Override
		protected void cleanup(Context context) throws IOException, InterruptedException {
			multipleOutputs.close();
		}

		final Text emptyText = new Text();
		final Text keyText = new Text();
		final Text valText = new Text();
		String bid = "";

		@Override
		public void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
			if (key.toString().startsWith("null") || key.toString().equals("-")) {
				if (flagDebug)
					System.err.println("key is null in identity reducer task.");
				return;
			}
			//			String oldblockid = "";
			//			String newblockid = "";
			bid = "";
			for (Text val : values) {
				// write node blockids into the stream only once
				if (val.toString().startsWith("n1")) {
					bid = val.toString().substring(2);
					if (bid.length() > 0) {
						keyText.set(key.toString() + bid + " .");
						context.write(keyText, emptyText);
						multipleOutputs.write(keyText, emptyText, context.getConfiguration().get("vssp.output") + File.separatorChar + "nodes" + File.separatorChar + "nodes");
					} else {
						System.err.println("BID length is zero in reduce!");
					}
					//					if (val.toString().startsWith("n0")) {
					//						oldblockid = key.toString() + bid + " .";
					//						//						if (flagDebug) {
					//						//							System.err.println("oldblockid:" + bid);
					//						//						}
					//					} else if (val.toString().startsWith("n1")) {
					//						newblockid = key.toString() + bid + " .";
					//						//						if (flagDebug) {
					//						//							System.err.println("newblockid:" + bid);
					//						//						}
					continue;
					//					}
				} else {
					context.write(key, val);
				}

			}

			//
			//			if (newblockid.length() > 0) {
			//				if (flagDebug) {
			//					System.err.println("wrote newblockid:" + newblockid);
			//				}
			//				if (newblockid.contains("null")) {
			//					System.err.println("newblockid contains null");
			//				}
			//				context.write(new Text(newblockid), emptyText);
			//				multipleOutputs.write(new Text(newblockid), emptyText, context.getConfiguration().get("vssp.output") + File.separatorChar + "nodes" + File.separatorChar + "nodes");
			//			} else if (oldblockid.length() > 0) {
			//				if (flagDebug) {
			//					System.err.println("wrote oldblockid:" + oldblockid);
			//				}
			//				if (oldblockid.contains("null")) {
			//					System.err.println("oldblockid contains null");
			//				}
			//				context.write(new Text(oldblockid), emptyText);
			//				multipleOutputs.write(new Text(oldblockid), emptyText, context.getConfiguration().get("vssp.output") + File.separatorChar + "nodes" + File.separatorChar + "nodes");
			//			}
		}
	}

	/**
	 * Mapper to compute new ids
	 *
	 */
	public static class FWBWBisimMapperTask extends Mapper<Object, Text, Text, Text> {
		//		private MultipleOutputs<Text, Text> multipleOutputs;

		String currKeyParse;
		String prevKey = "-";
		String currentKey = "-";
		boolean pkdone = false;
		boolean ckdone = false;

		// will generate ID using a rolling hash signature
		String sig = "";

		String newblockid = null;
		String bid = null;
		String pbid = null;
		String nodeblockid = null;
		String prevnodeblockid = null;

		String s, p, o;

		final TreeSet<Sig> tsFW = new TreeSet<Sig>();

		final Text emptyText = new Text();
		final Text mapOutKeyText = new Text();

		@Override
		public void map(Object key, Text value, Context context) throws IOException, InterruptedException {
			if (context.getConfiguration().getInt("vssp.iteration", 0) % 2 == 1) {
				flagInFWModeofFWBW = true;
			} else {
				flagInFWModeofFWBW = false;
			}

			currentKey = "-";
			// key is not used
			// value contains the line

			if (flagDebug) {
				System.out.println("value:" + value);
			}

			//			String fileName = ((FileSplit) context.getInputSplit()).getPath().getName();
			//			if (fileName.contains("nodes")) {
			//				String parse[] = value.toString().split("\t| ");
			//				String bid = parse[1];
			//				String ckey = parse[0] + " ";
			//				System.out.println("ckey:" + ckey);
			//				if (ckey.contains("-")) {
			//					System.err.println("here");
			//				}
			//				if (!bid.equals("0") && bid.length() != 32) {
			//					System.err.println("something wrong with bid pickup");
			//				}
			//				context.write(new Text(ckey), new Text("n0" + bid));
			//				return;
			//			}

			// parse the line from the value
			String parse[] = value.toString().split("\t| ");

			// check that it is the correct length
			if ((parse.length != 5 && parse.length != 3) || parse[parse.length - 1].charAt(0) != '.') {
				System.err.println("Length != 5 encountered in reduce!:" + value);
				return;
			}

			currKeyParse = parse[0];

			currentKey = currKeyParse.substring(0, currKeyParse.length() - 1);

			char lchar = currKeyParse.charAt(currKeyParse.length() - 1);
			if (lchar == '.') {
				if (nodeblockid != null) {
					prevnodeblockid = nodeblockid;
				}
				nodeblockid = parse[1];
				if (flagDebug) {
					System.out.println("nodeblockid:" + currentKey + "," + nodeblockid);
				}
				return;
			}
			if (lchar != '0' && lchar != '1') {
				System.err.println("lchar is not 0 or 1!!");
				return;
			}

			s = currentKey;
			p = parse[1];
			o = parse[3];
			bid = parse[2];

			// initialization and state update
			if (prevKey.equals("-")) {
				prevKey = currentKey;
			}

			if (prevKey.equals(currentKey)) {
				ckdone = pkdone;
			}

			if (!prevKey.equals(currentKey) && !pkdone) {
				if (flagDebug)
					System.out.println("CASEB");
				String oldblockid = computeId(prevKey, tsFW, prevnodeblockid);
				//				System.err.println("sending n1:" + prevKey + "," + oldblockid);
				context.write(new Text(prevKey + ". "), new Text("n1" + oldblockid));

				//				multipleOutputs.write(new Text(prevKey), new Text(oldblockid), context.getConfiguration().get("vssp.output") + File.separatorChar + "nodes" + File.separatorChar + "nodes");
				pkdone = true;
			}

			// line 2-5
			if (lchar == '0') {
				// in collection phase
				Sig sig;
				if (flagInFWModeofFWBW) {
					sig = new Sig(p, bid);
				} else {
					sig = new Sig("-" + p, bid);
				}

				if (!tsFW.contains(sig)) {
					tsFW.add(sig);
				}
			}

			if (lchar == '1' && !ckdone) {
				// the current key can be id-ed
				if (flagDebug)
					System.out.println("CASEA");
				newblockid = computeId(currentKey, tsFW, nodeblockid);
				//				System.err.println("sending n1:" + currentKey + "," + newblockid);
				context.write(new Text(currentKey + ". "), new Text("n1" + newblockid));

				//				multipleOutputs.write(new Text(currentKey), new Text(newblockid), context.getConfiguration().get("vssp.output") + File.separatorChar + "nodes" + File.separatorChar + "nodes");
				ckdone = true;
			}

			// line 8-11
			if (lchar == '1') {

				// remem that '1' category has stmts of the form (s,-p,o)
				//				mapOutKeyText.set(s + "0" + lastPart + s + " .");
				mapOutKeyText.set(s + "0" + " " + p + " " + bid + " " + o + " .");
				context.write(mapOutKeyText, emptyText);

				mapOutKeyText.set(o + "1" + " " + p + " " + newblockid + " " + s + " .");
				context.write(mapOutKeyText, emptyText);
			}

			// update history
			prevKey = currentKey;
			pkdone = ckdone;
			ckdone = false;
			pbid = bid;

		}

		@Override
		protected void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException {
			// capture the last node
			if (!pkdone && !prevKey.equals("-")) {
				if (flagDebug)
					System.out.println("CASEC");
				newblockid = computeId(prevKey, tsFW, prevnodeblockid);
				//				System.err.println("sending n1:" + prevKey + "," + newblockid);
				context.write(new Text(prevKey + ". "), new Text("n1" + newblockid));

				//				multipleOutputs.write(new Text(prevKey), new Text(newblockid), context.getConfiguration().get("vssp.output") + File.separatorChar + "nodes" + File.separatorChar + "nodes");
			}

			//			multipleOutputs.close();
		}

		//		@SuppressWarnings("unchecked")
		//		@Override
		//		protected void setup(org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException, InterruptedException {
		//			multipleOutputs = new MultipleOutputs<Text, Text>(context);
		//		}

		private String computeId(String currentKey, final TreeSet<Sig> tsFW, String prevbid) {
			if (prevbid == null) {
				prevbid = "0";
			}
			String newblockid;
			if (flagDebug) {
				System.out.println("---- computeId --");
				System.out.println("currentKey:" + currentKey);
				System.out.println("prevbid:" + prevbid);
				System.out.println("hashing: " + prevbid + tsFW.toString());
				System.out.println("ts:" + tsFW);
			}
			//			newblockid = hash(tsFW.toString());
			newblockid = GeneralUtil.getMD5(prevbid + tsFW.toString());
			if (flagDebug) {
				System.out.println("computId:" + currentKey + "," + newblockid);
				System.out.println();
			}
			tsFW.clear();
			return newblockid;
		}

	}

	// app config
	private static boolean flagDoCompress = true;

	private static Job createInitJob(Configuration conf, String inPath, String outPath) throws IOException, InterruptedException, ClassNotFoundException {

		//		conf.set("mapreduce.local.map.tasks.maximum", "4");
		//		conf.set("mapreduce.tasktracker.map.tasks.maximum", "3");

		// mapreduce.input.fileinputformat.split.maxsize
		// mapreduce.input.fileinputformat.split.minsize

		FileSystem fs = FileSystem.get(conf);

		Job job = new Job(conf, "BisimFWBW-initialization");
		job.setJarByClass(BisimFWBW.class);

		if (flagDoCompress) {
			FileOutputFormat.setCompressOutput(job, true);
			//			FileOutputFormat.setOutputCompressorClass(job, org.apache.hadoop.io.compress.BZip2Codec.class);
			//						FileOutputFormat.setOutputCompressorClass(job, org.apache.hadoop.io.compress.GzipCodec.class);
			//			FileOutputFormat.setOutputCompressorClass(job, nl.basjes.hadoop.io.compress.SplittableGzipCodec.class);
		}

		//		conf.set("mapred.local.map.tasks.maximum", "4");
		System.out.println("setting local max running maps:" + conf.getInt("vssp.nummaps", 1));
		LocalJobRunner.setLocalMaxRunningMaps(job, conf.getInt("vssp.nummaps", 1));
		job.setNumReduceTasks(1);

		job.setMapperClass(FWBWMapperInitialization.class);
		job.setMapOutputKeyClass(Text.class);
		job.setMapOutputValueClass(Text.class);

		//		job.setMapOutputKeyClass(MyCompoundKey.class);
		//		job.setSortComparatorClass(MyCompoundKeyComparator.class);
		//		job.setPartitionerClass(MyCompoundKeyPartitioner.class);
		//		job.setGroupingComparatorClass(MyCompoundKeyGroupingComparator.class);

		// used to sort
		job.setReducerClass(IdentityReducerTask.class);
		job.setOutputKeyClass(Text.class);
		job.setOutputValueClass(Text.class);

		// requires an external index
		//		job.setPartitionerClass(TotalOrderPartitioner.class);

		FileInputFormat.addInputPath(job, new Path(inPath));
		FileOutputFormat.setOutputPath(job, new Path(outPath));

		job.setInputFormatClass(TextInputFormat.class);
		job.setOutputFormatClass(TextOutputFormat.class);

		MultipleOutputs.setCountersEnabled(job, true);

		// true stands for recursively deleting the folder you gave
		fs.delete(new Path(outPath), true);

		return job;
	}

	private static Configuration applyCustomConfSettings(Configuration conf, String outPath, int iteration) {
		conf.set("io.compression.codecs", "org.apache.hadoop.io.compress.DefaultCodec,nl.basjes.hadoop.io.compress.SplittableGzipCodec,org.apache.hadoop.io.compress.BZip2Codec");

		conf.setInt("vssp.iteration", iteration);
		conf.set("vssp.output", outPath);

		// lmdb - uncompressed - for 8 threads
		//		conf.set("mapreduce.input.fileinputformat.split.minsize", 50000000 + "");
		//		conf.set("mapreduce.input.fileinputformat.split.maxsize", 50000000 + "");

		// lmdb - uncompressed
		//				conf.set("mapreduce.input.fileinputformat.split.minsize", "200000000");
		//				conf.set("mapreduce.input.fileinputformat.split.maxsize", "300000000");

		// lmdb - compressed
		conf.set("mapreduce.input.fileinputformat.split.minsize", "1000000");
		conf.set("mapreduce.input.fileinputformat.split.maxsize", "3000000");
		// dbpedia
		//		conf.set("mapreduce.input.fileinputformat.split.minsize", "900000000");
		//		conf.set("mapreduce.input.fileinputformat.split.maxsize", "1000000000");
		conf.set("mapreduce.task.io.sort.mb", "300");

		//		conf.set("java.io.tmpdir", "c:/htmp");
		//		conf.set("mapreduce.task.tmp.dir", "c:/htmp");
		//		conf.set("hadoop.tmp.dir", "c:/htmp");
		// following don't work
		//		conf.set("mapreduce.job.local.dir", "c:/htmp");
		//		conf.set("mapreduce.task.tmp.dir", "c:/htmp");

		if (flagDoCompress) {
			conf.set("mapred.compress.map.output", "true");
			conf.set("mapreduce.map.output.compress", "true");
		}
		return conf;
	}

	private static Job createTaskJob(Configuration conf, String inPath, String outPath) throws IOException, InterruptedException, ClassNotFoundException {

		Job job = new Job(conf, "BisimFWBW");
		job.setJarByClass(BisimFWBW.class);

		job.setMapperClass(FWBWBisimMapperTask.class);
		job.setMapOutputKeyClass(Text.class);
		job.setMapOutputValueClass(Text.class);

		//		job.setMapOutputKeyClass(MyCompoundKey.class);
		//		job.setMapOutputValueClass(WritablePair.class);

		// Note: the combiner cannot be used since it cannot return distinct values across parallel tasks
		//job.setCombinerClass(UpdateReducer.class);

		//		job.setSortComparatorClass(MyCompoundKeyComparator.class);
		//		job.setPartitionerClass(MyCompoundKeyPartitioner.class);
		//		job.setGroupingComparatorClass(MyCompoundKeyGroupingComparator.class);

		// used to sort
		job.setReducerClass(IdentityReducerTask.class);
		job.setOutputKeyClass(Text.class);
		job.setOutputValueClass(Text.class);

		//		conf.set("mapred.local.map.tasks.maximum", "4");
		System.out.println("setting local max running maps:" + conf.getInt("vssp.nummaps", 1));
		LocalJobRunner.setLocalMaxRunningMaps(job, conf.getInt("vssp.nummaps", 1));
		job.setNumReduceTasks(1);

		FileInputFormat.addInputPath(job, new Path(inPath));
		//		FileInputFormat.addInputPath(job, new Path(conf.get("vssp.noderestorepath") + File.separatorChar + "nodes" + "*.gz")); // + File.separatorChar + "nodes"
		FileOutputFormat.setOutputPath(job, new Path(outPath));

		if (flagDoCompress) {
			FileOutputFormat.setCompressOutput(job, true);
			//			FileOutputFormat.setOutputCompressorClass(job, org.apache.hadoop.io.compress.BZip2Codec.class);
			//			FileOutputFormat.setOutputCompressorClass(job, org.apache.hadoop.io.compress.GzipCodec.class);
			//			FileOutputFormat.setOutputCompressorClass(job, nl.basjes.hadoop.io.compress.SplittableGzipCodec.class);
		}

		// should always be split key/value reader otherwise keys may be left in other splits
		job.setInputFormatClass(SplitKeyValueInputFormat.class);
		job.setOutputFormatClass(TextOutputFormat.class);

		MultipleOutputs.setCountersEnabled(job, true);

		return job;
	}

	public static void main(String[] args) throws Exception {
		Logger.getRootLogger().setLevel(Level.INFO);

		Timer t = new Timer("fulljob", true);
		Configuration conf = new Configuration();

		if (System.getProperty("vssp.nummaps") == null) {
			System.setProperty("vssp.nummaps", "4");
		}
		System.out.println("vssp.nummaps:" + System.getProperty("vssp.nummaps"));
		System.out.println("conf.tmp:" + System.getProperty("hadoop.tmp.dir"));
		conf.set("hadoop.tmp.dir", System.getProperty("hadoop.tmp.dir"));
		conf.setInt("vssp.nummaps", Integer.parseInt(System.getProperty("vssp.nummaps")));

		String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
		if (otherArgs.length != 2) {
			System.err.println("Usage: BisimFWBW <in> <out>");
			System.exit(2);
		}

		String inPath = otherArgs[0];
		String outPath = otherArgs[1];

		FileSystem fs = FileSystem.get(conf);

		int fnum = 0;
		Timer t1 = new Timer("init", true);
		fs.delete(new Path(outPath + "-" + fnum), true);
		applyCustomConfSettings(conf, outPath + "-" + fnum, fnum);
		Job job = createInitJob(conf, inPath, outPath + "-" + fnum + File.separatorChar + "graph");
		job.waitForCompletion(true);
		System.out.println(t1.stop());

		//		System.exit(job.waitForCompletion(true) ? 0 : 1);

		long countold = 1;
		long countnew = -1;
		// won't work because initialization does not produce distinct nodes, just sorted statements
		//		long countold = runCountJob(outPath + "-" + fnum + File.separatorChar + "nodes", outPath + "-" + fnum + File.separatorChar + "count");
		int countequalscount = 0;
		while (countequalscount != 3) {
			if (fnum > 2) {
				fs.delete(new Path(outPath + "-" + (fnum - 2)), true);
				fs.delete(new Path(conf.get("hadoop.tmp.dir")), true);
			}

			String f1 = outPath + "-" + fnum + File.separatorChar + "graph";
			String noderestorepath = outPath + "-" + fnum + File.separatorChar + "nodes"; // + File.separatorChar + "nodes"

			fnum++;
			String f2 = outPath + "-" + fnum;

			Timer t2 = new Timer("iter-" + fnum, true);
			applyCustomConfSettings(conf, outPath + "-" + fnum, fnum);
			conf.set("vssp.noderestorepath", noderestorepath);

			// true stands for recursively deleting the folder you gave
			fs.delete(new Path(outPath + "-" + fnum), true);

			Job jobInner = createTaskJob(conf, f1, f2 + File.separatorChar + "graph");
			jobInner.waitForCompletion(true);
			System.out.println(t2.stop());

			Timer t3 = new Timer("count-" + fnum, true);
			countold = countnew;
			countnew = runCountJob(f2 + File.separatorChar + "nodes", f2 + File.separatorChar + "count");
			if (countold == countnew) {
				countequalscount++;
			} else {
				countequalscount = 0;
			}
			System.out.println(t3.stop());
			System.err.println("counter:" + countnew);
		}

		System.out.println(t.stop());
	}

	private static long runCountJob(String inPath, String outPath) throws IllegalArgumentException, IOException, InterruptedException, ClassNotFoundException {
		Configuration conf = new Configuration();
		Job job = new Job(conf, "distinct block count");
		job.setJarByClass(CounterJob.class);
		job.setMapperClass(CounterJob.TokenizerMapper.class);
		job.setCombinerClass(CounterJob.IntSumReducer.class);
		job.setReducerClass(CounterJob.IntSumReducer.class);
		job.setOutputKeyClass(Text.class);
		job.setOutputValueClass(IntWritable.class);
		FileInputFormat.addInputPath(job, new Path(inPath));
		FileOutputFormat.setOutputPath(job, new Path(outPath));
		job.waitForCompletion(true);
		// this counter is affected by the use of the combiner
		//		return job.getCounters().findCounter("vs", "distinct.block.count").getValue();
		return job.getCounters().findCounter("org.apache.hadoop.mapred.Task$Counter", "REDUCE_OUTPUT_RECORDS").getValue();
	}

}


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("P007-Reverse-Integer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Xeon Productions")]
[assembly: AssemblyProduct("P007-Reverse-Integer")]
[assembly: AssemblyCopyright("Copyright © Xeon Productions 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("26db4ff1-0b60-403b-9381-a24b06b4a2dd")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


text:
require 'uri'

module Copy
  module Storage
    autoload :Mongodb,    'copy/storage/mongodb'
    autoload :Redis,      'copy/storage/redis'
    autoload :Relational, 'copy/storage/relational'

    def self.connect!(connection_url)
      scheme = URI.parse(connection_url).scheme
      klass  = scheme.capitalize
      if %w(sqlite mysql postgres).include?(scheme)
        klass = 'Relational'
      end
      @@storage = Copy::Storage.const_get(klass).new(connection_url)
    end

    def self.connected?
      !defined?(@@storage).nil?
    end

    def self.get(name)
      @@storage.get(name.to_s)
    end

    def self.set(name, content)
      @@storage.set(name.to_s, content)
    end
  end
end


text:
Reports for loops that contain neither initialization nor update components, and suggests converting them to while
loops. This makes the code easier to read.

Example:

  for(; exitCondition(); ) {
    process();
  }

After the quick-fix is applied:

  while(exitCondition()) {
    process();
  }

The quick-fix is also available for other for loops, so you can replace any for loop with a
  while loop.

Use the Ignore 'infinite' for loops without conditions option if you want to ignore for
  loops with trivial or non-existent conditions.


text:
var CssChunkPlugin = require('../../lib/plugins/css-chunk'),
    Circus = require('../../'),
    ModuleNotFoundError = require('webpack/lib/ModuleNotFoundError'),
    webpack = require('webpack');

var expect = require('chai').expect,
    temp = require('temp'),
    fs = require('fs'),
    path = require('path'),
    package = require('../../package.json');

describe('css chunk plugin', function() {
  var outputDir;

  beforeEach(function(done) {
    temp.mkdir('loader-plugin', function(err, dirPath) {
      if (err) {
        throw err;
      }

      outputDir = dirPath;
      done();
    });
  });
  afterEach(function() {
    temp.cleanupSync();
  });

  it('should merge css modules into a single file per-chunk', function(done) {
    var cssChunkPlugin = new CssChunkPlugin(),
        entry = path.resolve(__dirname + '/../fixtures/css-chunk.js');

    webpack({
      entry: entry,
      output: {path: outputDir},

      plugins: [
        cssChunkPlugin
      ]
    }, function(err, status) {
      expect(err).to.not.exist;
      expect(status.compilation.errors).to.be.empty;
      expect(status.compilation.warnings).to.be.empty;

      // Verify the loader boilerplate
      var output = fs.readFileSync(outputDir + '/bundle.js').toString();
      expect(output).to.not.match(/\.foo/);
      expect(output).to.not.match(/\.baz/);

      // Verify the file records
      expect(Object.keys(status.compilation.assets)).to.eql(['bundle.js', '0.bundle.css']);

      // Verify the actual css content
      output = fs.readFileSync(outputDir + '/0.bundle.css').toString();
      expect(output).to.match(/\.foo/);
      expect(output).to.match(/\.baz/);

      done();
    });
  });

  it('should resolve urls defined in css modules', function(done) {
    var cssChunkPlugin = new CssChunkPlugin(),
        entry = path.resolve(__dirname + '/../fixtures/css-image.js');

    webpack({
      entry: entry,
      output: {path: outputDir},

      linker: {
        local: false
      },

      module: {
        loaders: [
          { test: /\.gif$/, loader: require.resolve('file-loader') }
        ]
      },
      plugins: [
        cssChunkPlugin
      ]
    }, function(err, status) {
      expect(err).to.not.exist;
      expect(status.compilation.errors).to.be.empty;
      expect(status.compilation.warnings).to.be.empty;

      // Verify the loader boilerplate
      var output = fs.readFileSync(outputDir + '/bundle.js').toString();
      expect(output).to.not.match(/\.foo/);
      expect(output).to.not.match(/\.baz/);

      // Verify the file records
      expect(Object.keys(status.compilation.assets)).to.eql(['e46d046421eba561b2d062319480f69a.gif', 'bundle.js', '0.bundle.css']);

      // Verify the actual css content
      output = fs.readFileSync(outputDir + '/0.bundle.css').toString();
      expect(output).to.match(/\.foo/);
      expect(output).to.match(/\.baz/);
      expect(output).to.match(/background: url\("e46d046421eba561b2d062319480f69a.gif"\);/);
      expect(output).to.match(/background: url\("data:foo"\);/);
      expect(output).to.match(/background: url\("e46d046421eba561b2d062319480f69a.gif#foo"\);/);
      expect(output).to.match(/background: url\("e46d046421eba561b2d062319480f69a.gif\?#foo"\);/);
      expect(output).to.match(/background: url\("#foo"\);/);
      expect(output).to.not.match(/undefined/);

      done();
    });
  });

  it('should import published urls from components', function(done) {
    var entry = path.resolve(__dirname + '/../fixtures/css-image.js');

    webpack(Circus.config({
      entry: entry,

      components: {
        zeus: {
          circusVersion: package.version,
          chunks: [],
          modules: {
            0: {
              chunk: 0,
              name: 'foo'
            },
            1: {
              chunk: 0,
              name: 'handlebars/runtime'
            }
          },
          published: {'e46d046421eba561b2d062319480f69a.gif': 'e46d046421eba561b2d062319480f69a.foo'},
          entry: 'bundle.js'
        }
      },
      output: {
        path: outputDir
      },

      module: {
        loaders: [
          {test: /\.gif$/, loader: 'file'}
        ]
      },

      resolve: {
        modulesDirectories: [
          outputDir
        ]
      }
    }), function(err, status) {
      expect(err).to.not.exist;
      expect(status.compilation.errors).to.be.empty;
      expect(status.compilation.warnings).to.be.empty;

      // Verify the loader boilerplate
      var output = fs.readFileSync(outputDir + '/bundle.js').toString();
      expect(output).to.not.match(/\.foo/);
      expect(output).to.not.match(/\.baz/);

      // Verify the file records
      expect(Object.keys(status.compilation.assets).sort()).to.eql([
        '0.bundle.css',
        '0.bundle.css.map',
        'bootstrap.js',
        'bootstrap.js.map',
        'bundle.js',
        'bundle.js.map',
        'circus.json'
      ]);

      // Verify the actual css content
      output = fs.readFileSync(outputDir + '/0.bundle.css').toString();
      expect(output).to.match(/\.foo/);
      expect(output).to.match(/\.baz/);
      expect(output).to.match(/background: url\("e46d046421eba561b2d062319480f69a.foo"\);/);
      expect(output).to.match(/background: url\("data:foo"\);/);
      expect(output).to.match(/background: url\("e46d046421eba561b2d062319480f69a.foo#foo"\);/);
      expect(output).to.match(/background: url\("e46d046421eba561b2d062319480f69a.foo\?#foo"\);/);
      expect(output).to.match(/background: url\("#foo"\);/);
      expect(output).to.not.match(/undefined/);

      done();
    });
  });

  it('should include chunk hash in the path name', function(done) {
    var cssChunkPlugin = new CssChunkPlugin(),
        entry = path.resolve(__dirname + '/../fixtures/css-chunk.js');

    webpack({
      entry: entry,
      output: {
        path: outputDir,
        chunkFilename: '[hash:2].[id].[chunkhash:2].bundle.[hash:4].js'
      },

      plugins: [
        cssChunkPlugin
      ]
    }, function(err, status) {
      expect(err).to.not.exist;
      expect(status.compilation.errors).to.be.empty;
      expect(status.compilation.warnings).to.be.empty;

      // Verify the file records
      var assets = Object.keys(status.compilation.assets);
      expect(assets[0]).to.match(/bundle.js/);
      expect(assets[1]).to.match(/[0-9a-f]{2}.0.[0-9a-f]{2}.bundle.[0-9a-f]{4}.css/);

      done();
    });
  });

  it('should nop without css content', function(done) {
    var cssChunkPlugin = new CssChunkPlugin(),
        entry = path.resolve(__dirname + '/../fixtures/router1.js');

    webpack({
      entry: entry,
      output: {path: outputDir},

      plugins: [
        cssChunkPlugin
      ]
    }, function(err, status) {
      expect(err).to.not.exist;
      expect(status.compilation.errors).to.be.empty;
      expect(status.compilation.warnings).to.be.empty;

      // Verify the loader boilerplate
      var output = fs.readFileSync(outputDir + '/bundle.js').toString();
      expect(output).to.not.match(/\.foo/);
      expect(output).to.not.match(/\.baz/);

      // Verify the file records
      expect(Object.keys(status.compilation.assets)).to.eql(['bundle.js']);

      done();
    });
  });

  it('should handled erroring dependencies', function(done) {
    var cssChunkPlugin = new CssChunkPlugin(),
        entry = path.resolve(__dirname + '/../fixtures/css-missing.js');

    webpack({
      entry: entry,
      output: {path: outputDir},

      plugins: [
        cssChunkPlugin
      ]
    }, function(err, status) {
      expect(err).to.not.exist;
      expect(status.compilation.errors[0]).to.be.instanceof(ModuleNotFoundError);
      expect(status.compilation.warnings).to.be.empty;

      // Verify the loader boilerplate
      var output = fs.readFileSync(outputDir + '/bundle.js').toString();
      expect(output).to.not.match(/\.foo/);
      expect(output).to.not.match(/\.baz/);

      // Verify the file records
      expect(Object.keys(status.compilation.assets)).to.eql(['bundle.js']);

      done();
    });
  });
});


text:
//-
// ==========================================================================
// BACON-STRIP.com RIG
//
// MIT License
// Copyright (c) 2017 Bacon-Strip
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// ==========================================================================
//+

////////////////////////////////////////////////////////////////////////
// DESCRIPTION:
// Produces the dependency graph node "baconAlign".
// This plug-in is part of a rigging package known as The "Bacon-Strip Rig"
// Bacon-Strip ID Block is : 0x0012a940 - 0x0012aa3f
// Registered for Bacon-Strip[Luis Alonso]
//
// ID:
// 0x0012a942
//
////////////////////////////////////////////////////////////////////////

#include <maya/MCallbackIdArray.h>
#include <maya/MDagMessage.h>
#include <maya/MDrawRegistry.h>
#include <maya/MFnDagNode.h>
#include <maya/MFnEnumAttribute.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MFnPlugin.h>
#include <maya/MFrameContext.h>
#include <maya/MItDag.h>
#include <maya/MPxDrawOverride.h>
#include <maya/MPxLocatorNode.h>
#include <maya/MVectorArray.h>
#include <maya/MPointArray.h>
#include <maya/MFnMatrixAttribute.h>
#include <maya/MFloatMatrix.h>
#include <maya/MTransformationMatrix.h>

#include <stdio.h>

using namespace MHWRender;

class baconFatRibbon : public MPxLocatorNode
{
public:

	enum ELineType
	{
		kSolid,
		kDotted,
		kDashed,
		kShortDotted,
		kShortDashed
	};

	static void* creator() { return new baconFatRibbon(); }

	static MStatus initialize();

	// Registration
	static char*   className;
	static MTypeId id;
	static MString drawDbClassification;
	static MString drawRegistrantId;

	// Attributes
	static MObject aWireColor;
	static MObject aTangentColor;
	static MObject aLineType;
	static MObject targetMatrix;
	static MObject parentTM;
	static MObject wireIntensity;
	static MObject xRay;
	static MObject showTangents;
	static MObject showSpline;
	static MObject showContrapposto;
	static MObject splineThickness;
	static MObject ContrappostoLength;
	static MObject ContrappostoOffset;

	static MObject startWorldMatrix;
	static MObject endWorldMatrix;
	static MObject startTangentWorldMatrix;
	static MObject endTangentWorldMatrix;

private:

	/*
	baconFatRibbon();
	*/

	virtual ~baconFatRibbon();

	/*
	// REMOVING CALLBACKS SINCE IT'S FASTER TO SIMPLY DRAW THE LINE
	// This plugin is based on "transformDrawNode" which is designed to
	// draw lines on all meshes in the scene.
	static void AllDagChangesCallback(
		MDagMessage::DagMessage msgType,
		MDagPath &child,
		MDagPath &parent,
		void *clientData);

	static void WorldMatrixModifiedCallback(
		MObject &transformNode,
		MDagMessage::MatrixModifiedFlags &modified,
		void *clientData);

	void processDagMessage(bool refreshWorldMatrixCbIds);

	MCallbackId fAllDagChangesCbId;
	MCallbackIdArray fWorldMatrixModifiedCbIds;
	*/

};

// Registration
char*   baconFatRibbon::className = "baconFatRibbon";
MTypeId baconFatRibbon::id(0x0012a942);
MString baconFatRibbon::drawDbClassification("drawdb/geometry/baconFatRibbon");
MString baconFatRibbon::drawRegistrantId(baconFatRibbon::className);

// Attributes
MObject baconFatRibbon::aWireColor;
MObject baconFatRibbon::aTangentColor;
MObject baconFatRibbon::aLineType;
MObject	baconFatRibbon::targetMatrix;
MObject	baconFatRibbon::parentTM;
MObject	baconFatRibbon::wireIntensity;
MObject	baconFatRibbon::xRay;
MObject	baconFatRibbon::ContrappostoLength;
MObject	baconFatRibbon::ContrappostoOffset;
MObject	baconFatRibbon::showTangents;
MObject	baconFatRibbon::showSpline;
MObject	baconFatRibbon::showContrapposto;
MObject	baconFatRibbon::splineThickness;

MObject	baconFatRibbon::startWorldMatrix;
MObject	baconFatRibbon::endWorldMatrix;
MObject	baconFatRibbon::startTangentWorldMatrix;
MObject	baconFatRibbon::endTangentWorldMatrix;

MMatrix setRow(MMatrix matrix, MVector newVector, const int row)
{
	MMatrix returnTM = matrix;
	returnTM[row][0] = newVector[0];
	returnTM[row][1] = newVector[1];
	returnTM[row][2] = newVector[2];
	return returnTM;
}

MMatrix transMatrix(MVector pos)
{
	MMatrix returnTM = setRow(MMatrix(), pos, 3);
	return returnTM;
}

MVector Bezier4Interpolation(MVector P0, MVector P1, MVector P2, MVector P3, float u)
{
	float u2(u * u);
	float u3(u2 * u);
	return (P0 + (-P0 * 3.0f + u * (3.0f * P0 - P0 * u)) * u
		+ (3.0f * P1 + u * (-6.0f * P1 + P1 * 3.0f * u)) * u
		+ (P2 * 3.0f - P2 * 3.0f * u) * u2 + P3 * u3);
}

MMatrix FloatMatrixToMatrix(MFloatMatrix fTM)
{
	MMatrix returnTM = MMatrix();
	returnTM = setRow(returnTM, MVector(fTM[0][0], fTM[0][1], fTM[0][2]), 0);
	returnTM = setRow(returnTM, MVector(fTM[1][0], fTM[1][1], fTM[1][2]), 1);
	returnTM = setRow(returnTM, MVector(fTM[2][0], fTM[2][1], fTM[2][2]), 2);
	returnTM = setRow(returnTM, MVector(fTM[3][0], fTM[3][1], fTM[3][2]), 3);
	return returnTM;
}

MStatus baconFatRibbon::initialize()
{

	MStatus				stat;
	MFnNumericAttribute wAttr;
	MFnNumericAttribute nAttr;

	aWireColor = nAttr.create("wireColor", "wirec", MFnNumericData::k3Float);
	nAttr.setDefault(1.0f, 1.0f, 1.0f);
	nAttr.setStorable(true);
	nAttr.setKeyable(true);
	nAttr.setHidden(false);
	nAttr.setWritable(true);
	nAttr.setReadable(true);
	nAttr.setUsedAsColor(true);
	MPxNode::addAttribute(aWireColor);

	MFnNumericAttribute tAttr;
	aTangentColor = tAttr.create("tangentColor", "tanc", MFnNumericData::k3Float);
	tAttr.setDefault(1.0f, 1.0f, 1.0f);
	tAttr.setStorable(true);
	tAttr.setKeyable(true);
	tAttr.setHidden(false);
	tAttr.setWritable(true);
	tAttr.setReadable(true);
	tAttr.setUsedAsColor(true);
	MPxNode::addAttribute(aTangentColor);

	MFnEnumAttribute eAttr;
	aLineType = eAttr.create("lineType", "tt", kDotted);
	eAttr.addField("Solid Line", kSolid);
	eAttr.addField("Dots", kDotted);
	eAttr.addField("Dashes", kDashed);
	eAttr.addField("Spaced Dots", kShortDotted);
	eAttr.addField("Spaced Dashes", kShortDashed);
	eAttr.setStorable(true);
	eAttr.setKeyable(true);
	eAttr.setHidden(false);
	eAttr.setWritable(true);
	eAttr.setReadable(true);
	MPxNode::addAttribute(aLineType);

	// showSpline
	showSpline = nAttr.create("showLine", "showL", MFnNumericData::kBoolean);
	nAttr.setDefault(true);
	nAttr.setKeyable(true);
	nAttr.setReadable(true);
	nAttr.setHidden(false);
	nAttr.setWritable(true);
	nAttr.setStorable(true);
	stat = addAttribute(showSpline);
	if (!stat) { stat.perror("addAttribute"); return stat; }

	// showTangents
	showTangents = nAttr.create("showTangents", "showT", MFnNumericData::kBoolean);
	nAttr.setDefault(true);
	nAttr.setKeyable(true);
	nAttr.setReadable(true);
	nAttr.setHidden(false);
	nAttr.setWritable(true);
	nAttr.setStorable(true);
	stat = addAttribute(showTangents);
	if (!stat) { stat.perror("addAttribute"); return stat; }

	// showContrapposto
	showContrapposto = nAttr.create("showContrapposto", "showC", MFnNumericData::kBoolean);
	nAttr.setDefault(true);
	nAttr.setKeyable(true);
	nAttr.setReadable(true);
	nAttr.setHidden(false);
	nAttr.setWritable(true);
	nAttr.setStorable(true);
	stat = addAttribute(showContrapposto);
	if (!stat) { stat.perror("addAttribute"); return stat; }

	// Line Thickness
	splineThickness = wAttr.create("lineThickness", "lt", MFnNumericData::kDouble);
	wAttr.setDefault(1.0);
	wAttr.setStorable(true);
	wAttr.setKeyable(true);
	wAttr.setHidden(false);
	wAttr.setWritable(true);
	wAttr.setReadable(true);
	MPxNode::addAttribute(splineThickness);

	wireIntensity = wAttr.create("wireIntensity", "wi", MFnNumericData::kDouble);
	wAttr.setDefault(0.3);
	wAttr.setMin(0.0);
	wAttr.setMax(1.0);
	wAttr.setStorable(true);
	wAttr.setKeyable(true);
	wAttr.setHidden(false);
	wAttr.setWritable(true);
	wAttr.setReadable(true);
	MPxNode::addAttribute(wireIntensity);

	ContrappostoLength = wAttr.create("ContrappostoLength", "cl", MFnNumericData::kDouble);
	wAttr.setDefault(0.0);
	wAttr.setStorable(true);
	wAttr.setKeyable(true);
	wAttr.setHidden(false);
	wAttr.setWritable(true);
	wAttr.setReadable(true);
	MPxNode::addAttribute(ContrappostoLength);

	ContrappostoOffset = wAttr.create("ContrappostoOffset", "co", MFnNumericData::kDouble);
	wAttr.setDefault(0.0);
	wAttr.setStorable(true);
	wAttr.setKeyable(true);
	wAttr.setHidden(false);
	wAttr.setWritable(true);
	wAttr.setReadable(true);
	MPxNode::addAttribute(ContrappostoOffset);

	// xRay
	xRay = nAttr.create("xRay", "xr", MFnNumericData::kBoolean);
	nAttr.setDefault(false);
	nAttr.setKeyable(true);
	nAttr.setReadable(true);
	nAttr.setHidden(false);
	nAttr.setWritable(true);
	nAttr.setStorable(true);
	stat = addAttribute(xRay);
	if (!stat) { stat.perror("addAttribute"); return stat; }

	MFnMatrixAttribute	matrixAttr;
	// input targetMatrix
	targetMatrix = matrixAttr.create("pelvicMatrix", "pelTM", matrixAttr.kFloat);
	matrixAttr.setStorable(true);
	matrixAttr.setKeyable(true);
	stat = addAttribute(targetMatrix);

	// input parentTM
	parentTM = matrixAttr.create("parentTM", "pTM", matrixAttr.kFloat);
	matrixAttr.setStorable(true);
	matrixAttr.setKeyable(true);
	stat = addAttribute(parentTM);

	// input startWorldMatrix
	startWorldMatrix = matrixAttr.create("startWorldMatrix", "sTM", matrixAttr.kFloat);
	matrixAttr.setStorable(true);
	matrixAttr.setKeyable(true);
	stat = addAttribute(startWorldMatrix);

	// input endWorldMatrix
	endWorldMatrix = matrixAttr.create("endWorldMatrix", "eTM", matrixAttr.kFloat);
	matrixAttr.setStorable(true);
	matrixAttr.setKeyable(true);
	stat = addAttribute(endWorldMatrix);

	// input startTangentWorldMatrix
	startTangentWorldMatrix = matrixAttr.create("startTangentWorldMatrix", "stTM", matrixAttr.kFloat);
	matrixAttr.setStorable(true);
	matrixAttr.setKeyable(true);
	stat = addAttribute(startTangentWorldMatrix);

	// input endTangentWorldMatrix
	endTangentWorldMatrix = matrixAttr.create("endTangentWorldMatrix", "etTM", matrixAttr.kFloat);
	matrixAttr.setStorable(true);
	matrixAttr.setKeyable(true);
	stat = addAttribute(endTangentWorldMatrix);

	return MS::kSuccess;
}

/*
baconFatRibbon::baconFatRibbon() : MPxLocatorNode()
{
	fAllDagChangesCbId = MDagMessage::addAllDagChangesCallback(
		AllDagChangesCallback, this);
}
*/

baconFatRibbon::~baconFatRibbon()
{
	/*
	if (fWorldMatrixModifiedCbIds.length() > 0)
	{
		MMessage::removeCallbacks(fWorldMatrixModifiedCbIds);
	}

	if (fAllDagChangesCbId != 0)
	{
		MMessage::removeCallback(fAllDagChangesCbId);
	}
	*/
}

/*
void baconFatRibbon::processDagMessage(bool refreshWorldMatrixModifiedCbIds)
{
	// Explicitly mark the node as being dirty on certain DAG message callbacks
	// so that the draw override can be updated.
	MRenderer::setGeometryDrawDirty(thisMObject());

	if (refreshWorldMatrixModifiedCbIds)
	{
		MStatus status;
		MItDag dagIt(MItDag::kDepthFirst, MFn::kMesh, &status);
		if (status)
		{
			// Remove existing callbacks
			if (fWorldMatrixModifiedCbIds.length() > 0)
			{
				MMessage::removeCallbacks(fWorldMatrixModifiedCbIds);
				fWorldMatrixModifiedCbIds.clear();
			}

			// Add new callbacks
			for (; !dagIt.isDone(); dagIt.next())
			{
				MDagPath dagPath;
				status = dagIt.getPath(dagPath);
				if (status)
				{
					MCallbackId id = MDagMessage::addWorldMatrixModifiedCallback(
						dagPath, WorldMatrixModifiedCallback, this);
					fWorldMatrixModifiedCbIds.append(id);
				}
			}
		}
	}
}

void baconFatRibbon::AllDagChangesCallback(
	MDagMessage::DagMessage msgType,
	MDagPath &child,
	MDagPath &parent,
	void *clientData)
{
	// We need to refresh the world matrix modified callbacks because the DAG
	// is just changed.
	baconFatRibbon *node = static_cast<baconFatRibbon*>(clientData);
	if (node) node->processDagMessage(true);
}

void baconFatRibbon::WorldMatrixModifiedCallback(
	MObject &transformNode,
	MDagMessage::MatrixModifiedFlags &modified,
	void *clientData)
{
	// We don't need to refresh the world matrix modified callbacks because the
	// DAG is not changed.

	baconFatRibbon *node = static_cast<baconFatRibbon*>(clientData);
	if (node) node->processDagMessage(false);

}

*/

class transformDrawData : public MUserData
{
public:
	transformDrawData()
		: MUserData(false)
		, fWireColor(1.0f, 1.0f, 1.0f, 1.0f)
		, fTangentColor(1.0f, 1.0f, 1.0f, 1.0f)
		, fWireIntensity(0.4)
		, fContrappostoLength(0.0)
		, fContrappostoOffset(0.0)
		, fLineType(baconFatRibbon::kDotted)
	{
	}

	virtual ~transformDrawData() {}

	MColor fWireColor;
	MColor fTangentColor;
	double fWireIntensity;
	double fContrappostoLength;
	double fContrappostoOffset;
	baconFatRibbon::ELineType fLineType;
	bool fXRay;

	bool fShowContrapposto;
	bool fShowSpline;
	bool fShowTangents;
	double fSplineThickness;

	//MVectorArray fPositions;
	//MVectorArray fVectors;
	MVector fTargetPos;
	MVector fStartPos;
	MVector fEndPos;
	MVector fStartTangentPos;
	MVector fEndTangentPos;

	MVector fContrappossto1A;
	MVector fContrappossto1B;
	MVector fContrappossto2A;
	MVector fContrappossto2B;

};

class transformDrawOverride : public MPxDrawOverride
{
public:

	static MPxDrawOverride* creator(const MObject& obj)
	{
		return new transformDrawOverride(obj);
	}

	virtual DrawAPI supportedDrawAPIs() const { return kAllDevices; }

	virtual bool hasUIDrawables() const { return true; }

	virtual MUserData* prepareForDraw(
		const MDagPath& objPath,
		const MDagPath& cameraPath,
		const MFrameContext& frameContext,
		MUserData* oldData);

	virtual void addUIDrawables(
		const MDagPath& objPath,
		MUIDrawManager& drawManager,
		const MFrameContext& frameContext,
		const MUserData* data);

private:

	// By setting isAlwaysDirty to false in MPxDrawOverride constructor, the
	// draw override will be updated (via prepareForDraw()) only when the node
	// is marked dirty via DG evaluation or dirty propagation. Additional
	// callbacks are also added to explicitly mark the node as being dirty (via
	// MRenderer::setGeometryDrawDirty()) for certain circumstances. Note that
	// the draw callback in MPxDrawOverride constructor is set to NULL in order
	// to achieve better performance.

	// "isAlwaysDirty" SET TO TRUE
	// This way it gets flagged as dirty when lookat objects transform.
	// This is faster than callbacks since you have to navigate through dagpaths
	// if not.

	transformDrawOverride(const MObject& obj) : MPxDrawOverride(obj, NULL, true) {}
	virtual ~transformDrawOverride() {}
};

MUserData* transformDrawOverride::prepareForDraw(
	const MDagPath& objPath,
	const MDagPath& cameraPath,
	const MFrameContext& frameContext,
	MUserData* oldData)
{
	MStatus status;
	MObject obj = objPath.node(&status);
	if (!status) return NULL;

	transformDrawData* tdData = dynamic_cast<transformDrawData*>(oldData);
	if (!tdData)
	{
		tdData = new transformDrawData();
	}

	/*
	MStatus returnStatus;
	MDataHandle worldTMhandle = data.inputValue(baconFatRibbon::worldMatrix, &returnStatus);
	MFloatMatrix worldTMValue = worldTMhandle.asFloatMatrix();
	*/

	//MPlug plugTM(obj, baconFatRibbon::parentInverseMatrix);
	MPlug plugTM(obj, baconFatRibbon::parentTM);
	MDataHandle worldTMhandle = plugTM.asMDataHandle();
	MFloatMatrix worldTMValue = worldTMhandle.asFloatMatrix();
	MMatrix thisTM = FloatMatrixToMatrix(worldTMValue);

	MPlug plugtTM(obj, baconFatRibbon::targetMatrix);
	MDataHandle worldtTMhandle = plugtTM.asMDataHandle();
	MFloatMatrix worldtTMValue = worldtTMhandle.asFloatMatrix();
	MMatrix targetTM = FloatMatrixToMatrix(worldtTMValue);
	MTransformationMatrix localTM = targetTM * thisTM.inverse();
	MVector vec = localTM.getTranslation(MSpace::kWorld);
	tdData->fTargetPos = vec;

	MPlug xRayPlug(obj, baconFatRibbon::xRay);
	tdData->fXRay = xRayPlug.asBool();

	// show
	MPlug showSplinePlug(obj, baconFatRibbon::showSpline);
	tdData->fShowSpline = showSplinePlug.asBool();

	MPlug showTangentsPlug(obj, baconFatRibbon::showTangents);
	tdData->fShowTangents = showTangentsPlug.asBool();

	MPlug showContrappostoPlug(obj, baconFatRibbon::showContrapposto);
	tdData->fShowContrapposto = showContrappostoPlug.asBool();

	// Bezier 4 points
	MPlug plugContrappostoLength(obj, baconFatRibbon::ContrappostoLength);
	MDataHandle ContrappostoLengthHandle = plugContrappostoLength.asMDataHandle();
	double cpLength = ContrappostoLengthHandle.asDouble();
	tdData->fContrappostoLength = cpLength;

	MPlug plugContrappostoOffset(obj, baconFatRibbon::ContrappostoOffset);
	MDataHandle ContrappostoOffsetHandle = plugContrappostoOffset.asMDataHandle();
	double cpOffset = ContrappostoOffsetHandle.asDouble();
	tdData->fContrappostoOffset = cpOffset;

	MPlug startPlugtTM(obj, baconFatRibbon::startWorldMatrix);
	MDataHandle startTMhandle = startPlugtTM.asMDataHandle();
	MFloatMatrix startTMValue = startTMhandle.asFloatMatrix();
	MMatrix startTM = FloatMatrixToMatrix(startTMValue);
	MTransformationMatrix startLocalTM = startTM * thisTM.inverse();
	MVector startVec = startLocalTM.getTranslation(MSpace::kWorld);
	tdData->fStartPos = startVec;

	MMatrix cposto1ATM = (transMatrix(MVector(0, 0, cpLength)) * targetTM) * thisTM.inverse();
	tdData->fContrappossto1A = MVector(cposto1ATM[3][0], cposto1ATM[3][1], cposto1ATM[3][2]);
	MMatrix cposto1BTM = (transMatrix(MVector(0, 0, -1.0 * cpLength)) * targetTM) * thisTM.inverse();
	tdData->fContrappossto1B = MVector(cposto1BTM[3][0], cposto1BTM[3][1], cposto1BTM[3][2]);

	MPlug endPlugtTM(obj, baconFatRibbon::endWorldMatrix);
	MDataHandle endTMhandle = endPlugtTM.asMDataHandle();
	MFloatMatrix endTMValue = endTMhandle.asFloatMatrix();
	MMatrix endTM = FloatMatrixToMatrix(endTMValue);
	MTransformationMatrix endLocalTM = endTM * thisTM.inverse();
	MVector endVec = endLocalTM.getTranslation(MSpace::kWorld);
	tdData->fEndPos = endVec;

	MMatrix cposto2ATM = (transMatrix(MVector(cpOffset, 0, cpLength)) * endTM) * thisTM.inverse();
	tdData->fContrappossto2A = MVector(cposto2ATM[3][0], cposto2ATM[3][1], cposto2ATM[3][2]);
	MMatrix cposto2BTM = (transMatrix(MVector(cpOffset, 0, -1.0 * cpLength)) * endTM) * thisTM.inverse();
	tdData->fContrappossto2B = MVector(cposto2BTM[3][0], cposto2BTM[3][1], cposto2BTM[3][2]);

	MPlug startTangentPlugtTM(obj, baconFatRibbon::startTangentWorldMatrix);
	MDataHandle startTangentTMhandle = startTangentPlugtTM.asMDataHandle();
	MFloatMatrix startTangentTMValue = startTangentTMhandle.asFloatMatrix();
	MMatrix startTangentTM = FloatMatrixToMatrix(startTangentTMValue);
	MTransformationMatrix startTangentLocalTM = startTangentTM * thisTM.inverse();
	MVector startTangentVec = startTangentLocalTM.getTranslation(MSpace::kWorld);
	tdData->fStartTangentPos = startTangentVec;

	MPlug endTangentPlugtTM(obj, baconFatRibbon::endTangentWorldMatrix);
	MDataHandle endTangentTMhandle = endTangentPlugtTM.asMDataHandle();
	MFloatMatrix endTangentTMValue = endTangentTMhandle.asFloatMatrix();
	MMatrix endTangentTM = FloatMatrixToMatrix(endTangentTMValue);
	MTransformationMatrix endTangentLocalTM = endTangentTM * thisTM.inverse();
	MVector endTangentVec = endTangentLocalTM.getTranslation(MSpace::kWorld);
	tdData->fEndTangentPos = endTangentVec;

	//MObject oTM = plugTM.asMObject();
	//MFnMatrixAttribute nTM(oTM);

	//pluglocalScaleX.getValue(localScaleValX);

	// Wire color
	{
		MPlug plug(obj, baconFatRibbon::aWireColor);
		MObject o = plug.asMObject();
		MFnNumericData nData(o);
		nData.getData(tdData->fWireColor.r, tdData->fWireColor.g, tdData->fWireColor.b);

		MPlug plugIntensity(obj, baconFatRibbon::wireIntensity);
		MDataHandle wireIntensityHandle = plugIntensity.asMDataHandle();
		tdData->fWireIntensity = wireIntensityHandle.asDouble();

		MPlug plugThickness(obj, baconFatRibbon::splineThickness);
		MDataHandle ThicknessHandle = plugThickness.asMDataHandle();
		tdData->fSplineThickness = ThicknessHandle.asDouble();

	}

	// Tangent Color
	{
		MPlug tColorPlug(obj, baconFatRibbon::aTangentColor);
		MObject otColor = tColorPlug.asMObject();
		MFnNumericData nData(otColor);
		nData.getData(tdData->fTangentColor.r, tdData->fTangentColor.g, tdData->fTangentColor.b);
	}

	// Type of Line
	MPlug plugLineType(obj, baconFatRibbon::aLineType);
	tdData->fLineType = (baconFatRibbon::ELineType)plugLineType.asInt();

	// Transform type
	/*
	{
	MPlug plug(obj, baconFatRibbon::aLineType);
	tdData->fLineType = (baconFatRibbon::ELineType)plug.asInt();
	}

	tdData->fPositions.clear();
	tdData->fVectors.clear();

	MItDag dagIt(MItDag::kDepthFirst, MFn::kMesh, &status);
	if (status)
	{
	for ( ; !dagIt.isDone(); dagIt.next() )
	{
	MDagPath dagPath;
	status = dagIt.getPath(dagPath);
	if (!status)
	{
	status.perror("MItDag::getPath");
	continue;
	}

	MObject transformNode = dagPath.transform(&status);
	if (!status)
	{
	status.perror("MDagPath::transform");
	continue;
	}

	MFnDagNode transform(transformNode, &status);
	if (!status)
	{
	status.perror("MFnDagNode constructor");
	continue;
	}

	//MTransformationMatrix matrix(transform.transformationMatrix());
	MTransformationMatrix localTM = targetTM * thisTM.inverse();
	MVector vec = localTM.getTranslation(MSpace::kWorld);
	//MVector vec = matrix.getTranslation(MSpace::kWorld);

	//vec = vec * thisTM.inverse();
	tdData->fPositions.append(vec);

	double tmp[3];
	MTransformationMatrix::RotationOrder order;
	switch (tdData->fLineType)
	{
	case baconFatRibbon::kRotate:
	matrix.getRotation(tmp, order);
	vec = MVector(tmp);
	break;
	case baconFatRibbon::kScale:
	matrix.getScale(tmp, MSpace::kWorld);
	vec = MVector(tmp);
	break;
	case baconFatRibbon::kShear:
	matrix.getShear(tmp, MSpace::kWorld);
	vec = MVector(tmp);
	break;
	default:
	// Don't reset vec so that translation is drawn by default.
	break;
	}

	tdData->fVectors.append(vec);
	}
	}
	*/

	return tdData;
}

void transformDrawOverride::addUIDrawables(
	const MDagPath& objPath,
	MUIDrawManager& drawManager,
	const MFrameContext& frameContext,
	const MUserData* data)
{
	const transformDrawData* tdData = dynamic_cast<const transformDrawData*>(data);
	if (!tdData) return;

	MColor wColor(tdData->fWireColor);
	wColor.a = float(tdData->fWireIntensity); //0.4;

	MColor tColor(tdData->fTangentColor);
	tColor.a = float(tdData->fWireIntensity); //0.4;

	MPointArray startTangentLine;
	startTangentLine.append(tdData->fStartPos);
	startTangentLine.append(tdData->fStartTangentPos);

	MPointArray endTangentLine;
	endTangentLine.append(tdData->fEndPos);
	endTangentLine.append(tdData->fEndTangentPos);

	MPointArray bezierLine;
	bezierLine.append(tdData->fStartPos);
	float totalDivisions(10.0f);
	float curveSample(1.0f / totalDivisions);
	for (int i = 1; i < totalDivisions; i++)
	{
		MVector nextPos = Bezier4Interpolation(tdData->fStartPos, tdData->fStartTangentPos,
			tdData->fEndTangentPos, tdData->fEndPos, (i * curveSample));
		bezierLine.append(nextPos);
		bezierLine.append(nextPos); // using kLineStrip will fail on xRay, so using segmented kLine
	}
	bezierLine.append(tdData->fEndPos);

	MPointArray ContrappostoLines;
	ContrappostoLines.append(tdData->fContrappossto1A);
	ContrappostoLines.append(tdData->fContrappossto1B);
	ContrappostoLines.append(tdData->fContrappossto2A);
	ContrappostoLines.append(tdData->fContrappossto2B);

	drawManager.beginDrawable();

	switch (tdData->fLineType)
	{
	case 1:
		drawManager.setLineStyle(MHWRender::MUIDrawManager::kDotted);
		break;
	case 2:
		drawManager.setLineStyle(MHWRender::MUIDrawManager::kDashed);
		break;
	case 3:
		drawManager.setLineStyle(MHWRender::MUIDrawManager::kShortDotted);
		break;
	case 4:
		drawManager.setLineStyle(MHWRender::MUIDrawManager::kShortDashed);
		break;
	default:
		drawManager.setLineStyle(MHWRender::MUIDrawManager::kSolid);
		break;
	}

	if (tdData->fXRay)
		drawManager.beginDrawInXray();

	drawManager.setColor(tColor);
	drawManager.setLineWidth(3.0f);
	if (tdData->fShowTangents)
	{
		drawManager.mesh(MHWRender::MUIDrawManager::kLines, startTangentLine);
		drawManager.mesh(MHWRender::MUIDrawManager::kLines, endTangentLine);
	}

	drawManager.setColor(wColor);
	drawManager.setLineWidth(tdData->fSplineThickness);
	drawManager.setLineStyle(MHWRender::MUIDrawManager::kSolid);

	if (tdData->fShowSpline)
	{
		drawManager.mesh(MHWRender::MUIDrawManager::kLines, bezierLine);
	}

	if (tdData->fShowContrapposto)
	{
		drawManager.mesh(MHWRender::MUIDrawManager::kLines, ContrappostoLines);
	}

	if (tdData->fXRay)
		drawManager.endDrawInXray();

	/*

	// text
	thisColor.a = 1.0;
	drawManager.setColor(thisColor);
	MPoint pos(tdData->fPositions[i]);
	MVector vec(tdData->fVectors[i]);
	char tmpStr[128] = {0};
	sprintf(tmpStr, "(%.3f, %.3f, %.3f)", vec.x, vec.y, vec.z);
	MString text(tmpStr);
	drawManager.text(pos, text, MUIDrawManager::kCenter);
	*/

	drawManager.endDrawable();
}

MStatus initializePlugin(MObject obj)
{
	MFnPlugin plugin(obj, "Bacon-Strip.com", "1.0", "Any");

	MStatus status = plugin.registerNode(
		baconFatRibbon::className,
		baconFatRibbon::id,
		baconFatRibbon::creator,
		baconFatRibbon::initialize,
		MPxNode::kLocatorNode,
		&baconFatRibbon::drawDbClassification);
	if (!status)
	{
		status.perror("registerNode");
		return status;
	}

	status = MDrawRegistry::registerDrawOverrideCreator(
		baconFatRibbon::drawDbClassification,
		baconFatRibbon::drawRegistrantId,
		transformDrawOverride::creator);
	if (!status)
	{
		status.perror("registerDrawOverrideCreator");
		return status;
	}

	return status;
}

MStatus uninitializePlugin(MObject obj)
{
	MFnPlugin plugin(obj);

	MStatus status = MDrawRegistry::deregisterDrawOverrideCreator(
		baconFatRibbon::drawDbClassification,
		baconFatRibbon::drawRegistrantId);
	if (!status)
	{
		status.perror("deregisterDrawOverrideCreator");
		return status;
	}

	status = plugin.deregisterNode(baconFatRibbon::id);
	if (!status)
	{
		status.perror("deregisterNode");
		return status;
	}

	return status;
}


text:
<?php

namespace supplyhog\JsonObjectBehavior\tests\models;

use supplyhog\JsonObjectBehavior\JsonObjectModel;

class JsonTest extends JsonObjectModel
{
	public $hello = 'world';
}


text:
PATCH operation example
-----------------------

Usage:

curl -X PATCH -H "Content-Type: text/json" -d '{"op":"put", "path":"headliner/name", "value":"This will be the new headliner name"}' http://localhost:9000/events


text:
require 'test_helper'

class PeopleControllerTest < ActionController::TestCase

end


text:
package org.unidal.cat.plugin.events.config;

import java.io.InputStream;

import junit.framework.Assert;

import org.junit.Test;
import org.unidal.cat.plugin.events.config.entity.EventsConfigModel;
import org.unidal.cat.plugin.events.config.transform.DefaultSaxParser;

public class EventsConfigTest {
   @Test
   public void test() throws Exception {
      InputStream in = getClass().getResourceAsStream("events-config.xml");
      EventsConfigModel config = DefaultSaxParser.parse(in);

      Assert.assertEquals(4, config.getConfigs().size());
   }
}


text:
@interface RSDFDatePickerDaysOfWeekView ()

@property (copy, nonatomic) NSCalendar *calendar;
@property (copy, nonatomic) NSArray *weekdayLabels;
@property (copy, nonatomic) NSArray *veryShortStandaloneWeekdaySymbols;
@property (copy, nonatomic) NSArray *shortStandaloneWeekdaySymbols;
@property (copy, nonatomic) NSArray *standaloneWeekdaySymbols;
@property (copy, nonatomic) NSArray *lastSymbolsUsed;
@property (assign, nonatomic) NSUInteger daysInWeek;
@property (assign, nonatomic) NSUInteger originalIndexOfFirstWeekdaySymbol;
@property (assign, nonatomic) NSUInteger originalIndexOfSaturdaySymbol;
@property (assign, nonatomic) NSUInteger originalIndexOfSundaySymbol;

@end

@implementation RSDFDatePickerDaysOfWeekView

#pragma mark - Lifecycle

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self commonInitializer];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self commonInitializer];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame calendar:(NSCalendar *)calendar
{
    self = [super initWithFrame:frame];
    if (self) {
        _calendar = calendar;
        [self commonInitializer];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];

    [self updateWeekdayLabels];
    [self layoutWeekdayLabels];
}

#pragma mark - Custom Accessors

- (NSCalendar *)calendar
{
    if (!_calendar) {
        _calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
        _calendar.locale = [NSLocale currentLocale];
    }
    return _calendar;
}

#pragma mark - Private

- (void)commonInitializer
{
    self.backgroundColor = [self selfBackgroundColor];

    self.daysInWeek = self.calendar.rsdf_daysInWeek;
    self.originalIndexOfFirstWeekdaySymbol = self.calendar.firstWeekday - 1;
    self.originalIndexOfSaturdaySymbol = self.calendar.rsdf_saturdayIndex - 1;
    self.originalIndexOfSundaySymbol = self.calendar.rsdf_sundayIndex - 1;

    NSString *dateFormatterName = [NSString stringWithFormat:@"calendarDaysOfWeekView_%@_%@", [self.calendar calendarIdentifier], [[self.calendar locale] localeIdentifier]];
    NSDateFormatter *dateFormatter = [self.calendar df_dateFormatterNamed:dateFormatterName withConstructor:^{
        NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
        [dateFormatter setCalendar:self.calendar];
        [dateFormatter setLocale:[self.calendar locale]];
        return dateFormatter;
    }];
    self.veryShortStandaloneWeekdaySymbols = [dateFormatter veryShortStandaloneWeekdaySymbols];
    self.shortStandaloneWeekdaySymbols = [dateFormatter shortStandaloneWeekdaySymbols];
    self.standaloneWeekdaySymbols = [dateFormatter standaloneWeekdaySymbols];

    if (self.originalIndexOfFirstWeekdaySymbol != 0) {
        self.veryShortStandaloneWeekdaySymbols = [self reorderedWeekdaySymbols:self.veryShortStandaloneWeekdaySymbols indexOfFirstWeekdaySymbol:self.originalIndexOfFirstWeekdaySymbol];
        self.shortStandaloneWeekdaySymbols = [self reorderedWeekdaySymbols:self.shortStandaloneWeekdaySymbols indexOfFirstWeekdaySymbol:self.originalIndexOfFirstWeekdaySymbol];
        self.standaloneWeekdaySymbols = [self reorderedWeekdaySymbols:self.standaloneWeekdaySymbols indexOfFirstWeekdaySymbol:self.originalIndexOfFirstWeekdaySymbol];
    }
}

- (void)layoutWeekdayLabels
{
    CGSize itemSize = [self selfItemSize];
    CGFloat interitemSpacing = [self selfInteritemSpacing];

    // recalculate the frames
    CGFloat y = 0.0;
    __block CGFloat x;

    NSLocaleLanguageDirection characterDirection = [NSLocale characterDirectionForLanguage:self.calendar.locale.localeIdentifier];
    if (characterDirection == NSLocaleLanguageDirectionRightToLeft) {
        x = CGRectGetWidth(self.frame) - itemSize.width;
        [self.weekdayLabels enumerateObjectsUsingBlock:^(UILabel *weekdayLabel, NSUInteger idx, BOOL *stop) {
            CGRect weekdayLabelFrame = CGRectMake(x, y, itemSize.width, itemSize.height);
            weekdayLabel.frame = weekdayLabelFrame;
            x -= (itemSize.width + interitemSpacing);
        }];
    } else {
        x = 0;
        [self.weekdayLabels enumerateObjectsUsingBlock:^(UILabel *weekdayLabel, NSUInteger idx, BOOL *stop) {
            CGRect weekdayLabelFrame = CGRectMake(x, y, itemSize.width, itemSize.height);
            weekdayLabel.frame = weekdayLabelFrame;
            x += (itemSize.width + interitemSpacing);
        }];
    }
}

- (CGFloat)maxWidthOfSymbols:(NSArray *)symbols
{
    CGSize boundingRectSize = CGSizeMake(CGFLOAT_MAX, [self selfItemSize].height);
    UIFont *font = [self dayOfWeekLabelFont];

    __block CGFloat maxWidthOfSymbols = 0.0;
    [symbols enumerateObjectsUsingBlock:^(NSString* theString, NSUInteger idx,BOOL *stop) {
        CGFloat currentWidth = ceilf([theString boundingRectWithSize:boundingRectSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{ NSFontAttributeName:font } context:nil].size.width);
        if (currentWidth >= maxWidthOfSymbols) {
            maxWidthOfSymbols = currentWidth;
        }
    }];

    return maxWidthOfSymbols;
}

- (NSUInteger)originalIndexOfWeekdaySymbolFromReorderedIndex:(NSUInteger)reorderedIndex
{
    NSInteger originalIndex = reorderedIndex + self.originalIndexOfFirstWeekdaySymbol;
    if (originalIndex > self.daysInWeek - 1) {
        originalIndex -= self.daysInWeek;
    }
    return originalIndex;
}

- (NSArray *)reorderedWeekdaySymbols:(NSArray *)weekdaySymbols indexOfFirstWeekdaySymbol:(NSUInteger)indexOfFirstWeekdaySymbol
{
    return [[weekdaySymbols subarrayWithRange:NSMakeRange(indexOfFirstWeekdaySymbol, [weekdaySymbols count] - indexOfFirstWeekdaySymbol)]
            arrayByAddingObjectsFromArray:[weekdaySymbols subarrayWithRange:NSMakeRange(0, indexOfFirstWeekdaySymbol)]];
}

- (void)updateWeekdayLabels
{
    NSArray *symbolsToUse;

    RSDFDaysOfWeekDisplayStyle style = [self displayStyle];
    if (style == RSDFDaysOfWeekDisplayStyleAuto) {

        UIEdgeInsets selfItemInsets = [self selfItemInsets];
        CGFloat maxAvailableItemWidth = [self selfItemSize].width - selfItemInsets.left - selfItemInsets.right;

        // first check if the largest one fits
        CGFloat maxWidthOfSymbols = [self maxWidthOfSymbols:self.standaloneWeekdaySymbols];
        if (maxWidthOfSymbols > maxAvailableItemWidth) { // it did not fit

            maxWidthOfSymbols = [self maxWidthOfSymbols:self.shortStandaloneWeekdaySymbols];
            if (maxWidthOfSymbols > maxAvailableItemWidth) { // it did not fit -> use very short symbols

                symbolsToUse = [self.veryShortStandaloneWeekdaySymbols copy];
            } else {
                symbolsToUse = [self.shortStandaloneWeekdaySymbols copy];
            }
        } else {
            symbolsToUse = [self.standaloneWeekdaySymbols copy];
        }
    } else {
        switch (style) {
            case RSDFDaysOfWeekDisplayStyleLong: {
                symbolsToUse = [self.standaloneWeekdaySymbols copy];
                break;
            }
            case RSDFDaysOfWeekDisplayStyleMedium: {
                symbolsToUse = [self.shortStandaloneWeekdaySymbols copy];
                break;
            }
            case RSDFDaysOfWeekDisplayStyleShort: {
                symbolsToUse = [self.veryShortStandaloneWeekdaySymbols copy];
                break;
            }
            default: {
                NSLog(@"Invalid RSDFDaysOfWeekDisplayStyle. Defaulting to RSDFDaysOfWeekStyleShort");
                symbolsToUse = [self.veryShortStandaloneWeekdaySymbols copy];
                break;
            }
        }
    }
    if (![symbolsToUse isEqualToArray:self.lastSymbolsUsed]){
        // there is now a different set of symbols so we need to reinit/retext the labels

        UIFont *dayOfWeekLabelFont = [self dayOfWeekLabelFont];

        if (self.weekdayLabels) { // the were already created so just change the text and update the font
            [self.weekdayLabels enumerateObjectsUsingBlock:^(UILabel *weekdayLabel, NSUInteger idx, BOOL *stop) {
                weekdayLabel.text = [symbolsToUse objectAtIndex:idx];
                weekdayLabel.font = dayOfWeekLabelFont;
            }];
        } else { // the labels have not been created yet
            UIColor *dayOfWeekLabelBackgroundColor = [UIColor clearColor];
            UIColor *dayOfWeekLabelTextColor = [self dayOfWeekLabelTextColor];
            UIColor *dayOffOfWeekLabelTextColor = [self dayOffOfWeekLabelTextColor];
            UIFont *dayOffOfWeekLabelFont = [self dayOffOfWeekLabelFont];

            NSMutableArray *weekdayLabels = [NSMutableArray arrayWithCapacity:[symbolsToUse count]];
            [symbolsToUse enumerateObjectsUsingBlock:^(NSString *weekdaySymbol, NSUInteger idx, BOOL *stop) {
                UILabel *weekdayLabel = [[UILabel alloc] init];
                weekdayLabel.textAlignment = NSTextAlignmentCenter;
                weekdayLabel.backgroundColor = dayOfWeekLabelBackgroundColor;

                CGFloat realWeekdayIndex = idx + [self.calendar firstWeekday] - 1;
                if (realWeekdayIndex > 6) {
                    realWeekdayIndex -= 7;
                }

                if (realWeekdayIndex != 0 && realWeekdayIndex!=6) {
                    weekdayLabel.font = dayOfWeekLabelFont;
                    weekdayLabel.textColor = dayOfWeekLabelTextColor;
                } else {
                    weekdayLabel.font = dayOffOfWeekLabelFont;
                    weekdayLabel.textColor = dayOffOfWeekLabelTextColor;
                }
                weekdayLabel.text = weekdaySymbol;
                weekdayLabel.isAccessibilityElement = NO;
                [weekdayLabels addObject:weekdayLabel];
                [self addSubview:weekdayLabel];
            }];
            self.weekdayLabels = [weekdayLabels copy];
        }
        // update the lastUsedSymbols
        self.lastSymbolsUsed = symbolsToUse;
    }
}

- (BOOL)isPhone
{
    return UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone;
}

- (BOOL)isPortraitInterfaceOrientation
{
    return UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]);
}

#pragma mark - Attributes of the View

- (UIColor *)selfBackgroundColor
{
    return [UIColor colorWithRed:248.0/255 green:248.0/255 blue:248.0/255 alpha:1.0];
}

#pragma mark - Attributes of the Layout

- (CGSize)selfItemSize
{
    NSUInteger numberOfItems = self.daysInWeek;
    CGFloat totalInteritemSpacing = [self selfInteritemSpacing] * (numberOfItems - 1);

    CGFloat selfItemWidth = (CGRectGetWidth(self.frame) - totalInteritemSpacing) / numberOfItems;
    selfItemWidth = floor(selfItemWidth * 1000) / 1000;
    CGFloat selfItemHeight = CGRectGetHeight(self.frame);

    return (CGSize){ selfItemWidth, selfItemHeight };
}

- (UIEdgeInsets)selfItemInsets
{
    return UIEdgeInsetsMake(0.0, 16.0, 0.0, 16.0);
}

- (CGFloat)selfInteritemSpacing
{
    return 2.0f;
}

- (RSDFDaysOfWeekDisplayStyle)displayStyle
{
    return RSDFDaysOfWeekDisplayStyleAuto;
}

#pragma mark - Attributes of Subviews

- (UIFont *)dayOfWeekLabelFont
{
    if ([self isPhone]) {
        if ([self isPortraitInterfaceOrientation]) {
            return [UIFont fontWithName:@"HelveticaNeue-Light" size:10.0];
        } else {
            return [UIFont fontWithName:@"HelveticaNeue-Light" size:12.0];
        }
    } else {
        return [UIFont fontWithName:@"HelveticaNeue-Light" size:16.0];
    }
}

- (UIFont *)dayOffOfWeekLabelFont
{
    if ([self isPhone]) {
        if ([self isPortraitInterfaceOrientation]) {
            return [UIFont fontWithName:@"HelveticaNeue-Light" size:10.0];
        } else {
            return [UIFont fontWithName:@"HelveticaNeue-Light" size:12.0];
        }
    } else {
        return [UIFont fontWithName:@"HelveticaNeue-Light" size:16.0];
    }
}

- (UIColor *)dayOfWeekLabelTextColor
{
    return [UIColor blackColor];
}

- (UIColor *)dayOffOfWeekLabelTextColor
{
    return [UIColor colorWithRed:150.0/255 green:150.0/255 blue:150.0/255 alpha:1.0];
}

@end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 83(4): 511 (1991)

#### Original name
Pestalotiopsis oenotherae Venkatas., Grand & Van Dyke

### Remarks
null


text:
.class public Lnz/co/telecom/smartphone/dto/topup/TopupDTO;
.super Lnz/co/telecom/smartphone/dto/creditcard/CreditCardMessagesDTO;
.source "TopupDTO.java"

# instance fields
.field private balance:D

.field private balanceDateTime:Ljava/util/Date;

.field private messages:Lnz/co/telecom/smartphone/dto/creditcard/CreditCardMessagesDTO;

.field private subscription_id:I

.field private type:Ljava/lang/String;

# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 22
    invoke-direct {p0}, Lnz/co/telecom/smartphone/dto/creditcard/CreditCardMessagesDTO;-><init>()V

    .line 23
    return-void
.end method

# virtual methods
.method public getBalance()D
    .locals 2

    .prologue
    .line 26
    iget-wide v0, p0, Lnz/co/telecom/smartphone/dto/topup/TopupDTO;->balance:D

    return-wide v0
.end method

.method public getBalanceDateTime()Ljava/util/Date;
    .locals 1

    .prologue
    .line 34
    iget-object v0, p0, Lnz/co/telecom/smartphone/dto/topup/TopupDTO;->balanceDateTime:Ljava/util/Date;

    return-object v0
.end method

.method public getMessages()Lnz/co/telecom/smartphone/dto/creditcard/CreditCardMessagesDTO;
    .locals 1

    .prologue
    .line 50
    iget-object v0, p0, Lnz/co/telecom/smartphone/dto/topup/TopupDTO;->messages:Lnz/co/telecom/smartphone/dto/creditcard/CreditCardMessagesDTO;

    return-object v0
.end method

.method public getSubscription_id()I
    .locals 1

    .prologue
    .line 42
    iget v0, p0, Lnz/co/telecom/smartphone/dto/topup/TopupDTO;->subscription_id:I

    return v0
.end method

.method public getType()Ljava/lang/String;
    .locals 1

    .prologue
    .line 15
    iget-object v0, p0, Lnz/co/telecom/smartphone/dto/topup/TopupDTO;->type:Ljava/lang/String;

    return-object v0
.end method

.method public setBalance(D)V
    .locals 0
    .param p1, "balance"    # D

    .prologue
    .line 30
    iput-wide p1, p0, Lnz/co/telecom/smartphone/dto/topup/TopupDTO;->balance:D

    .line 31
    return-void
.end method

.method public setBalanceDateTime(Ljava/util/Date;)V
    .locals 0
    .param p1, "balanceDateTime"    # Ljava/util/Date;

    .prologue
    .line 38
    iput-object p1, p0, Lnz/co/telecom/smartphone/dto/topup/TopupDTO;->balanceDateTime:Ljava/util/Date;

    .line 39
    return-void
.end method

.method public setMessages(Lnz/co/telecom/smartphone/dto/creditcard/CreditCardMessagesDTO;)V
    .locals 0
    .param p1, "messages"    # Lnz/co/telecom/smartphone/dto/creditcard/CreditCardMessagesDTO;

    .prologue
    .line 54
    iput-object p1, p0, Lnz/co/telecom/smartphone/dto/topup/TopupDTO;->messages:Lnz/co/telecom/smartphone/dto/creditcard/CreditCardMessagesDTO;

    .line 55
    return-void
.end method

.method public setSubscription_id(I)V
    .locals 0
    .param p1, "subscription_id"    # I

    .prologue
    .line 46
    iput p1, p0, Lnz/co/telecom/smartphone/dto/topup/TopupDTO;->subscription_id:I

    .line 47
    return-void
.end method

.method public setType(Ljava/lang/String;)V
    .locals 0
    .param p1, "type"    # Ljava/lang/String;

    .prologue
    .line 19
    iput-object p1, p0, Lnz/co/telecom/smartphone/dto/topup/TopupDTO;->type:Ljava/lang/String;

    .line 20
    return-void
.end method