text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

public partial class DesktopModules_CoreModules_Register_RegisterFull {

    /// <summary>
    /// NotifySaveContainer control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlGenericControl NotifySaveContainer;

    /// <summary>
    /// messageS_lbl control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label messageS_lbl;

    /// <summary>
    /// lblTitle control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblTitle;

    /// <summary>
    /// pnlForm control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Panel pnlForm;

    /// <summary>
    /// lblError control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblError;

    /// <summary>
    /// lblName control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblName;

    /// <summary>
    /// tfName control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.TextBox tfName;

    /// <summary>
    /// RequiredName control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredName;

    /// <summary>
    /// lblEmail control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblEmail;

    /// <summary>
    /// tfEmail control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.TextBox tfEmail;

    /// <summary>
    /// rfvEmail control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvEmail;

    /// <summary>
    /// revEmail control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.RegularExpressionValidator revEmail;

    /// <summary>
    /// trPwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlTableRow trPwd;

    /// <summary>
    /// lblPwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblPwd;

    /// <summary>
    /// tfPwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.TextBox tfPwd;

    /// <summary>
    /// rfvPwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvPwd;

    /// <summary>
    /// trPwdAgain control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlTableRow trPwdAgain;

    /// <summary>
    /// lblPwdAgain control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblPwdAgain;

    /// <summary>
    /// tfPwdAgain control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.TextBox tfPwdAgain;

    /// <summary>
    /// rfvPwdAgain control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvPwdAgain;

    /// <summary>
    /// cfvPwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.CompareValidator cfvPwd;

    /// <summary>
    /// lblBirthDate control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblBirthDate;

    /// <summary>
    /// startdate control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.TextBox startdate;

    /// <summary>
    /// cbirthday control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.RangeValidator cbirthday;

    /// <summary>
    /// lblCompany control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblCompany;

    /// <summary>
    /// tfCompany control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.TextBox tfCompany;

    /// <summary>
    /// lblPhone control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblPhone;

    /// <summary>
    /// tfPhone control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.TextBox tfPhone;

    /// <summary>
    /// lblCountry control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblCountry;

    /// <summary>
    /// ddlCountry control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.DropDownList ddlCountry;

    /// <summary>
    /// rfvCountry control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvCountry;

    /// <summary>
    /// lblReceiveNews control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblReceiveNews;

    /// <summary>
    /// chbReceiveNews control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.CheckBox chbReceiveNews;

    /// <summary>
    /// lblSendNotification control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblSendNotification;

    /// <summary>
    /// chbSendNotification control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.CheckBox chbSendNotification;

    /// <summary>
    /// trCaptcha control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlTableRow trCaptcha;

    /// <summary>
    /// recaptcha control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::Recaptcha.RecaptchaControl recaptcha;

    /// <summary>
    /// cvCaptcha control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.CustomValidator cvCaptcha;

    /// <summary>
    /// ChangePassword control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Button ChangePassword;

    /// <summary>
    /// btnSave control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Button btnSave;

    /// <summary>
    /// lblCategoryId control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblCategoryId;

    /// <summary>
    /// pnlSuceeded control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Panel pnlSuceeded;

    /// <summary>
    /// lblSuceeded control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblSuceeded;

    /// <summary>
    /// panChangePwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Panel panChangePwd;

    /// <summary>
    /// trPwdMessage control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlTableRow trPwdMessage;

    /// <summary>
    /// lblCurrPwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblCurrPwd;

    /// <summary>
    /// txtCurrentPwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.TextBox txtCurrentPwd;

    /// <summary>
    /// rfvCurrentPwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvCurrentPwd;

    /// <summary>
    /// cvCurrentPwdCorrect control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.CustomValidator cvCurrentPwdCorrect;

    /// <summary>
    /// lblNewPwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblNewPwd;

    /// <summary>
    /// txtNewPwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.TextBox txtNewPwd;

    /// <summary>
    /// rfvNewPwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvNewPwd;

    /// <summary>
    /// lblNewPwdAgain control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Label lblNewPwdAgain;

    /// <summary>
    /// txtNewPwdAgain control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.TextBox txtNewPwdAgain;

    /// <summary>
    /// rfvNewPwdAgain control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvNewPwdAgain;

    /// <summary>
    /// cfvNewPwdAgain control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.CompareValidator cfvNewPwdAgain;

    /// <summary>
    /// btnChangePwd control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Button btnChangePwd;

    /// <summary>
    /// btnChangePwdCancel control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.WebControls.Button btnChangePwdCancel;
}


text:
package avrora.stack;

/**
 * The AbstractArithmetic arithmetic class implements operations that are useful for working on
 * abstract integers which are represented as characters.

 *

 * The abstract values (e.g. register values) are represented as characters. Thus, an 8 bit register is
 * modelled using a 16-bit character. The upper 8 bits represent the "mask", those bits which are known. The
 * lower 8 bits represent the known bits of the value. Thus, if bit(regs[R], i+8) is set, then bit(R, i) is
 * known and its value is bit(regs[R], i). If bit(regs[R], i+8) is clear, then the value of bit(regs[R], i) is
 * unknown in this abstract value.

 *

 * Since there are 3 possible values (on, off, unknown) for each bit in the abstract state and there are two
 * bits reserved for representing each of these states, there are 4 bit states to represent 3 values. We
 * canonicalize the values when the bit value is unknown, i.e. when the known mask bit is clear, then the
 * value bit is clear as well. This makes comparison of canonical abstract values the same as character
 * equality. All abstract values stored within AbstractState are canonical for efficiency and
 * clarity.
 *
 * @author Ben L. Titzer
 */
public class AbstractArithmetic {
    private static final char KNOWN_MASK = 0xFF00;
    private static final char BIT_MASK = 0x00FF;
    private static final int SHIFT = 8;

    /**
     * The ZERO field represents the abstract value where all bits are known to be zero.
     */
    public static final char ZERO = KNOWN_MASK;

    /**
     * The TRUE field represents the abstract bit that is known to be true.
     */
    public static final char TRUE = 0x101;

    /**
     * The FALSE field represents the abstract bit that is known to be false.
     */
    public static final char FALSE = 0x100;

    /**
     * The UNKNOWN field represents the abstract value where none of the bits are known.
     */
    public static final char UNKNOWN = 0;

    /**
     * The merge() method merges abstract values. The merge of two abstract values is defined
     * intuitively as the intersection of the known bits of the two values that agree, and all other bits are
     * unknown. This variant of the method accepts two concrete values to merge.
     *
     * @param cv1 the first (concrete) value to merge
     * @param cv2 the second (concrete) value to merge
     * @return the abstract value representing the results of merging the two values
     */
    public static char merge(byte cv1, byte cv2) {
        int mm = ~(cv1 ^ cv2);
        return canon((char)mm, (char)cv1);
    }

    /**
     * The merge() method merges abstract values. The merge of two abstract values is defined
     * intuitively as the intersection of the known bits of the two values that agree, and all other bits are
     * unknown. This variant of the method accepts one abstract value and one concrete value to merge
     * together.
     *
     * @param av1 the first (abstract) value to merge
     * @param cv2 the second (concrete) value to merge
     * @return the abstract value representing the results of merging the two values
     */
    public static char merge(char av1, byte cv2) {
        int mm = ~(knownBitsOf(av1) ^ cv2);
        return canon((char)(mm & maskOf(av1)), av1);
    }

    /**
     * The merge() method merges abstract values. The merge of two abstract values is defined
     * intuitively as the intersection of the known bits of the two values that agree, and all other bits are
     * unknown. This variant of the method accepts three concrete values to merge.
     *
     * @param cv1 the first (concrete) value to merge
     * @param cv2 the second (concrete) value to merge
     * @param cv3 the third (concrete) value to merge
     * @return the abstract value representing the results of merging the two values
     */
    public static char merge(byte cv1, byte cv2, byte cv3) {
        return merge(merge(cv1, cv2), cv3);
    }

