text:
package com.facebook.buck.cxx;

import com.facebook.buck.android.AndroidPackageable;
import com.facebook.buck.android.AndroidPackageableCollector;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.model.MacroException;
import com.facebook.buck.model.MacroFinder;
import com.facebook.buck.model.MacroMatchResult;
import com.facebook.buck.model.Pair;
import com.facebook.buck.parser.NoSuchBuildTargetException;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.BuildRuleParams;
import com.facebook.buck.rules.BuildRuleResolver;
import com.facebook.buck.rules.Description;
import com.facebook.buck.rules.NoopBuildRule;
import com.facebook.buck.rules.PathSourcePath;
import com.facebook.buck.rules.SourcePath;
import com.facebook.buck.rules.SourcePathResolver;
import com.facebook.buck.rules.TargetGraph;
import com.facebook.buck.rules.args.Arg;
import com.facebook.buck.rules.args.SourcePathArg;
import com.facebook.buck.rules.args.StringArg;
import com.facebook.buck.rules.coercer.PatternMatchedCollection;
import com.facebook.buck.util.HumanReadableException;
import com.facebook.buck.util.immutables.BuckStyleTuple;
import com.facebook.infer.annotation.SuppressFieldNotInitialized;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;

import org.immutables.value.Value;

import java.util.Optional;

@Value.Immutable
@BuckStyleTuple
abstract class AbstractPrebuiltCxxLibraryGroupDescription implements
    Description<AbstractPrebuiltCxxLibraryGroupDescription.Args> {

  private static final MacroFinder FINDER = new MacroFinder();
  private static final String LIB_MACRO = "lib";
  private static final String REL_LIB_MACRO = "rel-lib";

  /**
   * If the arg contains a library reference, parse it and return it's name and argument.
   */
  private Optional<Pair<String, String>> getLibRef(ImmutableSet<String> macros, String arg) {
    Optional<MacroMatchResult> result;
    try {
      result = FINDER.match(macros, arg);
    } catch (MacroException e) {
      throw new HumanReadableException(e, e.getMessage());
    }
    if (!result.isPresent()) {
      return Optional.empty();
    }
    if (result.get().getMacroType().equals("")) {
      throw new HumanReadableException("expected library reference");
    }
    if (result.get().getMacroInput().size() != 1) {
      throw new HumanReadableException("expected a single library reference argument");
    }
    return Optional.of(
        new Pair<>(result.get().getMacroType(), result.get().getMacroInput().get(0)));
  }

  @Override
  public Args createUnpopulatedConstructorArg() {
    return new Args();
  }

  /**
   * @return the link args formed from the user-provided static link line after resolving library
   *         macro references.
   */
  private Iterable<Arg> getStaticLinkArgs(
      BuildTarget target,
      SourcePathResolver pathResolver,
      ImmutableList<SourcePath> libs,
      ImmutableList<String> args) {
    ImmutableList.Builder<Arg> builder = ImmutableList.builder();
    for (String arg : args) {
      Optional<Pair<String, String>> libRef = getLibRef(ImmutableSet.of(LIB_MACRO), arg);
      if (libRef.isPresent()) {
        int index;
        try {
          index = Integer.parseInt(libRef.get().getSecond());
        } catch (NumberFormatException e) {
          throw new HumanReadableException("%s: ", target);
        }
        if (index < 0 || index >= libs.size()) {
          throw new HumanReadableException("%s: ", target);
        }
        builder.add(new SourcePathArg(pathResolver, libs.get(index)));
      } else {
        builder.add(new StringArg(arg));
      }
    }
    return builder.build();
  }

  /**
   * @return the link args formed from the user-provided shared link line after resolving library
   *         macro references.
   */
  private Iterable<Arg> getSharedLinkArgs(
      BuildTarget target,
      SourcePathResolver pathResolver,
      ImmutableMap<String, SourcePath> libs,
      ImmutableList<String> args) {
    ImmutableList.Builder<Arg> builder = ImmutableList.builder();
    for (String arg : args) {
      Optional<Pair<String, String>> libRef =
          getLibRef(ImmutableSet.of(LIB_MACRO, REL_LIB_MACRO), arg);
      if (libRef.isPresent()) {
        SourcePath lib = libs.get(libRef.get().getSecond());
        if (lib == null) {
          throw new HumanReadableException(
              "%s: library \"%s\" (in \"%s\") must refer to keys in the `sharedLibs` parameter",
              target,
              libRef.get().getSecond(),
              arg);
        }
        Arg libArg;
        if (libRef.get().getFirst().equals(LIB_MACRO)) {
          libArg = new SourcePathArg(pathResolver, lib);
        } else if (libRef.get().getFirst().equals(REL_LIB_MACRO)) {
          if (!(lib instanceof PathSourcePath)) {
            throw new HumanReadableException(
                "%s: can only link prebuilt DSOs without sonames",
                target);
          }
          libArg = new RelativeLinkArg((PathSourcePath) lib);
        } else {
          throw new IllegalStateException();
        }
        builder.add(libArg);
      } else {
        builder.add(new StringArg(arg));
      }
    }
    return builder.build();
  }

  @Override
  public <A extends Args> BuildRule createBuildRule(
      TargetGraph targetGraph,
      final BuildRuleParams params,
      final BuildRuleResolver resolver,
      final A args) throws NoSuchBuildTargetException {
    final SourcePathResolver pathResolver = new SourcePathResolver(resolver);
    return new CustomPrebuiltCxxLibrary(params, pathResolver) {

      private final LoadingCache<
          CxxPreprocessables.CxxPreprocessorInputCacheKey,
          ImmutableMap<BuildTarget, CxxPreprocessorInput>
          > transitiveCxxPreprocessorInputCache =
          CxxPreprocessables.getTransitiveCxxPreprocessorInputCache(this);

      @Override
      public Iterable<AndroidPackageable> getRequiredPackageables() {
        return AndroidPackageableCollector.getPackageableRules(params.getDeps());
      }

      @Override
      public void addToCollector(AndroidPackageableCollector collector) {
        collector.addNativeLinkable(this);
      }

      @Override
      public Iterable<? extends CxxPreprocessorDep> getCxxPreprocessorDeps(
          CxxPlatform cxxPlatform) {
        return FluentIterable.from(getDeps())
            .filter(CxxPreprocessorDep.class);
      }

      @Override
      public Optional<HeaderSymlinkTree> getExportedHeaderSymlinkTree(CxxPlatform cxxPlatform) {
        return Optional.empty();
      }

      @Override
      public CxxPreprocessorInput getCxxPreprocessorInput(
          CxxPlatform cxxPlatform,
          HeaderVisibility headerVisibility)
          throws NoSuchBuildTargetException {
        CxxPreprocessorInput.Builder builder = CxxPreprocessorInput.builder();

        switch (headerVisibility) {
          case PUBLIC:
            builder.putAllPreprocessorFlags(
                CxxFlags.getLanguageFlags(
                    args.exportedPreprocessorFlags,
                    PatternMatchedCollection.of(),
                    ImmutableMap.of(),
                    cxxPlatform));
            for (SourcePath includeDir : args.includeDirs) {
              builder.addIncludes(
                  CxxHeadersDir.of(CxxPreprocessables.IncludeType.SYSTEM, includeDir));
            }
            return builder.build();
          case PRIVATE:
            return builder.build();
        }

        // We explicitly don't put this in a default statement because we
        // want the compiler to warn if someone modifies the HeaderVisibility enum.
        throw new RuntimeException("Invalid header visibility: " + headerVisibility);
      }

      @Override
      public ImmutableMap<BuildTarget, CxxPreprocessorInput> getTransitiveCxxPreprocessorInput(
          CxxPlatform cxxPlatform,
          HeaderVisibility headerVisibility)
          throws NoSuchBuildTargetException {
        return transitiveCxxPreprocessorInputCache.getUnchecked(
            ImmutableCxxPreprocessorInputCacheKey.of(cxxPlatform, headerVisibility));
      }

      @Override
      public Iterable<? extends NativeLinkable> getNativeLinkableDeps() {
        return FluentIterable.from(params.getDeclaredDeps().get())
            .filter(NativeLinkable.class);
      }

      @Override
      public Iterable<? extends NativeLinkable> getNativeLinkableExportedDeps() {
        return FluentIterable.from(args.exportedDeps)
            .transform(resolver::getRule)
            .filter(NativeLinkable.class);
      }

      @Override
      public NativeLinkableInput getNativeLinkableInput(
          CxxPlatform cxxPlatform,
          Linker.LinkableDepType type)
          throws NoSuchBuildTargetException {
        NativeLinkableInput.Builder builder = NativeLinkableInput.builder();
        switch (type) {
          case STATIC:
            builder.addAllArgs(
                getStaticLinkArgs(
                    getBuildTarget(),
                    pathResolver,
                    CxxGenruleDescription.fixupSourcePaths(
                        resolver,
                        pathResolver,
                        cxxPlatform,
                        args.staticLibs),
                    args.staticLink));
            break;
          case STATIC_PIC:
            builder.addAllArgs(
                getStaticLinkArgs(
                    getBuildTarget(),
                    pathResolver,
                    CxxGenruleDescription.fixupSourcePaths(
                        resolver,
                        pathResolver,
                        cxxPlatform,
                        args.staticPicLibs),
                    args.staticPicLink));
            break;
          case SHARED:
            builder.addAllArgs(
                getSharedLinkArgs(
                    getBuildTarget(),
                    pathResolver,
                    CxxGenruleDescription.fixupSourcePaths(
                        resolver,
                        pathResolver,
                        cxxPlatform,
                        ImmutableMap.<String, SourcePath>builder()
                            .putAll(args.sharedLibs)
                            .putAll(args.providedSharedLibs)
                            .build()),
                    args.sharedLink));
            break;
        }
        return builder.build();
      }

      @Override
      public Linkage getPreferredLinkage(CxxPlatform cxxPlatform) {

        // If we both shared and static libs, we support any linkage.
        if (!args.sharedLink.isEmpty() &&
            !(args.staticLink.isEmpty() && args.staticPicLink.isEmpty())) {
          return Linkage.ANY;
        }

        // Otherwise, if we have a shared library, we only support shared linkage.
        if (!args.sharedLink.isEmpty()) {
          return Linkage.SHARED;
        }

        // Otherwise, if we have a static library, we only support static linkage.
        if (!(args.staticLink.isEmpty() && args.staticPicLink.isEmpty())) {
          return Linkage.STATIC;
        }

        // Otherwise, header only libs use any linkage.
        return Linkage.ANY;
      }

      @Override
      public ImmutableMap<String, SourcePath> getSharedLibraries(CxxPlatform cxxPlatform)
          throws NoSuchBuildTargetException {
        return args.sharedLibs;
      }

    };
  }

  private abstract static class CustomPrebuiltCxxLibrary
      extends NoopBuildRule
      implements AbstractCxxLibrary {
    public CustomPrebuiltCxxLibrary(
        BuildRuleParams params,
        SourcePathResolver resolver) {
      super(params, resolver);
    }
  }

  @SuppressFieldNotInitialized
  public static class Args {

    public ImmutableList<String> exportedPreprocessorFlags = ImmutableList.of();
    public ImmutableList<SourcePath> includeDirs = ImmutableList.of();

    /**
     * The link arguments to use when linking using the static link style.
     */
    public ImmutableList<String> staticLink = ImmutableList.of();

    /**
     * Libraries references in the static link args above.
     */
    public ImmutableList<SourcePath> staticLibs = ImmutableList.of();

    /**
     * The link arguments to use when linking using the static-pic link style.
     */
    public ImmutableList<String> staticPicLink = ImmutableList.of();

    /**
     * Libraries references in the static-pic link args above.
     */
    public ImmutableList<SourcePath> staticPicLibs = ImmutableList.of();

    /**
     * The link arguments to use when linking using the shared link style.
     */
    public ImmutableList<String> sharedLink = ImmutableList.of();

    /**
     * Libraries references in the shared link args above.
     */
    public ImmutableMap<String, SourcePath> sharedLibs = ImmutableMap.of();
    public ImmutableMap<String, SourcePath> providedSharedLibs = ImmutableMap.of();

    public ImmutableSortedSet<BuildTarget> deps = ImmutableSortedSet.of();
    public ImmutableSortedSet<BuildTarget> exportedDeps = ImmutableSortedSet.of();

  }

}


