text:
package v1

import (
	unsafe "unsafe"

	v1 "github.com/openshift/api/network/v1"
	network "github.com/openshift/origin/pkg/network/apis/network"
	conversion "k8s.io/apimachinery/pkg/conversion"
	runtime "k8s.io/apimachinery/pkg/runtime"
)

func init() {
	localSchemeBuilder.Register(RegisterConversions)
}

// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
	return scheme.AddGeneratedConversionFuncs(
		Convert_v1_ClusterNetwork_To_network_ClusterNetwork,
		Convert_network_ClusterNetwork_To_v1_ClusterNetwork,
		Convert_v1_ClusterNetworkEntry_To_network_ClusterNetworkEntry,
		Convert_network_ClusterNetworkEntry_To_v1_ClusterNetworkEntry,
		Convert_v1_ClusterNetworkList_To_network_ClusterNetworkList,
		Convert_network_ClusterNetworkList_To_v1_ClusterNetworkList,
		Convert_v1_EgressNetworkPolicy_To_network_EgressNetworkPolicy,
		Convert_network_EgressNetworkPolicy_To_v1_EgressNetworkPolicy,
		Convert_v1_EgressNetworkPolicyList_To_network_EgressNetworkPolicyList,
		Convert_network_EgressNetworkPolicyList_To_v1_EgressNetworkPolicyList,
		Convert_v1_EgressNetworkPolicyPeer_To_network_EgressNetworkPolicyPeer,
		Convert_network_EgressNetworkPolicyPeer_To_v1_EgressNetworkPolicyPeer,
		Convert_v1_EgressNetworkPolicyRule_To_network_EgressNetworkPolicyRule,
		Convert_network_EgressNetworkPolicyRule_To_v1_EgressNetworkPolicyRule,
		Convert_v1_EgressNetworkPolicySpec_To_network_EgressNetworkPolicySpec,
		Convert_network_EgressNetworkPolicySpec_To_v1_EgressNetworkPolicySpec,
		Convert_v1_HostSubnet_To_network_HostSubnet,
		Convert_network_HostSubnet_To_v1_HostSubnet,
		Convert_v1_HostSubnetList_To_network_HostSubnetList,
		Convert_network_HostSubnetList_To_v1_HostSubnetList,
		Convert_v1_NetNamespace_To_network_NetNamespace,
		Convert_network_NetNamespace_To_v1_NetNamespace,
		Convert_v1_NetNamespaceList_To_network_NetNamespaceList,
		Convert_network_NetNamespaceList_To_v1_NetNamespaceList,
	)
}

func autoConvert_v1_ClusterNetwork_To_network_ClusterNetwork(in *v1.ClusterNetwork, out *network.ClusterNetwork, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.Network = in.Network
	out.HostSubnetLength = in.HostSubnetLength
	out.ServiceNetwork = in.ServiceNetwork
	out.PluginName = in.PluginName
	out.ClusterNetworks = *(*[]network.ClusterNetworkEntry)(unsafe.Pointer(&in.ClusterNetworks))
	out.VXLANPort = (*uint32)(unsafe.Pointer(in.VXLANPort))
	return nil
}

// Convert_v1_ClusterNetwork_To_network_ClusterNetwork is an autogenerated conversion function.
func Convert_v1_ClusterNetwork_To_network_ClusterNetwork(in *v1.ClusterNetwork, out *network.ClusterNetwork, s conversion.Scope) error {
	return autoConvert_v1_ClusterNetwork_To_network_ClusterNetwork(in, out, s)
}

func autoConvert_network_ClusterNetwork_To_v1_ClusterNetwork(in *network.ClusterNetwork, out *v1.ClusterNetwork, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.ClusterNetworks = *(*[]v1.ClusterNetworkEntry)(unsafe.Pointer(&in.ClusterNetworks))
	out.Network = in.Network
	out.HostSubnetLength = in.HostSubnetLength
	out.ServiceNetwork = in.ServiceNetwork
	out.PluginName = in.PluginName
	out.VXLANPort = (*uint32)(unsafe.Pointer(in.VXLANPort))
	return nil
}

// Convert_network_ClusterNetwork_To_v1_ClusterNetwork is an autogenerated conversion function.
func Convert_network_ClusterNetwork_To_v1_ClusterNetwork(in *network.ClusterNetwork, out *v1.ClusterNetwork, s conversion.Scope) error {
	return autoConvert_network_ClusterNetwork_To_v1_ClusterNetwork(in, out, s)
}

func autoConvert_v1_ClusterNetworkEntry_To_network_ClusterNetworkEntry(in *v1.ClusterNetworkEntry, out *network.ClusterNetworkEntry, s conversion.Scope) error {
	out.CIDR = in.CIDR
	out.HostSubnetLength = in.HostSubnetLength
	return nil
}

// Convert_v1_ClusterNetworkEntry_To_network_ClusterNetworkEntry is an autogenerated conversion function.
func Convert_v1_ClusterNetworkEntry_To_network_ClusterNetworkEntry(in *v1.ClusterNetworkEntry, out *network.ClusterNetworkEntry, s conversion.Scope) error {
	return autoConvert_v1_ClusterNetworkEntry_To_network_ClusterNetworkEntry(in, out, s)
}

func autoConvert_network_ClusterNetworkEntry_To_v1_ClusterNetworkEntry(in *network.ClusterNetworkEntry, out *v1.ClusterNetworkEntry, s conversion.Scope) error {
	out.CIDR = in.CIDR
	out.HostSubnetLength = in.HostSubnetLength
	return nil
}

// Convert_network_ClusterNetworkEntry_To_v1_ClusterNetworkEntry is an autogenerated conversion function.
func Convert_network_ClusterNetworkEntry_To_v1_ClusterNetworkEntry(in *network.ClusterNetworkEntry, out *v1.ClusterNetworkEntry, s conversion.Scope) error {
	return autoConvert_network_ClusterNetworkEntry_To_v1_ClusterNetworkEntry(in, out, s)
}

func autoConvert_v1_ClusterNetworkList_To_network_ClusterNetworkList(in *v1.ClusterNetworkList, out *network.ClusterNetworkList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]network.ClusterNetwork, len(*in))
		for i := range *in {
			if err := Convert_v1_ClusterNetwork_To_network_ClusterNetwork(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Items = nil
	}
	return nil
}

// Convert_v1_ClusterNetworkList_To_network_ClusterNetworkList is an autogenerated conversion function.
func Convert_v1_ClusterNetworkList_To_network_ClusterNetworkList(in *v1.ClusterNetworkList, out *network.ClusterNetworkList, s conversion.Scope) error {
	return autoConvert_v1_ClusterNetworkList_To_network_ClusterNetworkList(in, out, s)
}

func autoConvert_network_ClusterNetworkList_To_v1_ClusterNetworkList(in *network.ClusterNetworkList, out *v1.ClusterNetworkList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	if in.Items != nil {
		in, out := &in.Items, &out.Items
		*out = make([]v1.ClusterNetwork, len(*in))
		for i := range *in {
			if err := Convert_network_ClusterNetwork_To_v1_ClusterNetwork(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.Items = nil
	}
	return nil
}

// Convert_network_ClusterNetworkList_To_v1_ClusterNetworkList is an autogenerated conversion function.
func Convert_network_ClusterNetworkList_To_v1_ClusterNetworkList(in *network.ClusterNetworkList, out *v1.ClusterNetworkList, s conversion.Scope) error {
	return autoConvert_network_ClusterNetworkList_To_v1_ClusterNetworkList(in, out, s)
}

func autoConvert_v1_EgressNetworkPolicy_To_network_EgressNetworkPolicy(in *v1.EgressNetworkPolicy, out *network.EgressNetworkPolicy, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	if err := Convert_v1_EgressNetworkPolicySpec_To_network_EgressNetworkPolicySpec(&in.Spec, &out.Spec, s); err != nil {
		return err
	}
	return nil
}

// Convert_v1_EgressNetworkPolicy_To_network_EgressNetworkPolicy is an autogenerated conversion function.
func Convert_v1_EgressNetworkPolicy_To_network_EgressNetworkPolicy(in *v1.EgressNetworkPolicy, out *network.EgressNetworkPolicy, s conversion.Scope) error {
	return autoConvert_v1_EgressNetworkPolicy_To_network_EgressNetworkPolicy(in, out, s)
}

func autoConvert_network_EgressNetworkPolicy_To_v1_EgressNetworkPolicy(in *network.EgressNetworkPolicy, out *v1.EgressNetworkPolicy, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	if err := Convert_network_EgressNetworkPolicySpec_To_v1_EgressNetworkPolicySpec(&in.Spec, &out.Spec, s); err != nil {
		return err
	}
	return nil
}

// Convert_network_EgressNetworkPolicy_To_v1_EgressNetworkPolicy is an autogenerated conversion function.
func Convert_network_EgressNetworkPolicy_To_v1_EgressNetworkPolicy(in *network.EgressNetworkPolicy, out *v1.EgressNetworkPolicy, s conversion.Scope) error {
	return autoConvert_network_EgressNetworkPolicy_To_v1_EgressNetworkPolicy(in, out, s)
}

func autoConvert_v1_EgressNetworkPolicyList_To_network_EgressNetworkPolicyList(in *v1.EgressNetworkPolicyList, out *network.EgressNetworkPolicyList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]network.EgressNetworkPolicy)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_v1_EgressNetworkPolicyList_To_network_EgressNetworkPolicyList is an autogenerated conversion function.
func Convert_v1_EgressNetworkPolicyList_To_network_EgressNetworkPolicyList(in *v1.EgressNetworkPolicyList, out *network.EgressNetworkPolicyList, s conversion.Scope) error {
	return autoConvert_v1_EgressNetworkPolicyList_To_network_EgressNetworkPolicyList(in, out, s)
}

func autoConvert_network_EgressNetworkPolicyList_To_v1_EgressNetworkPolicyList(in *network.EgressNetworkPolicyList, out *v1.EgressNetworkPolicyList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]v1.EgressNetworkPolicy)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_network_EgressNetworkPolicyList_To_v1_EgressNetworkPolicyList is an autogenerated conversion function.
func Convert_network_EgressNetworkPolicyList_To_v1_EgressNetworkPolicyList(in *network.EgressNetworkPolicyList, out *v1.EgressNetworkPolicyList, s conversion.Scope) error {
	return autoConvert_network_EgressNetworkPolicyList_To_v1_EgressNetworkPolicyList(in, out, s)
}

func autoConvert_v1_EgressNetworkPolicyPeer_To_network_EgressNetworkPolicyPeer(in *v1.EgressNetworkPolicyPeer, out *network.EgressNetworkPolicyPeer, s conversion.Scope) error {
	out.CIDRSelector = in.CIDRSelector
	out.DNSName = in.DNSName
	return nil
}

// Convert_v1_EgressNetworkPolicyPeer_To_network_EgressNetworkPolicyPeer is an autogenerated conversion function.
func Convert_v1_EgressNetworkPolicyPeer_To_network_EgressNetworkPolicyPeer(in *v1.EgressNetworkPolicyPeer, out *network.EgressNetworkPolicyPeer, s conversion.Scope) error {
	return autoConvert_v1_EgressNetworkPolicyPeer_To_network_EgressNetworkPolicyPeer(in, out, s)
}