    /**
     * The merge() method merges abstract values. The merge of two abstract values is defined
     * intuitively as the intersection of the known bits of the two values that agree, and all other bits are
     * unknown. This variant of the method accepts four concrete values to merge.
     *
     * @param cv1 the first (concrete) value to merge
     * @param cv2 the second (concrete) value to merge
     * @param cv3 the third (concrete) value to merge
     * @param cv4 the fourth (concrete) value to merge
     * @return the abstract value representing the results of merging the two values
     */
    public static char merge(byte cv1, byte cv2, byte cv3, byte cv4) {
        return merge(merge(cv1, cv2), merge(cv3, cv4));
    }

    /**
     * The merge() method merges abstract values. The merge of two abstract values is defined
     * intuitively as the intersection of the known bits of the two values that agree, and all other bits are
     * unknown. This variant of the method accepts two abstract values to merge.
     *
     * @param av1 the first (abstract) value to merge
     * @param av2 the second (abstract) value to merge
     * @return the abstract value representing the results of merging the two values
     */
    public static char merge(char av1, char av2) {
        if (av1 == av2) return av1;

        char v1k = maskOf(av1); // known mask of av1
        char v2k = maskOf(av2); // known mask of av2

        int mm = ~(knownBitsOf(av1) ^ knownBitsOf(av2)); // matched bits
        int rk = v1k & v2k & mm & 0xff; // known bits of result

        return canon((char)rk, av1);
    }

    /**
     * The isKnown() method tests whether an abstract value represents a single, fully known
     * value.
     *
     * @param av1 the abstract value to test
     * @return true if all of the bits of the abstract value are known; false if any bits are unknown
     */
    public static boolean isUnknown(char av1) {
        return (av1 & KNOWN_MASK) != KNOWN_MASK;
    }

    /**
     * The areKnown() method tests whether two abstract values each represent a single, fully
     * known value.
     *
     * @param av1 the first abstract value to test
     * @param av2 the second abstract value to test
     * @return true if all of the bits of the both abstract values are known; false if any bits are unknown
     */
    public static boolean areKnown(char av1, char av2) {
        return (av1 & av2 & KNOWN_MASK) == KNOWN_MASK;
    }

    /**
     * The areEqual() method tests whether two abstract values are equivalent in the "abstract
     * value" sense. Two abstract values are equivalent if their known bits are equal and their known masks
     * are equal
     *
     * @param val1 the first abstract value
     * @param val2 the second abstract value
     * @return true if the abstract values are equal; false otherwise
     */
    public static boolean areEqual(char val1, char val2) {
        if (val1 == val2) return true;
        return canon(val1) == canon(val2);
    }

    /**
     * The canon() method canonicalizes an abstract value. An abstract value is canonical if all
     * of its unknown bits are set to zero. This variant takes a single abstract value and ensures that it is
     * canonical.
     *
     * @param av1 the abstract value to canonicalize
     * @return the canonicalized representation of this abstract value
     */
    public static char canon(char av1) {
        int vk = av1 & KNOWN_MASK;
        return (char)((vk) | (av1 & (vk >> SHIFT)));
    }

    /**
     * The canon() method canonicalizes an abstract value. An abstract value is canonical if all
     * of its unknown bits are set to zero. This variant takes a mask and an abstract value and returns an
     * abstract value that is canonical with the specified known bit mask.
     *
     * @param mask the known bit mask to canonicalize with respect to
     * @param av1  the abstract value to canonicalize
     * @return the canonicalized representation of this abstract value
     */
    public static char canon(char mask, char av1) {
        return (char)((mask << SHIFT) | (av1 & mask));
    }

    /**
     * The knownVal() method creates a canonical abstract value from the given concrete value.
     *
     * @param cv1 the concrete value to create an abstract value for
     * @return a canonical abstract value representing the concrete value.
     */
    public static char knownVal(byte cv1) {
        return (char)(KNOWN_MASK | (cv1 & 0xff));
    }

    /**
     * The knownBitsOf() method returns computes the concrete value from the given abstract value
     * where all unknown bits of the abstract value are set to zero.
     *
     * @param val the abstract value to get the known bits of
     * @return a concrete value such that all unknown bits are set to zero
     */
    public static byte knownBitsOf(char val) {
        return (byte)(((val & KNOWN_MASK) >> SHIFT) & val);
    }

    /**
     * The bitsOf() method returns the lower 8 bits (the value bits) of the abstract value,
     * ignoring the known bit mask. For a canonical abstract value, this method will return the same result as
     * knownBitsOf, because, by definition, the unknown bits of a canonical abstract value are
     * set to zero.
     *
     * @param av1 the abstract value
     * @return the lower bits of the abstract value as a concrete value
     */
    public static char bitsOf(char av1) {
        return (char)(av1 & BIT_MASK);
    }

    /**
     * The maskOf() method returns the upper 8 bits of the abstract (the mask bits) of the
     * abstract value. This mask represents those bits that are known.
     *
     * @param av1 the abstract value
     * @return the mask of known bits of the abstract value
     */
    public static char maskOf(char av1) {
        return (char)((av1 & KNOWN_MASK) >> SHIFT);
    }

    /**
     * The getBit() method extracts the specified abstract bit from the specified abstract
     * value.
     *
     * @param av1 the abstract value
     * @param bit the bit number
     * @return AbstractArithmetic.TRUE if the bit is known to be on;
     *         AbstractArithmetic.FALSE if the bit is known to be off;
     *         AbstractArithmetic.UNKNOWN otherwise
     */
    public static char getBit(char av1, int bit) {
        return (char)((av1 >> bit) & TRUE);
    }

    /**
     * The setBit() method updates the specified abstract bit within the specified abstract
     * value.
     *
     * @param av1 the abstract value
     * @param bit the bit number
     * @param on  the new abstract value of the bit
     * @return a new abstract value where the specified bit has been replaced with the specified abstract
     *         value
     */
    public static char setBit(char av1, int bit, char on) {
        int mask = ~(TRUE << bit);
        return (char)((av1 & mask) | ((on & TRUE) << bit));
    }

    /**
     * The couldBeZero method performs a "fuzzy" equality test against zero for an abstract
     * value. It will return one of three values, depending on whether the specified abstract value is
     * definately zero, definately not zero, or unknown.
     *
     * @param av1 the abstract value
     * @return AbstractArithmetic.TRUE if the specified abstract value is definately zero;
     *         AbstractArithmetic.FALSE if the specified abstract value cannot possibly be zero
     *         (it has one bit that is known to be on); AbstractArithmetic.UNKNOWN otherwise
     */
    public static char couldBeZero(char av1) {
        if (av1 == ZERO) return TRUE;
        if (knownBitsOf(av1) != 0) return FALSE;
        return UNKNOWN;
    }

    /**
     * The couldBeZero() method performs a "fuzzy" equality test against zero for two abstract
     * values. It will return one of three values, depending on whether the specified abstract values are
     * definately zero, definately not zero, or unknown.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @return AbstractArithmetic.TRUE if both abstract values are definately zero;
     *         AbstractArithmetic.FALSE if either of the specified abstract values cannot
     *         possibly be zero (it has one bit that is known to be on); AbstractArithmetic.UNKNOWN
     *         otherwise
     */
    public static char couldBeZero(char av1, char av2) {
        if (av1 == ZERO && av2 == ZERO) return TRUE;
        if (knownBitsOf(av1) != 0 || knownBitsOf(av2) != 0) return FALSE;
        return UNKNOWN;
    }