text:
/*	Displays preview of DOM element */

App.ElementPreviewView = Backbone.View.extend({

	/* ---------------------   C O N S T S   ---------------------- */

	// events
	ON_UPDATE: "ON_UPDATE",

	// other consts

	/* -----------------------   V A R S   ------------------------ */

	/* --------------   B A C K B O N E   V A R S   --------------- */

	// tagName: "li",
	// className: "document-row",
	el: $('#temp-element'),

	// delegated events for interaction
	events: {
		// "click #back-btn": "backHandler",
		// "click #done-btn": "doneHandler"
	},

	/* ------------   B A C K B O N E   M E T H O D S  ------------ */

	// at initialization bind to the relevant events on a collection etc
	initialize: function() {
		glog("ElementPreviewView: initialize");

		var self = this;
		self.listenTo(self.model, "change", self.render);

		self.render();
	},

	render: function() {
		glog("ElementPreviewView: render");

		var self = this;
		self.$el.css( self.model.toJSON() );
	},

	/* --------------   P U B L I C   M E T H O D S   ------------- */

	/* --------------   E V E N T   H A N D L E R S   ------------- */

	updateHandler: function(e) {
		glog("ElementPreviewView: updateHandler");

		var self = this;

		self.trigger(self.ON_UPDATE); // broadcast event
	}

});

redpajama_set_name: RedPajamaGithub


text:
var args = arguments[0] || {};
var hideActivity = function () {
	$.readWindow.remove($.activityIndicator);
};

function myLoader(e) {
	Alloy.Collections.page.fetch({  success: e.hide, error: e.hide});

}
// If I weren't directly binding the model to the view then I'd use the success key
// to do a more advanced manipulation/display of the data.
Alloy.Collections.page.fetch({ success: hideActivity, error: hideActivity });
$.ptr.init($.table);


text:
extern "Java"
{
  namespace javax
  {
    namespace swing
    {
        class JPopupMenu;
        class JPopupMenu$1;
    }
  }
}

class javax::swing::JPopupMenu$1 : public ::java::lang::Object
{

public: // actually package-private
  JPopupMenu$1(::javax::swing::JPopupMenu *);
public:
  virtual void run();
public: // actually package-private
  ::javax::swing::JPopupMenu * __attribute__((aligned(__alignof__( ::java::lang::Object)))) this$0;
public:
  static ::java::lang::Class class$;
};

#endif // __javax_swing_JPopupMenu$1__


text:
module.exports = function () {
    return (this.opts.platforms || this.opts.cordova.platforms || []).filter(function (platform) {
        return this.opts.plugin.pluginInfo.getPlatformsArray().indexOf(platform) > -1;
    }, this);
};


text:
'use strict';

// Configuring the Users module menu
/*
 * Menu method reference
 * Menus.addMenu(menuId, [isPublic], [roles])
 * Menus.addMenuItem(menuId, menuItemTitle, menuItemType, menuItemURL,
 * 	[menuItemUIRoute], [isPublic], [roles], [position]);
 * Menus.addSubMenuItem(menuId, rootMenuItemURL, menuItemTitle, menuItemURL,
 * [menuItemUIRoute], [isPublic], [roles]);
 */

angular.module('users').run(['Menus',
	function(Menus) {
		// Set top bar menu items
		Menus.addMenuItem('topbar', 'Rosters', 'item', 'admin/rosters', 'rosters', 'false', ['admin']);
		//Menus.addMenuItem('topbar', 'Uniforms', 'item', 'admin/uniforms', 'uniforms', 'false', ['admin']);
		//Menus.addMenuItem('topbar', 'Instruments', 'item', 'admin/instruments', 'instruments', 'false', ['admin']);
		Menus.addMenuItem('topbar', 'Manage Moderators', 'item', 'mods/list', '', 'false', ['admin']);
		Menus.addMenuItem('topbar', 'Manage Bands', 'dropdown', 'bands', '', 'false', ['admin']);
			Menus.addSubMenuItem('topbar', 'bands', 'View Band Info.', 'bands', 'list-bands', 'false', ['admin']);
			Menus.addSubMenuItem('topbar', 'bands', 'View Band Applications', 'bandapplications', 'list-bandapplications', 'false', ['admin']);
	}
]);

// Config HTTP Error Handling
angular.module('users').config(['$httpProvider',
	function($httpProvider) {
		// Set the httpProvider "not authorized" interceptor
		$httpProvider.interceptors.push(['$q', '$location', 'Authentication',
			function($q, $location, Authentication) {
				return {
					responseError: function(rejection) {
						switch (rejection.status) {
							case 401:
								// Deauthenticate the global user
								Authentication.user = null;

								// Redirect to signin page
								$location.path('signin');
								break;
							case 403:
								// Add unauthorized behaviour
								break;
						}

						return $q.reject(rejection);
					}
				};
			}
		]);
	}
]);


text:
package com.hazelcast.client.splitbrainprotection.executor;

import com.hazelcast.client.splitbrainprotection.PartitionedClusterClients;
import com.hazelcast.client.test.TestHazelcastFactory;
import com.hazelcast.core.IExecutorService;
import com.hazelcast.splitbrainprotection.SplitBrainProtectionOn;
import com.hazelcast.splitbrainprotection.executor.ExecutorSplitBrainProtectionReadTest;
import com.hazelcast.test.HazelcastSerialParametersRunnerFactory;
import com.hazelcast.test.annotation.ParallelJVMTest;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.UseParametersRunnerFactory;