func autoConvert_network_EgressNetworkPolicyPeer_To_v1_EgressNetworkPolicyPeer(in *network.EgressNetworkPolicyPeer, out *v1.EgressNetworkPolicyPeer, s conversion.Scope) error {
	out.CIDRSelector = in.CIDRSelector
	out.DNSName = in.DNSName
	return nil
}

// Convert_network_EgressNetworkPolicyPeer_To_v1_EgressNetworkPolicyPeer is an autogenerated conversion function.
func Convert_network_EgressNetworkPolicyPeer_To_v1_EgressNetworkPolicyPeer(in *network.EgressNetworkPolicyPeer, out *v1.EgressNetworkPolicyPeer, s conversion.Scope) error {
	return autoConvert_network_EgressNetworkPolicyPeer_To_v1_EgressNetworkPolicyPeer(in, out, s)
}

func autoConvert_v1_EgressNetworkPolicyRule_To_network_EgressNetworkPolicyRule(in *v1.EgressNetworkPolicyRule, out *network.EgressNetworkPolicyRule, s conversion.Scope) error {
	out.Type = network.EgressNetworkPolicyRuleType(in.Type)
	if err := Convert_v1_EgressNetworkPolicyPeer_To_network_EgressNetworkPolicyPeer(&in.To, &out.To, s); err != nil {
		return err
	}
	return nil
}

// Convert_v1_EgressNetworkPolicyRule_To_network_EgressNetworkPolicyRule is an autogenerated conversion function.
func Convert_v1_EgressNetworkPolicyRule_To_network_EgressNetworkPolicyRule(in *v1.EgressNetworkPolicyRule, out *network.EgressNetworkPolicyRule, s conversion.Scope) error {
	return autoConvert_v1_EgressNetworkPolicyRule_To_network_EgressNetworkPolicyRule(in, out, s)
}

func autoConvert_network_EgressNetworkPolicyRule_To_v1_EgressNetworkPolicyRule(in *network.EgressNetworkPolicyRule, out *v1.EgressNetworkPolicyRule, s conversion.Scope) error {
	out.Type = v1.EgressNetworkPolicyRuleType(in.Type)
	if err := Convert_network_EgressNetworkPolicyPeer_To_v1_EgressNetworkPolicyPeer(&in.To, &out.To, s); err != nil {
		return err
	}
	return nil
}

// Convert_network_EgressNetworkPolicyRule_To_v1_EgressNetworkPolicyRule is an autogenerated conversion function.
func Convert_network_EgressNetworkPolicyRule_To_v1_EgressNetworkPolicyRule(in *network.EgressNetworkPolicyRule, out *v1.EgressNetworkPolicyRule, s conversion.Scope) error {
	return autoConvert_network_EgressNetworkPolicyRule_To_v1_EgressNetworkPolicyRule(in, out, s)
}

func autoConvert_v1_EgressNetworkPolicySpec_To_network_EgressNetworkPolicySpec(in *v1.EgressNetworkPolicySpec, out *network.EgressNetworkPolicySpec, s conversion.Scope) error {
	out.Egress = *(*[]network.EgressNetworkPolicyRule)(unsafe.Pointer(&in.Egress))
	return nil
}

// Convert_v1_EgressNetworkPolicySpec_To_network_EgressNetworkPolicySpec is an autogenerated conversion function.
func Convert_v1_EgressNetworkPolicySpec_To_network_EgressNetworkPolicySpec(in *v1.EgressNetworkPolicySpec, out *network.EgressNetworkPolicySpec, s conversion.Scope) error {
	return autoConvert_v1_EgressNetworkPolicySpec_To_network_EgressNetworkPolicySpec(in, out, s)
}

func autoConvert_network_EgressNetworkPolicySpec_To_v1_EgressNetworkPolicySpec(in *network.EgressNetworkPolicySpec, out *v1.EgressNetworkPolicySpec, s conversion.Scope) error {
	out.Egress = *(*[]v1.EgressNetworkPolicyRule)(unsafe.Pointer(&in.Egress))
	return nil
}

// Convert_network_EgressNetworkPolicySpec_To_v1_EgressNetworkPolicySpec is an autogenerated conversion function.
func Convert_network_EgressNetworkPolicySpec_To_v1_EgressNetworkPolicySpec(in *network.EgressNetworkPolicySpec, out *v1.EgressNetworkPolicySpec, s conversion.Scope) error {
	return autoConvert_network_EgressNetworkPolicySpec_To_v1_EgressNetworkPolicySpec(in, out, s)
}

func autoConvert_v1_HostSubnet_To_network_HostSubnet(in *v1.HostSubnet, out *network.HostSubnet, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.Host = in.Host
	out.HostIP = in.HostIP
	out.Subnet = in.Subnet
	out.EgressIPs = *(*[]string)(unsafe.Pointer(&in.EgressIPs))
	out.EgressCIDRs = *(*[]string)(unsafe.Pointer(&in.EgressCIDRs))
	return nil
}

// Convert_v1_HostSubnet_To_network_HostSubnet is an autogenerated conversion function.
func Convert_v1_HostSubnet_To_network_HostSubnet(in *v1.HostSubnet, out *network.HostSubnet, s conversion.Scope) error {
	return autoConvert_v1_HostSubnet_To_network_HostSubnet(in, out, s)
}

func autoConvert_network_HostSubnet_To_v1_HostSubnet(in *network.HostSubnet, out *v1.HostSubnet, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.Host = in.Host
	out.HostIP = in.HostIP
	out.Subnet = in.Subnet
	out.EgressIPs = *(*[]string)(unsafe.Pointer(&in.EgressIPs))
	out.EgressCIDRs = *(*[]string)(unsafe.Pointer(&in.EgressCIDRs))
	return nil
}

// Convert_network_HostSubnet_To_v1_HostSubnet is an autogenerated conversion function.
func Convert_network_HostSubnet_To_v1_HostSubnet(in *network.HostSubnet, out *v1.HostSubnet, s conversion.Scope) error {
	return autoConvert_network_HostSubnet_To_v1_HostSubnet(in, out, s)
}

func autoConvert_v1_HostSubnetList_To_network_HostSubnetList(in *v1.HostSubnetList, out *network.HostSubnetList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]network.HostSubnet)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_v1_HostSubnetList_To_network_HostSubnetList is an autogenerated conversion function.
func Convert_v1_HostSubnetList_To_network_HostSubnetList(in *v1.HostSubnetList, out *network.HostSubnetList, s conversion.Scope) error {
	return autoConvert_v1_HostSubnetList_To_network_HostSubnetList(in, out, s)
}

func autoConvert_network_HostSubnetList_To_v1_HostSubnetList(in *network.HostSubnetList, out *v1.HostSubnetList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]v1.HostSubnet)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_network_HostSubnetList_To_v1_HostSubnetList is an autogenerated conversion function.
func Convert_network_HostSubnetList_To_v1_HostSubnetList(in *network.HostSubnetList, out *v1.HostSubnetList, s conversion.Scope) error {
	return autoConvert_network_HostSubnetList_To_v1_HostSubnetList(in, out, s)
}

func autoConvert_v1_NetNamespace_To_network_NetNamespace(in *v1.NetNamespace, out *network.NetNamespace, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.NetName = in.NetName
	out.NetID = in.NetID
	out.EgressIPs = *(*[]string)(unsafe.Pointer(&in.EgressIPs))
	return nil
}

// Convert_v1_NetNamespace_To_network_NetNamespace is an autogenerated conversion function.
func Convert_v1_NetNamespace_To_network_NetNamespace(in *v1.NetNamespace, out *network.NetNamespace, s conversion.Scope) error {
	return autoConvert_v1_NetNamespace_To_network_NetNamespace(in, out, s)
}

func autoConvert_network_NetNamespace_To_v1_NetNamespace(in *network.NetNamespace, out *v1.NetNamespace, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.NetName = in.NetName
	out.NetID = in.NetID
	out.EgressIPs = *(*[]string)(unsafe.Pointer(&in.EgressIPs))
	return nil
}

// Convert_network_NetNamespace_To_v1_NetNamespace is an autogenerated conversion function.
func Convert_network_NetNamespace_To_v1_NetNamespace(in *network.NetNamespace, out *v1.NetNamespace, s conversion.Scope) error {
	return autoConvert_network_NetNamespace_To_v1_NetNamespace(in, out, s)
}

func autoConvert_v1_NetNamespaceList_To_network_NetNamespaceList(in *v1.NetNamespaceList, out *network.NetNamespaceList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]network.NetNamespace)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_v1_NetNamespaceList_To_network_NetNamespaceList is an autogenerated conversion function.
func Convert_v1_NetNamespaceList_To_network_NetNamespaceList(in *v1.NetNamespaceList, out *network.NetNamespaceList, s conversion.Scope) error {
	return autoConvert_v1_NetNamespaceList_To_network_NetNamespaceList(in, out, s)
}