    /**
     * The couldBeEqual() method performs a "fuzzy" equality test between two abstract values. It
     * will return one of three values, depending on whether the abstract values are definately equal,
     * definately not equal, or unknown.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @return AbstractArithmetic.TRUE if the abstract values are definately equal;
     *         AbstractArithmetic.FALSE if the abstract values are definately not equal;
     *         AbstractArithmetic.UNKNOWN otherwise
     */
    public static char couldBeEqual(char av1, char av2) {
        if (areKnown(av1, av2) && av1 == av2) return TRUE;
        if (knownBitsOf(av1) != knownBitsOf(av2)) return FALSE;
        return UNKNOWN;
    }

    /**
     * The commonMask() method computes the intersection of the known bit masks of two abstract
     * values.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @return the intersection of the known bit masks of each abstract value
     */
    public static char commonMask(char av1, char av2) {
        return (char)(maskOf(av1) & maskOf(av2));
    }

    /**
     * The commonMask() method computes the intersection of the known bit masks of three abstract
     * values.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @param av3 the third abstract value
     * @return the intersection of the known bit masks of each abstract value
     */
    public static char commonMask(char av1, char av2, char av3) {
        return (char)(maskOf(av1) & maskOf(av2) & maskOf(av3));
    }

    /**
     * The logicalAnd method computes the logical bitwise AND of two abstract values.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @return an abstract value representing the bitwise AND of the two abstract value operands
     */
    public static char logicalAnd(char av1, char av2) {
        return (char)(av1 & av2 & TRUE);
    }

    /**
     * The add() method performs addition of two abstract values. It relies on the
     * ceiling() and floor() functions that allow abstract addition to be expressed
     * in terms of two concrete additions, resulting in a straightforward and clean implementation.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @return an abstract value that represents the sum of the two abstract values.
     */
    public static char add(char av1, char av2) {
        char common = commonMask(av1, av2);

        if (areKnown(av1, av2)) // common case of all bits are known.
            return knownVal((byte)(bitsOf(av1) + bitsOf(av2)));

        int resultA = ceiling(av1) + ceiling(av2);
        int resultB = floor(av1) + floor(av2);

        return mergeMask(common, merge((byte)resultA, (byte)resultB));
    }

    /**
     * The add() method performs subtraction of two abstract values. It relies on the
     * ceiling() and floor() functions that allow abstract subtraction to be
     * expressed in terms of two concrete subtractions, resulting in a straightforward and clean
     * implementation.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @return an abstract value that represents the difference of the two abstract values.
     */
    public static char subtract(char av1, char av2) {
        char common = commonMask(av1, av2);

        if (areKnown(av1, av2)) // common case of all bits are known.
            return knownVal((byte)(bitsOf(av1) - bitsOf(av2)));

        int resultA = ceiling(av1) - ceiling(av2);
        int resultB = floor(av1) - floor(av2);

        return mergeMask(common, merge((byte)resultA, (byte)resultB));
    }

    /**
     * The increment() method simply adds 1 to the abstract value. It is a special case of the
     * add() that is common enough to warrant its own method.
     *
     * @param av1 the abstract value
     * @return an abstract value that represents the sum of the specified abstract value and the known value
     *         1
     */
    public static char increment(char av1) {
        char mask = maskOf(av1);
        // TODO: optimize for common case of known / unknown values.
        int resultA = ceiling(av1) + 1;
        int resultB = floor(av1) + 1;
        return mergeMask(mask, merge((byte)resultA, (byte)resultB));
    }

    /**
     * The decrement() method simply subtracts 1 to the abstract value. It is a special case of
     * the subtract() that is common enough to warrant its own method.
     *
     * @param av1 the abstract value
     * @return an abstract value that represents the difference of the specified abstract value and the known
     *         value 1
     */
    public static char decrement(char av1) {
        char mask = maskOf(av1);
        // TODO: optimize for common case of known / unknown values.
        int resultA = ceiling(av1) - 1;
        int resultB = floor(av1) - 1;
        return mergeMask(mask, merge((byte)resultA, (byte)resultB));
    }

    /**
     * The mergeMask() merges the given abstract value with the known bit mask passed. This means
     * that the known bits will be the intersection of the known bits of the mask and the known bits of the
     * abstract value.
     *
     * @param mask the known bit mask
     * @param av1  the abstract value
     * @return an abstract value in which the known bit mask is the intersection of the given bit mask and the
     *         bit mask of the given abstract value
     */
    public static char mergeMask(char mask, char av1) {
        char common = (char)(mask & maskOf(av1));
        return canon(common, av1);
    }

    /**
     * The xor() method computes the bitwise exclusive or operation on the two given abstract
     * values.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @return the bitwise exclusive or of the two abstract values
     */
    public static char xor(char av1, char av2) {
        char mask = commonMask(av1, av2);
        return canon(mask, (char)(av1 ^ av2));
    }

    /**
     * The and() method computes the logical bitwise AND of two abstract values.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @return an abstract value representing the bitwise AND of the two abstract value operands
     */
    public static char and(char av1, char av2) {
        return (char)(av1 & av2);
    }

    /**
     * The or() method computes the logical bitwise or of two abstract values.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @return an abstract value representing the bitwise inclusive or of the two abstract value operands
     */
    public static char or(char av1, char av2) {
        return canon(commonMask(av1, av2), (char)(av1 | av2));
    }

    /**
     * The and() method computes the logical bitwise AND of three abstract values.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @param av3 the third abstract value
     * @return an abstract value representing the bitwise AND of the three abstract value operands
     */
    public static char and(char av1, char av2, char av3) {
        return (char)(av1 & av2 & av3);
    }

    /**
     * The or() method computes the logical bitwise or of three abstract values.
     *
     * @param av1 the first abstract value
     * @param av2 the second abstract value
     * @param av3 the third abstract value
     * @return an abstract value representing the bitwise inclusive or of the two abstract value operands
     */
    public static char or(char av1, char av2, char av3) {
        return canon(commonMask(av1, av2, av3), (char)(av1 | av2 | av3));
    }

    /**
     * The not() method computes the bitwise negation (one's complement) of the specified
     * abstract value
     *
     * @param av1 the abstract value
     * @return the abstract value representing the bitwise negation of the operand
     */
    public static char not(char av1) {
        return canon((char)(av1 ^ 0xff));
    }

    /**
     * The ceiling() function computes the concrete value with all unknown bits set to one. This
     * is useful for implementation of some arithmetic operations.
     *
     * @param av1 the abstract value to compute the ceiling of
     * @return a concrete value where each of the unknown bits of the abstract value are set to one
     */
    public static int ceiling(char av1) {
        int invmask = (~maskOf(av1)) & 0xff;
        return bitsOf(av1) | invmask;
    }

    /**
     * The ceiling() function computes the concrete value with all unknown bits set to one. This
     * is useful for implementation of some arithmetic operations. This variant takes two abstract values
     * representing the lower and upper bytes of a word and returns a concrete unsigned 16-bit word
     * representing the ceiling function.
     *
     * @param av1 the abstract value representing the lower byte
     * @param av2 the abstract value representing the high byte
     * @return a concrete word value where each of the unknown bits of the abstract value are set to one
     */
    public static int ceiling(char av1, char av2) {
        return ceiling(av1) | (ceiling(av2) << 8);
    }

    /**
     * The floor() function computes the concrete value with all unknown bits set to zero. This
     * is useful for implementation of some arithmetic operations.
     *
     * @param av1 the abstract value to compute the ceiling of
     * @return a concrete value where each of the unknown bits of the abstract value are set to zero
     */
    public static int floor(char av1) {
        return bitsOf(av1);
    }