@RunWith(Parameterized.class)
@UseParametersRunnerFactory(HazelcastSerialParametersRunnerFactory.class)
@Category({QuickTest.class, ParallelJVMTest.class})
public class ClientExecutorSplitBrainProtectionReadTest extends ExecutorSplitBrainProtectionReadTest {

    private static PartitionedClusterClients clients;

    @BeforeClass
    public static void setUp() {
        TestHazelcastFactory factory = new TestHazelcastFactory();
        initTestEnvironment(smallInstanceConfig(), factory);
        clients = new PartitionedClusterClients(cluster, factory);
    }

    @AfterClass
    public static void tearDown() {
        if (clients != null) {
            clients.terminateAll();
        }
        shutdownTestEnvironment();
    }

    @Override
    protected IExecutorService exec(int index, SplitBrainProtectionOn splitBrainProtectionOn) {
        return clients.client(index).getExecutorService(EXEC_NAME + splitBrainProtectionOn.name());
    }
}


text:
using BreakingChangesDetector.MetadataItems;
using System;

namespace BreakingChangesDetector.BreakingChanges.Definitions
{
    internal sealed class ChangedParameterDefaultValueDefinition : BreakingChangeDefinitionBase
    {
        public static readonly ChangedParameterDefaultValueDefinition Instance =
            new ChangedParameterDefaultValueDefinition();

        private ChangedParameterDefaultValueDefinition() { }

        public override void CompareItems(CompareItemsContext context)
        {
            var oldParameter = (ParameterData)context.OldItem;
            var newParameter = (ParameterData)context.NewItem;

            if (oldParameter.IsOptional &&
                newParameter.IsOptional &&
                Object.Equals(oldParameter.DefaultValue, newParameter.DefaultValue) == false)
            {
                context.BreakingChanges.Add(new ChangedParameterDefaultValue(oldParameter, newParameter, (IParameterizedItem)context.AdditionalInfo));
            }
        }

        public override BreakingChangeKind BreakingChangeKind =>
            BreakingChangeKind.ChangedParameterDefaultValue;

        public override MetadataItemKinds MembersKindsHandled =>
            MetadataItemKinds.Parameter;
    }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using Gorgon.Core;
using Gorgon.IO.Providers;

namespace Gorgon.IO
{
    ///
    /// The virtual file System interface.
    ///
    /// <remarks>
    /// <para>
    /// This will allow the user to mount directories or packed files (such as Zip files) into a unified file system.  For example, if the user has mounted MyData.zip and C:\users\Bob\Data\ into the file
    /// system then all files and/or directories from both sources would be combined into a single virtual file system. This has the advantage of being able to access disparate file systems without having
    /// to run through multiple interfaces to get at their data.
    /// </para>
    /// <para>
    /// The virtual file system is a read only file system. This is done by design so that the integrity of the original physical file systems can be preserved. If your application needs to write data into
    /// the file system, then the <see cref="IGorgonFileSystemWriter{T}"/> has been provided to give access to a writable area that will integrate with this object.
    /// </para>
    /// <para>
    /// Physical file systems (such as a windows directory or a Zip file) are "mounted" into this object. When a physical file system is mounted, all of the file names (and other info) and directory names
    /// will be stored in hierarchal structure similar to a Unix directory structure. Because of this, there will be some differences from the typical Windows directory setup:
    /// <list type="bullet">
    /// <item>
    ///		<description>The root of the file system is not "C:\" or "\\Computer\". In this object, the root is '/' (e.g. <c>/MyFile.txt</c> is a file located in the root).</description>
    /// </item>
    /// <item>
    ///		<description>The directory separators are forward slashes: / and not back slashes: \. (e.g. <c>c:\MyDirectory\MySubDirectory\</c> is now <c><![CDATA[/MyDirectory/MySubDirectory/]]></c>)</description>
    /// </item>
    /// </list>
    /// </para>
    /// <para>
    /// <note type="important">
    /// <para>
    /// The order in which file systems are mounted into the virtual file system is important.  If a zip file contains SomeText.txt, and a directory contains the same file path, then if the zip file is
    /// mounted, followed by the directory, the file in the directory will override the file in the zip file. This is true for directories as well.
    /// </para>
    /// </note>
    /// </para>
    /// <para>
    /// By default, a new file system instance will only have access to the directories and files of the hard drive via the default provider. File systems that are in packed files (e.g. Zip files) can be
    /// loaded into the file system by way of a <see cref="GorgonFileSystemProvider"/>. Providers are typically plug in objects that are loaded into the file system via the <see cref="GorgonFileSystemProviderFactory"/>.
    /// Once a provider plug in is loaded, then the contents of that file system can be mounted like a standard directory.
    /// </para>
    /// <para>
    /// When a file system provider is added to the virtual file system object upon creation, the object will contain 2 providers, the default provider is always available with any additional providers.
    /// </para>
    /// </remarks>
    /// <seealso cref="IGorgonFileSystemWriter{T}"/>
    /// <seealso cref="GorgonFileSystemProvider"/>
    /// <example>
    /// This example shows how to create a file system with the default provider, and mount a directory to the root:
    ///
    /// <![CDATA[
    /// IGorgonFileSystem fileSystem = new GorgonFileSystem();
    ///
    /// fileSystem.Mount(@"C:\MyDirectory\", "/");
    /// ]]>
    ///
    /// This example shows how to load a provider from the provider factory and use it with the file system:
    ///
    /// <![CDATA[
    /// // First we need to load the assembly with the provider plug in.
    /// using (GorgonPlugInAssemblyCache assemblies = new GorgonPlugInAssemblyCache())
    /// {
    ///		assemblies.Load(@"C:\PlugIns\GorgonFileSystem.Zip.dll");
    ///		GorgonPlugInService plugInService = new GorgonPlugInService(assemblies);
    ///
    ///		// We'll use the factory to get the zip plug in provider.
    ///		IGorgonFileSystemProviderFactory factory = new GorgonFileSystemProviderFactory(plugInService);
    ///
    ///		IGorgonFileSystemProvider zipProvider = factory.CreateProvider("Gorgon.IO.Zip.ZipProvider");
    ///
    ///		// Now create the file system with the zip provider.
    ///		IGorgonFileSystem fileSystem = new GorgonFileSystem(zipProvider);
    ///		fileSystem.Mount(@"C:\ZipFiles\MyFileSystem.zip", "/");
    /// }
    /// ]]>
    ///
    /// </example>
    public interface IGorgonFileSystem
    {
        #region Properties.

        ///
        /// Property to return the <see cref="IGorgonFileSystemProvider"/> installed in this file system.
        ///
        IEnumerable<IGorgonFileSystemProvider> Providers
        {
            get;
        }

        ///
        /// Property to return the default file system provider for this file system.
        ///
        IGorgonFileSystemProvider DefaultProvider
        {
            get;
        }

        ///
        /// Property to return a list of mount points that are currently assigned to this file system.
        ///
        /// <remarks>
        /// This is a list of <see cref="GorgonFileSystemMountPoint"/> values. These values contain location of the mount point in the virtual file system, the physical location of the physical file system and
        /// the provider that mounted the physical file system.
        /// </remarks>
        IEnumerable<GorgonFileSystemMountPoint> MountPoints
        {
            get;
        }

        ///
        /// Property to return the root directory for the file system.
        ///
        /// <remarks>
        /// <para>
        /// This is the beginning of the directory/file structure for the file system. Users can walk through the properties on this object to get the sub directories and files for a virtual file system as a
        /// hierarchical view.
        /// </para>
        /// <para>
        /// <note type="tip">
        /// <para>
        /// When populating a tree view, this property is useful for helping to lay out the nodes in the tree.
        /// </para>
        /// </note>
        /// </para>
        /// </remarks>
        IGorgonVirtualDirectory RootDirectory
        {
            get;
        }
        #endregion

        #region Methods.
        ///
        /// Function to find all the directories with the name specified by the directory mask.
        ///
        /// <param name="path">The path to the directory to start searching from.</param>
        /// <param name="directoryMask">The directory name or mask to search for.</param>
        /// <param name="recursive">[Optional] true to search all child directories, false to search only the immediate directory.</param>
        /// <returns>An enumerable object containing <see cref="IGorgonVirtualDirectory"/> objects that match the <paramref name="directoryMask"/>.</returns>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="directoryMask"/> or the <paramref name="path"/> parameter is null.</exception>
        /// <exception cref="ArgumentEmptyException">Thrown when the <paramref name="directoryMask"/> or the <paramref name="path"/> parameter are empty.</exception>
        /// <exception cref="DirectoryNotFoundException">Thrown when the directory in specified by the <paramref name="path"/> parameter was not found.</exception>
        /// <remarks>
        /// <para>
        /// This will look for all the directories specified by the <paramref name="directoryMask"/> parameter. This parameter will accept wild card characters like * and ?. This allows pattern matching
        /// which can be used to find a series of directories. If the wild card is omitted, then only that name is sought out.
        /// </para>
        /// <para>
        /// The <paramref name="path"/> parameter is assumed to be starting from the root directory: <c>/</c>. If the path omits the starting root separator (e.g. <c><![CDATA[MyDir/MyFile.txt]]></c>
        /// instead of <c><![CDATA[/MyDir/MyFile.txt]]></c>), then one will be supplied automatically.
        /// </para>
        /// <para>
        /// <note type="warning">
        /// <para>
        /// The <paramref name="directoryMask"/> is not a path.  It is the name (or mask of the name) of the directory we wish to find.  Calling <c>FindDirectories("/", "<![CDATA[/MyDir/ThisDir/C*w/]]>");</c>
        /// will not return any results. Use the <paramref name="path"/> parameter to specify the origin for the search.
        /// </para>
        /// </note>
        /// </para>
        /// </remarks>
        IEnumerable<IGorgonVirtualDirectory> FindDirectories(string path, string directoryMask, bool recursive = true);