func autoConvert_network_NetNamespaceList_To_v1_NetNamespaceList(in *network.NetNamespaceList, out *v1.NetNamespaceList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]v1.NetNamespace)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_network_NetNamespaceList_To_v1_NetNamespaceList is an autogenerated conversion function.
func Convert_network_NetNamespaceList_To_v1_NetNamespaceList(in *network.NetNamespaceList, out *v1.NetNamespaceList, s conversion.Scope) error {
	return autoConvert_network_NetNamespaceList_To_v1_NetNamespaceList(in, out, s)
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using WikiClientLibrary.Sites;

namespace WikiClientLibrary
{

    ///
    /// MediaWiki development channels.
    ///
    /// <seealso cref="MediaWikiVersion"/>
    /// <seealso cref="SiteInfo.Version"/>
    public enum MediaWikiDevChannel
    {
        ///
        /// Official release. No version suffix.
        ///
        None = 0,
        ///
        /// WMF weekly release. Version suffix is <c>-wmf</c>.
        ///
        Wmf = 1,
        ///
        /// Alpha release. Version suffix is <c>-alpha</c>.
        ///
        Alpha = 2,
        ///
        /// Beta release. Version suffix is <c>-beta</c>.
        ///
        Beta = 3,
        ///
        /// Release candidate. Version suffix is <c>-rc</c>.
        ///
        RC = 4
    }

    ///
    /// Represents a MediaWiki core version number.
    ///
    /// <remarks>
    /// <para>MediaWiki version number has the following format</para>
    /// <para><var>major</var>.<var>minor</var>.<var>revision</var>[-<var>devChannel</var>[.<var>devVersion</var>]]</para>
    /// <para>where <var>devChannel</var> can be, in the order of release, <c>wmf</c>, <c>alpha</c>, <c>beta</c>, and <c>rc</c>.</para>
    /// </remarks>
    /// <seealso cref="MediaWikiDevChannel"/>
    /// <seealso cref="SiteInfo.Version"/>
    public readonly struct MediaWikiVersion : IEquatable<MediaWikiVersion>, IComparable<MediaWikiVersion>, IComparable
    {

        private static readonly Regex versionRegex = new Regex(@"
^\s*(?<Major>\d+)\s*
(\.\s*(?<Minor>\d+)\s*)?
(\.\s*(?<Revision>\d+)\s*)?
(
    -\s*(?<DevChannel>wmf|alpha|beta|rc)\s*
    ((\.|-)?\s*?(?<DevVersion>\d+))?
)?\s*
(?<UnknownSuffix>.+)?",
            RegexOptions.IgnorePatternWhitespace
            | RegexOptions.IgnoreCase
            | RegexOptions.CultureInvariant);

        private readonly short _Major, _Minor, _Revision;

        // bitmap for -wmf.3
        // DevChannel | DevVersion
        //       0001 | 0000 0000 0011
        private readonly ushort fullDevVersion;

        ///
        /// Gets the default zero value of <see cref="MediaWikiVersion"/>, i.e. <c>v0.0.0</c>.
        ///
        public static MediaWikiVersion Zero { get; } = default;

        /// <inheritdoc cref="Parse(string,bool)"/>
        /// <remarks>This overload does not allow version truncation.</remarks>
        public static MediaWikiVersion Parse(string version)
        {
            return Parse(version, false);
        }

        ///
        /// Parses a MediaWiki core version number from its string representation.
        ///
        /// <param name="version">The version to be parsed.</param>
        /// <param name="allowTruncation">Whether allows truncating unknown version suffix (such as <c>-1+deb7u1</c> in <c>1.19.5-1+deb7u1</c>).</param>
        /// <exception cref="ArgumentException"><paramref name="version"/> is <c>null</c> or empty.</exception>
        /// <exception cref="FormatException">
        /// <paramref name="version"/> is not a valid version expression, such as
        /// <list type="bullet">
        /// <item><description>is <c>null</c>, empty, or whitespace.</description></item>
        /// <item><description>has more than 3 version components before the first dash, if any.</description></item>
        /// <item><description>has invalid dev-channel suffix, and suffix truncation is not allowed. See <seealso cref="MediaWikiDevChannel"/> for a list of valid dev-channel suffixes.</description></item>
        /// <item><description>has invalid numeric version components, including failure to parse as number, or arithmetic overflow.</description></item>
        /// </list>
        /// </exception>
        /// <returns>The parsed version.</returns>
        /// <seealso cref="TryParse(string,out MediaWikiVersion)"/>
        public static MediaWikiVersion Parse(string version, bool allowTruncation)
        {
            var result = Parse(version, allowTruncation, true, out var v);
            Debug.Assert(result);
            return v;
        }

        /// <inheritdoc cref="TryParse(string,bool,out MediaWikiVersion)"/>
        /// <remarks>This overload does not allow version truncation.</remarks>
        public static bool TryParse(string version, out MediaWikiVersion parsed)
        {
            return Parse(version, false, false, out parsed);
        }

        ///
        /// Tries to parse a MediaWiki core version number from its string representation.
        ///
        /// <param name="version">The version to be parsed.</param>
        /// <param name="allowTruncation">Whether allows truncating unknown version suffix (such as <c>-1+deb7u1</c> in <c>1.19.5-1+deb7u1</c>).</param>
        /// <param name="parsed">A variable to receive the parsed version value.</param>
        /// <returns>Whether the parsing is successful.</returns>
        /// <seealso cref="Parse(string)"/>
        public static bool TryParse(string version, bool allowTruncation, out MediaWikiVersion parsed)
        {
            return Parse(version, true, false, out parsed);
        }

        internal static bool Parse(string version, bool allowTruncation, bool raiseError, out MediaWikiVersion parsed)
        {
            if (string.IsNullOrEmpty(version))
            {
                if (!raiseError) goto SILENT_FAIL;
                throw new ArgumentException(Prompts.ExceptionArgumentNullOrEmpty, nameof(version));
            }

            // 1.0.0-rc-1
            var match = versionRegex.Match(version);
            if (!match.Success)
            {
                if (!raiseError) goto SILENT_FAIL;
                throw new FormatException(Prompts.ExceptionVersionMalformed);
            }

            short major,minor, revision;
            try
            {
                major = match.Groups["Major"].Success ? short.Parse(match.Groups["Major"].Value) : (short)0;
                minor = match.Groups["Minor"].Success ? short.Parse(match.Groups["Minor"].Value) : (short)0;
                revision = match.Groups["Revision"].Success ? short.Parse(match.Groups["Revision"].Value) : (short)0;
            }
            catch (Exception ex)
            {
                if (!raiseError) goto SILENT_FAIL;
                throw new FormatException(Prompts.ExceptionVersionInvalidNumber, ex);
            }

            var devChannel = MediaWikiDevChannel.None;
            short devVersion = 0;
            if (match.Groups["DevChannel"].Success)
            {
                var devChannelExpr = match.Groups["DevChannel"].Value;
                if (string.Equals(devChannelExpr, "wmf", StringComparison.OrdinalIgnoreCase))
                {
                    devChannel = MediaWikiDevChannel.Wmf;
                }
                else if (string.Equals(devChannelExpr, "alpha", StringComparison.OrdinalIgnoreCase))
                {
                    devChannel = MediaWikiDevChannel.Alpha;
                }
                else if (string.Equals(devChannelExpr, "beta", StringComparison.OrdinalIgnoreCase))
                {
                    devChannel = MediaWikiDevChannel.Beta;
                }
                else if (string.Equals(devChannelExpr, "rc", StringComparison.OrdinalIgnoreCase))
                {
                    devChannel = MediaWikiDevChannel.RC;
                }
                else
                {
                    Debug.Fail("Have you forgotten to add MediaWikiDevChannel enum member?");
                }
                try
                {
                    devVersion = match.Groups["DevVersion"].Success ? short.Parse(match.Groups["DevVersion"].Value) : (short)0;
                }
                catch (Exception ex)
                {
                    if (!raiseError) goto SILENT_FAIL;
                    throw new FormatException(Prompts.ExceptionVersionInvalidDevVersion, ex);
                }
            }

            if (!allowTruncation && match.Groups["UnknownSuffix"].Success)
            {
                if (!raiseError) goto SILENT_FAIL;
                throw new FormatException(string.Format(Prompts.ExceptionVersionTruncated1, match.Groups["UnknownSuffix"].Value));
            }

            parsed = new MediaWikiVersion(major, minor, revision, devChannel, devVersion);
            return true;
            SILENT_FAIL:
            parsed = default;
            return false;
        }

        ///
        /// Initializes a new <seealso cref="MediaWikiVersion"/> instance with major and minor versions.
        ///
        /// <inheritdoc cref="MediaWikiVersion(short,short,short,MediaWikiDevChannel,short)"/>
        public MediaWikiVersion(short major, short minor)
            : this(major, minor, 0, MediaWikiDevChannel.None, 0)
        {
        }

        ///
        /// Initializes a new <seealso cref="MediaWikiVersion"/> instance with major, minor, revision versions.
        ///
        /// <inheritdoc cref="MediaWikiVersion(short,short,short,MediaWikiDevChannel,short)"/>
        public MediaWikiVersion(short major, short minor, short revision)
            : this(major, minor, revision, MediaWikiDevChannel.None, 0)
        {
        }

        ///
        /// Initializes a new <seealso cref="MediaWikiVersion"/> instance with major, minor, revision versions and
        /// dev-channel.
        ///
        /// <inheritdoc cref="MediaWikiVersion(short,short,short,MediaWikiDevChannel,short)"/>
        public MediaWikiVersion(short major, short minor, short revision, MediaWikiDevChannel devChannel)
            : this(major, minor, revision, devChannel, 0)
        {
        }

        ///
        /// Initializes a new <seealso cref="MediaWikiVersion"/> instance with major, minor versions and
        /// dev-version.
        ///
        /// <inheritdoc cref="MediaWikiVersion(short,short,short,MediaWikiDevChannel,short)"/>
        public MediaWikiVersion(short major, short minor, MediaWikiDevChannel devChannel, short devVersion)
            : this(major, minor, 0, devChannel, devVersion)
        {
        }

        ///
        /// Initializes a new <seealso cref="MediaWikiVersion"/> instance with major, minor, revision versions and
        /// dev-version.
        ///
        /// <param name="major">Major version. Should be between 0 and 32767.</param>
        /// <param name="minor">Minor version. Should be between 0 and 32767.</param>
        /// <param name="revision">Revision number. Should be between 0 and 32767.</param>
        /// <param name="devChannel">Channel of development.</param>
        /// <param name="devVersion">DevVersion. Should be between 0 and 4095.</param>
        /// <exception cref="ArgumentOutOfRangeException">Any one of the version numbers is out of range.</exception>
        /// <exception cref="ArgumentException">
        /// <paramref name="devChannel"/> is <see cref="MediaWikiDevChannel.None"/>,
        /// but <paramref name="devVersion"/> is non-zero.
        /// </exception>
        public MediaWikiVersion(short major, short minor, short revision, MediaWikiDevChannel devChannel, short devVersion)
        {
            if (major < 0)
                throw new ArgumentOutOfRangeException(nameof(major));
            if (minor < 0)
                throw new ArgumentOutOfRangeException(nameof(minor));
            if (revision < 0)
                throw new ArgumentOutOfRangeException(nameof(revision));
            _Major = major;
            _Minor = minor;
            _Revision = revision;
            fullDevVersion = MakeFullDevVersion(devChannel, devVersion);
        }

        ///
        /// Major version.
        ///
        public int Major => _Major;

        ///
        /// Minor version.
        ///
        public int Minor => _Minor;

        ///
        /// Revision number.
        ///
        public int Revision => _Revision;

        ///
        /// Development channel.
        ///
        public MediaWikiDevChannel DevChannel => (MediaWikiDevChannel)(fullDevVersion >> 12);

        ///
        /// Version in development channel.
        ///
        public int DevVersion => fullDevVersion & 0x0FFF;

        /// <inheritdoc />
        public override int GetHashCode() => HashCode.Combine(_Major, _Minor, _Revision, fullDevVersion);

        /// <inheritdoc />
        public int CompareTo(MediaWikiVersion other)
        {
            if (_Major > other._Major) return 1;
            if (_Major < other._Major) return -1;
            if (_Minor > other._Minor) return 1;
            if (_Minor < other._Minor) return -1;
            if (_Revision > other._Revision) return 1;
            if (_Revision < other._Revision) return -1;
            // fullDevVersion != 0: wmf/alpha/beta/rc
            if (fullDevVersion == 0)
                return other.fullDevVersion == 0 ? 0 : 1;
            if (other.fullDevVersion == 0)
                // We have fullDevVersion != 0 here.
                return -1;
            if (fullDevVersion > other.fullDevVersion) return 1;
            if (fullDevVersion < other.fullDevVersion) return -1;
            return 0;
        }

        /// <inheritdoc />
        public override string ToString()
        {
            var sb = new StringBuilder(20);
            sb.Append(Major);
            sb.Append('.');
            sb.Append(Minor);
            sb.Append('.');
            sb.Append(Revision);
            var channel = DevChannel;
            if (channel != MediaWikiDevChannel.None)
            {
                switch (DevChannel)
                {
                    case MediaWikiDevChannel.Wmf:
                        sb.Append("-wmf");
                        break;
                    case MediaWikiDevChannel.Alpha:
                        sb.Append("-alpha");
                        break;
                    case MediaWikiDevChannel.Beta:
                        sb.Append("-beta");
                        break;
                    case MediaWikiDevChannel.RC:
                        sb.Append("-rc");
                        break;
                    default:
                        Debug.Assert(false, "Invalid DevChannel value.");
                        sb.Append("-invalid");
                        break;
                }
                var devVersion = DevVersion;
                if (devVersion > 0)
                {
                    sb.Append('.');
                    sb.Append(devVersion);
                }
            }
            return sb.ToString();
        }

        /// <inheritdoc />
        public bool Equals(MediaWikiVersion other)
        {
            return _Major == other._Major && _Minor == other._Minor && _Revision == other._Revision && fullDevVersion == other.fullDevVersion;
        }

        /// <inheritdoc />
        public override bool Equals(object? obj)
        {
            return obj is MediaWikiVersion other && Equals(other);
        }

        public static bool operator ==(MediaWikiVersion left, MediaWikiVersion right)
        {
            return left.Equals(right);
        }

        public static bool operator !=(MediaWikiVersion left, MediaWikiVersion right)
        {
            return !left.Equals(right);
        }

        /// <inheritdoc />
        public int CompareTo(object? obj)
        {
            if (obj is null) return 1;
            return obj is MediaWikiVersion other ? CompareTo(other) : throw new ArgumentException($"Object must be of type {nameof(MediaWikiVersion)}");
        }

        public static bool operator <(MediaWikiVersion left, MediaWikiVersion right)
        {
            return left.CompareTo(right) < 0;
        }

        public static bool operator >(MediaWikiVersion left, MediaWikiVersion right)
        {
            return left.CompareTo(right) > 0;
        }

        public static bool operator <=(MediaWikiVersion left, MediaWikiVersion right)
        {
            return left.CompareTo(right) <= 0;
        }

        public static bool operator >=(MediaWikiVersion left, MediaWikiVersion right)
        {
            return left.CompareTo(right) >= 0;
        }

        private static ushort MakeFullDevVersion(MediaWikiDevChannel devChannel, short devVersion)
        {
            if (devChannel < MediaWikiDevChannel.None || devChannel > MediaWikiDevChannel.RC)
                throw new ArgumentOutOfRangeException(nameof(devChannel));
            if (devVersion < 0 || devVersion > 0x0FFF)
                throw new ArgumentOutOfRangeException(nameof(devVersion));
            if (devChannel == MediaWikiDevChannel.None && devVersion != 0)
                throw new ArgumentException(Prompts.ExceptionDevVersionRequiresDevChannel, nameof(devVersion));
            return (ushort)(((uint)devChannel << 12) | (ushort)devVersion);
        }

        private static bool IsVersionSegmentInRange(int value, Range range, string rangeParamName)
        {
            var start = range.Start;
            var end = range.End;
            if (start.IsFromEnd)
                throw new ArgumentException("Lower bound of version segment cannot count from end.", rangeParamName);
            if (end.IsFromEnd && end.Value > 0)
                throw new ArgumentException("Upper bound of version segment cannot count more than 0 from end.", rangeParamName);
            return value >= start.Value && (end.IsFromEnd || value < end.Value);
        }

        /// Determines whether the version is in the specified range.
        /// <param name="major">major version.</param>
        public bool In(short major)
        {
            return _Major == major;
        }

        /// Determines whether the version is in the specified range.
        /// <param name="major">range of major version.</param>
        public bool In(Range major)
        {
            return IsVersionSegmentInRange(_Major, major, nameof(major));
        }

        /// Determines whether the version is in the specified range.
        /// <param name="major">major version.</param>
        /// <param name="minor">minor version.</param>
        public bool In(short major, short minor)
        {
            return _Major == major && _Minor == minor;
        }

        /// Determines whether the version is in the specified range.
        /// <param name="major">major version.</param>
        /// <param name="minor">range of minor version.</param>
        public bool In(short major, Range minor)
        {
            if (_Major != major) return false;
            return IsVersionSegmentInRange(_Minor, minor, nameof(minor));
        }

        /// Determines whether the version is in the specified range.
        /// <param name="major">major version.</param>
        /// <param name="minor">minor version.</param>
        /// <param name="revision">revision number.</param>
        public bool In(short major, short minor, short revision)
        {
            return _Major == major && _Minor == minor && _Revision == revision;
        }

        /// Determines whether the version is in the specified range.
        /// <param name="major">major version.</param>
        /// <param name="minor">minor version.</param>
        /// <param name="revision">range of revision number.</param>
        public bool In(short major, short minor, Range revision)
        {
            if (_Major != major) return false;
            if (_Minor != minor) return false;
            return IsVersionSegmentInRange(_Revision, revision, nameof(revision));
        }

        /// <inheritdoc cref="Above(short,short,short)"/>
        public bool Above(short major, short minor)
            => Above(major, minor, 0);

        /// Determines whether the version is equal to or above than the specified official release version.
        /// <param name="major">major version.</param>
        /// <param name="minor">minor version.</param>
        /// <param name="revision">revision number.</param>
        public bool Above(short major, short minor, short revision)
        {
            if (_Major != major) return _Major > major;
            if (_Minor != minor) return _Minor > minor;
            if (_Revision != revision) return _Revision > revision;
            return fullDevVersion != 0;
        }

        /// <inheritdoc cref="Above(short,short,short,MediaWikiDevChannel,short)"/>
        public bool Above(short major, short minor, MediaWikiDevChannel devChannel, short devVersion)
            => Above(major, minor, 0, devChannel, devVersion);

        /// Determines whether the version is equal to or above than the specified version.
        /// <param name="major">major version.</param>
        /// <param name="minor">minor version.</param>
        /// <param name="revision">revision number.</param>
        /// <param name="devChannel">Channel of development.</param>
        /// <param name="devVersion">DevVersion. Should be between 0 and 4095.</param>
        /// <exception cref="ArgumentOutOfRangeException">Any one of the version numbers is out of range.</exception>
        /// <exception cref="ArgumentException">
        /// <paramref name="devChannel"/> is <see cref="MediaWikiDevChannel.None"/>,
        /// but <paramref name="devVersion"/> is non-zero.
        /// </exception>
        public bool Above(short major, short minor, short revision, MediaWikiDevChannel devChannel, short devVersion)
        {
            var fdv = MakeFullDevVersion(devChannel, devVersion);
            if (_Major != major) return _Major > major;
            if (_Minor != minor) return _Minor > minor;
            if (_Revision != revision) return _Revision > revision;
            // 0: official release
            if (fdv == 0) return fullDevVersion == 0;
            return fullDevVersion >= fdv;
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
layout: post
date: '2016-07-10'
title: "PAGEANT DRESSES Mac Duggal Off the Shoulder Prom Dress 64734H"
category: PAGEANT DRESSES
tags: [PAGEANT DRESSES]
---
### PAGEANT DRESSES Mac Duggal Off the Shoulder Prom Dress 64734H
Just **$527.99**
###

Buy it: [https://www.eudances.com/en/pageant-dresses/1515-mac-duggal-off-the-shoulder-prom-dress-64734h.html](https://www.eudances.com/en/pageant-dresses/1515-mac-duggal-off-the-shoulder-prom-dress-64734h.html)


text:
package in.jedimaster.cli;

import org.apache.commons.cli.*;
import java.lang.reflect.Field;

public class AnnotatedOptionParser {

  private Parser parser;

  public AnnotatedOptionParser() {
    this(new PosixParser());
  }

  public AnnotatedOptionParser(Parser parser) {
    this.parser = parser;
  }

  public <T> T parse(Class<T> clazz, String[] args) throws Exception {

    // build options first
    Options opts = new Options();
    opts.addOption("h", "help", false, "Show this help message and exit");
    Field[] fields = clazz.getDeclaredFields();
    for (Field f : fields) {
      if (f.isAnnotationPresent(Option.class)) {
        Option anno = f.getAnnotation(Option.class);
        // use long option if short ones are not available
        String shortOpt = (anno.shortOpt() == null) ? anno.opt() : anno.shortOpt();
        opts.addOption(shortOpt, anno.opt(), anno.required(), anno.desc());
      }
    }

    // parse
    CommandLine cmd = parser.parse(opts, args);
    if (cmd.hasOption('h')) {
      HelpFormatter h = new HelpFormatter();
      h.printHelp("help", opts);
      System.exit(-1);
    }

    // set properties
    T confObject = clazz.newInstance();
    for (Field f : fields) {
      if (f.isAnnotationPresent(Option.class)) {
        Option anno = f.getAnnotation(Option.class);
        String strVal = cmd.getOptionValue(anno.opt());
        if (strVal == null) {
          // if none is available and the annotation is mandatory, error out
          if (anno.required()) {
            throw new IllegalArgumentException("required argument " + anno.opt() + " not supplied");
          }
        } else {
          // otherwise attempt to coerce it in the appropriate type
          Object val;
          if (f.getType().equals(String.class)) {
            val = strVal;
          } else {
            val = coerceToType(f.getType().getName(), strVal);
          }
          f.set(confObject, val);
        }
      }
    }
    return confObject;
  }

  protected Object coerceToType(String type, String strVal) {
    switch (type) {
      case "boolean":
        return Boolean.parseBoolean(strVal);
      case "char":
        return strVal.charAt(0);
      case "int":
        return Integer.parseInt(strVal);
      case "short":
        return Short.parseShort(strVal);
      case "long":
        return Long.parseLong(strVal);
      case "float":
        return Float.parseFloat(strVal);
      case "double":
        return Double.parseDouble(strVal);
      default:
        return null;
    }
  }
}


text:
<TITLE>Review for Happiness (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Happiness (1998)

reviewed by
Greg King

HAPPINESS (R).
(October Films/Dendy Films)
Director: Todd Solondz
Stars: Jane Adams, Dylan Baker, Lara Flynn Boyle, Ben Gazzara, Philip
Seymour Hoffman, Cynthia
Stephenson, Camryn Manheim, Jared Harris, Louise Lasser, Elizabeth
Ashley, Rufus Read, Jon Lovitz,
Dan Moran, Evan Silverberg, Matt Malloy
Running time: 135 minutes.

Todd Solondz is one of America's few truly independent
directors, who doesn't bow to convention or safe formulas.  In his
debut film, Welcome To The Dollhouse, Solondz looked at a
dysfunctional New Jersey family largely through the eyes of the
troubled teenage daughter.  In his disquieting and confronting new
black comedy Happiness, Solondz yet again taps into the lives of a
dysfunctional family from suburban New Jersey and unearths more rich
and fertile material.  Here he also deliberately pushes back the
envelope and tackles some of the few remaining cinematic taboos -
including masturbation and paedophilia - in a brave, frank and
forthright fashion.  Although he is tackling some important themes and
issues, many in the audience will find elements of Happiness
disturbing.

It is a pretty ironic title, as all the characters here are
looking for happiness, but never seem to find it.  Love often ends in
betrayal and hurt and bitterness.  Solondz seems to tap into much that
is wrong with personal relationships and families in the latter part
of the 1990's.  For him, sex is not the answer, it seems to be an
integral part of the problem.  The film concentrates mainly on the
three Jordan sisters, and the narrative follows their interrelated
stories without glossy embellishments or unrealistic or melodramatic
plot devices.

The film unfolds mainly as a series of conversations, which
reveal much about the various characters.  There is a sense of real
pain and anguish lurking just beneath the surface of their seemingly
content and fulfilled lives.  There is an aching loneliness, as they
are all desperately trying to make a connection in a largely uncaring
world.

Trish (Cynthia Stevenson, from Forget Paris, etc) is the
typical suburban housewife, who has no idea that her psychiatrist
husband Bill (Dylan Baker, from Murder One, etc) harbours a secret
lust for young boys.  A seemingly normal family man and father of
three, Bill turns out to be a paedophile who coldly preys on the
vulnerable friends of his 11 year old son.  We watch, appalled yet
morbidly fascinated, as he drugs his own family one night so that he
can take advantage of the young boy who is sleeping over.  While we
never actually see Bill's actions on screen, Solondz still paints a
pretty chilling picture of him as a predator, without remorse or
compunction.  While Adrian Lyne's remake of Lolita is currently
attracting controversy for its depiction of a man's torrid affair with
his 12 year old stepdaughter, Happiness seems to have slipped in under
the guard of the self-appointed and self-important moral watchdogs.

Trish's sister, the self-absorbed and bitchy Helen (Lara Flynn
Boyle, from Twin Peaks, etc) is a best selling author full of self
loathing and pity, who looks down on her two sisters.  She develops a
relationship with an obscene phone caller (Philip Seymour Hoffman,
also appearing opposite Robin Williams in the far more mainstream
comedy Patch Adams), who turns out to be her next door neighbour.
Taking a plunge, she decides to invites him in one evening.  The
meeting unfolds in an uncomfortable, embarrassing silence that is
abruptly ended when she throws him out of her apartment, declaring
that he is not her type.  Helen's other neighbour is Kristina (The
Practice's Camryn Manheim), a lonely and overweight murderess.

The other sister, Joy (Jane Adams, from Kansas City, etc), is
the pitiful, insecure and naive loser who lurches from one hapless and
unsatisfactory encounter to the next, yet remains full of optimism.
Solondz also introduces us to their parents (Ben Gazzara and Louise
Lasser), who live in Florida, but are in the throes of a separation
after forty years of marriage.

Happiness has something of an Altmanesque quality to it, as
Solondz draws together with deceptive ease and skill the disparate
plots and characters.  Solondz draws wonderful and perceptive
performances from his ensemble cast that bring this collection of
colourful losers to life.  Especially good is Baker, who gets under
the skin of his character and manages to make him more sympathetic
than you would expect.

Happiness is, by turns, sardonic, cruel, relentlessly
uncompromising, earthy, funny, poignant, honest, confronting,
compassionate, insightful, uncomfortable, bleak, despairing, and
challenging.  Many may well find it tasteless and shocking.  Solondz
balances his observations about life, love and other bruises with
humour and casual horror.  Some scenes are excruciatingly
uncomfortable to watch.  Happiness is a powerful and provocative film
that cuts close to the bone, yet lingers in the mind long after the
final credits.

***
greg king
http://www.netau.com.au/gregking

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text: {{label}}


text:
using System;
using System.Configuration;

namespace CityHall.Config
{

    public class CityHallConfigSection : ConfigurationSection
    {
        [ConfigurationProperty("url", IsRequired = true)]
        public String Url
        {
            get { return (String)this["url"]; }
            set { this["url"] = value; }
        }

        [ConfigurationProperty("user")]
        public String User
        {
            get { return (String)this["user"]; }
            set { this["user"] = value; }
        }

        [ConfigurationProperty("password")]
        public String Password
        {
            get { return (String)this["password"]; }
            set { this["password"] = value; }
        }
    }
}


text:
title: "release notes 2019-07-10"
date: 2019-07-10
releaseType:
  - ui
  - api
---

### New Marketing Campaigns

A brand new version of Marketing Campaigns, with the addition of [Automation]({{root_url}}/ui/sending-email/getting-started-with-automation/), [Email Testing]({{root_url}}/ui/sending-email/email-testing/), and [Signup Forms]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#create-a-signup-form) is now generally available. These new features are incremental to the existing functionality for [one-to-many campaign sending]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/#creating-a-single-send), [contact management]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#manage-contacts), real-time analytics, and more.


text:
@implementation MNDocument

- (id)init
{
    self = [super init];
    if (self) {
        // Add your subclass-specific initialization here.
    }
    return self;
}

- (NSString *)windowNibName
{
    // Override returning the nib file name of the document
    // If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead.
    return @"MNDocument";
}

- (void)windowControllerDidLoadNib:(NSWindowController *)aController
{
    [super windowControllerDidLoadNib:aController];
    // Add any code here that needs to be executed once the windowController has loaded the document's window.
}

+ (BOOL)autosavesInPlace
{
    return YES;
}

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.strengthcoach.strengthcoach" > <!-- Checked in by Neeraja starts -->
    <uses-sdk android:minSdkVersion="8" />

    <permission
        android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <permission
        android:name="com.strengthcoach.strengthcoach.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.strengthcoach.strengthcoach.permission.C2D_MESSAGE" />
    <!-- Permission to vibrate - recommended, allows vibration feedback on scan -->
    <uses-permission android:name="android.permission.VIBRATE" />
    <!-- Permission for SMS -->
    <uses-permission android:name="android.permission.SEND_SMS" >
    </uses-permission>
    <uses-permission android:name="android.permission.RECEIVE_SMS" >
    </uses-permission>
    <!-- Permission to use camera - required -->
    <uses-permission android:name="android.permission.CAMERA" />
    <!-- Camera features - recommended -->
    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.autofocus"
        android:required="false" />
    <uses-feature
        android:name="android.hardware.camera.flash"
        android:required="false" />

    <android:uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <android:uses-permission
        android:name="android.permission.READ_EXTERNAL_STORAGE"
        android:maxSdkVersion="18" />

    <!-- Checked in by Neeraja ends -->
    <application
        android:name=".activities.StrengthCoachApplication"
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
  	<activity
            android:name=".activities.LauncherActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.HomeActivity"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name=".activities.LoginActivity"
            android:label="@string/signup"
            android:windowSoftInputMode="stateVisible" >
        </activity>
        <activity
            android:name=".activities.PhoneNoVerificationActivity"
            android:label="@string/title_activity_phone_no_verification"
            android:parentActivityName=".activities.LoginActivity"
            android:windowSoftInputMode="stateVisible" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.strengthcoach.strengthcoach.activities.LoginActivity" />
        </activity>
        <activity
            android:name=".activities.BlockSlotActivity"
            android:label="@string/title_activity_block_slot"
            android:parentActivityName=".activities.LoginActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.strengthcoach.strengthcoach.activities.LoginActivity" />
        </activity>
        <activity
            android:name=".activities.TrainerDetailsActivity"
            android:label="@string/title_activity_trainer_details" >
        </activity>
        <activity
            android:name=".activities.ChatActivity"
            android:label="@string/title_activity_chat">
        </activity>
        <activity
            android:name=".activities.PaymentActivity"
            android:label="@string/title_activity_payment"
            android:parentActivityName=".activities.BlockSlotActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.strengthcoach.strengthcoach.activities.BlockSlotActivity" />
        </activity>
        <activity
            android:name=".activities.CartActivity"
            android:label="@string/title_activity_cart"
            android:parentActivityName=".activities.BlockSlotActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.strengthcoach.strengthcoach.activities.BlockSlotActivity" />
        </activity>
        <activity
            android:name=".activities.UpcomingEventsActivity"
            android:label="@string/title_activity_upcoming_events" >
        </activity>

        <uses-library
            android:name="com.google.android.maps"
            android:required="true" />

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyCxQbe8eGA5y8HSAJq4B9bsTqgV2wAlXgc" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <service android:name="com.parse.PushService" />

        <receiver android:name="com.parse.ParseBroadcastReceiver" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.USER_PRESENT" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="com.parse.GcmBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="com.strengthcoach.strengthcoach" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".helpers.PushBroadcastReceiver"
            android:exported="false" >
            <intent-filter>
                <action android:name="com.parse.push.intent.RECEIVE" />
                <action android:name="com.parse.push.intent.DELETE" />
                <action android:name="com.parse.push.intent.OPEN" />
            </intent-filter>
        </receiver>

        <!-- replace @drawable/push_icon with your push icon identifier -->
        <meta-data
            android:name="com.parse.push.notification_icon"
            android:resource="@drawable/app_icon" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <activity
            android:name=".activities.MapActivity"
            android:label="@string/title_activity_map" >
        </activity>
        <activity
            android:name=".activities.TrainerDetailsAnimatedActivity"
            android:label="@string/title_activity_trainer_details_animated"
            android:parentActivityName=".activities.HomeActivity" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.strengthcoach.strengthcoach.activities.HomeActivity" />
        </activity>
        <activity
            android:name=".activities.CardScannedActivity"
            android:label="@string/title_activity_card_scanned" >
        </activity>
    </application>

</manifest>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Fieldiana, Bot. 21: 98 (1989)

#### Original name
Leucoagaricus tricolor Singer

### Remarks
null


text:
@interface ShouYouViewController : UIViewController

@property(strong,nonatomic)UILabel *jieshu;
//定时器
@property(strong,nonatomic)NSTimer *timer;

@end


text:
// App2App.cpp : Implementation of App2App

#include "stdafx.h"
#include ".\skypemessagequeue.h"
#include ".\usercollection.h"
#include ".\app2app.h"
#include ".\app2appstream.h"

namespace SkypeAPILib
{

#define APP_ID_CHECK \
	if(m_strAppName.empty()) \
		return AtlReportError(GetObjectCLSID(), _T("Application Name Not Set"), GUID_NULL, E_FAIL);

// App2App

void App2App::SetAppName(LPCWSTR AppName) {
	if(wcslen(AppName) > 32) {
		throw(L"Application names are limited to 32 characters");
	}
	m_strAppName = AppName;
}

STDMETHODIMP App2App::CreateApplication()
{
	APP_ID_CHECK
	CHECK_PROTOCOL(5)

	if(m_strAppName.length() > 32) {
		return AtlReportError(GetObjectCLSID(), L"Application name must be under 32 characters",
			GUID_NULL, E_INVALIDARG);
	}

	wstring wstrCommand = L"CREATE APPLICATION " + m_strAppName;
	try {
		gSkypeQueue.ExecuteBlockingCommand(wstrCommand.c_str(), wstrCommand.c_str());
		return S_OK;
	} catch(const WCHAR * err) {
		return AtlReportError(GetObjectCLSID(), err, GUID_NULL, E_FAIL);
	}
}

STDMETHODIMP App2App::DeleteApplication(void)
{
	APP_ID_CHECK
	CHECK_PROTOCOL(5)

	wstring wstrCommand = L"DELETE APPLICATION ";
	wstrCommand += m_strAppName;

	try {
		gSkypeQueue.ExecuteBlockingCommand(wstrCommand.c_str(), wstrCommand.c_str());
	} catch (const WCHAR * err) {
		return AtlReportError(GetObjectCLSID(), err, GUID_NULL, E_FAIL);
	}

	return S_OK;
}

STDMETHODIMP App2App::InitiateConnection(BSTR UserID)
{
	APP_ID_CHECK
	CHECK_PROTOCOL(5)

	wstring wstrCommand = L"ALTER APPLICATION ";
	wstrCommand += m_strAppName;
	wstrCommand += L" CONNECT ";
	wstrCommand += UserID;

	try {
		LPWSTR lpstrResult = gSkypeQueue.ExecuteBlockingCommand(wstrCommand.c_str(), wstrCommand.c_str());
		free(lpstrResult);
		return S_OK;
	} catch (const WCHAR * err) {
		return AtlReportError(GetObjectCLSID(), err, GUID_NULL, E_FAIL);
	}
}

STDMETHODIMP App2App::get_ConnectableUsers(IUserCollection ** pVal)
{
	APP_ID_CHECK
	CHECK_PROTOCOL(5)

	CComObject<UserCollection> * pUsers = NULL;
	LPWSTR pstrUsers = NULL;

	try {
		pstrUsers = gSkypeQueue.RetrieveProperty(L"APPLICATION", m_strAppName.c_str(), L"CONNECTABLE");
	} catch (const WCHAR * err) {
		return AtlReportError(GetObjectCLSID(), err, GUID_NULL, E_FAIL);
	}

	try {
		HRESULT hr = CComObject<UserCollection>::CreateInstance(& pUsers);
		if(SUCCEEDED(hr)) {
			pUsers->SetItemList(pstrUsers);
		}
		free(pstrUsers);
		return pUsers->QueryInterface(pVal);
	} catch (const WCHAR * err) {
		return AtlReportError(GetObjectCLSID(), err, GUID_NULL, E_FAIL);
	}
}

}


text:
/**
 * @module ol/format/filter/EqualTo
 */
import ComparisonBinary from '../filter/ComparisonBinary.js';

/**
 * @classdesc
 * Represents a `<PropertyIsEqualTo>` comparison operator.
 * @api
 */
class EqualTo extends ComparisonBinary {

  /**
   * @param {!string} propertyName Name of the context property to compare.
   * @param {!(string|number)} expression The value to compare.
   * @param {boolean=} opt_matchCase Case-sensitive?
   */
  constructor(propertyName, expression, opt_matchCase) {
    super('PropertyIsEqualTo', propertyName, expression, opt_matchCase);
  }

}

export default EqualTo;


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Implementations of the Bean Validation metadata interfaces as well as Hibernate Validator specific meta data classes.
    Raw meta data can come from any configuration source, be it annotation, XML or programmatic configuration. See also
    {@code ConfigurationSource}


text:
.. spelling::

    wt

.. index:: frameworks ; wt

.. _pkg.wt:

wt
==

-  `Official <https://github.com/emweb/wt>`__
-  `Hunterized <https://github.com/hunter-packages/wt>`__
-  `Example <https://github.com/ruslo/hunter/blob/master/examples/wt/CMakeLists.txt>`__
-  Added by `Casey <https://github.com/caseymcc>`__ (`pr-1655 <https://github.com/ruslo/hunter/pull/1655>`__)

Wt is a web GUI library in modern C++.

.. literalinclude:: /../examples/wt/CMakeLists.txt
  :language: cmake
  :start-after: # DOCUMENTATION_START {
  :end-before: # DOCUMENTATION_END }


text:
import sys
import hashlib
from OpenSSL.crypto import *

def main():
  if(len(sys.argv) != 4):
    print( sys.argv[0] + " /path/to/ssl.crt /path/to/ssl.key ProcessedMachineIdentifier")
    sys.exit(0)
  hash = hashlib.sha512()
  hash.update('plex'.encode('utf-8'))
  hash.update(sys.argv[3].encode('utf-8'))
  passphrase = hash.hexdigest()

  with open(sys.argv[1], 'rb') as f:
    c = f.read()

  with open(sys.argv[2], 'rb') as f:
    k = f.read()

  key = load_privatekey(FILETYPE_PEM,k)
  cert = load_certificate(FILETYPE_PEM,c)
  p12 = PKCS12()
  p12.set_certificate(cert)
  p12.set_privatekey(key)
  open("certificate.p12", 'wb' ).write( p12.export(passphrase) )

  print(passphrase)

if __name__ == '__main__':
  main()


text:
<?php

namespace Shoperti\Uploader\Contracts;

/**
 * This is the uploader interface class.
 *
 * @author Arturo Rodríguez <arturo@shoperti.com>
 * @author Joseph Cohen <joe@shoperti.com>
 */
interface Uploader
{
    /**
     * Uploads a file to a filesystem disk.
     *
     * @param string      $path
     * @param string|null $disk
     *
     * @throws \Shoperti\Uploader\Exceptions\InvalidFileException
     *
     * @return \Shoperti\Uploader\UploadResult
     */
    public function upload($path, $disk = null);

    /**
     * Uploads a file to a filesystem disk with a name.
     *
     * @param string      $path
     * @param string      $name
     * @param string|null $disk
     *
     * @throws \Shoperti\Uploader\Exceptions\InvalidFileException
     *
     * @return \Shoperti\Uploader\UploadResult
     */
    public function uploadAs($path, $name, $disk = null);
}


text:
<?php

namespace Acme\UserBundle\Controller;

use Acme\UserBundle\Form\Type\LoginFormType;
use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use FOS\UserBundle\Controller\ResettingController as BaseController;
use FOS\UserBundle\Model\UserInterface;

class ResettingController extends BaseController
{

    public function requestAction()
    {
        $form = $this->container->get('form.factory')->createBuilder()
            ->add('username', 'email', array('label' => 'form.email'))
            ->getForm();
        $request = $this->container->get('request_stack')->getCurrentRequest();
        if ('POST' === $request->getMethod()) {
            $form->bind($request);
            if ($form->isValid()) {
                /** @var $user UserInterface */
                $user = $this->container->get('fos_user.user_manager')->findUserByUsernameOrEmail($form->getData()['username']);
                try {
                    if (null === $user) {
                        throw new \Exception('form.email_doesnt_exists');
                    }

                    if (null === $user->getConfirmationToken()) {
                        /** @var $tokenGenerator \FOS\UserBundle\Util\TokenGeneratorInterface */
                        $tokenGenerator = $this->container->get('fos_user.util.token_generator');
                        $user->setConfirmationToken($tokenGenerator->generateToken());
                    }

                    $this->container->get('fos_user.mailer')->sendResettingEmailMessage($user);
                    $user->setPasswordRequestedAt(new \DateTime());
                    $this->container->get('fos_user.user_manager')->updateUser($user);
//                    return $this->container->get('templating')->renderResponse('AcmeUserBundle:Resetting:check_email.html.twig', array('email' => $user->getEmail()));
                    return new JsonResponse(array('success' => true));
                } catch (\Exception $e) {
//                    $error = new FormError($e->getMessage());
//                    $form->get('username')->addError($error);
                    return new JsonResponse(array('success' => false));

                }
            }
        }
        return new JsonResponse(array('success' => false));
//        return $this->container->get('templating')->renderResponse('AcmeUserBundle:Resetting:request.html.twig', array('form' => $form->createView()));
    }

    public function resetAction($token){

        $user = $this->container->get('fos_user.user_manager')->findUserByConfirmationToken($token);
		if (null === $user) {
			echo 'The user with confirmation token does not exist for value '.$token;
            throw new NotFoundHttpException(sprintf('The user with "confirmation token" does not exist for value "%s"', $token));
        }

        if (!$user->isPasswordRequestNonExpired($this->container->getParameter('fos_user.resetting.token_ttl'))) {
        	return new RedirectResponse($this->container->get('router')->generate('fos_user_resetting_request'));
        }

        $form = $this->container->get('fos_user.resetting.form');
        $formHandler = $this->container->get('fos_user.resetting.form.handler');
        $process = $formHandler->process($user);

        if ($process) {
           $this->setFlash('fos_user_success', 'resetting.flash.success');
        //    $response = new RedirectResponse($this->getRedirectionUrl($user));
         //   $this->authenticateUser($user, $response);
            Header("Location:/user/login");
            die();
          //  return $response;
        }

        return $this->container->get('templating')->renderResponse('AcmeUserBundle:Resetting:reset.html.'.$this->getEngine(), array(
            'token' => $token,
            'form' => $form->createView(),
        ));
    }

    protected function getRedirectionUrl(UserInterface $user)
    {
        return new RedirectResponse($this->container->get('router')->generate('app'));
    }

 	public function requestcheckEmailAction()
    {
       		$form = $this->container->get('form.factory')->createBuilder()
            ->add('username', 'email', array('label' => 'form.email'))
            ->add('token', 'hidden')
            ->getForm();

            $request = $this->container->get('request_stack')->getCurrentRequest();

            if ('POST' === $request->getMethod()) {
            $form->bind($request);
               /** @var $user UserInterface */
                $user = $this->container->get('fos_user.user_manager')->findUserByUsernameOrEmail($_POST['username']);
                try {
                    if (null === $user) {
                        throw new \Exception('form.email_doesnt_exists');
                    }
                    $this->container->get('fos_user.mailer')->sendSocialEmailMessage($user,$_POST['token']."&email=".$_POST['username']);
                    return new JsonResponse(array('success' => true));
                } catch (\Exception $e) {
                    return new JsonResponse(array('success' => false));

                }
            }
       // }
        return new JsonResponse(array('success' => false));
//        return $this->container->get('templating')->renderResponse('AcmeUserBundle:Resetting:request.html.twig', array('form' => $form->createView()));
    }

}


text:
#include <iostream>
#include <fstream>
#include <string>
#include "opencv2/opencv_modules.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/stitching/detail/autocalib.hpp"
#include "opencv2/stitching/detail/blenders.hpp"
#include "opencv2/stitching/detail/camera.hpp"
#include "opencv2/stitching/detail/exposure_compensate.hpp"
#include "opencv2/stitching/detail/matchers.hpp"
#include "opencv2/stitching/detail/motion_estimators.hpp"
#include "opencv2/stitching/detail/seam_finders.hpp"
#include "opencv2/stitching/detail/util.hpp"
#include "opencv2/stitching/detail/warpers.hpp"
#include "opencv2/stitching/warpers.hpp"

using namespace std;
using namespace cv;
using namespace cv::detail;

static void printUsage()
{
    cout <<
        "Rotation model images stitcher.\n\n"
        "stitching_detailed img1 img2 [...imgN] [flags]\n\n"
        "Flags:\n"
        "  --preview\n"
        "      Run stitching in the preview mode. Works faster than usual mode,\n"
        "      but output image will have lower resolution.\n"
        "  --try_gpu (yes|no)\n"
        "      Try to use GPU. The default value is 'no'. All default values\n"
        "      are for CPU mode.\n"
        "\nMotion Estimation Flags:\n"
        "  --work_megapix <float>\n"
        "      Resolution for image registration step. The default is 0.6 Mpx.\n"
        "  --features (surf|orb)\n"
        "      Type of features used for images matching. The default is surf.\n"
        "  --match_conf <float>\n"
        "      Confidence for feature matching step. The default is 0.65 for surf and 0.3 for orb.\n"
        "  --conf_thresh <float>\n"
        "      Threshold for two images are from the same panorama confidence.\n"
        "      The default is 1.0.\n"
        "  --ba (reproj|ray)\n"
        "      Bundle adjustment cost function. The default is ray.\n"
        "  --ba_refine_mask (mask)\n"
        "      Set refinement mask for bundle adjustment. It looks like 'x_xxx',\n"
        "      where 'x' means refine respective parameter and '_' means don't\n"
        "      refine one, and has the following format:\n"
        "      <fx><skew><ppx><aspect><ppy>. The default mask is 'xxxxx'. If bundle\n"
        "      adjustment doesn't support estimation of selected parameter then\n"
        "      the respective flag is ignored.\n"
        "  --wave_correct (no|horiz|vert)\n"
        "      Perform wave effect correction. The default is 'horiz'.\n"
        "  --save_graph <file_name>\n"
        "      Save matches graph represented in DOT language to <file_name> file.\n"
        "      Labels description: Nm is number of matches, Ni is number of inliers,\n"
        "      C is confidence.\n"
        "\nCompositing Flags:\n"
        "  --warp (plane|cylindrical|spherical|fisheye|stereographic|compressedPlaneA2B1|compressedPlaneA1.5B1|compressedPlanePortraitA2B1|compressedPlanePortraitA1.5B1|paniniA2B1|paniniA1.5B1|paniniPortraitA2B1|paniniPortraitA1.5B1|mercator|transverseMercator)\n"
        "      Warp surface type. The default is 'spherical'.\n"
        "  --seam_megapix <float>\n"
        "      Resolution for seam estimation step. The default is 0.1 Mpx.\n"
        "  --seam (no|voronoi|gc_color|gc_colorgrad)\n"
        "      Seam estimation method. The default is 'gc_color'.\n"
        "  --compose_megapix <float>\n"
        "      Resolution for compositing step. Use -1 for original resolution.\n"
        "      The default is -1.\n"
        "  --expos_comp (no|gain|gain_blocks)\n"
        "      Exposure compensation method. The default is 'gain_blocks'.\n"
        "  --blend (no|feather|multiband)\n"
        "      Blending method. The default is 'multiband'.\n"
        "  --blend_strength <float>\n"
        "      Blending strength from [0,100] range. The default is 5.\n"
        "  --output <result_img>\n"
        "      The default is 'result.jpg'.\n";
}

// Default command line args
vector<string> img_names;
bool preview = false;
bool try_gpu = false;
double work_megapix = 0.6;
double seam_megapix = 0.1;
double compose_megapix = -1;
float conf_thresh = 1.f;
string features_type = "surf";
string ba_cost_func = "ray";
string ba_refine_mask = "xxxxx";
bool do_wave_correct = true;
WaveCorrectKind wave_correct = detail::WAVE_CORRECT_HORIZ;
bool save_graph = false;
std::string save_graph_to;
string warp_type = "spherical";
int expos_comp_type = ExposureCompensator::GAIN_BLOCKS;
float match_conf = 0.3f;
string seam_find_type = "gc_color";
int blend_type = Blender::MULTI_BAND;
float blend_strength = 5;
string result_name = "result.jpg";

static int parseCmdArgs(int argc, char** argv)
{
    if (argc == 1)
    {
        printUsage();
        return -1;
    }
    for (int i = 1; i < argc; ++i)
    {
        if (string(argv[i]) == "--help" || string(argv[i]) == "/?")
        {
            printUsage();
            return -1;
        }
        else if (string(argv[i]) == "--preview")
        {
            preview = true;
        }
        else if (string(argv[i]) == "--try_gpu")
        {
            if (string(argv[i + 1]) == "no")
                try_gpu = false;
            else if (string(argv[i + 1]) == "yes")
                try_gpu = true;
            else
            {
                cout << "Bad --try_gpu flag value\n";
                return -1;
            }
            i++;
        }
        else if (string(argv[i]) == "--work_megapix")
        {
            work_megapix = atof(argv[i + 1]);
            i++;
        }
        else if (string(argv[i]) == "--seam_megapix")
        {
            seam_megapix = atof(argv[i + 1]);
            i++;
        }
        else if (string(argv[i]) == "--compose_megapix")
        {
            compose_megapix = atof(argv[i + 1]);
            i++;
        }
        else if (string(argv[i]) == "--result")
        {
            result_name = argv[i + 1];
            i++;
        }
        else if (string(argv[i]) == "--features")
        {
            features_type = argv[i + 1];
            if (features_type == "orb")
                match_conf = 0.3f;
            i++;
        }
        else if (string(argv[i]) == "--match_conf")
        {
            match_conf = static_cast<float>(atof(argv[i + 1]));
            i++;
        }
        else if (string(argv[i]) == "--conf_thresh")
        {
            conf_thresh = static_cast<float>(atof(argv[i + 1]));
            i++;
        }
        else if (string(argv[i]) == "--ba")
        {
            ba_cost_func = argv[i + 1];
            i++;
        }
        else if (string(argv[i]) == "--ba_refine_mask")
        {
            ba_refine_mask = argv[i + 1];
            if (ba_refine_mask.size() != 5)
            {
                cout << "Incorrect refinement mask length.\n";
                return -1;
            }
            i++;
        }
        else if (string(argv[i]) == "--wave_correct")
        {
            if (string(argv[i + 1]) == "no")
                do_wave_correct = false;
            else if (string(argv[i + 1]) == "horiz")
            {
                do_wave_correct = true;
                wave_correct = detail::WAVE_CORRECT_HORIZ;
            }
            else if (string(argv[i + 1]) == "vert")
            {
                do_wave_correct = true;
                wave_correct = detail::WAVE_CORRECT_VERT;
            }
            else
            {
                cout << "Bad --wave_correct flag value\n";
                return -1;
            }
            i++;
        }
        else if (string(argv[i]) == "--save_graph")
        {
            save_graph = true;
            save_graph_to = argv[i + 1];
            i++;
        }
        else if (string(argv[i]) == "--warp")
        {
            warp_type = string(argv[i + 1]);
            i++;
        }
        else if (string(argv[i]) == "--expos_comp")
        {
            if (string(argv[i + 1]) == "no")
                expos_comp_type = ExposureCompensator::NO;
            else if (string(argv[i + 1]) == "gain")
                expos_comp_type = ExposureCompensator::GAIN;
            else if (string(argv[i + 1]) == "gain_blocks")
                expos_comp_type = ExposureCompensator::GAIN_BLOCKS;
            else
            {
                cout << "Bad exposure compensation method\n";
                return -1;
            }
            i++;
        }
        else if (string(argv[i]) == "--seam")
        {
            if (string(argv[i + 1]) == "no" ||
                string(argv[i + 1]) == "voronoi" ||
                string(argv[i + 1]) == "gc_color" ||
                string(argv[i + 1]) == "gc_colorgrad" ||
                string(argv[i + 1]) == "dp_color" ||
                string(argv[i + 1]) == "dp_colorgrad")
                seam_find_type = argv[i + 1];
            else
            {
                cout << "Bad seam finding method\n";
                return -1;
            }
            i++;
        }
        else if (string(argv[i]) == "--blend")
        {
            if (string(argv[i + 1]) == "no")
                blend_type = Blender::NO;
            else if (string(argv[i + 1]) == "feather")
                blend_type = Blender::FEATHER;
            else if (string(argv[i + 1]) == "multiband")
                blend_type = Blender::MULTI_BAND;
            else
            {
                cout << "Bad blending method\n";
                return -1;
            }
            i++;
        }
        else if (string(argv[i]) == "--blend_strength")
        {
            blend_strength = static_cast<float>(atof(argv[i + 1]));
            i++;
        }
        else if (string(argv[i]) == "--output")
        {
            result_name = argv[i + 1];
            i++;
        }
        else
            img_names.push_back(argv[i]);
    }
    if (preview)
    {
        compose_megapix = 0.6;
    }
    return 0;
}

int main(int argc, char* argv[])
{
#if ENABLE_LOG
    int64 app_start_time = getTickCount();
#endif

    cv::setBreakOnError(true);

    int retval = parseCmdArgs(argc, argv);
    if (retval)
        return retval;

    // Check if have enough images
    int num_images = static_cast<int>(img_names.size());
    if (num_images < 2)
    {
        LOGLN("Need more images");
        return -1;
    }

    double work_scale = 1, seam_scale = 1, compose_scale = 1;
    bool is_work_scale_set = false, is_seam_scale_set = false, is_compose_scale_set = false;

    LOGLN("Finding features...");
#if ENABLE_LOG
    int64 t = getTickCount();
#endif

    Ptr<FeaturesFinder> finder;
    if (features_type == "surf")
    {
#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU)
        if (try_gpu && gpu::getCudaEnabledDeviceCount() > 0)
            finder = new SurfFeaturesFinderGpu();
        else
#endif
            finder = new SurfFeaturesFinder();
    }
    else if (features_type == "orb")
    {
        finder = new OrbFeaturesFinder();
    }
    else
    {
        cout << "Unknown 2D features type: '" << features_type << "'.\n";
        return -1;
    }

    Mat full_img, img;
    vector<ImageFeatures> features(num_images);
    vector<Mat> images(num_images);
    vector<Size> full_img_sizes(num_images);
    double seam_work_aspect = 1;

    for (int i = 0; i < num_images; ++i)
    {
        full_img = imread(img_names[i]);
        full_img_sizes[i] = full_img.size();

        if (full_img.empty())
        {
            LOGLN("Can't open image " << img_names[i]);
            return -1;
        }
        if (work_megapix < 0)
        {
            img = full_img;
            work_scale = 1;
            is_work_scale_set = true;
        }
        else
        {
            if (!is_work_scale_set)
            {
                work_scale = min(1.0, sqrt(work_megapix * 1e6 / full_img.size().area()));
                is_work_scale_set = true;
            }
            resize(full_img, img, Size(), work_scale, work_scale);
        }
        if (!is_seam_scale_set)
        {
            seam_scale = min(1.0, sqrt(seam_megapix * 1e6 / full_img.size().area()));
            seam_work_aspect = seam_scale / work_scale;
            is_seam_scale_set = true;
        }

        (*finder)(img, features[i]);
        features[i].img_idx = i;
        LOGLN("Features in image #" << i+1 << ": " << features[i].keypoints.size());

        resize(full_img, img, Size(), seam_scale, seam_scale);
        images[i] = img.clone();
    }

    finder->collectGarbage();
    full_img.release();
    img.release();

    LOGLN("Finding features, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");

    LOG("Pairwise matching");
#if ENABLE_LOG
    t = getTickCount();
#endif
    vector<MatchesInfo> pairwise_matches;
    BestOf2NearestMatcher matcher(try_gpu, match_conf);
    matcher(features, pairwise_matches);
    matcher.collectGarbage();
    LOGLN("Pairwise matching, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");

    // Check if we should save matches graph
    if (save_graph)
    {
        LOGLN("Saving matches graph...");
        ofstream f(save_graph_to.c_str());
        f << matchesGraphAsString(img_names, pairwise_matches, conf_thresh);
    }

    // Leave only images we are sure are from the same panorama
    vector<int> indices = leaveBiggestComponent(features, pairwise_matches, conf_thresh);
    vector<Mat> img_subset;
    vector<string> img_names_subset;
    vector<Size> full_img_sizes_subset;
    for (size_t i = 0; i < indices.size(); ++i)
    {
        img_names_subset.push_back(img_names[indices[i]]);
        img_subset.push_back(images[indices[i]]);
        full_img_sizes_subset.push_back(full_img_sizes[indices[i]]);
    }

    images = img_subset;
    img_names = img_names_subset;
    full_img_sizes = full_img_sizes_subset;

    // Check if we still have enough images
    num_images = static_cast<int>(img_names.size());
    if (num_images < 2)
    {
        LOGLN("Need more images");
        return -1;
    }

    HomographyBasedEstimator estimator;
    vector<CameraParams> cameras;
    estimator(features, pairwise_matches, cameras);

    for (size_t i = 0; i < cameras.size(); ++i)
    {
        Mat R;
        cameras[i].R.convertTo(R, CV_32F);
        cameras[i].R = R;
        LOGLN("Initial intrinsics #" << indices[i]+1 << ":\n" << cameras[i].K());
    }

    Ptr<detail::BundleAdjusterBase> adjuster;
    if (ba_cost_func == "reproj") adjuster = new detail::BundleAdjusterReproj();
    else if (ba_cost_func == "ray") adjuster = new detail::BundleAdjusterRay();
    else
    {
        cout << "Unknown bundle adjustment cost function: '" << ba_cost_func << "'.\n";
        return -1;
    }
    adjuster->setConfThresh(conf_thresh);
    Mat_<uchar> refine_mask = Mat::zeros(3, 3, CV_8U);
    if (ba_refine_mask[0] == 'x') refine_mask(0,0) = 1;
    if (ba_refine_mask[1] == 'x') refine_mask(0,1) = 1;
    if (ba_refine_mask[2] == 'x') refine_mask(0,2) = 1;
    if (ba_refine_mask[3] == 'x') refine_mask(1,1) = 1;
    if (ba_refine_mask[4] == 'x') refine_mask(1,2) = 1;
    adjuster->setRefinementMask(refine_mask);
    (*adjuster)(features, pairwise_matches, cameras);

    // Find median focal length

    vector<double> focals;
    for (size_t i = 0; i < cameras.size(); ++i)
    {
        LOGLN("Camera #" << indices[i]+1 << ":\n" << cameras[i].K());
        focals.push_back(cameras[i].focal);
    }

    sort(focals.begin(), focals.end());
    float warped_image_scale;
    if (focals.size() % 2 == 1)
        warped_image_scale = static_cast<float>(focals[focals.size() / 2]);
    else
        warped_image_scale = static_cast<float>(focals[focals.size() / 2 - 1] + focals[focals.size() / 2]) * 0.5f;

    if (do_wave_correct)
    {
        vector<Mat> rmats;
        for (size_t i = 0; i < cameras.size(); ++i)
            rmats.push_back(cameras[i].R);
        waveCorrect(rmats, wave_correct);
        for (size_t i = 0; i < cameras.size(); ++i)
            cameras[i].R = rmats[i];
    }

    LOGLN("Warping images (auxiliary)... ");
#if ENABLE_LOG
    t = getTickCount();
#endif

    vector<Point> corners(num_images);
    vector<Mat> masks_warped(num_images);
    vector<Mat> images_warped(num_images);
    vector<Size> sizes(num_images);
    vector<Mat> masks(num_images);

    // Preapre images masks
    for (int i = 0; i < num_images; ++i)
    {
        masks[i].create(images[i].size(), CV_8U);
        masks[i].setTo(Scalar::all(255));
    }

    // Warp images and their masks

    Ptr<WarperCreator> warper_creator;
#ifdef HAVE_OPENCV_GPU
    if (try_gpu && gpu::getCudaEnabledDeviceCount() > 0)
    {
        if (warp_type == "plane") warper_creator = new cv::PlaneWarperGpu();
        else if (warp_type == "cylindrical") warper_creator = new cv::CylindricalWarperGpu();
        else if (warp_type == "spherical") warper_creator = new cv::SphericalWarperGpu();
    }
    else
#endif
    {
        if (warp_type == "plane") warper_creator = new cv::PlaneWarper();
        else if (warp_type == "cylindrical") warper_creator = new cv::CylindricalWarper();
        else if (warp_type == "spherical") warper_creator = new cv::SphericalWarper();
        else if (warp_type == "fisheye") warper_creator = new cv::FisheyeWarper();
        else if (warp_type == "stereographic") warper_creator = new cv::StereographicWarper();
        else if (warp_type == "compressedPlaneA2B1") warper_creator = new cv::CompressedRectilinearWarper(2, 1);
        else if (warp_type == "compressedPlaneA1.5B1") warper_creator = new cv::CompressedRectilinearWarper(1.5, 1);
        else if (warp_type == "compressedPlanePortraitA2B1") warper_creator = new cv::CompressedRectilinearPortraitWarper(2, 1);
        else if (warp_type == "compressedPlanePortraitA1.5B1") warper_creator = new cv::CompressedRectilinearPortraitWarper(1.5, 1);
        else if (warp_type == "paniniA2B1") warper_creator = new cv::PaniniWarper(2, 1);
        else if (warp_type == "paniniA1.5B1") warper_creator = new cv::PaniniWarper(1.5, 1);
        else if (warp_type == "paniniPortraitA2B1") warper_creator = new cv::PaniniPortraitWarper(2, 1);
        else if (warp_type == "paniniPortraitA1.5B1") warper_creator = new cv::PaniniPortraitWarper(1.5, 1);
        else if (warp_type == "mercator") warper_creator = new cv::MercatorWarper();
        else if (warp_type == "transverseMercator") warper_creator = new cv::TransverseMercatorWarper();
    }

    if (warper_creator.empty())
    {
        cout << "Can't create the following warper '" << warp_type << "'\n";
        return 1;
    }

    Ptr<RotationWarper> warper = warper_creator->create(static_cast<float>(warped_image_scale * seam_work_aspect));

    for (int i = 0; i < num_images; ++i)
    {
        Mat_<float> K;
        cameras[i].K().convertTo(K, CV_32F);
        float swa = (float)seam_work_aspect;
        K(0,0) *= swa; K(0,2) *= swa;
        K(1,1) *= swa; K(1,2) *= swa;

        corners[i] = warper->warp(images[i], K, cameras[i].R, INTER_LINEAR, BORDER_REFLECT, images_warped[i]);
        sizes[i] = images_warped[i].size();

        warper->warp(masks[i], K, cameras[i].R, INTER_NEAREST, BORDER_CONSTANT, masks_warped[i]);
    }

    vector<Mat> images_warped_f(num_images);
    for (int i = 0; i < num_images; ++i)
        images_warped[i].convertTo(images_warped_f[i], CV_32F);

    LOGLN("Warping images, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");

    Ptr<ExposureCompensator> compensator = ExposureCompensator::createDefault(expos_comp_type);
    compensator->feed(corners, images_warped, masks_warped);

    Ptr<SeamFinder> seam_finder;
    if (seam_find_type == "no")
        seam_finder = new detail::NoSeamFinder();
    else if (seam_find_type == "voronoi")
        seam_finder = new detail::VoronoiSeamFinder();
    else if (seam_find_type == "gc_color")
    {
#ifdef HAVE_OPENCV_GPU
        if (try_gpu && gpu::getCudaEnabledDeviceCount() > 0)
            seam_finder = new detail::GraphCutSeamFinderGpu(GraphCutSeamFinderBase::COST_COLOR);
        else
#endif
            seam_finder = new detail::GraphCutSeamFinder(GraphCutSeamFinderBase::COST_COLOR);
    }
    else if (seam_find_type == "gc_colorgrad")
    {
#ifdef HAVE_OPENCV_GPU
        if (try_gpu && gpu::getCudaEnabledDeviceCount() > 0)
            seam_finder = new detail::GraphCutSeamFinderGpu(GraphCutSeamFinderBase::COST_COLOR_GRAD);
        else
#endif
            seam_finder = new detail::GraphCutSeamFinder(GraphCutSeamFinderBase::COST_COLOR_GRAD);
    }
    else if (seam_find_type == "dp_color")
        seam_finder = new detail::DpSeamFinder(DpSeamFinder::COLOR);
    else if (seam_find_type == "dp_colorgrad")
        seam_finder = new detail::DpSeamFinder(DpSeamFinder::COLOR_GRAD);
    if (seam_finder.empty())
    {
        cout << "Can't create the following seam finder '" << seam_find_type << "'\n";
        return 1;
    }

    seam_finder->find(images_warped_f, corners, masks_warped);

    // Release unused memory
    images.clear();
    images_warped.clear();
    images_warped_f.clear();
    masks.clear();

    LOGLN("Compositing...");
#if ENABLE_LOG
    t = getTickCount();
#endif

    Mat img_warped, img_warped_s;
    Mat dilated_mask, seam_mask, mask, mask_warped;
    Ptr<Blender> blender;
    //double compose_seam_aspect = 1;
    double compose_work_aspect = 1;

    for (int img_idx = 0; img_idx < num_images; ++img_idx)
    {
        LOGLN("Compositing image #" << indices[img_idx]+1);

        // Read image and resize it if necessary
        full_img = imread(img_names[img_idx]);
        if (!is_compose_scale_set)
        {
            if (compose_megapix > 0)
                compose_scale = min(1.0, sqrt(compose_megapix * 1e6 / full_img.size().area()));
            is_compose_scale_set = true;

            // Compute relative scales
            //compose_seam_aspect = compose_scale / seam_scale;
            compose_work_aspect = compose_scale / work_scale;

            // Update warped image scale
            warped_image_scale *= static_cast<float>(compose_work_aspect);
            warper = warper_creator->create(warped_image_scale);

            // Update corners and sizes
            for (int i = 0; i < num_images; ++i)
            {
                // Update intrinsics
                cameras[i].focal *= compose_work_aspect;
                cameras[i].ppx *= compose_work_aspect;
                cameras[i].ppy *= compose_work_aspect;

                // Update corner and size
                Size sz = full_img_sizes[i];
                if (std::abs(compose_scale - 1) > 1e-1)
                {
                    sz.width = cvRound(full_img_sizes[i].width * compose_scale);
                    sz.height = cvRound(full_img_sizes[i].height * compose_scale);
                }

                Mat K;
                cameras[i].K().convertTo(K, CV_32F);
                Rect roi = warper->warpRoi(sz, K, cameras[i].R);
                corners[i] = roi.tl();
                sizes[i] = roi.size();
            }
        }
        if (abs(compose_scale - 1) > 1e-1)
            resize(full_img, img, Size(), compose_scale, compose_scale);
        else
            img = full_img;
        full_img.release();
        Size img_size = img.size();

        Mat K;
        cameras[img_idx].K().convertTo(K, CV_32F);

        // Warp the current image
        warper->warp(img, K, cameras[img_idx].R, INTER_LINEAR, BORDER_REFLECT, img_warped);

        // Warp the current image mask
        mask.create(img_size, CV_8U);
        mask.setTo(Scalar::all(255));
        warper->warp(mask, K, cameras[img_idx].R, INTER_NEAREST, BORDER_CONSTANT, mask_warped);

        // Compensate exposure
        compensator->apply(img_idx, corners[img_idx], img_warped, mask_warped);

        img_warped.convertTo(img_warped_s, CV_16S);
        img_warped.release();
        img.release();
        mask.release();

        dilate(masks_warped[img_idx], dilated_mask, Mat());
        resize(dilated_mask, seam_mask, mask_warped.size());
        mask_warped = seam_mask & mask_warped;

        if (blender.empty())
        {
            blender = Blender::createDefault(blend_type, try_gpu);
            Size dst_sz = resultRoi(corners, sizes).size();
            float blend_width = sqrt(static_cast<float>(dst_sz.area())) * blend_strength / 100.f;
            if (blend_width < 1.f)
                blender = Blender::createDefault(Blender::NO, try_gpu);
            else if (blend_type == Blender::MULTI_BAND)
            {
                MultiBandBlender* mb = dynamic_cast<MultiBandBlender*>(static_cast<Blender*>(blender));
                mb->setNumBands(static_cast<int>(ceil(log(blend_width)/log(2.)) - 1.));
                LOGLN("Multi-band blender, number of bands: " << mb->numBands());
            }
            else if (blend_type == Blender::FEATHER)
            {
                FeatherBlender* fb = dynamic_cast<FeatherBlender*>(static_cast<Blender*>(blender));
                fb->setSharpness(1.f/blend_width);
                LOGLN("Feather blender, sharpness: " << fb->sharpness());
            }
            blender->prepare(corners, sizes);
        }

        // Blend the current image
        blender->feed(img_warped_s, mask_warped, corners[img_idx]);
    }

    Mat result, result_mask;
    blender->blend(result, result_mask);

    LOGLN("Compositing, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec");

    imwrite(result_name, result);

    LOGLN("Finished, total time: " << ((getTickCount() - app_start_time) / getTickFrequency()) << " sec");
    return 0;
}