    /**
     * The floor() function computes the concrete value with all unknown bits set to zero. This
     * is useful for implementation of some arithmetic operations. This variant takes two abstract values
     * representing the lower and upper bytes of a word and returns a concrete unsigned 16-bit word
     * representing the floor function.
     *
     * @param av1 the abstract value representing the lower byte
     * @param av2 the abstract value representing the high byte
     * @return a concrete word value where each of the unknown bits of the abstract value are set to zero
     */
    public static int floor(char av1, char av2) {
        return bitsOf(av1) | (bitsOf(av2) << 8);
    }

    /**
     * The shiftLeftOne() method shifts the abstract value left by one bit.
     *
     * @param av1 the abstract value
     * @return an abstract value representing the operand shifted left by one and the lower bit is set to
     *         known zero
     */
    public static char shiftLeftOne(char av1) {
        return (char)(((av1 & 0x7f7f) << 1) | FALSE);
    }

    /**
     * The shiftLeftOne() method shifts the abstract value left by one bit and sets the lowest
     * bit to the given value.
     *
     * @param av1    the abstract value
     * @param lowbit the value of the lowest bit
     * @return an abstract value representing the operand shifted left by one and the lower bit is set to the
     *         given value
     */
    public static char shiftLeftOne(char av1, char lowbit) {
        return (char)(((av1 & 0x7f7f) << 1) | (lowbit & TRUE));
    }

    /**
     * The toString() method converts an 8-bit abstract value to a string representation. Each
     * bit's value is represented as either '0', '1', or '.' and listed with the most significant first.
     *
     * @param av1 the abstract value to convert to a string
     * @return a string representation of the abstract value
     */
    public static String toString(char av1) {
        StringBuffer buf = new StringBuffer(9);
        toString(av1, buf);
        return buf.toString();
    }

    /**
     * The toShortString() method converts an 8-bit abstract value to a string representation.
     * Each bit's value is represented as either '0', '1', or '.' and listed with the most significant first.
     *
     * @param av1 the abstract value to convert to a string
     * @return a string representation of the abstract value
     */
    public static String toShortString(char av1) {
        if (av1 == ZERO) return "0";
        StringBuffer buf = new StringBuffer(9);
        toString(av1, buf);
        return buf.toString();
    }

    /**
     * The toString() method converts an 1-bit abstract value to a string representation. The
     * bit's value is represented as either '0', '1', or '.'.
     *
     * @param av1 the abstract bit to convert to a string
     * @return a character representation of the abstract bit
     */
    public static char bitToChar(char av1) {
        switch (av1) {
            case TRUE:
                return '1';
            case FALSE:
                return '0';
            default:
                return '.';
        }
    }

    /**
     * The toString() method converts an 8-bit abstract value to a string representation and
     * appends it to the end of the given string buffer. Each bit's value is represented as either '0', '1',
     * or '.' and listed with the most significant first.
     *
     * @param av1 the abstract value to convert to a string
     * @param buf the string buffer to append the result to
     */
    public static void toString(char av1, StringBuffer buf) {
        for (int cntr = 7; cntr >= 0; cntr--) {
            buf.append(bitToChar(getBit(av1, cntr)));
        }
    }
}

redpajama_set_name: RedPajamaGithub


text: mongoimport -d snps -c problem11 --drop problem11.json


text:
import hashlib
import logging
import logging.handlers
import multiprocessing
import os
import sys
import time

import chardet
import configobj
import HTML
import MySQLdb

try:
   from collections import OrderedDict
except ImportError:
   # Python 2.6
   from ordereddict import OrderedDict

CONFIG_FILE = 'ofarchiver.ini'
CONFIG_DIRS = ('/usr/local/etc', '/etc', os.environ['HOME'])
SUPPORTED_DBS = ('mysql',)

_ofarchiver = None
_lock = None