        ///
        /// Function to find all the files with the name specified by the file mask.
        ///
        /// <param name="path">The path to the directory to start searching from.</param>
        /// <param name="fileMask">The file name or mask to search for.</param>
        /// <param name="recursive">[Optional] true to search all directories, false to search only the immediate directory.</param>
        /// <returns>An enumerable object containing <see cref="IGorgonVirtualFile"/> objects that match the <paramref name="fileMask"/>.</returns>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="fileMask"/> or the <paramref name="path"/> parameter is null.</exception>
        /// <exception cref="ArgumentEmptyException">Thrown when the <paramref name="fileMask"/> or the <paramref name="path"/> are empty.</exception>
        /// <exception cref="DirectoryNotFoundException">Thrown when the directory in specified by the <paramref name="path"/> parameter was not found.</exception>
        /// <remarks>
        /// <para>
        /// This will look for all the files specified by the <paramref name="fileMask"/> parameter. This parameter will accept wild card characters like * and ?. This allows pattern matching which can be
        /// used to find a series of files. If the wild card is omitted, then only that name is sought out.
        /// </para>
        /// <para>
        /// The <paramref name="path"/> parameter is assumed to be starting from the root directory: <c>/</c>. If the path omits the starting root separator (e.g. <c><![CDATA[MyDir/MyFile.txt]]></c>
        /// instead of <c><![CDATA[/MyDir/MyFile.txt]]></c>), then one will be supplied automatically.
        /// </para>
        /// <para>
        /// <note type="warning">
        /// <para>
        /// The <paramref name="fileMask"/> is not a path.  It is the name (or mask of the name) of the file we wish to find.  Calling <c>FindFiles("/", "<![CDATA[/MyDir/C*w.txt]]>");</c> will not return
        /// any results. Use the <paramref name="path"/> parameter to specify the origin for the search.
        /// </para>
        /// </note>
        /// </para>
        /// </remarks>
        IEnumerable<IGorgonVirtualFile> FindFiles(string path, string fileMask, bool recursive = true);

        ///
        /// Function to retrieve a <see cref="IGorgonVirtualFile"/> from the file system.
        ///
        /// <param name="path">Path to the file to retrieve.</param>
        /// <returns>The <see cref="IGorgonVirtualFile"/> requested or null if the file was not found.</returns>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="path"/> parameter is null.</exception>
        /// <exception cref="ArgumentEmptyException">Thrown when the <paramref name="path"/> parameter is empty.
        /// <para>-or-</para>
        /// <para>Thrown when there is no file name in the <paramref name="path"/>.</para>
        /// </exception>
        /// <remarks>
        /// <para>
        /// This is the primary method of accessing files from the file system. It will return a <see cref="IGorgonVirtualFile"/> object that will allow users to open a stream to the file and read its
        /// contents.
        /// </para>
        /// <para>
        /// The <paramref name="path"/> parameter is assumed to be starting from the root directory: <c>/</c>. If the path omits the starting root separator (e.g. <c><![CDATA[MyDir/MyFile.txt]]></c>
        /// instead of <c><![CDATA[/MyDir/MyFile.txt]]></c>), then one will be supplied automatically. This is also true for filenames without a directory in the path.
        /// </para>
        /// </remarks>
        /// <example>
        /// This example will show how to read a file from the file system:
        ///
        /// <![CDATA[
        /// IGorgonFileSystem fileSystem = new GorgonFileSystem();
        ///
        /// fileSystem.Mount(@"C:\MyDirectory\", "/");
        ///
        /// IGorgonVirtualFile file = fileSystem.GetFile("/ASubDirectory/MyFile.txt");
        ///
        /// using (Stream stream = file.OpenStream())
        /// {
        ///    // Read the file from the stream...
        /// }
        /// ]]>
        ///
        /// </example>
        IGorgonVirtualFile GetFile(string path);

        ///
        /// Function to retrieve a directory from the file system.
        ///
        /// <param name="path">Path to the directory to retrieve.</param>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="path"/> parameter is null</exception>
        /// <exception cref="ArgumentEmptyException">Thrown when the <paramref name="path"/> parameter is an empty string.</exception>
        /// <returns>A <see cref="IGorgonVirtualDirectory"/> if found, null if not.</returns>
        /// <remarks>
        /// <para>
        /// This is the primary method of accessing directories from the file system. It will return a <see cref="IGorgonVirtualDirectory"/> object that will allow users retrieve the files or any sub
        /// directories under that directory.
        /// </para>
        /// <para>
        /// The <paramref name="path"/> parameter is assumed to be starting from the root directory: <c>/</c>. If the path omits the starting root separator (e.g. <c><![CDATA[MyDir/MyFile.txt]]></c>
        /// instead of <c><![CDATA[/MyDir/MyFile.txt]]></c>), then one will be supplied automatically.
        /// </para>
        /// </remarks>
        /// <example>
        /// This example will show how to retrieve a directory from the file system:
        ///
        /// <![CDATA[
        /// IGorgonFileSystem fileSystem = new GorgonFileSystem();
        ///
        /// fileSystem.Mount(@"C:\MyDirectory\", "/");
        ///
        /// IGorgonVirtualDirectory directory = fileSystem.GetDirectory("/ASubDirectory");
        ///
        /// foreach(IGorgonVirtualDirectory subDirectory in directory.Directories)
        /// {
        ///		Console.WriteLine("Sub directory: {0}", subDirectory.FullPath);
        /// }
        /// ]]>
        ///
        /// </example>
        IGorgonVirtualDirectory GetDirectory(string path);

        ///
        /// Function to reload all the files and directories in the file system.
        ///
        /// <remarks>
        /// <para>
        /// This will unmount and re-mount all the known mount points for the file system, effectively rebuilding the file system file/directory tree.
        /// </para>
        /// <para>
        /// Any files or directories sharing the same path as those in the <see cref="IGorgonFileSystemWriter{T}"/> will be restored if they were deleted. This is because the physical file systems (other
        /// than the write area) are never changed. For example:
        /// <para>
        ///
        /// <![CDATA[
        /// // Let's assume this contains a file called "MyBudget.xls"
        /// fileSystem.Mount("MyZip.zip", "/");
        ///
        /// // And the write area also contains a file called "MyBudget.xls".
        /// writeArea.Mount();
        ///
        /// // The "MyBudget.xls" in the write area overrides the file in the zip file since the write area mount
        /// // is higher in the order list.
        /// //
        /// // This will now delete the MyBudget.xls from the virtual file system and from the physical write area.
        /// writeArea.Delete("MyBudget.xls");
        ///
        /// // Now refresh the file system...
        /// fileSystem.Refresh();
        ///
        /// // Now the file will be back, only this time it will belong to the zip file because
        /// // the write area had its file deleted.
        /// var file = fileSystem.GetFile("MyBudget.xls");
        /// ]]>
        ///
        /// </para>
        /// </para>
        /// </remarks>
        void Refresh();

        ///
        /// Function to reload all the files and directories within, and optionally, under the specified directory.
        ///
        /// <param name="path">The path to the directory to refresh.</param>
        /// <remarks>
        /// <para>
        /// Any files or directories sharing the same path as those in the <see cref="IGorgonFileSystemWriter{T}"/> will be restored if they were deleted. This is because the physical file systems (other
        /// than the write area) are never changed. For example:
        /// <para>
        ///
        /// <![CDATA[
        /// // Let's assume this contains a file called "MyBudget.xls"
        /// fileSystem.Mount(@"C:\MountDirectory\", "/");
        ///
        /// // Copy an external file into out mounted directory.
        /// File.Copy(@"C:\OtherData\MyBudget.xls", "C:\MountDirectory\Files\");
        ///
        /// // Get the file...
        /// IGorgonVirtualFile file = fileSystem.GetFile("/Files/MyBudget.xls");
        ///
        /// // The file does not exist yet because the file system has no idea that it's been added.
        /// if (file is null)
        /// {
        ///    Console.WriteLine("File does not exist.");
        /// }
        ///
        /// // Now refresh the file system...
        /// fileSystem.Refresh("/Files/");
        ///
        /// // Get the file... again.
        /// IGorgonVirtualFile file = fileSystem.GetFile("/Files/MyBudget.xls");
        ///
        /// // The file will now show up in the directory.
        /// if (file is not null)
        /// {
        ///    Console.WriteLine("File exists.");
        /// }
        /// ]]>
        ///
        /// </para>
        /// </para>
        /// </remarks>
        void Refresh(string path);