class OfArchiver(object):

    """A class for generating an HTML archive of chat rooms on an Openfire
    instant messaging server.

    Public methods:
    get_rooms -- Returns the list of rooms to archive.
    gen_archive -- Generates HTML archives for a chat room.
    """

    _lock = None
    _used_colors = {}

    def __init__(self):
        for config_dir in CONFIG_DIRS:
            config_path = os.path.join(config_dir, CONFIG_FILE)
            if os.path.isfile(config_path):
                self.config = configobj.ConfigObj(config_path)
                break
        else:
            sys.stderr.write("%s not found in either of these directories: %s\n" %
                             (CONFIG_FILE, ', '.join(CONFIG_DIRS)) )
            sys.exit(1)

        self._set_logging()

        try:
            self._basedir = self.config['main']['basedir']
        except KeyError:
            self.error("Archive base directory not configured")

        if not os.path.isdir(self._basedir):
            self.error("'%s' doesn't exist or isn't a directory" %
                       self._basedir)

        try:
            self._confserver = self.config['main']['confserver']
        except KeyError:
            self.error('Conference server not configured')

        self._dbtype = self.config['main']['db']
        if self._dbtype not in SUPPORTED_DBS:
            self.error("Database type '%s' not supported" % self._dbtype)

        try:
            dbconfig = self.config['db']
        except KeyError:
            self.error("Config for database not found")

        dbvars = ('hostname', 'username', 'password', 'database')
        for dbvar in dbvars:
            try:
                setattr(self, '_db' + dbvar, dbconfig[dbvar])
            except KeyError:
                self.error("Database variable '%s' not defined" % dbvar)

        try:
            colorconfig = self.config['colors']
            if colorconfig['enabled'] == 'true':
                self._colors = colorconfig['names']
            else:
                self._colors = None
        except KeyError:
            self._colors = None

        try:
            self._org = self.config['main']['org']
        except KeyError:
            self._org = None

        try:
            self._rooms = self.config['main']['rooms']
        except KeyError:
            self._rooms = self._get_available_rooms()

    def _set_logging(self):
        self._logger = logging.getLogger('ofarchiver')
        self._logger.setLevel(logging.DEBUG)

        debug = False
        loglevel = logging.ERROR
        try:
            debug = self.config['main']['debug']
            if debug == 'true':
                loglevel = logging.DEBUG
        except KeyError:
            pass

        handler = logging.StreamHandler()
        handler.setLevel(loglevel)
        self._logger.addHandler(handler)

        try:
            logfile = self.config['main']['logfile']
        except KeyError:
            pass
        else:
            if debug == 'true':
                loglevel = logging.DEBUG
            else:
                loglevel = logging.INFO

            handler = logging.handlers.RotatingFileHandler(logfile,
                                                           maxBytes=10485760,
                                                           backupCount=5)
            handler.setLevel(loglevel)
            logformat = "%(asctime)s - %(levelname)s - %(message)s"
            formatter = logging.Formatter(logformat)
            handler.setFormatter(formatter)
            self._logger.addHandler(handler)

    def _log(self, msg, level):
        """Log a message with the given level."""
        try:
            loglevel = getattr(logging, level.upper())
        except AttributeError:
            self.error("Log level '%s' not valid" % level)

        if self._lock is not None:
            with self._lock:
                self._logger.log(loglevel, msg)
        else:
            self._logger.log(loglevel, msg)

    def debug(self, msg):
        self._log(msg, level='DEBUG')

    def info(self, msg):
        self._log(msg, level='INFO')

    def warn(self, msg):
        self._log(msg, level='WARNING')

    def error(self, msg):
        self._log(msg, level='ERROR')
        sys.exit(1)

    def get_rooms(self):
        return self._rooms

    def _get_available_rooms(self):
        """Return a list of rooms available to archive."""
        db = self._db_connect()
        cursor = db.cursor()
        sql = """SELECT DISTINCT ToJID from ofMessageArchive
                 WHERE ToJID LIKE '%%@%s/%%'""" % self._confserver
        cursor.execute(sql)

        roomlist = []
        for row in cursor:
            room, therest = row[0].split('@', 1)
            roomlist.append(room)

        # dedupe the list
        return list(set(roomlist))

    def gen_archive(self, room, lock=None):
        """Generate HTML archive for a chat room.

        A lock can also be passed, when using the threading or
        multiprocessing module to improve performance.
        """
        self._lock = lock
        self.debug("Generating HTML for '%s'" % room)

        roomdict = OrderedDict()
        for msgdict in self._fetch_msgs(room):
            msgmember = msgdict['member']
            msgdate = msgdict['date']
            msgbody = msgdict['body']

            filepath = self._get_file_path(room, msgdate)

            try:
                table = roomdict[filepath]['table']
            except KeyError:
                tabledict = self._init_table(room, msgdate)
                roomdict[filepath] = tabledict
                table = tabledict['table']

            row = self._gen_table_row(msgdate, msgmember, msgbody)
            table.rows.append(row)

        for filepath in roomdict:
            tabledict = roomdict[filepath]

            html = """

            <title>%(title)s</title>

%(title)s

            %(table)s

            """ % tabledict

            with open(filepath, 'w') as htmlfile:
                htmlfile.write(html)
                numentries = len(tabledict['table'].rows)
                self.debug("Wrote %d archive messages to %s" %
                           (numentries, filepath))

        self.info("Wrote %d HTML files for %s" % (len(roomdict), room))

    def _db_connect(self):
        """Return a connection to the database."""
        try:
            db = MySQLdb.connect(self._dbhostname, self._dbusername,
                                 self._dbpassword, self._dbdatabase)
        except Exception as exc_info:
            self.error("Couldn't connect to %s on %s: %s" %
                       (self._dbtype, self._dbhostname, exc_info))

        return db

    def _fetch_msgs(self, room):
        """Fetch all messages for a room, encoded as UTF-8"""
        db = self._db_connect()
        cursor = db.cursor(MySQLdb.cursors.SSDictCursor)

        # Some rows have a NULL body for some undetermined reason.
        # They don't seem to correspond to actual messages sent.
        sql = """SELECT FromJID, ToJID, sentDate, body
                from ofMessageArchive WHERE ToJID LIKE '%s@%%'
                AND body IS NOT NULL ORDER BY sentDate""" % room
        cursor.execute(sql)

        for row in cursor:
            msg = {}

            try:
                msg['member'] = row['FromJID'].split('@')[0]
                # strip away the milliseconds
                msg['date'] = row['sentDate'] / 1000
                msg['body'] = row['body']
            except Exception as exc_info:
                self.warn("Expected values for database row not found: %s" %
                          exc_info)
                continue

            try:
                detected = chardet.detect(msg['body'])
            except TypeError as exc_info:
                self.warn("Couldn't detect encoding for '%s': %s" %
                          (msg['body'], exc_info))
            else:
                try:
                    decodedmsg = msg['body'].decode(detected['encoding'])
                except UnicodeDecodeError as exc_info:
                    self.warn("Couldn't decode '%s': %s" %
                              (msg['body'], exc_info))
                else:
                    msg['body'] = decodedmsg.encode('utf-8')

                    yield msg

    def _get_file_path(self, room, msgdate):
        """Return a file path based on room and message date."""
        timestruct = time.localtime(msgdate)
        monthsubdir = time.strftime("%Y/%B", timestruct)

        filedir = "%s/%s/%s" % (self._basedir, room, monthsubdir)
        if not os.path.isdir(filedir):
            os.makedirs(filedir)

        msgday = time.strftime("%d", timestruct)
        filepath = "%s/%s.html" % (filedir, msgday)

        return filepath

    def _init_table(self, room, msgdate):
        """Initialize a room table."""
        tabledict = {}

        tabledict['table'] = HTML.Table(header_row=
                                        ('Time', 'Member', 'Message')
                                        )

        timestruct = time.localtime(msgdate)
        titledate = time.strftime("%A, %B %d, %Y", timestruct)
        title = ''
        if self._org is not None:
            title += "%s " % self._org
        title += "%s archive for %s" % (room, titledate)
        tabledict['title'] = title

        return tabledict

    def _gen_table_row(self, msgdate, msgmember, msgbody):
        """Generate a row for the room table."""
        timestruct = time.localtime(msgdate)
        msgtime = time.strftime("%H:%M:%S %Z", timestruct)

        row = []
        for col in (msgtime, msgmember, msgbody):
            if self._colors is not None and col is msgmember:
                color = self._pick_member_color(msgmember)
                style = "color: %s" % color
            else:
                style = None

            cell = HTML.TableCell(col, style=style)
            row.append(cell)

        return row

    def _pick_member_color(self, member):
        """Pick a color for a member, unique from the others if possible."""
        if member in self._used_colors:
            return self._used_colors[member]

        colors = self._colors

        index = self._hash(colors, member)
        color = colors[index]

        # While there's a hash collision, append the reversed member name
        # and try again until all colors have been used up.
        reversed_member = member
        while (color in self._used_colors.values() and
               len(self._used_colors) < len(colors)):
            reversed_member += reversed_member[::-1]
            index = self._hash(colors, reversed_member)
            color = colors[index]

        self._used_colors[member] = color
        return color

    def _hash(self, hlist, hkey):
        """Return a hash given a list and key."""
        hobj = hashlib.sha256(hkey)
        hdigest = hobj.hexdigest()
        hindex = int(hdigest, 16) % len(hlist)

        return hindex

def gen_archive(room):
    """Generate HTML archive for a chat room.

    This wrapper function is required to work around this limitation:
    http://stackoverflow.com/questions/1816958/

    """
    _ofarchiver.gen_archive(room, _lock)

def main():
    global _ofarchiver
    global _lock

    _ofarchiver = OfArchiver()
    rooms = _ofarchiver.get_rooms()

    if len(rooms) > 1:
        manager = multiprocessing.Manager()
        _lock = manager.Lock()

        pool = multiprocessing.Pool()
        pool.map(gen_archive, rooms, 1)
        pool.close()
        pool.join()
    elif rooms:
        _ofarchiver.gen_archive(rooms[0])

if __name__ == '__main__':
    main()

__all__ = ['OfArchiver',]


text:
package org.gradle.tooling.internal.provider;

import org.gradle.tooling.BuildAction;
import org.gradle.tooling.BuildController;
import org.gradle.tooling.GradleConnectionException;

import java.util.List;

public class CustomAction implements BuildAction<Object> {
    // Some interesting type references
    byte[][][] buffers;
    BuildController[][] controllers;
    List<String> values;

    public Object execute(BuildController controller) throws GradleConnectionException {
        return new CustomModel(this);
    }
}


text:
using ImageMagick;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ImageMagickApprovalReporter.Comperers
{
    public abstract class ImageCompererBase : IDisposable
    {
        protected readonly string image1Path;
        protected readonly string image2Path;
        protected readonly MagickImage image1;
        protected readonly MagickImage image2;

        public ImageCompererBase(string image1Path, string image2Path)
        {
            this.image1Path = image1Path;
            this.image2Path = image2Path;

            if (!File.Exists(image1Path) || !File.Exists(image2Path))
            {
                NoFileExists = true;
                return;
            }
            image1 = TransferToRgbIfNeeded(new MagickImage(image1Path));
            image2 = TransferToRgbIfNeeded(new MagickImage(image2Path));
        }

        public virtual bool NoFileExists { get; protected set; }

        public abstract void SaveDiffIamgeTo(string diffImagePath);

        public virtual void Dispose()
        {
            if (image1 != null)
                image1.Dispose();
            if (image2 != null)
                image2.Dispose();
        }

        protected virtual MagickImage TransferToRgbIfNeeded(MagickImage image)
        {
            if (image.ColorSpace != ColorSpace.sRGB)
                image.ColorSpace = ColorSpace.sRGB;
            return image;
        }
    }

    internal abstract class ImageCompererBase<ParmsType> : ImageCompererBase where ParmsType : IImageCompererParms
    {
        protected readonly ParmsType parms;

        public ImageCompererBase(string image1Path, string image2Path, ParmsType parms)
            : base(image1Path, image2Path)
        {
            this.parms = parms;
        }
    }
}


text:
<?xml version="1.0" ?>
<!DOCTYPE FTCS SYSTEM "futuretense_cs.dtd">
<FTCS Version="1.1">

		<STRING.STREAM VALUE="Variables.AssetType"/>

		<XLAT.LOOKUP KEY="dvin/UI/Save" VARNAME="_Save_"/>
				<INPUT type="SUBMIT" value="Variables._Save_" REPLACEALL="Variables._Save_"/>

			<XLAT.STREAM KEY="dvin/AT/Common/ID"/>:

			<STRING.STREAM VALUE="Variables.id"/>

		<XLAT.STREAM KEY="dvin/AT/Common/Name"/>:

			<replace STR="Variables.ContentDetails:name">
				<input TYPE="TEXT" NAME="Segments:name" SIZE="32" MAXLENGTH="32" VALUE="Variables.ContentDetails:name"/>
			</replace>

		<XLAT.STREAM KEY="dvin/AT/Common/Description"/>:

			<SETVAR NAME="OutputQString" VALUE="Variables.empty"/>
			<STRING.ENCODE VARIABLE="ContentDetails:description" VARNAME="OutputQString"/>
			<input TYPE="TEXT" NAME="Segments:description" SIZE="32" MAXLENGTH="128" VALUE="Variables.OutputQString" REPLACEALL="Variables.OutputQString"/>

			<XLAT.STREAM KEY="dvin/AT/Segments/RuleSetID"/>:

			<STRING.STREAM VALUE="Variables.ContentDetails:ruleset_id"/>

	<if COND="IsVariable.ContentDetails:ruleset=true">
		<then>
			<substitute STR="Variables.ContentDetails:ruleset" WHAT="<" WITH="&lt;" OUTSTR="OurText"/>
		</then>
		<else>
			<setvar NAME="OurText" VALUE="Variables.empty"/>
		</else>
	</if>

		<XLAT.STREAM KEY="dvin/AT/Common/XML"/>:

			<textarea name="SegmentRuleText" rows="24" COLS="60" wrap="virtual"><STRING.STREAM VALUE="Variables.OurText"/></textarea>

<INPUT type="SUBMIT" value="Variables._Save_" REPLACEALL="Variables._Save_"/>

</FTCS>


text:
package uk.trainwatch.util.cache;

import javax.cache.configuration.Factory;
import javax.cache.expiry.ExpiryPolicy;

/**
 *
 * @author peter
 */
public class HalfMinuteExpiryPolicyFactory
        implements Factory<ExpiryPolicy>
{

    @Override
    public ExpiryPolicy create()
    {
        return new HalfMinuteExpiryPolicy();
    }

}


text:
namespace views {
class Textfield;
class View;
}  // namespace views