        ///
        /// Function to unmount the mounted virtual file system directories and files specified by the mount point.
        ///
        /// <param name="mountPoint">The mount point to unmount.</param>
        /// <exception cref="ArgumentEmptyException">Thrown when the <paramref name="mountPoint"/> was not found in the file system.</exception>
        /// <remarks>
        /// <para>
        /// This will unmount a physical file system from the virtual file system by removing all directories and files associated with that <paramref name="mountPoint"/>.
        /// </para>
        /// <para>
        /// When passing the <paramref name="mountPoint"/> parameter, users should pass the return value from the <see cref="Mount"/> method.
        /// </para>
        /// <para>
        /// Since the mount order overrides any existing directories or files with the same paths, those files/directories will not be restored. A user should call the <see cref="Refresh()"/> method if they
        /// wish to restore any file/directory entries.
        /// </para>
        /// </remarks>
        void Unmount(GorgonFileSystemMountPoint mountPoint);

        ///
        /// Function to unmount the mounted virtual file system directories and files pointed at the by the physical path specified and mounted into the mount location specified.
        ///
        /// <param name="physicalPath">The physical file system path.</param>
        /// <param name="mountLocation">The virtual sub directory that the physical location is mounted under.</param>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="physicalPath"/> or the <paramref name="mountLocation"/> parameters are null.</exception>
        /// <exception cref="ArgumentEmptyException">Thrown when the <paramref name="physicalPath"/> or the <paramref name="mountLocation"/> parameters are empty.
        /// <para>-or-</para>
        /// <para>Thrown when the mount point with the <paramref name="physicalPath"/> and <paramref name="mountLocation"/> was not found in the file system.</para>
        /// </exception>
        /// <remarks>
        /// <para>
        /// This will unmount a physical file system from the virtual file system by removing all directories and files associated with that mount point <paramref name="physicalPath"/> and <paramref name="mountLocation"/>.
        /// </para>
        /// <para>
        /// Since the mount order overrides any existing directories or files with the same paths, those files/directories will not be restored. A user should call the <see cref="Refresh()"/> method if they
        /// wish to restore any file/directory entries.
        /// </para>
        /// </remarks>
        void Unmount(string physicalPath, string mountLocation);

        ///
        /// Function to unmount the mounted virtual file system directories and files pointed at by a physical path.
        ///
        /// <param name="physicalPath">The physical path to unmount.</param>
        /// <remarks>This overload will unmount all the mounted virtual files/directories for every mount point with the specified <paramref name="physicalPath"/>.</remarks>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="physicalPath"/> parameter is null.</exception>
        /// <exception cref="ArgumentEmptyException">Thrown when the <paramref name="physicalPath"/> parameter is empty.
        /// <para>-or-</para>
        /// <para>Thrown when the mount point with the <paramref name="physicalPath"/> was not found in the file system.</para>
        /// </exception>
        /// <remarks>
        /// <para>
        /// This will unmount a physical file system from the virtual file system by removing all directories and files associated with that mount point <paramref name="physicalPath"/>.
        /// </para>
        /// <para>
        /// Since the mount order overrides any existing directories or files with the same paths, those files/directories will not be restored. A user should call the <see cref="Refresh()"/> method if they
        /// wish to restore any file/directory entries.
        /// </para>
        /// </remarks>
        void Unmount(string physicalPath);

        ///
        /// Function to mount a physical file system into the virtual file system.
        ///
        /// <param name="physicalPath">Path to the physical file system directory or file that contains the files/directories to enumerate.</param>
        /// <param name="mountPath">[Optional] Virtual directory path to mount into.</param>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="physicalPath"/> parameter is null.</exception>
        /// <exception cref="ArgumentEmptyException">Thrown when the <paramref name="physicalPath"/> parameter is an empty string.
        /// <para>-or-</para>
        /// <para>Thrown if mounting a directory and there is no directory in the path.</para>
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">Thrown when the directory specified by <paramref name="physicalPath"/> was not found.</exception>
        /// <exception cref="FileNotFoundException">Thrown if a file was specified by <paramref name="physicalPath"/> was not found.</exception>
        /// <exception cref="IOException">Thrown when the file pointed to by the physicalPath parameter could not be read by any of the file system providers.</exception>
        /// <returns>A mount point value for the currently mounted physical path, its mount point in the virtual file system, and the provider used to mount the physical location.</returns>
        /// <remarks>
        /// <para>
        /// This method is used to mount the contents of a physical file system (such as a windows directory, or a file if the appropriate provider is installed) into a virtual directory in the file system.
        /// All folders and files in the physical file system object will be made available under the virtual folder specified by the <paramref name="mountPath"/> parameter.
        /// </para>
        /// <para>
        /// The method will determine if the user is attempting to mount a physical directory or file. For directories, the <paramref name="physicalPath"/> must end with a trailing backward slash (or
        /// forward slash depending on your native physical file system). For files, the directory should contain a file name. If mounting a file, and only the file name is supplied, then the current
        /// directory is used to locate the file. Relative paths are supported, and will be converted into absolute paths based on the current directory.
        /// </para>
        /// <para>
        /// When files (e.g. zip files) are mounted, the appropriate provider must be loaded and installed via the constructor of this object. The providers can be loaded through a
        /// <see cref="IGorgonFileSystemProviderFactory"/> instance.
        /// </para>
        /// <para>
        /// The <paramref name="physicalPath"/> is usually a file or a directory on the operating system file system. But in some cases, this physical location may point to somewhere completely virtual.
        /// In order to mount data from those file systems, a provider-specific prefix must be prefixed to the parameter (see provider documentation
        /// for the correct prefix). This prefix must always begin with <c>::\\</c>.
        /// </para>
        /// <para>
        /// The <paramref name="mountPath"/> parameter is optional, and if omitted, the contents of the physical file system object will be mounted into the root (<c>/</c>) of the virtual file system. If
        /// the <paramref name="mountPath"/> is supplied, then a virtual directory is created (or used if it already exists) to host the contents of the physical file system.
        /// </para>
        /// </remarks>
        /// <example>
        /// This example shows how to create a file system with the default provider, and mount a directory to the root:
        ///
        /// <![CDATA[
        /// IGorgonFileSystem fileSystem = new GorgonFileSystem();
        ///
        /// fileSystem.Mount(@"C:\MyDirectory\", "/");
        /// ]]>
        ///
        /// This example shows how to load a provider from the provider factory and use it with the file system:
        ///
        /// <![CDATA[
        /// // First we need to load the assembly with the provider plug in.
        /// using (GorgonPlugInAssemblyCache assemblies = new GorgonPlugInAssemblyCache())
        /// {
        ///		assemblies.Load(@"C:\PlugIns\GorgonFileSystem.Zip.dll");
        ///		GorgonPlugInService plugInService = new GorgonPlugInService(assemblies);
        ///
        ///		// We'll use the factory to get the zip plug in provider.
        ///		IGorgonFileSystemProviderFactory factory = new GorgonFileSystemProviderFactory(plugInService);
        ///
        ///		IGorgonFileSystemProvider zipProvider = factory.CreateProvider("Gorgon.IO.Zip.ZipProvider");
        ///
        ///		// Now create the file system with the zip provider.
        ///		IGorgonFileSystem fileSystem = new GorgonFileSystem(zipProvider);
        ///		fileSystem.Mount(@"C:\ZipFiles\MyFileSystem.zip", "/");
        /// }
        /// ]]>
        ///
        /// </example>
        GorgonFileSystemMountPoint Mount(string physicalPath, string mountPath = null);
        #endregion
    }
}


text:
Aria.classDefinition({
    $classpath : "test.aria.widgets.wai.multiselect.MultiSelectJawsTestCase",
    $extends : "aria.jsunit.JawsTestCase",
    $constructor : function () {
        this.$JawsTestCase.constructor.call(this);
        this.setTestEnv({
            template : "test.aria.widgets.wai.multiselect.MultiSelectTpl"
        });
    },
    $prototype : {
        // skips removeDuplicates in assertJawsHistoryEquals, as we call it ourselves from our filter function
        skipRemoveDuplicates: true,

        /**
         * This method is always the first entry point to a template test Start the test by focusing the first field
         */
        runTemplateTest : function () {
            var checkedRegExp = /not checked\nchecked/g;
            var notCheckedRegExp = /checked\nnot checked/g;
            var chechBoxStartingLineRegExp = /\ncheck box/g;

            this.execute([
                ["click", this.getElementById("tf")],
                ["pause", 2000],
                ["type", null, "[down][down]"],
                ["pause", 1000],
                ["type", null, "[<shift>][F10][>shift<]"],
                ["pause", 1000],
                ["type", null, "[space]"],
                ["pause", 500],
                ["type", null, "[down]"],
                ["pause", 500],
                ["type", null, "[space]"],
                ["pause", 500],
                ["type", null, "[down][down]"],
                ["pause", 500],
                ["type", null, "[space]"],
                ["pause", 500],
                ["type", null, "[down]"],
                ["pause", 500],
                ["type", null, "[space]"],
                ["pause", 500],
                ["type", null, "[escape]"],
                ["pause", 500],
                ["type", null, "[tab]"],
                ["pause", 500],
                ["type", null, "[space]"],
                ["pause", 1000]
            ], {
                fn: function () {
                    this.assertJawsHistoryEquals(
                        "Here is the default Multi-Select: Edit\nType in text.\nMy Multi-select:\nEdit\nAir Canada check box checked\nAir France check box not checked\nAir France check box checked\nAir New Zealand check box not checked\nBritish Airways check box not checked\nBritish Airways check box checked\nDelta Airlines check box not checked Unavailable\nMy Multi-select: Edit\nAir Canada,Air France,British Airways\nType in text.\nPress space to open the selection list\nAir Canada check box checked",
                    this.end,
                    function(response) {
                        return this.removeDuplicates(response.
                            replace(chechBoxStartingLineRegExp, " check box").
                            replace(checkedRegExp, "checked").
                            replace(notCheckedRegExp, "not checked")
                        );
                    });
                },
                scope: this
            });
        }
    }
});


text:
class WXDLLIMPEXP_BASE wxClassInfo;

// ----------------------------------------------------------------------------
// Enum Support
//
// In the header files XTI requires no change from pure c++ code, however in the
// implementation, an enum needs to be enumerated eg:
//
// wxBEGIN_ENUM( wxFlavor )
//   wxENUM_MEMBER( Vanilla )
//   wxENUM_MEMBER( Chocolate )
//   wxENUM_MEMBER( Strawberry )
// wxEND_ENUM( wxFlavor )
// ----------------------------------------------------------------------------

struct WXDLLIMPEXP_BASE wxEnumMemberData
{
    const wxChar*   m_name;
    int             m_value;
};

class WXDLLIMPEXP_BASE wxEnumData
{
public:
    wxEnumData( wxEnumMemberData* data );

    // returns true if the member has been found and sets the int value
    // pointed to accordingly (if ptr != null )
    // if not found returns false, value left unchanged
    bool HasEnumMemberValue( const wxChar *name, int *value = NULL ) const;

    // returns the value of the member, if not found in debug mode an
    // assert is issued, in release 0 is returned
    int GetEnumMemberValue(const wxChar *name ) const;

    // returns the name of the enum member having the passed in value
    // returns an emtpy string if not found
    const wxChar *GetEnumMemberName(int value) const;

    // returns the number of members in this enum
    int GetEnumCount() const { return m_count; }

    // returns the value of the nth member
    int GetEnumMemberValueByIndex( int n ) const;

    // returns the value of the nth member
    const wxChar *GetEnumMemberNameByIndex( int n ) const;

private:
    wxEnumMemberData *m_members;
    int m_count;
};

#define wxBEGIN_ENUM( e ) \
    wxEnumMemberData s_enumDataMembers##e[] = {

#define wxENUM_MEMBER( v ) { wxT(#v), v },

#define wxEND_ENUM( e )                                                 \
        { NULL, 0 } };                                                 \
    wxEnumData s_enumData##e( s_enumDataMembers##e );                   \
    wxEnumData *wxGetEnumData(e) { return &s_enumData##e; }             \
    template<> void wxStringReadValue(const wxString& s, e &data )     \
        { data = (e) s_enumData##e.GetEnumMemberValue(s.c_str()); }     \
    template<> void wxStringWriteValue(wxString &s, const e &data )    \
        { s = s_enumData##e.GetEnumMemberName((int)data); }             \
    void FromLong##e( long data, wxAny& result )                  \
        { result = wxAny((e)data); }                               \
    void ToLong##e( const wxAny& data, long &result )             \
        { result = (long) (data).As(static_cast<e*>(NULL)); }      \
                                                                        \
    wxTO_STRING_IMP( e )                                                \
    wxFROM_STRING_IMP( e )                                              \
    wxEnumTypeInfo s_typeInfo##e(wxT_ENUM, &s_enumData##e,            \
            &wxTO_STRING( e ), &wxFROM_STRING( e ), &ToLong##e,      \
            &FromLong##e, typeid(e).name() );

// ----------------------------------------------------------------------------
// Set Support
//
// in the header :
//
// enum wxFlavor
// {
//  Vanilla,
//  Chocolate,
//  Strawberry,
// };
//
// typedef wxBitset<wxFlavor> wxCoupe;
//
// in the implementation file :
//
// wxBEGIN_ENUM( wxFlavor )
//  wxENUM_MEMBER( Vanilla )
//  wxENUM_MEMBER( Chocolate )
//  wxENUM_MEMBER( Strawberry )
// wxEND_ENUM( wxFlavor )
//
// wxIMPLEMENT_SET_STREAMING( wxCoupe, wxFlavor )
//
// implementation note: no partial specialization for streaming, but a delegation
//                      to a different class
//
// ----------------------------------------------------------------------------

void WXDLLIMPEXP_BASE wxSetStringToArray( const wxString &s, wxArrayString &array );

template<typename e>
void wxSetFromString(const wxString &s, wxBitset<e> &data )
{
    wxEnumData* edata = wxGetEnumData((e) 0);
    data.reset();

    wxArrayString array;
    wxSetStringToArray( s, array );
    wxString flag;
    for ( int i = 0; i < array.Count(); ++i )
    {
        flag = array[i];
        int ivalue;
        if ( edata->HasEnumMemberValue( flag.c_str(), &ivalue ) )
        {
            data.set( (e) ivalue );
        }
    }
}

template<typename e>
void wxSetToString( wxString &s, const wxBitset<e> &data )
{
    wxEnumData* edata = wxGetEnumData((e) 0);
    int count = edata->GetEnumCount();
    int i;
    s.Clear();
    for ( i = 0; i < count; i++ )
    {
        e value = (e) edata->GetEnumMemberValueByIndex(i);
        if ( data.test( value ) )
        {
            // this could also be done by the templated calls
            if ( !s.empty() )
                s += wxT("|");
            s += edata->GetEnumMemberNameByIndex(i);
        }
    }
}

#define wxIMPLEMENT_SET_STREAMING(SetName,e)                                    \
    template<> void wxStringReadValue(const wxString &s, wxBitset<e> &data )   \
        { wxSetFromString( s, data ); }                                        \
    template<> void wxStringWriteValue( wxString &s, const wxBitset<e> &data ) \
        { wxSetToString( s, data ); }                                          \
    void FromLong##SetName( long data, wxAny& result )                    \
        { result = wxAny(SetName((unsigned long)data)); }                  \
    void ToLong##SetName( const wxAny& data, long &result )               \
        { result = (long) (data).As(static_cast<SetName*>(NULL)).to_ulong(); } \
    wxTO_STRING_IMP( SetName )                                                  \
    wxFROM_STRING_IMP( SetName )                                                \
    wxEnumTypeInfo s_typeInfo##SetName(wxT_SET, &s_enumData##e,               \
            &wxTO_STRING( SetName ), &wxFROM_STRING( SetName ),               \
            &ToLong##SetName, &FromLong##SetName, typeid(SetName).name() );

template<typename e>
void wxFlagsFromString(const wxString &s, e &data )
{
    wxEnumData* edata = wxGetEnumData((e*) 0);
    data.m_data = 0;

    wxArrayString array;
    wxSetStringToArray( s, array );
    wxString flag;
    for ( size_t i = 0; i < array.Count(); ++i )
    {
        flag = array[i];
        int ivalue;
        if ( edata->HasEnumMemberValue( flag.c_str(), &ivalue ) )
        {
            data.m_data |= ivalue;
        }
    }
}

template<typename e>
void wxFlagsToString( wxString &s, const e& data )
{
    wxEnumData* edata = wxGetEnumData((e*) 0);
    int count = edata->GetEnumCount();
    int i;
    s.Clear();
    long dataValue = data.m_data;
    for ( i = 0; i < count; i++ )
    {
        int value = edata->GetEnumMemberValueByIndex(i);
        // make this to allow for multi-bit constants to work
        if ( value && ( dataValue & value ) == value )
        {
            // clear the flags we just set
            dataValue &= ~value;
            // this could also be done by the templated calls
            if ( !s.empty() )
                s +=wxT("|");
            s += edata->GetEnumMemberNameByIndex(i);
        }
    }
}

#define wxBEGIN_FLAGS( e ) \
    wxEnumMemberData s_enumDataMembers##e[] = {

#define wxFLAGS_MEMBER( v ) { wxT(#v), static_cast<int>(v) },

#define wxEND_FLAGS( e )                                                \
        { NULL, 0 } };                                                 \
    wxEnumData s_enumData##e( s_enumDataMembers##e );                   \
    wxEnumData *wxGetEnumData(e*) { return &s_enumData##e; }            \
    template<>  void wxStringReadValue(const wxString &s, e &data )    \
        { wxFlagsFromString<e>( s, data ); }                           \
    template<>  void wxStringWriteValue( wxString &s, const e& data )  \
        { wxFlagsToString<e>( s, data ); }                             \
    void FromLong##e( long data, wxAny& result )                  \
        { result = wxAny(e(data)); }                               \
    void ToLong##e( const wxAny& data, long &result )             \
        { result = (long) (data).As(static_cast<e*>(NULL)).m_data; } \
    wxTO_STRING_IMP( e )                                                \
    wxFROM_STRING_IMP( e )                                              \
    wxEnumTypeInfo s_typeInfo##e(wxT_SET, &s_enumData##e,             \
            &wxTO_STRING( e ), &wxFROM_STRING( e ), &ToLong##e,      \
            &FromLong##e, typeid(e).name() );

// ----------------------------------------------------------------------------
// Type Information
// ----------------------------------------------------------------------------

//  All data exposed by the RTTI is characterized using the following classes.
//  The first characterization is done by wxTypeKind. All enums up to and including
//  wxT_CUSTOM represent so called simple types. These cannot be divided any further.
//  They can be converted to and from wxStrings, that's all.
//  Other wxTypeKinds can instead be splitted recursively into smaller parts until
//  the simple types are reached.

enum wxTypeKind
{
    wxT_VOID = 0,   // unknown type
    wxT_BOOL,
    wxT_CHAR,
    wxT_UCHAR,
    wxT_INT,
    wxT_UINT,
    wxT_LONG,
    wxT_ULONG,
    wxT_LONGLONG,
    wxT_ULONGLONG,
    wxT_FLOAT,
    wxT_DOUBLE,
    wxT_STRING,     // must be wxString
    wxT_SET,        // must be wxBitset<> template
    wxT_ENUM,
    wxT_CUSTOM,     // user defined type (e.g. wxPoint)

    wxT_LAST_SIMPLE_TYPE_KIND = wxT_CUSTOM,

    wxT_OBJECT_PTR, // object reference
    wxT_OBJECT,     // embedded object
    wxT_COLLECTION, // collection

    wxT_DELEGATE,   // for connecting against an event source

    wxT_LAST_TYPE_KIND = wxT_DELEGATE // sentinel for bad data, asserts, debugging
};

class WXDLLIMPEXP_BASE wxAny;
class WXDLLIMPEXP_BASE wxTypeInfo;

WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxTypeInfo*, wxTypeInfoMap, class WXDLLIMPEXP_BASE );

class WXDLLIMPEXP_BASE wxTypeInfo
{
public:
    typedef void (*wxVariant2StringFnc)( const wxAny& data, wxString &result );
    typedef void (*wxString2VariantFnc)( const wxString& data, wxAny &result );

    wxTypeInfo(wxTypeKind kind,
               wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL,
               const wxString &name = wxEmptyString):
            m_toString(to), m_fromString(from), m_kind(kind), m_name(name)
    {
        Register();
    }
#if 0 // wxUSE_UNICODE
    wxTypeInfo(wxTypeKind kind,
               wxVariant2StringFnc to, wxString2VariantFnc from,
               const char *name):
            m_toString(to), m_fromString(from), m_kind(kind),
            m_name(wxString::FromAscii(name))
    {
        Register();
    }
#endif

    virtual ~wxTypeInfo()
    {
        Unregister();
    }

    // return the kind of this type (wxT_... constants)
    wxTypeKind GetKind() const { return m_kind; }

    // returns the unique name of this type
    const wxString& GetTypeName() const { return m_name; }

    // is this type a delegate type
    bool IsDelegateType() const { return m_kind == wxT_DELEGATE; }

    // is this type a custom type
    bool IsCustomType() const { return m_kind == wxT_CUSTOM; }

    // is this type an object type
    bool IsObjectType() const { return m_kind == wxT_OBJECT || m_kind == wxT_OBJECT_PTR; }

    // can the content of this type be converted to and from strings ?
    bool HasStringConverters() const { return m_toString != NULL && m_fromString != NULL; }

    // convert a wxAny holding data of this type into a string
    void ConvertToString( const wxAny& data, wxString &result ) const
    {
        if ( m_toString )
            (*m_toString)( data, result );
        else
            wxLogError( wxGetTranslation(wxT("String conversions not supported")) );
    }

    // convert a string into a wxAny holding the corresponding data in this type
    void ConvertFromString( const wxString& data, wxAny &result ) const
    {
        if( m_fromString )
            (*m_fromString)( data, result );
        else
            wxLogError( wxGetTranslation(wxT("String conversions not supported")) );
    }

    // statics:

    // looks for the corresponding type, will return NULL if not found
    static wxTypeInfo *FindType( const wxString& typeName );
private:
    void Register();
    void Unregister();

    wxVariant2StringFnc m_toString;
    wxString2VariantFnc m_fromString;

    wxTypeKind m_kind;
    wxString m_name;

    // the static list of all types we know about
    static wxTypeInfoMap* ms_typeTable;
};

class WXDLLIMPEXP_BASE wxBuiltInTypeInfo : public wxTypeInfo
{
public:
    wxBuiltInTypeInfo( wxTypeKind kind, wxVariant2StringFnc to = NULL,
                       wxString2VariantFnc from = NULL,
                       const wxString &name = wxEmptyString ) :
            wxTypeInfo( kind, to, from, name )
       { wxASSERT_MSG( GetKind() < wxT_SET, wxT("Illegal Kind for Base Type") ); }
};

class WXDLLIMPEXP_BASE wxCustomTypeInfo : public wxTypeInfo
{
public:
    wxCustomTypeInfo( const wxString &name, wxVariant2StringFnc to,
                      wxString2VariantFnc from ) :
            wxTypeInfo( wxT_CUSTOM, to, from, name )
       {}
};

class WXDLLIMPEXP_BASE wxEnumTypeInfo : public wxTypeInfo
{
public:
    typedef void (*converterToLong_t)( const wxAny& data, long &result );
    typedef void (*converterFromLong_t)( long data, wxAny &result );

    wxEnumTypeInfo( wxTypeKind kind, wxEnumData* enumInfo, wxVariant2StringFnc to,
                    wxString2VariantFnc from, converterToLong_t toLong,
                    converterFromLong_t fromLong, const wxString &name  ) :
        wxTypeInfo( kind, to, from, name ), m_toLong( toLong ), m_fromLong( fromLong )
    {
        wxASSERT_MSG( kind == wxT_ENUM || kind == wxT_SET,
                      wxT("Illegal Kind for Enum Type"));
        m_enumInfo = enumInfo;
    }

    const wxEnumData* GetEnumData() const { return m_enumInfo; }

    // convert a wxAny holding data of this type into a long
    void ConvertToLong( const wxAny& data, long &result ) const
    {
        if( m_toLong )
            (*m_toLong)( data, result );
        else
            wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) );
    }

    // convert a long into a wxAny holding the corresponding data in this type
    void ConvertFromLong( long data, wxAny &result ) const
    {
        if( m_fromLong )
            (*m_fromLong)( data, result );
        else
            wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) );
    }