namespace ash {

class AppListView;
class AppListViewDelegate;
class ContentsView;
class ResultSelectionController;
class SearchBoxViewDelegate;
class SearchResultBaseView;

// Subclass of SearchBoxViewBase. SearchBoxModel is its data model
// that controls what icon to display, what placeholder text to use for
// Textfield. The text and selection model part could be set to change the
// contents and selection model of the Textfield.
class ASH_EXPORT SearchBoxView : public SearchBoxViewBase,
                                 public AppListModelProvider::Observer,
                                 public SearchBoxModelObserver {
 public:
  enum class PlaceholderTextType {
    kShortcuts = 0,
    kTabs = 1,
    kSettings = 2,
    kGames = 3
  };

  SearchBoxView(SearchBoxViewDelegate* delegate,
                AppListViewDelegate* view_delegate,
                AppListView* app_list_view = nullptr);

  SearchBoxView(const SearchBoxView&) = delete;
  SearchBoxView& operator=(const SearchBoxView&) = delete;

  ~SearchBoxView() override;

  // Initializes the search box style for usage in bubble (clamshell mode)
  // launcher.
  void InitializeForBubbleLauncher();

  // Initializes the search box style for usage in fullscreen (tablet mode)
  // launcher.
  void InitializeForFullscreenLauncher();

  // Must be called before the user interacts with the search box. Cannot be
  // part of Init() because the controller isn't available until after Init()
  // is called.
  void SetResultSelectionController(ResultSelectionController* controller);

  // Called when tablet mode starts and ends.
  void OnTabletModeChanged(bool started);

  // Resets state of SearchBoxView so it can be reshown.
  void ResetForShow();

  // Returns the total focus ring spacing for use in folders.
  static int GetFocusRingSpacing();

  // Creates a focus ring layer if the search box is not in the bubble launcher.
  void MaybeCreateFocusRing();

  // Overridden from SearchBoxViewBase:
  void UpdateSearchTextfieldAccessibleNodeData(
      ui::AXNodeData* node_data) override;
  void HandleSearchBoxEvent(ui::LocatedEvent* located_event) override;
  void UpdateKeyboardVisibility() override;
  void HandleQueryChange(const std::u16string& query,
                         bool initiated_by_user) override;
  void UpdatePlaceholderTextStyle() override;
  void UpdateSearchBoxBorder() override;
  void RecordSearchBoxActivationHistogram(ui::EventType event_type) override;
  void OnSearchBoxActiveChanged(bool active) override;
  void UpdateSearchBoxFocusPaint() override;

  // AppListModelProvider::Observer:
  void OnActiveAppListModelsChanged(AppListModel* model,
                                    SearchModel* search_model) override;

  // Overridden from views::View:
  void OnKeyEvent(ui::KeyEvent* event) override;
  bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
  void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
  void OnPaintBackground(gfx::Canvas* canvas) override;
  void OnPaintBorder(gfx::Canvas* canvas) override;
  const char* GetClassName() const override;
  void OnThemeChanged() override;
  void OnBoundsChanged(const gfx::Rect& previous_bounds) override;

  // Updates the search box's background corner radius and color based on the
  // state of AppListModel.
  void UpdateBackground(AppListState target_state);

  // Updates the search box's layout based on the state of AppListModel.
  void UpdateLayout(AppListState target_state, int target_state_height);

  // Returns background border corner radius in the given state.
  int GetSearchBoxBorderCornerRadiusForState(AppListState state) const;

  // Returns background color for the given state.
  SkColor GetBackgroundColorForState(AppListState state) const;

  // Shows Zero State suggestions.
  void ShowZeroStateSuggestions();

  // Called when the wallpaper colors change.
  void OnWallpaperColorsChanged();

  // Sets the autocomplete text if autocomplete conditions are met.
  void ProcessAutocomplete(SearchResultBaseView* first_result_view);

  // Sets up prefix match autocomplete. Returns true if successful.
  bool ProcessPrefixMatchAutocomplete(SearchResult* search_result,
                                      const std::u16string& user_typed_text);

  // Removes all autocomplete text.
  void ClearAutocompleteText();

  // Updates the search box with |new_query| and starts a new search.
  void UpdateQuery(const std::u16string& new_query);

  // Clears the search query and de-activate the search box.
  void ClearSearchAndDeactivateSearchBox();

  // Sets the view accessibility ID of the search box's active descendant.
  // The active descendant should be the currently selected result view in the
  // search results list.
  // `nullopt` indicates no active descendant, i.e. that no result is selected.
  void SetA11yActiveDescendant(
      const absl::optional<int32_t>& active_descendant);

  // Refreshes the placeholder text with a fixed one rather than the one picked
  // up randomly
  void UseFixedPlaceholderTextForTest();

  void set_contents_view(ContentsView* contents_view) {
    contents_view_ = contents_view;
  }
  ContentsView* contents_view() { return contents_view_; }

  ResultSelectionController* result_selection_controller_for_test() {
    return result_selection_controller_;
  }
  void set_highlight_range_for_test(const gfx::Range& range) {
    highlight_range_ = range;
  }

  const std::u16string& current_query() const { return current_query_; }

  // Update search box view background when result container visibility changes.
  void OnResultContainerVisibilityChanged(bool visible);

  // Whether the search box has a non-empty, non-whitespace query.
  bool HasValidQuery();

  // Calculates the correct sizing for search box icons and buttons.
  int GetSearchBoxIconSize();
  int GetSearchBoxButtonSize();

 private:
  class FocusRingLayer;

  // Called when the close button within the search box gets pressed.
  void CloseButtonPressed();

  // Called when the assistant button within the search box gets pressed.
  void AssistantButtonPressed();

  // Updates the icon shown left of the search box texfield.
  void UpdateSearchIcon();

  // Whether 'autocomplete_text' is a valid candidate for classic highlighted
  // autocomplete.
  bool IsValidAutocompleteText(const std::u16string& autocomplete_text);

  // Updates the text field text color.
  void UpdateTextColor();

  // Updates the search box placeholder text and accessible name.
  void UpdatePlaceholderTextAndAccessibleName();

  // Notifies SearchBoxViewDelegate that the autocomplete text is valid.
  void AcceptAutocompleteText();

  // Returns true if there is currently an autocomplete suggestion in
  // search_box().
  bool HasAutocompleteText();

  // After verifying autocomplete text is valid, sets the current searchbox
  // text to the autocomplete text and sets the text highlight.
  void SetAutocompleteText(const std::u16string& autocomplete_text);

  // Returns the text shown in the text field when there is no text inputs.
  SearchBoxView::PlaceholderTextType SelectPlaceholderText() const;

  // Overridden from views::TextfieldController:
  void OnBeforeUserAction(views::Textfield* sender) override;
  bool HandleKeyEvent(views::Textfield* sender,
                      const ui::KeyEvent& key_event) override;
  bool HandleMouseEvent(views::Textfield* sender,
                        const ui::MouseEvent& mouse_event) override;
  bool HandleGestureEvent(views::Textfield* sender,
                          const ui::GestureEvent& gesture_event) override;

  // Overridden from SearchBoxModelObserver:
  void SearchEngineChanged() override;
  void ShowAssistantChanged() override;

  // Updates search_box() for the |selected_result|. Should be called when the
  // selected search result changes.
  void UpdateSearchBoxForSelectedResult(SearchResult* selected_result);

  // Returns true if the event to trigger autocomplete should be handled.
  bool ShouldProcessAutocomplete();

  // Clear highlight range.
  void ResetHighlightRange();

  // Tracks whether the search result page view is visible.
  bool search_result_page_visible_ = false;

  // Tracks the current app list state.
  AppListState current_app_list_state_ = AppListState::kStateApps;

  std::u16string current_query_;

  // The range of highlighted text for autocomplete.
  gfx::Range highlight_range_;

  // The key most recently pressed.
  ui::KeyboardCode last_key_pressed_ = ui::VKEY_UNKNOWN;

  SearchBoxViewDelegate* const delegate_;
  AppListViewDelegate* const view_delegate_;

  // Owned by views hierarchy. May be null for bubble launcher.
  AppListView* const app_list_view_;

  // Owned by views hierarchy. May be null for bubble launcher.
  ContentsView* contents_view_ = nullptr;

  // The layer that will draw the focus ring if needed. Could be a nullptr if
  // the search box is in the bubble launcher.
  std::unique_ptr<FocusRingLayer> focus_ring_layer_;

  // Whether the search box is embedded in the bubble launcher.
  const bool is_app_list_bubble_;

  // Whether tablet mode is active.
  bool is_tablet_mode_;

  // Whether the search box view should draw a highlight border.
  bool should_paint_highlight_border_ = false;

  // The corner radius of the search box background.
  int corner_radius_ = 0;

  // Set by SearchResultPageView when the accessibility selection moves to a
  // search result view - the value is the ID of the currently selected result
  // view.
  absl::optional<int32_t> a11y_active_descendant_;

  // Owned by SearchResultPageView (for fullscreen launcher) or
  // ProductivityLauncherSearchPage (for bubble launcher).
  ResultSelectionController* result_selection_controller_ = nullptr;

  // The timestamp taken when the search box model's query is updated by the
  // user. Used in metrics. Metrics are only recorded for search model updates
  // that occur after a search has been initiated.
  base::TimeTicks user_initiated_model_update_time_;

  // If true, `SelectPlaceholderText()` always returns a fixed placeholder text
  // instead of the one picked randomly.
  bool use_fixed_placeholder_text_for_test_ = false;

  base::ScopedObservation<SearchBoxModel, SearchBoxModelObserver>
      search_box_model_observer_{this};

  base::WeakPtrFactory<SearchBoxView> weak_ptr_factory_{this};
};

}  // namespace ash

#endif  // ASH_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_


text:
img: https://storage.googleapis.com/mail-attachments
subject: "Isha Programs, June 2017"
preview: https://rawgit.com/ishacrm/emails/master/dist/au/2017/program-schedule-201705.html
---
<container>
    {{> spacer }}
    <row class="email-header">
        <columns large="2" small="4">
            <wrapper>

            </wrapper>
        </columns>
        <columns large="8" small="8">
            <wrapper class="header text-right" valign="middle">
                Program Schedule

                International Day of Yoga

                June 2017
            </wrapper>
        </columns>
    </row>
    {{> drop-shadow }}
    <row class="section-title orange-background">
        <columns>
            Inner Engineering Completion (2 day program)
        </columns>
    </row>
    <row class="collapse no-vpad">
        <columns>
            <wrapper>

            </wrapper>
        </columns>
    </row>
    {{> spacer-white-small }}
    <row>
        <columns large="1" small="2" class="no-pad-right no-pad-left">

        </columns>
        <columns large="10" small="9">

                    Logic can take you through the mundane. But if you want to know the magic of life, you need to transcend logic.

                    - Sadhguru

        </columns>
        <columns large="1" small="1">
        </columns>
    </row>
    <row>
        <columns>

                Inner Engineering Completion is a 2 day in-person course available to those who have completed Inner Engineering Online. In this class, you will learn a simple and powerful 21 minute practice called Shambhavi Mahamudra Kriya.

Maintain high energy and alertness throughout the day

Eliminate stress, fear and anxiety

Improve communication and interpersonal relationships

Enhance mental clarity, emotional balance & productivity

Relief from chronic ailments

Achieve inner peace, joy and fulfillment

        </columns>
    </row>
    <row class="program-details">
        <columns>

                    Date:
                    1 - 2 July (Early Bird ends on 16 June)

                    Venue:
                    Sri Ruthra Kaliamman Temple

* Completion of Inner Engineering Online is a prerequisite

        </columns>
    </row>
    {{> spacer-white-small}}
    <row>
        <columns>

Existing Inner Engineering Online User?

Steps to register for Shambhavi Mahamudra Kriya

Login to the course using your IEO username/password

Finish all the 7 modules and the survey

You will notice a new "Shambhavi" tab on the top