private:
    converterToLong_t m_toLong;
    converterFromLong_t m_fromLong;

    wxEnumData *m_enumInfo; // Kind == wxT_ENUM or Kind == wxT_SET
};

class WXDLLIMPEXP_BASE wxClassTypeInfo : public wxTypeInfo
{
public:
    wxClassTypeInfo( wxTypeKind kind, wxClassInfo* classInfo,
                     wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL,
                     const wxString &name = wxEmptyString);

    const wxClassInfo *GetClassInfo() const { return m_classInfo; }

private:
    wxClassInfo *m_classInfo; // Kind == wxT_OBJECT - could be NULL
};

class WXDLLIMPEXP_BASE wxCollectionTypeInfo : public wxTypeInfo
{
public:
    wxCollectionTypeInfo( const wxString &elementName, wxVariant2StringFnc to,
                          wxString2VariantFnc from , const wxString &name) :
            wxTypeInfo( wxT_COLLECTION, to, from, name )
       { m_elementTypeName = elementName; m_elementType = NULL; }

    const wxTypeInfo* GetElementType() const
    {
        if ( m_elementType == NULL )
            m_elementType = wxTypeInfo::FindType( m_elementTypeName );
        return m_elementType;
    }

private:
    mutable wxTypeInfo * m_elementType;
    wxString    m_elementTypeName;
};

class WXDLLIMPEXP_BASE wxEventSourceTypeInfo : public wxTypeInfo
{
public:
    wxEventSourceTypeInfo( int eventType, wxClassInfo* eventClass,
                        wxVariant2StringFnc to = NULL,
                        wxString2VariantFnc from = NULL );
    wxEventSourceTypeInfo( int eventType, int lastEventType, wxClassInfo* eventClass,
                        wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL );

    int GetEventType() const { return m_eventType; }
    int GetLastEventType() const { return m_lastEventType; }
    const wxClassInfo* GetEventClass() const { return m_eventClass; }

private:
    const wxClassInfo *m_eventClass; // (extended will merge into classinfo)
    int m_eventType;
    int m_lastEventType;
};

template<typename T> const wxTypeInfo* wxGetTypeInfo( T * )
    { return wxTypeInfo::FindType(typeid(T).name()); }

// this macro is for usage with custom, non-object derived classes and structs,
// wxPoint is such a custom type

#if wxUSE_FUNC_TEMPLATE_POINTER
    #define wxCUSTOM_TYPE_INFO( e, toString, fromString ) \
        wxCustomTypeInfo s_typeInfo##e(typeid(e).name(), &toString, &fromString);
#else
    #define wxCUSTOM_TYPE_INFO( e, toString, fromString )             \
        void ToString##e( const wxAny& data, wxString &result )   \
            { toString(data, result); }                                 \
        void FromString##e( const wxString& data, wxAny &result ) \
            { fromString(data, result); }                               \
        wxCustomTypeInfo s_typeInfo##e(typeid(e).name(),               \
                                       &ToString##e, &FromString##e);
#endif

#define wxCOLLECTION_TYPE_INFO( element, collection )                      \
    wxCollectionTypeInfo s_typeInfo##collection( typeid(element).name(),   \
                                NULL, NULL, typeid(collection).name() );

// sometimes a compiler invents specializations that are nowhere called,
// use this macro to satisfy the refs, currently we don't have to play
// tricks, but if we will have to according to the compiler, we will use
// that macro for that

#define wxILLEGAL_TYPE_SPECIALIZATION( a )

#endif      // wxUSE_EXTENDED_RTTI
#endif      // _XTITYPES_H_


text:
/**
 * @file connectedComponents.cpp
 * @brief mex interface for cv::connectedComponents
 * @ingroup imgproc
 * @author Amro
 * @date 2015
 */
#include "mexopencv.hpp"
using namespace std;
using namespace cv;

/**
 * Main entry called from Matlab
 * @param nlhs number of left-hand-side arguments
 * @param plhs pointers to mxArrays in the left-hand-side
 * @param nrhs number of right-hand-side arguments
 * @param prhs pointers to mxArrays in the right-hand-side
 */
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
    // Check the number of arguments
    nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=4);

    // Argument vector
    vector<MxArray> rhs(prhs, prhs+nrhs);

    // Option processing
    int connectivity = 8;
    int ltype = CV_32S;
    for (int i=1; i<nrhs; i+=2) {
        string key(rhs[i].toString());
        if (key == "Connectivity")
            connectivity = rhs[i+1].toInt();
        else if (key == "LType")
            ltype = ClassNameMap[rhs[i+1].toString()];
        else
            mexErrMsgIdAndTxt("mexopencv:error",
                "Unrecognized option %s", key.c_str());
    }

    // Process
    Mat img(rhs[0].toMat(CV_8U)), labels;
    int N = 0;
    if (nlhs > 2) {
        Mat stats, centroids;
        N = connectedComponentsWithStats(img, labels, stats, centroids,
            connectivity, ltype);
        plhs[2] = MxArray(stats);
        if (nlhs > 3)
            plhs[3] = MxArray(centroids);
    }
    else
        N = connectedComponents(img, labels, connectivity, ltype);
    plhs[0] = MxArray(labels);
    if (nlhs > 1)
        plhs[1] = MxArray(N);
}


text:
package com.intellij.openapi.externalSystem.service.project.manage;

import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.externalSystem.model.DataNode;
import com.intellij.openapi.externalSystem.model.Key;
import com.intellij.openapi.externalSystem.model.project.ProjectData;
import com.intellij.openapi.externalSystem.service.project.IdeModelsProvider;
import com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProvider;
import com.intellij.openapi.externalSystem.util.Order;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Computable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;

/**
 * Defines common contract for a strategy which is able to manage project data defines in terms of 'external systems' sub-system.
 *

 * Implementations of this interface are expected to be thread-safe.
 *

 * Note: there is a possible case that more than one service is registered for the same key, e.g. there is a built-in
 * generic service and a plugin provides custom extension to it. Platform calls all of them then. That means that project data
 * service implementation must be ready to the following:
 *

 *

 *
target data is already imported by another service (just no-op then);

 *

 *     provide a hint about the order in which the services for the same key should be processed. That is done by marking
 *     it by {@link Order} annotation where the smaller value corresponds to earlier execution;
 *

 *

 *

 *
 *
 * @author Denis Zhdanov
 * @param <E>  target external project data type
 * @param   target ide project data type
 */
public interface ProjectDataService<E, I> {

  ExtensionPointName<ProjectDataService<?, ?>> EP_NAME = ExtensionPointName.create("com.intellij.externalProjectDataService");

  /**
   * @return key of project data supported by the current manager
   */
  @NotNull
  Key<E> getTargetDataKey();

  /**
   * It's assumed that given data nodes present at the ide when this method returns. I.e. the method should behave as below for
   * every of the given data nodes:
   *

   *

   *
there is an existing project entity for the given data node and it has the same state. Do nothing for it then;

   *

   *     there is an existing project entity for the given data node but it has different state (e.g. a module dependency
   *     is configured as 'exported' at the ide but not at external system). Reset the state to the external system's one then;
   *

   *
 there is no corresponding project entity at the ide side. Create it then;

   *

   *

   * are created, updated or left as-is if they have the
   *
   * @param toImport
   * @param project
   */
  void importData(@NotNull Collection<DataNode<E>> toImport,
                  @Nullable ProjectData projectData,
                  @NotNull Project project,
                  @NotNull IdeModifiableModelsProvider modelsProvider);

  /**
   * Compute orphan data.
   */
  @NotNull
  Computable<Collection> computeOrphanData(@NotNull Collection<DataNode<E>> toImport,
                                              @NotNull ProjectData projectData,
                                              @NotNull Project project,
                                              @NotNull IdeModifiableModelsProvider modelsProvider);

  /**
   * Asks to remove all given ide project entities.
   *

   * Note: as more than one {@link ProjectDataService} might be configured for a target entity type, there is a possible case
   * that the entities have already been removed when this method is called. Then it's necessary to cleanup auxiliary data (if any)
   * or just return otherwise.
   *
   * @param toRemove     project entities to remove
   * @param project      target project
   */
  void removeData(@NotNull Computable<Collection> toRemove,
                  @NotNull Collection<DataNode<E>> toIgnore,
                  @NotNull ProjectData projectData,
                  @NotNull Project project,
                  @NotNull IdeModifiableModelsProvider modelsProvider);

  default void postProcess(@NotNull Collection<DataNode<E>> toImport,
                           @Nullable ProjectData projectData,
                           @NotNull Project project,
                           @NotNull IdeModifiableModelsProvider modelsProvider) {
  }

  default void onSuccessImport(@NotNull Collection<DataNode<E>> imported,
                               @Nullable ProjectData projectData,
                               @NotNull Project project,
                               @NotNull IdeModelsProvider modelsProvider) {
  }

  default void onFailureImport(Project project) {
  }
}


text:
'use strict';

const utils = require('./utils.js');

const handled = new Set();

const parseWordBreak = function(version) {
	const source = utils.readDataFile(version, 'word-break');
	if (!source) {
		return;
	}
	const map = {};
	const lines = source.split('\n');
	lines.forEach(function(line) {
		if (!line || /^#/.test(line)) {
			return;
		}
		const data = line.trim().split(';');
		const charRange = data[0].replace('..', '-').trim();
		const rangeParts = charRange.split('-');
		const value = data[1].split('#')[0].trim();
		const canonicalName = value;
		if (rangeParts.length == 2) {
			utils.range(
				parseInt(rangeParts[0], 16),
				parseInt(rangeParts[1], 16)
			).forEach((codePoint) => {
				utils.append(map, canonicalName, codePoint);
				handled.add(codePoint);
			});
		} else {
			const codePoint = parseInt(charRange, 16);
			utils.append(map, canonicalName, codePoint);
			handled.add(codePoint);
		}
	});
	// All code points not explicitly listed have the value `Other` (`XX`).
	for (let codePoint = 0x000000; codePoint <= 0x10FFFF; codePoint++) {
		if (!handled.has(codePoint)) {
			utils.append(map, 'Other', codePoint);
		}
	}
	return map;
};

module.exports = parseWordBreak;