Click on the Shambhavi tab and follow the instructions

        </columns>
    </row>

    {{> drop-shadow }}

    <row class="collapse no-vpad">
        <columns>
            <wrapper>

            </wrapper>
        </columns>
    </row>
    {{> drop-shadow }}

    <row class="section-title orange-background">
        <columns>
            FREE Isha Upa Yoga Workshops

            Celebrating International Day of Yoga
        </columns>
    </row>
    {{> spacer-white}}

    <row>
        <columns>

                In celebration of the 3rd International Day of Yoga - 2017, Isha Singapore will be offering FREE Isha Upa Yoga workshops in Singapore.

        </columns>
    </row>
    <row>
        <columns large="4">
            <wrapper>

            </wrapper>
        </columns>

        <columns large="6">

                These 5-minute processes are easy-to-practice yet potent tools to enhance health, joy, peace, love, success and inner exploration, helping one cope with the hectic pace of modern life and realize full potential in all spheres of life.

        </columns>
    </row>
    {{> spacer-white }}
    <row>
        <columns>

                    Date
                    Time
                    Center

                    Sun, 18 June 2017
                    09:30 am - 11:00 am
                    Woodlands CC

                    Sun, 18 June 2017
                    11:30 am - 01:00 pm
                    Woodlands CC

                    Sun, 18 June 2017
                    04:00 pm - 05:30 pm
                    Woodlands CC

                    Sun, 18 June 2017
                    06:00 pm - 07:30 pm
                    Woodlands CC

                    Sun, 18 June 2017
                    09:00 am - 10:30 am
                    CA T1, Singapore

                    Sun, 18 June 2017
                    11:00 am - 12:30 pm
                    CA T1, Singapore

                    Sun, 18 June 2017
                    09:00 am - 10:30 am
                    YBIS, Singapore

                    Sun, 18 June 2017
                    11:00 am - 12:30 pm
                    YBIS, Singapore

<button href="https://ishayoga.sg/idy" class="orange small">Register</button>

        </columns>
    </row>
    {{> drop-shadow}}

    <row class="section-title orange-background">
        <columns>
            Surya Kriya - Fire up the Sun within
        </columns>
    </row>
    {{> spacer-white-small}}
    <row>
        <columns>

                Surya Kriya, the forefather to Surya Namaskar (Sun Salutation) is a powerful process of activating the sun within you. It balances a person's energies, leading to stability of the body and stillness of the mind. This strong foundation becomes the basis to explore higher dimensions of life.

        </columns>
    </row>
    <row class="no-vpad">
        <columns large="4">
            <wrapper>

            </wrapper>
        </columns>

        <columns large="6">

Develops mental clarity and focus

Remedies weak constitutions

Balances hormonal levels in the body

Prepares one for deeper states of meditation

        </columns>
    </row>
    <row class="program-details">
        <columns>

                    Date:
                    17 - 18 June

                    Venue:
                    SIC, Singapore

<button href="https://ishayoga.sg/register/2078" class="orange small">Register</button>
        </columns>
    </row>
    {{> drop-shadow }}

    <row class="section-title orange-background">
        <columns>
            Hatha Yoga Refresher Sessions
        </columns>
    </row>
    {{> spacer-white-small}}
    <row>
        <columns>

Refresher sessions are a chance to go through the practice guided by a trained Hatha Yoga teacher.

It is a good opportunity to get your practices corrected, deepen the experience of your practice and clarify any doubts that you may have.

Please note that these sessions are open only to those that have completed the respective program (Surya Kriya / Bhuta Shuddhi) and are offered free of cost

        </columns>
    </row>

    <row>
        <columns>

Surya Kriya Refresher

Dates: 17 June, 4:15 pm to 5:45 pm

Venue: SIC, Singapore

<button href="https://ishayoga.sg/register/2163" class="orange small">Register</button>

        </columns>
    </row>

    <row>
        <columns>

Bhuta Shuddhi Refresher

Dates: 17 June, 3:30 pm to 4 pm

Venue: SIC, Singapore

<button href="https://ishayoga.sg/register/2164" class="orange small">Register</button>

        </columns>
    </row>
    {{> drop-shadow }}

    <row class="section-title orange-background">
        <columns>
            Sadhana Day
        </columns>
    </row>
    {{> spacer-white-small }}
    <row class="section-text">
        <columns>
            <callout class="secondary">

When we say sadhana, we are not talking about any particular aspect.
                    We are talking about using every aspect of life – both internal and external – so that it is a continuous nurturing for your life.
                    Because the very nature of a human being is such, unless there is some dynamism, some movement in his life towards betterment within
                    and outside of himself, he will feel frustrated. He has to keep moving to a newer and newer possibility.
                    Sadhana is that which facilitates that.

                        - Sadhguru

            </callout>

 For many of us, when we first went through Inner Engineering or any advanced program,
                we experienced high energy levels, intensity, and awareness. As external influences grow,
                slowly we again feel like we are getting stuck either in the same limitations or patterns.

 Sadhana Day is a unique opportunity for you to break the threshold, revitalise, and
                intensify your sadhana to the next level with Sadhguru's grace. The structure for this
                day has been crafted under the guidance of Sadhguru and will be conducted by a trained
                Inner Engineering teacher. You will have opportunity to

Get corrections for your Kriyas including both Shakti Chalana Kriya and Shambhavi Mahamudra Kriya.

Clear any doubts / questions related to practices.

Seek guidance with respect to your own inner journey with Isha.

Access meditations and processes exclusive to Sadhana Day.

Watch videos by Sadhguru to support your Sadhana.

Please note:

Prerequisite: Initiation into Shambhavi Mahamudra Kriya or Shoonya meditation.

You should be on an empty stomach condition.

You should be seated in the hall at least 15 minutes before the start time as late comers will not be accommodated.

First hour is for those who wish to practice Shakti Chalana Kriya or Hatha Yoga.

Session ends with potluck - Please bring a plate of positive pranic vegetarian food (without onion, garlic or green chillies) to share.

                    Date
                    Time
                    Venue
                    RSVP

                    Sunday, 25 June
                    7 am - 2 pm
                    Smart Innovation Center
                    Register

        </columns>
    </row>
    {{> drop-shadow }}

    <row class="section-header">
        <columns>
            Isha Kriya
        </columns>
    </row>
    <row>
        <columns large="4">
            <wrapper>

            </wrapper>
        </columns>

        <columns large="6">

                A simple yet powerful 12-minute meditation process created by Sadhguru.  It has the potential to transform the life of anyone who is willing to invest just 12 minutes a day.

        </columns>
    </row>
    <row>
        <columns>

                    Date
                    Venue

                    Sun, 18 June 2017
                    Jurong Spring CC

                    Sun, 25 June 2017
                    Jurong Spring CC

            <button href="https://ishayoga.sg/upcoming?type=ishakriya" class="orange small">Register</button>
        </columns>
    </row>
    {{> drop-shadow }}

    <row class="section-header">
        <columns>
            Isha Upa Yoga
        </columns>
    </row>
    <row>
        <columns large="4">
            <wrapper>

            </wrapper>
        </columns>

        <columns large="6">

                These 5-minute processes are easy-to-practice yet potent tools to enhance health, joy, peace, love, success and inner exploration, helping one cope with the hectic pace of modern life and realize full potential in all spheres of life.

        </columns>
    </row>
    <row>
        <columns>

                    Date
                    Venue

                    Sat, 17 June 2017
                    Bedok Reservoir RC

                    Wed, 28 June 2017
                    Marine Crescent Gardens Rc

            <button href="https://ishayoga.sg/upcoming?type=ishaupayoga" class="orange small">Register</button>
        </columns>
    </row>
    {{> drop-shadow }}

    <row class="section-title orange-background">
        <columns>
            Visiting Isha Yoga Center, India?
        </columns>
    </row>
    <row>
        <columns>

                For any enquiries regarding attending programmes at or visiting Isha Yoga Center in India, please contact visitindia-apac@ishafoundation.org

        </columns>
    </row>
    {{> drop-shadow }}
    <row class="collapse no-vpad">
        <columns>
            <wrapper>

            </wrapper>
        </columns>
    </row>
    {{> spacer }}
    {{> footer-sg-unsub }}
    {{> spacer }}
</container>