text:
#pragma warning disable 618  // deprecated SpringConfigUrl
namespace Apache.Ignite.Core
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.IO;
    using System.Linq;
    using System.Reflection;
    using System.Runtime;
    using System.Threading;
    using Apache.Ignite.Core.Binary;
    using Apache.Ignite.Core.Common;
    using Apache.Ignite.Core.Impl;
    using Apache.Ignite.Core.Impl.Binary;
    using Apache.Ignite.Core.Impl.Binary.IO;
    using Apache.Ignite.Core.Impl.Common;
    using Apache.Ignite.Core.Impl.Handle;
    using Apache.Ignite.Core.Impl.Memory;
    using Apache.Ignite.Core.Impl.Unmanaged;
    using Apache.Ignite.Core.Lifecycle;
    using BinaryReader = Apache.Ignite.Core.Impl.Binary.BinaryReader;
    using UU = Apache.Ignite.Core.Impl.Unmanaged.UnmanagedUtils;

    ///
    /// This class defines a factory for the main Ignite API.
    ///

    /// Use <see cref="Start()"/> method to start Ignite with default configuration.
    /// <para/>
    /// All members are thread-safe and may be used concurrently from multiple threads.
    ///
    public static class Ignition
    {
        /** */
        internal const string EnvIgniteSpringConfigUrlPrefix = "IGNITE_SPRING_CONFIG_URL_PREFIX";

        /** */
        private static readonly object SyncRoot = new object();

        /** GC warning flag. */
        private static int _gcWarn;

        /** */
        private static readonly IDictionary<NodeKey, Ignite> Nodes = new Dictionary<NodeKey, Ignite>();

        /** Current DLL name. */
        private static readonly string IgniteDllName = Path.GetFileName(Assembly.GetExecutingAssembly().Location);

        /** Startup info. */
        [ThreadStatic]
        private static Startup _startup;

        /** Client mode flag. */
        [ThreadStatic]
        private static bool _clientMode;

        ///
        /// Static initializer.
        ///
        [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
        static Ignition()
        {
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
        }

        ///
        /// Gets or sets a value indicating whether Ignite should be started in client mode.
        /// Client nodes cannot hold data in caches.
        ///
        public static bool ClientMode
        {
            get { return _clientMode; }
            set { _clientMode = value; }
        }

        ///
        /// Starts Ignite with default configuration. By default this method will
        /// use Ignite configuration defined in <c>{IGNITE_HOME}/config/default-config.xml</c>
        /// configuration file. If such file is not found, then all system defaults will be used.
        ///
        /// <returns>Started Ignite.</returns>
        public static IIgnite Start()
        {
            return Start(new IgniteConfiguration());
        }

        ///
        /// Starts all grids specified within given Spring XML configuration file. If Ignite with given name
        /// is already started, then exception is thrown. In this case all instances that may
        /// have been started so far will be stopped too.
        ///
        /// <param name="springCfgPath">Spring XML configuration file path or URL. Note, that the path can be
        /// absolute or relative to IGNITE_HOME.</param>
        /// <returns>Started Ignite. If Spring configuration contains multiple Ignite instances, then the 1st
        /// found instance is returned.</returns>
        public static IIgnite Start(string springCfgPath)
        {
            return Start(new IgniteConfiguration {SpringConfigUrl = springCfgPath});
        }

        ///
        /// Starts Ignite with given configuration.
        ///
        /// <returns>Started Ignite.</returns>
        public unsafe static IIgnite Start(IgniteConfiguration cfg)
        {
            IgniteArgumentCheck.NotNull(cfg, "cfg");

            lock (SyncRoot)
            {
                // 1. Check GC settings.
                CheckServerGc(cfg);

                // 2. Create context.
                IgniteUtils.LoadDlls(cfg.JvmDllPath);

                var cbs = new UnmanagedCallbacks();

                IgniteManager.CreateJvmContext(cfg, cbs);

                var gridName = cfg.GridName;

                var cfgPath = cfg.SpringConfigUrl == null
                    ? null
                    : Environment.GetEnvironmentVariable(EnvIgniteSpringConfigUrlPrefix) + cfg.SpringConfigUrl;

                // 3. Create startup object which will guide us through the rest of the process.
                _startup = new Startup(cfg, cbs);

                IUnmanagedTarget interopProc = null;

                try
                {
                    // 4. Initiate Ignite start.
                    UU.IgnitionStart(cbs.Context, cfgPath, gridName, ClientMode);

                    // 5. At this point start routine is finished. We expect STARTUP object to have all necessary data.
                    var node = _startup.Ignite;
                    interopProc = node.InteropProcessor;

                    // 6. On-start callback (notify lifecycle components).
                    node.OnStart();

                    Nodes[new NodeKey(_startup.Name)] = node;

                    return node;
                }
                catch (Exception)
                {
                    // 1. Perform keys cleanup.
                    string name = _startup.Name;

                    if (name != null)
                    {
                        NodeKey key = new NodeKey(name);

                        if (Nodes.ContainsKey(key))
                            Nodes.Remove(key);
                    }

                    // 2. Stop Ignite node if it was started.
                    if (interopProc != null)
                        UU.IgnitionStop(interopProc.Context, gridName, true);

                    // 3. Throw error further (use startup error if exists because it is more precise).
                    if (_startup.Error != null)
                        throw _startup.Error;

                    throw;
                }
                finally
                {
                    _startup = null;

                    if (interopProc != null)
                        UU.ProcessorReleaseStart(interopProc);
                }
            }
        }

        ///
        /// Check whether GC is set to server mode.
        ///
        /// <param name="cfg">Configuration.</param>
        private static void CheckServerGc(IgniteConfiguration cfg)
        {
            if (!cfg.SuppressWarnings && !GCSettings.IsServerGC && Interlocked.CompareExchange(ref _gcWarn, 1, 0) == 0)
                Console.WriteLine("GC server mode is not enabled, this could lead to less " +
                    "than optimal performance on multi-core machines (to enable see " +
                    "http://msdn.microsoft.com/en-us/library/ms229357(v=vs.110).aspx).");
        }

        ///
        /// Prepare callback invoked from Java.
        ///
        /// <param name="inStream">Intput stream with data.</param>
        /// <param name="outStream">Output stream.</param>
        /// <param name="handleRegistry">Handle registry.</param>
        internal static void OnPrepare(PlatformMemoryStream inStream, PlatformMemoryStream outStream,
            HandleRegistry handleRegistry)
        {
            try
            {
                BinaryReader reader = BinaryUtils.Marshaller.StartUnmarshal(inStream);

                PrepareConfiguration(reader, outStream);

                PrepareLifecycleBeans(reader, outStream, handleRegistry);
            }
            catch (Exception e)
            {
                _startup.Error = e;

                throw;
            }
        }

        ///
        /// Preapare configuration.
        ///
        /// <param name="reader">Reader.</param>
        /// <param name="outStream">Response stream.</param>
        private static void PrepareConfiguration(BinaryReader reader, PlatformMemoryStream outStream)
        {
            // 1. Load assemblies.
            IgniteConfiguration cfg = _startup.Configuration;

            LoadAssemblies(cfg.Assemblies);

            ICollection<string> cfgAssembllies;
            BinaryConfiguration binaryCfg;

            BinaryUtils.ReadConfiguration(reader, out cfgAssembllies, out binaryCfg);

            LoadAssemblies(cfgAssembllies);

            // 2. Create marshaller only after assemblies are loaded.
            if (cfg.BinaryConfiguration == null)
                cfg.BinaryConfiguration = binaryCfg;

            _startup.Marshaller = new Marshaller(cfg.BinaryConfiguration);

            // 3. Send configuration details to Java
            cfg.Write(_startup.Marshaller.StartMarshal(outStream));
        }

        ///
        /// Prepare lifecycle beans.
        ///
        /// <param name="reader">Reader.</param>
        /// <param name="outStream">Output stream.</param>
        /// <param name="handleRegistry">Handle registry.</param>
        private static void PrepareLifecycleBeans(BinaryReader reader, PlatformMemoryStream outStream,
            HandleRegistry handleRegistry)
        {
            IList<LifecycleBeanHolder> beans = new List<LifecycleBeanHolder>();

            // 1. Read beans defined in Java.
            int cnt = reader.ReadInt();

            for (int i = 0; i < cnt; i++)
                beans.Add(new LifecycleBeanHolder(CreateLifecycleBean(reader)));

            // 2. Append beans definied in local configuration.
            ICollection<ILifecycleBean> nativeBeans = _startup.Configuration.LifecycleBeans;

            if (nativeBeans != null)
            {
                foreach (ILifecycleBean nativeBean in nativeBeans)
                    beans.Add(new LifecycleBeanHolder(nativeBean));
            }

            // 3. Write bean pointers to Java stream.
            outStream.WriteInt(beans.Count);

            foreach (LifecycleBeanHolder bean in beans)
                outStream.WriteLong(handleRegistry.AllocateCritical(bean));

            outStream.SynchronizeOutput();

            // 4. Set beans to STARTUP object.
            _startup.LifecycleBeans = beans;
        }

        ///
        /// Create lifecycle bean.
        ///
        /// <param name="reader">Reader.</param>
        /// <returns>Lifecycle bean.</returns>
        private static ILifecycleBean CreateLifecycleBean(BinaryReader reader)
        {
            // 1. Instantiate.
            var bean = IgniteUtils.CreateInstance<ILifecycleBean>(reader.ReadString());

            // 2. Set properties.
            var props = reader.ReadDictionaryAsGeneric<string, object>();

            IgniteUtils.SetProperties(bean, props);

            return bean;
        }

        ///
        /// Kernal start callback.
        ///
        /// <param name="interopProc">Interop processor.</param>
        /// <param name="stream">Stream.</param>
        internal static void OnStart(IUnmanagedTarget interopProc, IBinaryStream stream)
        {
            try
            {
                // 1. Read data and leave critical state ASAP.
                BinaryReader reader = BinaryUtils.Marshaller.StartUnmarshal(stream);

                // ReSharper disable once PossibleInvalidOperationException
                var name = reader.ReadString();

                // 2. Set ID and name so that Start() method can use them later.
                _startup.Name = name;

                if (Nodes.ContainsKey(new NodeKey(name)))
                    throw new IgniteException("Ignite with the same name already started: " + name);

                _startup.Ignite = new Ignite(_startup.Configuration, _startup.Name, interopProc, _startup.Marshaller,
                    _startup.LifecycleBeans, _startup.Callbacks);
            }
            catch (Exception e)
            {
                // 5. Preserve exception to throw it later in the "Start" method and throw it further
                //    to abort startup in Java.
                _startup.Error = e;

                throw;
            }
        }

        ///
        /// Load assemblies.
        ///
        /// <param name="assemblies">Assemblies.</param>
        private static void LoadAssemblies(IEnumerable<string> assemblies)
        {
            if (assemblies != null)
            {
                foreach (string s in assemblies)
                {
                    // 1. Try loading as directory.
                    if (Directory.Exists(s))
                    {
                        string[] files = Directory.GetFiles(s, "*.dll");

#pragma warning disable 0168

                        foreach (string dllPath in files)
                        {
                            if (!SelfAssembly(dllPath))
                            {
                                try
                                {
                                    Assembly.LoadFile(dllPath);
                                }

                                catch (BadImageFormatException)
                                {
                                    // No-op.
                                }
                            }
                        }

#pragma warning restore 0168

                        continue;
                    }

                    // 2. Try loading using full-name.
                    try
                    {
                        Assembly assembly = Assembly.Load(s);

                        if (assembly != null)
                            continue;
                    }
                    catch (Exception e)
                    {
                        if (!(e is FileNotFoundException || e is FileLoadException))
                            throw new IgniteException("Failed to load assembly: " + s, e);
                    }

                    // 3. Try loading using file path.
                    try
                    {
                        Assembly assembly = Assembly.LoadFrom(s);

                        if (assembly != null)
                            continue;
                    }
                    catch (Exception e)
                    {
                        if (!(e is FileNotFoundException || e is FileLoadException))
                            throw new IgniteException("Failed to load assembly: " + s, e);
                    }

                    // 4. Not found, exception.
                    throw new IgniteException("Failed to load assembly: " + s);
                }
            }
        }

        ///
        /// Whether assembly points to Ignite binary.
        ///
        /// <param name="assembly">Assembly to check..</param>
        /// <returns><c>True</c> if this is one of GG assemblies.</returns>
        private static bool SelfAssembly(string assembly)
        {
            return assembly.EndsWith(IgniteDllName, StringComparison.OrdinalIgnoreCase);
        }

        ///
        /// Gets a named Ignite instance. If Ignite name is {@code null} or empty string,
        /// then default no-name Ignite will be returned. Note that caller of this method
        /// should not assume that it will return the same instance every time.
        ///

        /// Note that single process can run multiple Ignite instances and every Ignite instance (and its
        /// node) can belong to a different grid. Ignite name defines what grid a particular Ignite
        /// instance (and correspondingly its node) belongs to.
        ///
        /// <param name="name">Ignite name to which requested Ignite instance belongs. If <c>null</c>,
        /// then Ignite instance belonging to a default no-name Ignite will be returned.
        /// </param>
        /// <returns>An instance of named grid.</returns>
        public static IIgnite GetIgnite(string name)
        {
            lock (SyncRoot)
            {
                Ignite result;

                if (!Nodes.TryGetValue(new NodeKey(name), out result))
                    throw new IgniteException("Ignite instance was not properly started or was already stopped: " + name);

                return result;
            }
        }

        ///
        /// Gets an instance of default no-name grid. Note that
        /// caller of this method should not assume that it will return the same
        /// instance every time.
        ///
        /// <returns>An instance of default no-name grid.</returns>
        public static IIgnite GetIgnite()
        {
            return GetIgnite(null);
        }

        ///
        /// Stops named grid. If <c>cancel</c> flag is set to <c>true</c> then
        /// all jobs currently executing on local node will be interrupted. If
        /// grid name is <c>null</c>, then default no-name Ignite will be stopped.
        ///
        /// <param name="name">Grid name. If <c>null</c>, then default no-name Ignite will be stopped.</param>
        /// <param name="cancel">If <c>true</c> then all jobs currently executing will be cancelled
        /// by calling <c>ComputeJob.cancel</c>method.</param>
        /// <returns><c>true</c> if named Ignite instance was indeed found and stopped, <c>false</c>
        /// othwerwise (the instance with given <c>name</c> was not found).</returns>
        public static bool Stop(string name, bool cancel)
        {
            lock (SyncRoot)
            {
                NodeKey key = new NodeKey(name);

                Ignite node;

                if (!Nodes.TryGetValue(key, out node))
                    return false;

                node.Stop(cancel);

                Nodes.Remove(key);

                GC.Collect();

                return true;
            }
        }

        ///
        /// Stops all started grids. If <c>cancel</c> flag is set to <c>true</c> then
        /// all jobs currently executing on local node will be interrupted.
        ///
        /// <param name="cancel">If <c>true</c> then all jobs currently executing will be cancelled
        /// by calling <c>ComputeJob.Cancel()</c> method.</param>
        public static void StopAll(bool cancel)
        {
            lock (SyncRoot)
            {
                while (Nodes.Count > 0)
                {
                    var entry = Nodes.First();

                    entry.Value.Stop(cancel);

                    Nodes.Remove(entry.Key);
                }
            }

            GC.Collect();
        }

        ///
        /// Handles the AssemblyResolve event of the CurrentDomain control.
        ///
        /// <param name="sender">The source of the event.</param>
        /// <param name="args">The <see cref="ResolveEventArgs"/> instance containing the event data.</param>
        /// <returns>Manually resolved assembly, or null.</returns>
        private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
        {
            return LoadedAssembliesResolver.Instance.GetAssembly(args.Name);
        }

        ///
        /// Grid key.
        ///
        private class NodeKey
        {
            /** */
            private readonly string _name;

            ///
            /// Initializes a new instance of the <see cref="NodeKey"/> class.
            ///
            /// <param name="name">The name.</param>
            internal NodeKey(string name)
            {
                _name = name;
            }

            /** <inheritdoc /> */
            public override bool Equals(object obj)
            {
                var other = obj as NodeKey;

                return other != null && Equals(_name, other._name);
            }

            /** <inheritdoc /> */
            public override int GetHashCode()
            {
                return _name == null ? 0 : _name.GetHashCode();
            }
        }

        ///
        /// Value object to pass data between .Net methods during startup bypassing Java.
        ///
        private class Startup
        {
            ///
            /// Constructor.
            ///
            /// <param name="cfg">Configuration.</param>
            /// <param name="cbs"></param>
            internal Startup(IgniteConfiguration cfg, UnmanagedCallbacks cbs)
            {
                Configuration = cfg;
                Callbacks = cbs;
            }
            ///
            /// Configuration.
            ///
            internal IgniteConfiguration Configuration { get; private set; }

            ///
            /// Gets unmanaged callbacks.
            ///
            internal UnmanagedCallbacks Callbacks { get; private set; }

            ///
            /// Lifecycle beans.
            ///
            internal IList<LifecycleBeanHolder> LifecycleBeans { get; set; }

            ///
            /// Node name.
            ///
            internal string Name { get; set; }

            ///
            /// Marshaller.
            ///
            internal Marshaller Marshaller { get; set; }

            ///
            /// Start error.
            ///
            internal Exception Error { get; set; }

            ///
            /// Gets or sets the ignite.
            ///
            internal Ignite Ignite { get; set; }
        }
    }
}


text:
<?php

// autoload_files.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'e1edc6b39e340029dfa1d72c228b8497' => $vendorDir . '/xiaoler/blade/src/helpers.php',
);

redpajama_set_name: RedPajamaGithub


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

Dogma (1999)

reviewed by
Indra Moeljadi

Dogma (1999)

review

Ater I came out of the cinema to watch Dogma, my reaction was "Kevin Smith
is a genius!". Not for directing this movie and starring in it, but for
writing it. In Dogma, Smith questions the whole concept of faith and
religion, by diving deeply into one religion and coming up with the big
reality of what religion should be, in a unusual and comic way.

Bartleby (Ben Affleck) and Loki (Matt Damon) are two angels wanting to get
back to heaven after being sent away by God years ago. They found a heavenly
loophole in New Jersey where they could go back, but at the same time by
doing that, they will destroy all existence. Bethany (Linda Fiorentino) is
then send by The Voice of God (Alan Rickman) to stop these two buddies from
entering the loophle. She is accompanied by two stoner-prophets, Silent Bob
(Kevin Smith), who only spoke 5 words during the entire movie, and Jay
(Jason Mewes), who spoke 500.000 words, 499.995 being "fuck". They are also
accompanied by Rufus (Chris Rock), the 13th black apostle.

On the way to New Jersey, a lot of things happens, and a few deep
discussions occur, talking about religion. From these discussions, Smith
wants to point out how the normal society treats religion as an obligation,
not as a faith. Which is, in some kind of way, exactly the same what I'm
feeling. And in between a whole lot of movie jokes.

So they made it to New Jersey. But how do you stop two angels, desperate of
going home back to heaven? Well, maybe God can help.

This movie is being criticized heavily by the catholic community, but I
think that is a bit unfair. Smith did make some jokes about catholics,
Jesus, and even God, but in the end Smith is actually showing the reality
about religion. People who can look through the profanity and the
poop-monster will be thinking a lot about their faith and religion, and
Smith is showing the way to what these people should do, which is believe in
God and do something about it.

Indra Moeljadi
haven't seen any Kevin Smith movies before

for more PopCulture reviews
http://www.geocities.com/anakzaman

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:
package com.gemstone.gemfire.internal.tools.gfsh.app.commands;

import java.util.LinkedList;
import java.util.List;

import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.Scope;
import com.gemstone.gemfire.internal.tools.gfsh.app.CommandExecutable;
import com.gemstone.gemfire.internal.tools.gfsh.app.Gfsh;
import com.gemstone.gemfire.internal.tools.gfsh.app.aggregator.Aggregator;
import com.gemstone.gemfire.internal.tools.gfsh.app.aggregator.functions.util.RegionDestroyFunction;
import com.gemstone.gemfire.internal.tools.gfsh.app.command.CommandClient;
import com.gemstone.gemfire.internal.tools.gfsh.app.command.task.RegionDestroyTask;
import com.gemstone.gemfire.internal.tools.gfsh.app.command.task.data.MemberInfo;
import com.gemstone.gemfire.internal.tools.gfsh.command.CommandResults;
import com.gemstone.gemfire.internal.tools.gfsh.util.RegionUtil;

public class rmdir implements CommandExecutable
{
	private Gfsh gfsh;

	public rmdir(Gfsh gfsh)
	{
		this.gfsh = gfsh;
	}

	public void help()
	{
		gfsh.println("rmdir [-a|-g|-s] [-?] <region path>");
		gfsh.println("     Remove the local region if no options specified. The region path");
		gfsh.println("     can be absolute or relative.");
		gfsh.println("     -a Remove both the local region and the server region.");
		gfsh.println("        The region destroy will be distributed to other caches if the");
		gfsh.println("        scope is not Scope.LOCAL.");
		gfsh.println("     -g Remove globally. Remove the local region and all server");
		gfsh.println("        regions regardless of scope. This option also removes server");
		gfsh.println("        regions with Scope.LOCAL.");
		gfsh.println("     -s Remove only the server region. The local region is not destroyed.");
		gfsh.println("        The region destroy will be distributed to other caches if the");
		gfsh.println("        scope is not Scope.LOCAL.");
		gfsh.println();
	}

	public void execute(String command) throws Exception
	{
		if (command.startsWith("rmdir -?")) {
			help();
		} else if (command.startsWith("rmdir -a")) {
			rmdir_a(command);
		} else if (command.startsWith("rmdir -g")) {
			rmdir_g(command);
		} else if (command.startsWith("rmdir -s")) {
			rmdir_s(command);
		} else {
			rmdir_local(command);
		}
	}

	private void rmdir(String command) throws Exception
	{
		int index = command.indexOf(" ");
		if (index == -1) {
			gfsh.println("Error: rmdir requires a region path to remove");
		} else {
			Cache cache = gfsh.getCache();
			Region region;
			String newPath = command.substring(index).trim();
			String fullPath = gfsh.getFullPath(newPath, gfsh.getCurrentPath());
			if (fullPath == null) {
				gfsh.println("Error: region path must be provided. mkdir <regionPath>");
			} else {
				// absolute path
				region = cache.getRegion(fullPath);
				if (region == null) {
					gfsh.println("Error: region does not exist - " + fullPath);
					return;
				}
				region.close();
				gfsh.println("Region removed: " + fullPath);
			}
		}
	}

	private void rmdir_local(String command)
	{
		LinkedList list = new LinkedList();
		gfsh.parseCommand(command, list);
		String regionPath = null;
		if (list.size() > 1) {
			regionPath = (String)list.get(1);
		} else {
			gfsh.println("Error: must specify a region path to remove");
			return;
		}

		remove_local(regionPath);
	}

	private void rmdir_a(String command) throws Exception
	{
		LinkedList list = new LinkedList();
		gfsh.parseCommand(command, list);
		String regionPath = null;
		if (list.size() > 2) {
			regionPath = (String)list.get(2);
		} else {
			gfsh.println("Error: must specify a region path to remove");
			return;
		}

		remove_server(regionPath, false);
		remove_local(regionPath);
	}

	private void rmdir_g(String command) throws Exception
	{
		LinkedList list = new LinkedList();
		gfsh.parseCommand(command, list);
		String regionPath = null;
		if (list.size() > 2) {
			regionPath = (String)list.get(2);
		} else {
			gfsh.println("Error: must specify a region path to remove");
			return;
		}

		remove_server(regionPath, true);
		remove_local(regionPath);
	}

	private void rmdir_s(String command) throws Exception
	{
		LinkedList list = new LinkedList();
		gfsh.parseCommand(command, list);
		String regionPath = null;
		if (list.size() > 2) {
			regionPath = (String)list.get(2);
		} else {
			gfsh.println("Error: must specify a region path to remove");
			return;
		}

		remove_server(regionPath, false);
	}

	private void remove_local(String regionPath)
	{
		if (regionPath == null) {
			return;
		}

		String currentPath = gfsh.getCurrentPath();
		String fullPath = gfsh.getFullPath(regionPath, currentPath);
		if (fullPath == null) {
			gfsh.println("Error: invalid region path");
		} else if (fullPath.equals("/")) {
			gfsh.println("Error: cannot remove top level");
		} else {
			Region region = gfsh.getCache().getRegion(fullPath);
			if (region == null) {
				gfsh.println("Error: undefined region path " + fullPath);
				return;
			}
			region.close();

			// correct the current path if the removed region path
			// lies in the current path
			String currentSplit[] = currentPath.split("/");
			Cache cache = gfsh.getCache();
			Region currentRegion = null;
			if (currentSplit.length > 1) {
				currentRegion = region = cache.getRegion(currentSplit[1]);
				if (region != null) {
					for (int i = 2; i < currentSplit.length; i++) {
						region = region.getSubregion(currentSplit[i]);
						if (region == null) {
							break;
						}
						currentRegion = region;
					}
				}
			}
			if (currentRegion == null) {
				gfsh.setCurrentPath("/");
			} else {
				gfsh.setCurrentPath(currentRegion.getFullPath());
			}
			gfsh.setCurrentRegion(currentRegion);

			gfsh.println("Region removed from local VM: " + regionPath);
		}
	}

	private void remove_server(String regionPath, boolean global) throws Exception
	{
		if (regionPath == null) {
			return;
		}

		String currentPath = gfsh.getCurrentPath();
		String fullPath = gfsh.getFullPath(regionPath, currentPath);
		if (fullPath == null) {
			gfsh.println("Error: invalid region path");
		} else if (fullPath.equals("/")) {
			gfsh.println("Error: cannot remove top level");
		} else {

			String confirmation = gfsh.getLine("This command will remove the region " + fullPath + " from the server(s). \nDo you want to proceed? (yes|no): ");
			if (confirmation.equalsIgnoreCase("yes") == false) {
				gfsh.println("Command aborted.");
				return;
			}

			if (global) {

				Aggregator aggregator = gfsh.getAggregator();
				List<CommandResults> aggregateList = (List<CommandResults>)aggregator.aggregate(new RegionDestroyFunction(fullPath), gfsh.getAggregateRegionPath());

				int i = 1;
				for (CommandResults commandResults : aggregateList) {

					MemberInfo memberInfo = (MemberInfo)commandResults.getDataObject();
					gfsh.print(i + ". " + memberInfo.getMemberName() + "(" + memberInfo.getMemberId() + ")" + ": ");
					if (commandResults.getCode() == RegionDestroyTask.ERROR_REGION_DESTROY) {
						gfsh.println("error - " + commandResults.getCodeMessage());
					} else {
						Region region = RegionUtil.getRegion(fullPath, Scope.LOCAL, DataPolicy.NORMAL, null);
						gfsh.println("region removed: " + region.getFullPath());
					}
					i++;
				}
			} else {
				CommandClient commandClient = gfsh.getCommandClient();
				CommandResults commandResults = commandClient.execute(new RegionDestroyTask(fullPath));
				MemberInfo memberInfo = (MemberInfo)commandResults.getDataObject();
				gfsh.print(memberInfo.getMemberName() + "(" + memberInfo.getMemberId() + ")" + ": ");
				if (commandResults.getCode() == RegionDestroyTask.ERROR_REGION_DESTROY) {
					gfsh.println("error - " + commandResults.getCodeMessage());
				} else {
					Region region = RegionUtil.getRegion(regionPath, Scope.LOCAL, DataPolicy.NORMAL, null);
					gfsh.println("region removed: " + region.getFullPath());
				}
			}
		}
	}

}


text:
class Species::ReferenceSerializer < ActiveModel::Serializer
  attributes :citation, :is_standard
end


text:
/*
 *
 *
 *
 */
package com.sxm.core.utils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;

/**
 * Pageable工具类.
 *
 * @author sxm
 * @version 2014-07-18
 * @----------------------------------------------------------------------------------------
 * @updated 修改描述.
 * @updated by sxm
 * @updated at 2014-07-18
 */
public abstract class Pageables {

	private final static int PAGE = 1;
	private final static int SIZE = 10;
	private final static String PAGE_NO = "pageNo";
	private final static String PAGE_SIZE = "pageSize";
	private final static String REPAGE = "repage";
	private final static String RE_PAGE_NO = "rePageNo";

	public static Pageable Build(int page) {
		return new PageRequest(page - 1, SIZE);
	}

	public static Pageable Build(int page, int size) {
		return new PageRequest(page - 1, size);
	}

	public static Pageable Build(Sort sort) {
		return new PageRequest(PAGE, SIZE, sort);
	}

	public static Pageable Build(int page, int size, Sort sort) {
		return new PageRequest(page - 1, size, sort);
	}

	public static Pageable Build(Direction direction, String... properties) {
		return new PageRequest(PAGE, SIZE, direction, properties);
	}

	public static Pageable Build(int page, int size, Direction direction, String... properties) {
		return new PageRequest(page - 1, size, direction, properties);
	}

	public static Pageable Build(HttpServletRequest request, HttpServletResponse response) {
		int pageNo = getAndSet(request, response, PAGE_NO);
		int pageSize = getAndSet(request, response, PAGE_SIZE);
		return new PageRequest(pageNo - 1, pageSize);
	}

	public static Pageable Build(HttpServletRequest request, HttpServletResponse response, Sort sort) {
		int pageNo = getAndSet(request, response, PAGE_NO);
		int pageSize = getAndSet(request, response, PAGE_SIZE);
		return new PageRequest(pageNo - 1, pageSize, sort);
	}

	public static Pageable Build(HttpServletRequest request, HttpServletResponse response, int size) {
		int pageNo = getAndSet(request, response, PAGE_NO);
		if (size < 1) {
			return new PageRequest(pageNo - 1, SIZE);
		} else {
			return new PageRequest(pageNo - 1, size);
		}
	}

	public static Pageable Build(HttpServletRequest request, HttpServletResponse response, int size, Sort sort) {
		int pageNo = getAndSet(request, response, PAGE_NO);
		if (size < 1) {
			return new PageRequest(pageNo - 1, SIZE, sort);
		} else {
			return new PageRequest(pageNo - 1, size, sort);
		}
	}

	public static Pageable Build(HttpServletRequest request, HttpServletResponse response, Direction direction, String... properties) {
		int pageNo = getAndSet(request, response, PAGE_NO);
		int pageSize = getAndSet(request, response, PAGE_SIZE);
		return new PageRequest(pageNo - 1, pageSize, direction, properties);
	}

	private static int getAndSet(HttpServletRequest request, HttpServletResponse response, String name) {
		int result = 0;
		// 设置分页参数(传递repage参数,记住分页参数)
		String val = request.getParameter(name);
		if (StringUtils.isNumeric(val)) {
			Cookies.setCookie(response, name, val);
			result = Integer.parseInt(val);
		} else if (request.getParameter(REPAGE) != null) {
			val = Cookies.getCookie(request, name);
			if (StringUtils.isNumeric(val)) {
				result = Integer.parseInt(val);
			}
		} else {
			if (StringUtils.isBlank(val)) {
				val = PAGE_NO.equals(name) ? String.valueOf(PAGE) : String.valueOf(SIZE);
				Cookies.setCookie(response, name, val);
				result = Integer.parseInt(val);
			}
		}
		if (PAGE_NO.equals(name)) {
			if (result < PAGE) {
				result = PAGE;
			} else {
				// 当rePageNo=true时,设置pageNo=1
				String rePageNo = request.getParameter(RE_PAGE_NO);
				if ("true".equals(rePageNo)) {
					result = PAGE;
				}
			}
		}
		return result;
	}

}


text:
<template name="videoButtons">

		{{#if videoAvaliable}}
			{{#unless videoActive}}
				{{#if callInProgress}}
					<button class="rc-button rc-button--secondary join-video-call primary" aria-label="{{_ "Join_video_call"}}"></button>
					<button class="rc-button rc-button--secondary join-audio-call secondary" aria-label="{{_ "Join_audio_call"}}"></button>
				{{else}}
					<button class="rc-button rc-button--secondary start-video-call primary" aria-label="{{_ "Start_video_call"}}"></button>
					<button class="rc-button rc-button--secondary start-audio-call secondary" aria-label="{{_ "Start_audio_call"}}"></button>
				{{/if}}
			{{/unless}}
		{{/if}}

</template>


text:
import unittest

from advanced_data_structures.linked_list import LinkedList

class TestLinkedList(unittest.TestCase):

    def test_add(self):
        l = LinkedList()
        l.add(1)


text:
#ifndef __GTK_APPLICATION_PRIVATE_H__
#define __GTK_APPLICATION_PRIVATE_H__

#include "gtkapplicationwindow.h"
#include "gtkwindowprivate.h"

#include "gtkactionmuxer.h"

G_BEGIN_DECLS

void                    gtk_application_window_set_id                   (GtkApplicationWindow     *window,
                                                                         guint                     id);
GActionGroup *          gtk_application_window_get_action_group         (GtkApplicationWindow     *window);
void                    gtk_application_handle_window_realize           (GtkApplication           *application,
                                                                         GtkWindow                *window);
void                    gtk_application_handle_window_map               (GtkApplication           *application,
                                                                         GtkWindow                *window);
GtkActionMuxer *        gtk_application_get_parent_muxer_for_window     (GtkWindow                *window);

gboolean                gtk_application_activate_accel                  (GtkApplication           *application,
                                                                         GActionGroup             *action_group,
                                                                         guint                     key,
                                                                         GdkModifierType           modifier);

void                    gtk_application_foreach_accel_keys              (GtkApplication           *application,
                                                                         GtkWindow                *window,
                                                                         GtkWindowKeysForeachFunc  callback,
                                                                         gpointer                  user_data);
GtkActionMuxer *        gtk_application_get_action_muxer                (GtkApplication           *application);
void                    gtk_application_insert_action_group             (GtkApplication           *application,
                                                                         const gchar              *name,
                                                                         GActionGroup             *action_group);

#define GTK_TYPE_APPLICATION_IMPL                           (gtk_application_impl_get_type ())
#define GTK_APPLICATION_IMPL_CLASS(class)                   (G_TYPE_CHECK_CLASS_CAST ((class),                     \
                                                             GTK_TYPE_APPLICATION_IMPL,                            \
                                                             GtkApplicationImplClass))
#define GTK_APPLICATION_IMPL_GET_CLASS(obj)                 (G_TYPE_INSTANCE_GET_CLASS ((obj),                     \
                                                             GTK_TYPE_APPLICATION_IMPL,                            \
                                                             GtkApplicationImplClass))

typedef struct
{
  GObject parent_instance;
  GtkApplication *application;
  GdkDisplay *display;
} GtkApplicationImpl;

typedef struct
{
  GObjectClass parent_class;

  void        (* startup)                   (GtkApplicationImpl          *impl,
                                             gboolean                     register_session);
  void        (* shutdown)                  (GtkApplicationImpl          *impl);

  void        (* before_emit)               (GtkApplicationImpl          *impl,
                                             GVariant                    *platform_data);

  void        (* window_added)              (GtkApplicationImpl          *impl,
                                             GtkWindow                   *window);
  void        (* window_removed)            (GtkApplicationImpl          *impl,
                                             GtkWindow                   *window);
  void        (* active_window_changed)     (GtkApplicationImpl          *impl,
                                             GtkWindow                   *window);
  void        (* handle_window_realize)     (GtkApplicationImpl          *impl,
                                             GtkWindow                   *window);
  void        (* handle_window_map)         (GtkApplicationImpl          *impl,
                                             GtkWindow                   *window);

  void        (* set_app_menu)              (GtkApplicationImpl          *impl,
                                             GMenuModel                  *app_menu);
  void        (* set_menubar)               (GtkApplicationImpl          *impl,
                                             GMenuModel                  *menubar);

  guint       (* inhibit)                   (GtkApplicationImpl          *impl,
                                             GtkWindow                   *window,
                                             GtkApplicationInhibitFlags   flags,
                                             const gchar                 *reason);
  void        (* uninhibit)                 (GtkApplicationImpl          *impl,
                                             guint                        cookie);
  gboolean    (* is_inhibited)              (GtkApplicationImpl          *impl,
                                             GtkApplicationInhibitFlags   flags);

  gboolean    (* prefers_app_menu)          (GtkApplicationImpl          *impl);

} GtkApplicationImplClass;

#define GTK_TYPE_APPLICATION_IMPL_DBUS                      (gtk_application_impl_dbus_get_type ())
#define GTK_APPLICATION_IMPL_DBUS_CLASS(class)              (G_TYPE_CHECK_CLASS_CAST ((class),                     \
                                                             GTK_TYPE_APPLICATION_IMPL_DBUS,                       \
                                                             GtkApplicationImplDBusClass))
#define GTK_APPLICATION_IMPL_DBUS_GET_CLASS(obj)            (G_TYPE_INSTANCE_GET_CLASS ((obj),                     \
                                                             GTK_TYPE_APPLICATION_IMPL_DBUS,                       \
                                                             GtkApplicationImplDBusClass))

typedef struct
{
  GtkApplicationImpl impl;

  GDBusConnection *session;

  const gchar     *application_id;
  const gchar     *unique_name;
  const gchar     *object_path;

  gchar           *app_menu_path;
  guint            app_menu_id;

  gchar           *menubar_path;
  guint            menubar_id;

  /* Session management... */
  gchar           *app_id; /* actually prgname... */
  GDBusProxy      *sm_proxy;
  GDBusProxy      *client_proxy;
  gchar           *client_path;
} GtkApplicationImplDBus;

typedef struct
{
  GtkApplicationImplClass parent_class;

  /* returns floating */
  GVariant *  (* get_window_system_id)      (GtkApplicationImplDBus      *dbus,
                                             GtkWindow                   *window);
} GtkApplicationImplDBusClass;

GType                   gtk_application_impl_get_type                   (void);
GType                   gtk_application_impl_dbus_get_type              (void);
GType                   gtk_application_impl_x11_get_type               (void);
GType                   gtk_application_impl_wayland_get_type           (void);
GType                   gtk_application_impl_quartz_get_type            (void);

GtkApplicationImpl *    gtk_application_impl_new                        (GtkApplication              *application,
                                                                         GdkDisplay                  *display);
void                    gtk_application_impl_startup                    (GtkApplicationImpl          *impl,
                                                                         gboolean                     register_sesion);
void                    gtk_application_impl_shutdown                   (GtkApplicationImpl          *impl);
void                    gtk_application_impl_before_emit                (GtkApplicationImpl          *impl,
                                                                         GVariant                    *platform_data);
void                    gtk_application_impl_window_added               (GtkApplicationImpl          *impl,
                                                                         GtkWindow                   *window);
void                    gtk_application_impl_window_removed             (GtkApplicationImpl          *impl,
                                                                         GtkWindow                   *window);
void                    gtk_application_impl_active_window_changed      (GtkApplicationImpl          *impl,
                                                                         GtkWindow                   *window);
void                    gtk_application_impl_handle_window_realize      (GtkApplicationImpl          *impl,
                                                                         GtkWindow                   *window);
void                    gtk_application_impl_handle_window_map          (GtkApplicationImpl          *impl,
                                                                         GtkWindow                   *window);
void                    gtk_application_impl_set_app_menu               (GtkApplicationImpl          *impl,
                                                                         GMenuModel                  *app_menu);
void                    gtk_application_impl_set_menubar                (GtkApplicationImpl          *impl,
                                                                         GMenuModel                  *menubar);
guint                   gtk_application_impl_inhibit                    (GtkApplicationImpl          *impl,
                                                                         GtkWindow                   *window,
                                                                         GtkApplicationInhibitFlags   flags,
                                                                         const gchar                 *reason);
void                    gtk_application_impl_uninhibit                  (GtkApplicationImpl          *impl,
                                                                         guint                        cookie);
gboolean                gtk_application_impl_is_inhibited               (GtkApplicationImpl          *impl,
                                                                         GtkApplicationInhibitFlags   flags);

gchar *                 gtk_application_impl_dbus_get_window_path       (GtkApplicationImplDBus      *dbus,
                                                                         GtkWindow                   *window);
gboolean                gtk_application_impl_prefers_app_menu           (GtkApplicationImpl          *impl);

void                    gtk_application_impl_quartz_setup_menu          (GMenuModel                  *model,
                                                                         GtkActionMuxer              *muxer);

G_END_DECLS

#endif /* __GTK_APPLICATION_PRIVATE_H__ */


text:
import libmsym as msym, numpy as np, argparse, random, sys

def read_xyz(fin):
    length = int(fin.readline())
    comment = fin.readline()[:-1]
    elements = []
    for i in range(0,length):
        line = fin.readline().split()
        elements.append(msym.Element(name = line[0], coordinates = map(float, line[1:4])))

    return (elements, comment)

def write_xyz(fout, elements, comment):
    fout.write("%d\n%s\n" % (len(elements), comment))
    for e in elements:
        v = e.coordinates
        fout.write("%s %.14f %.14f %.14f\n" % (e.name, *v))

parser = argparse.ArgumentParser()
parser.add_argument('infile', type=argparse.FileType('r'))
parser.add_argument('outfile', type=argparse.FileType('w'))
args = parser.parse_args()

(elements, comment) = read_xyz(args.infile)

def set_basis(element):
    basis_function = msym.RealSphericalHarmonic(element = element, name = "1s")
    element.basis_functions = [basis_function]
    return basis_function

basis_functions = [set_basis(e) for e in elements]

#msym.init(library_location='/path_to_libmsym_library/libmsym.dylib') # e.g. for OS X without libmsym in dload path

#with msym.Context() as ctx:
#    ctx.elements = elements
#    point_group = ctx.find_symmetry()
#    selements = ctx.symmetrize_elements()
#    write_xyz(args.outfile, selements, comment + " symmetrized by libmsym according to point group " + point_group)

with msym.Context(elements = elements, basis_functions = basis_functions) as ctx:
    point_group = ctx.find_symmetry()
    selements = ctx.symmetrize_elements()
    write_xyz(args.outfile, selements, comment + " symmetrized by libmsym according to point group " + point_group)
    ctx.symmetry_operations #symmetry operations
    ctx.subrepresentation_spaces # subspace
    ctx.subrepresentation_spaces[0].symmetry_species #symmetry species of space (index into character table)
    ctx.subrepresentation_spaces[0].salcs # salcs that span space
    ctx.subrepresentation_spaces[0].salcs[0].basis_functions # basis functions for salc
    ctx.subrepresentation_spaces[0].salcs[0].partner_functions # numpy array of partner functions expressed in terms of basis_functions coefficients

    ctx.character_table.table # table as numpy array
    ctx.character_table.symmetry_operations # representative symmetry operations
    ctx.character_table.symmetry_species # symmetry species
    ctx.character_table.symmetry_species[0].dim  # dimensionality of symmetry species
    ctx.character_table.symmetry_species[0].name # name of symmetry species e.g. A2g

    somefunc = np.zeros((len(basis_functions)),dtype=np.float64)
    for i in range(0,len(somefunc)):
        somefunc[i] = i

    species_components = ctx.symmetry_species_components(somefunc)

    species = ctx.character_table.symmetry_species

    print(somefunc)
    for i, c in enumerate(species_components):
        print(str(c) + species[i].name)

    #matrix version of the above, as well as wave function symmetrization
    (matrix, species, partners) = ctx.salcs
    (d,d) = matrix.shape
    print(matrix)
    print(species)
    print([(p.index, p.dim) for p in partners])
    indexes = [x for x in range(0,d)]
    random.shuffle(indexes)
    matrix = matrix[indexes,:]
    matrix += 0.01
    print(matrix)
    (_same_matrix, species,partners) = ctx.symmetrize_wavefunctions(matrix)
    print(matrix)
    print(species)
    print([(p.index, p.dim) for p in partners])

    #generating elements
    ctx.point_group = "D6h"
    gen_elements = [msym.Element(name = "C", coordinates = [1.443524, 0.0,0.0]), msym.Element(name = "H", coordinates = [2.568381, 0.0, 0.0])]
    benzene = ctx.generate_elements(gen_elements)
    maxcomp = max([max(e.coordinates) for e in benzene])
    print(len(benzene),"\nbenzene")
    for e in benzene:
        vec = np.asarray(e.coordinates)
        vec[vec < maxcomp*sys.float_info.epsilon] = 0
        print(e.name, vec[0],vec[1],vec[2])

#with msym.Context(elements = elements, point_group = "T") as ctx:
#    point_group = ctx.point_group
#    selements = ctx.symmetrize_elements()
#    write_xyz(args.outfile, selements, comment + " symmetrized by libmsym according to point group " + point_group)


text:
<?php

if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

if( ! class_exists('acf_pro_updates') ) :

class acf_pro_updates {

	/*
	*  __construct
	*
	*  Initialize filters, action, variables and includes
	*
	*  @type	function
	*  @date	23/06/12
	*  @since	5.0.0
	*
	*  @param	n/a
	*  @return	n/a
	*/

	function __construct() {

		// append plugin information
		// Note: is_admin() was used previously, however this prevents jetpack manage & ManageWP from working
	    add_filter('plugins_api', array($this, 'inject_info'), 20, 3);

		// append update information
		add_filter('pre_set_site_transient_update_plugins', array($this, 'inject_update'));

		// add custom message when PRO not activated but update available
		add_action('in_plugin_update_message-' . acf_get_setting('basename'), array($this, 'in_plugin_update_message'), 10, 2 );

	}

	/*
	*  inject_info
	*
	*  This function will populate the plugin data visible in the 'View details' popup
	*
	*  @type	function
	*  @date	17/01/2014
	*  @since	5.0.0
	*
	*  @param	$result (bool|object)
	*  @param	$action (string)
	*  @param	$args (object)
	*  @return	$result
	*/

	function inject_info( $result, $action = null, $args = null ) {

		// vars
		$slug = acf_get_setting('slug');

		// validate
    	if( isset($args->slug) && $args->slug == $slug ) {

	    	$info = acf_pro_get_remote_info();
	    	$sections = acf_extract_vars($info, array(
	    		'description',
	    		'installation',
	    		'changelog',
	    		'upgrade_notice',
	    	));

	    	$obj = new stdClass();

		    foreach( $info as $k => $v ) {

		        $obj->$k = $v;

		    }

		    $obj->sections = $sections;

		    return $obj;

    	}

    	// return
        return $result;

	}

	/*
	*  inject_update
	*
	*  This function will connect to the ACF website and find release details
	*
	*  @type	function
	*  @date	16/01/2014
	*  @since	5.0.0
	*
	*  @param	$transient (object)
	*  @return	$transient
	*/

	function inject_update( $transient ) {

		// bail early if no show_updates
		if( !acf_get_setting('show_updates') ) {

			return $transient;

		}

		// bail early if no update available
		if( !acf_pro_is_update_available() ) {

			return $transient;

		}

        // vars
		$info = acf_pro_get_remote_info();
		$basename = acf_get_setting('basename');
		$slug = acf_get_setting('slug');

        // create new object for update
        $obj = new stdClass();
        $obj->slug = $slug;
        $obj->plugin = $basename;
        $obj->new_version = $info['version'];
        $obj->url = $info['homepage'];
        $obj->package = '';

        // license
		if( acf_pro_is_license_active() ) {

			$obj->package = acf_pro_get_remote_url('download', array(
				'k'				=> acf_pro_get_license(),
				'wp_url'		=> home_url(),
				'acf_version'	=> acf_get_setting('version'),
				'wp_version'	=> get_bloginfo('version'),
			));

		}

        // add to transient
        $transient->response[ $basename ] = $obj;

		// return
        return $transient;

	}

	/*
	*  in_plugin_update_message
	*
	*  Displays an update message for plugin list screens.
	*  Shows only the version updates from the current until the newest version
	*
	*  @type	function
	*  @date	5/06/13
	*
	*  @param	{array}		$plugin_data
	*  @param	{object}	$r
	*/

	function in_plugin_update_message( $plugin_data, $r ) {

		// validate
		if( acf_pro_is_license_active() ) {

			return;

		}

		// vars
		$m = __('To enable updates, please enter your license key on the Updates page. If you don\'t have a licence key, please see details & pricing', 'acf');

		// show message
		echo '
' . sprintf( $m, admin_url('edit.php?post_type=acf-field-group&page=acf-settings-updates'), 'http://www.advancedcustomfields.com/pro');

	}

}

// initialize
new acf_pro_updates();

endif; // class_exists check

?>


text:
namespace mscorlib
{
	namespace System
	{
		namespace Text
		{

			//Constructors Tests

			//EncoderReplacementFallback()
			TEST(mscorlib_System_Text_EncoderReplacementFallback_Fixture,DefaultConstructor)
			{

				mscorlib::System::Text::EncoderReplacementFallback *value = new mscorlib::System::Text::EncoderReplacementFallback();
				EXPECT_NE(NULL, value->GetNativeObject());

			}

			//EncoderReplacementFallback(mscorlib::System::String replacement)
			TEST(mscorlib_System_Text_EncoderReplacementFallback_Fixture,Constructor_2)
			{

				mscorlib::System::Text::EncoderReplacementFallback *value = new mscorlib::System::Text::EncoderReplacementFallback();
				EXPECT_NE(NULL, value->GetNativeObject());

			}

			//Public Methods Tests

			// Method CreateFallbackBuffer
			//		Signature:
			TEST(mscorlib_System_Text_EncoderReplacementFallback_Fixture,CreateFallbackBuffer_Test)
			{

			}

			// Method Equals
			//		Signature: mscorlib::System::Object value
			TEST(mscorlib_System_Text_EncoderReplacementFallback_Fixture,Equals_Test)
			{

			}

			// Method GetHashCode
			//		Signature:
			TEST(mscorlib_System_Text_EncoderReplacementFallback_Fixture,GetHashCode_Test)
			{

			}

			//Public Properties Tests

			// Property DefaultString
			//		Return Type: mscorlib::System::String
			//			Property Get Method
			TEST(mscorlib_System_Text_EncoderReplacementFallback_Fixture,get_DefaultString_Test)
			{

			}

			// Property MaxCharCount
			//		Return Type: mscorlib::System::Int32
			//			Property Get Method
			TEST(mscorlib_System_Text_EncoderReplacementFallback_Fixture,get_MaxCharCount_Test)
			{

			}

		}
	}
}


text:
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import './Placeholder.css';

/**
 * Image placeholders.
 */
export default class Placeholder extends Component {
	static propTypes = {
		type: PropTypes.oneOf([
			'animal',
			'bacon',
			'beard',
			'bear',
			'cat',
			'food',
			'city',
			'nature',
			'people',
		]),
		width: PropTypes.number,
		height: PropTypes.number,
	};

	static defaultProps = {
		type: 'animal',
		width: 150,
		height: 150,
	};

	getImageUrl() {
		const { type, width, height } = this.props;
		const types = {
			animal: `http://placeimg.com/${width}/${height}/animals`,
			bacon: `http://baconmockup.com/${width}/${height}`,
			bear: `http://www.placebear.com/${width}/${height}`,
			beard: `http://placebeard.it/${width}/${height}`,
			cat: `http://lorempixel.com/${width}/${height}/cats`,
			city: `http://lorempixel.com/${width}/${height}/city`,
			food: `http://lorempixel.com/${width}/${height}/food`,
			nature: `http://lorempixel.com/${width}/${height}/nature`,
			people: `http://lorempixel.com/${width}/${height}/people`,
		};
		return types[type];
	}

	render() {
		const { type, width, height } = this.props;
		return (
			<img
				className="placeholder"
				src={this.getImageUrl()}
				alt={type}
				width={width}
				height={height}
			/>
		);
	}
}


text:
from django.contrib.auth.models import User
from django import forms

class UserForm(forms.ModelForm):
    password = forms.CharField(widget = forms.PasswordInput)
    class Meta:
        model = User
        fields = ['username','email','password']


text:
package co.instil.jenkins.plugins.pipeline.dsl;

import hudson.Extension;
import org.jenkinsci.plugins.pipelinedsl.PipelineDSLGlobal;

/**
 *
 */
@Extension
public class SetBooleanBuildParameter extends PipelineDSLGlobal {

    @Override
    public String getFunctionName() {
        return "setBooleanBuildParameter";
    }

}


text:
import { DatePipe } from "@angular/common";
import { Calendar, CalendarBase } from "../calendarbase"
import { DateUnit } from "../dateunit";
import { Row, Cell } from "../elements";

export class Gregorian implements CalendarBase {
    weekDayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
    weekFirstDay = 0;
    monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
    minYear = 1970;
    maxYear = 2070;

    nameOfMonth(num: number): string{
        return this.monthNames[num];
    }

    dateToString(date: Date, format: string): string {
        return new DatePipe('en-en').transform(date, format);
    }

    dateToDateUnit(date: Date): DateUnit {
        let uDate: DateUnit = new DateUnit();
        uDate.year = date.getFullYear();
        uDate.month = date.getMonth();
        uDate.day = date.getDate();
        uDate.hour = date.getHours();
        uDate.minute = date.getMinutes();
        uDate.seconds = date.getSeconds();
        return uDate;
    }

    dateUnitToDate(date: DateUnit): Date {
        return new Date(date.year, date.month, date.day, date.hour, date.minute, date.seconds);
    }

    monthLength(date: DateUnit) {
        return new Date(date.year, date.month + 1, 0).getDate();
    }

    weekHeaders() {
        let row = new Row();
        for (let i = 0; i < 7; i++) {
            row.cells[i] = new Cell;
            let index = i + this.weekFirstDay;
            index -= (i + this.weekFirstDay < 7) ? 0 : 7;
            row.cells[i].content = this.weekDayNames[index];
        }
        return row;
    }

    dayNumberOfMonthFirst(date: DateUnit): number {
        return new Date(date.year, date.month, 1).getDay();
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
><TITLE
>Qtc.Gui.QPainter</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
>

Qtc.Gui.QPainter

class QqPainter x1

class QqPainter_nf x1

class Qbackground x1

backgroundMode

class Qbegin x1 xr

class QqboundingRect x1 xr

class QqqboundingRect x1 xr

class Qbrush x1

brushOrigin

qbrushOrigin

clipPath

clipRegion

combinedMatrix

combinedTransform

compositionMode

class Qdevice x1 xr

deviceMatrix

class QdeviceTransform x1

class QdrawArc x1

class QqdrawArc x1

class QdrawChord x1

class QqdrawChord x1

class QdrawConvexPolygon x1

class QdrawEllipse x1

class QqdrawEllipse x1

class QdrawImage x1

class QqdrawImage x1

class QdrawLine x1

class QqdrawLine x1

class QdrawLines x1

drawPath

class QdrawPicture x1

class QqdrawPicture x1

class QdrawPie x1

class QqdrawPie x1

class QdrawPixmap x1

class QqdrawPixmap x1

class QdrawPoint x1

class QqdrawPoint x1

class QdrawPoints x1

class QdrawPolygon x1

class QdrawPolyline x1

class QdrawRect x1

class QqdrawRect x1

class QdrawRects x1

class QdrawRoundRect x1

class QqdrawRoundRect x1

class QdrawText x1

class QqdrawText x1

class QdrawTiledPixmap x1

class QqdrawTiledPixmap x1

class Qend x1 xr

class QeraseRect x1

class QqeraseRect x1

fillPath

class QfillRect x1

class QqfillRect x1

class Qfont x1

class QfontInfo x1

class QfontMetrics x1

hasClipping

class QinitFrom x1

class QisActive x1

class QlayoutDirection x1

class Qmatrix x1

matrixEnabled

opacity

class QpaintEngine x1

class Qpen x1

class QqPainterRedirected x1

class QrenderHints x1

class QresetMatrix x1

class QresetTransform x1

restore

class QqPainterRestoreRedirected x1

class Qrotate x1

class Qsave x1 xr

class Qqscale x1

class Qqqscale x1

class QsetBackground x1

setBackgroundMode

class QsetBrush x1

class QsetBrushOrigin x1

class QqsetBrushOrigin x1

class QsetClipPath x1

class QsetClipRect x1

class QqsetClipRect x1

class QsetClipRegion x1

setClipping

setCompositionMode

class QsetFont x1

class QsetLayoutDirection x1

class QsetMatrix x1

setMatrixEnabled

setOpacity

class QsetPen x1

class QqPainterSetRedirected x1

class QqqPainterSetRedirected x1

class QsetRenderHint x1

class QsetRenderHints x1

class QsetTransform x1

setViewTransformEnabled

class QsetViewport x1

qsetViewport

class QsetWindow x1

qsetWindow

class QsetWorldMatrix x1

setWorldMatrixEnabled

class QsetWorldTransform x1

class Qshear x1

strokePath

testRenderHint

class Qtransform x1

class Qqtranslate x1 xr

class Qqqtranslate x1

viewTransformEnabled

class Qviewport x1 xr

qviewport

class Qwindow x1 xr

qwindow

worldMatrix

worldMatrixEnabled

worldTransform

qPainter_delete


text:
<?php

# See {$THRIFT_HOME}/lib/php/README for additional help.

# Change this to match your thrift root.
$GLOBALS['THRIFT_ROOT'] = '/Users/irubin/Thrift/thrift-20080411p1/lib/php/src';

require_once( $GLOBALS['THRIFT_ROOT'].'/Thrift.php' );

# Something is wrong with this. Is this the PHP way of doing things?
# Old versions of thrift seemingly worked with just a couple includes.
require_once( $GLOBALS['THRIFT_ROOT'].'/type/TMessageType.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/type/TType.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/exception/TException.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/factory/TStringFuncFactory.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/stringfunc/TStringFunc.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/stringfunc/Core.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/transport/TSocket.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/transport/TBufferedTransport.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/protocol/TBinaryProtocol.php' );

# According to the thrift documentation, compiled PHP thrift libraries should
# reside under the THRIFT_ROOT/packages directory. Copy them there from gen-php/.
if (mkdir($GLOBALS['THRIFT_ROOT'].'/packages/Hbase', 0770, true)) {
  $files = scandir('gen-php/Hbase');
  foreach ($files as $file) {
    if (preg_match("/.*php$/", $file)) {
      copy("./gen-php/Hbase/$file", $GLOBALS['THRIFT_ROOT']."/packages/Hbase/$file");
    }
  }
}

require_once( $GLOBALS['THRIFT_ROOT'].'/packages/Hbase/Hbase.php' );
require_once( $GLOBALS['THRIFT_ROOT'].'/packages/Hbase/Types.php' );

use Thrift\Transport\TSocket;
use Thrift\Transport\TBufferedTransport;
use Thrift\Protocol\TBinaryProtocol;
use Hbase\HbaseClient;
use Hbase\ColumnDescriptor;
use Hbase\Mutation;

function printRow( $rowresult ) {
  echo( "row: {$rowresult->row}, cols: \n" );
  $values = $rowresult->columns;
  asort( $values );
  foreach ( $values as $k=>$v ) {
    echo( "  {$k} => {$v->value}\n" );
  }
}

$socket = new TSocket( 'localhost', 9090 );
$socket->setSendTimeout( 10000 ); // Ten seconds (too long for production, but this is just a demo ;)
$socket->setRecvTimeout( 20000 ); // Twenty seconds
$transport = new TBufferedTransport( $socket );
$protocol = new TBinaryProtocol( $transport );
$client = new HbaseClient( $protocol );

$transport->open();

$t = 'demo_table';

?><html>
<head>
<title>DemoClient</title>
</head>
<body>
<pre>
<?php

#
# Scan all tables, look for the demo table and delete it.
#
echo( "scanning tables...\n" );
$tables = $client->getTableNames();
sort( $tables );
foreach ( $tables as $name ) {
  echo( "  found: {$name}\n" );
  if ( $name == $t ) {
    if ($client->isTableEnabled( $name )) {
      echo( "    disabling table: {$name}\n");
      $client->disableTable( $name );
    }
    echo( "    deleting table: {$name}\n" );
    $client->deleteTable( $name );
  }
}

#
# Create the demo table with two column families, entry: and unused:
#
$columns = array(
  new ColumnDescriptor( array(
    'name' => 'entry:',
    'maxVersions' => 10
  ) ),
  new ColumnDescriptor( array(
    'name' => 'unused:'
  ) )
);

echo( "creating table: {$t}\n" );
try {
  $client->createTable( $t, $columns );
} catch ( AlreadyExists $ae ) {
  echo( "WARN: {$ae->message}\n" );
}

echo( "column families in {$t}:\n" );
$descriptors = $client->getColumnDescriptors( $t );
asort( $descriptors );
foreach ( $descriptors as $col ) {
  echo( "  column: {$col->name}, maxVer: {$col->maxVersions}\n" );
}
$dummy_attributes = array();
#
# Test UTF-8 handling
#
$invalid = "foo-\xfc\xa1\xa1\xa1\xa1\xa1";
$valid = "foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\xBC\xE3\x83\xAB";

# non-utf8 is fine for data
$mutations = array(
  new Mutation( array(
    'column' => 'entry:foo',
    'value' => $invalid
  ) ),
);
$client->mutateRow( $t, "foo", $mutations, $dummy_attributes );

# try empty strings
$mutations = array(
  new Mutation( array(
    'column' => 'entry:',
    'value' => ""
  ) ),
);
$client->mutateRow( $t, "", $mutations, $dummy_attributes );

# this row name is valid utf8
$mutations = array(
  new Mutation( array(
    'column' => 'entry:foo',
    'value' => $valid
  ) ),
);
$client->mutateRow( $t, $valid, $mutations, $dummy_attributes );

# non-utf8 is not allowed in row names
try {
  $mutations = array(
    new Mutation( array(
      'column' => 'entry:foo',
      'value' => $invalid
    ) ),
  );
  $client->mutateRow( $t, $invalid, $mutations, $dummy_attributes );
  throw new Exception( "shouldn't get here!" );
} catch ( IOError $e ) {
  echo( "expected error: {$e->message}\n" );
}

# Run a scanner on the rows we just created
echo( "Starting scanner...\n" );
$scanner = $client->scannerOpen( $t, "", array( "entry:" ), $dummy_attributes );
try {
  while (true) printRow( $client->scannerGet( $scanner ) );
} catch ( NotFound $nf ) {
  $client->scannerClose( $scanner );
  echo( "Scanner finished\n" );
}

#
# Run some operations on a bunch of rows.
#
for ($e=100; $e>=0; $e--) {

  # format row keys as "00000" to "00100"
  $row = str_pad( $e, 5, '0', STR_PAD_LEFT );

  $mutations = array(
    new Mutation( array(
      'column' => 'unused:',
      'value' => "DELETE_ME"
    ) ),
  );
  $client->mutateRow( $t, $row, $mutations, $dummy_attributes );
  printRow( $client->getRow( $t, $row, $dummy_attributes ));
  $client->deleteAllRow( $t, $row, $dummy_attributes );

  $mutations = array(
    new Mutation( array(
      'column' => 'entry:num',
      'value' => "0"
    ) ),
    new Mutation( array(
      'column' => 'entry:foo',
      'value' => "FOO"
    ) ),
  );
  $client->mutateRow( $t, $row, $mutations, $dummy_attributes );
  printRow( $client->getRow( $t, $row, $dummy_attributes ));

  $mutations = array(
    new Mutation( array(
      'column' => 'entry:foo',
      'isDelete' => 1
    ) ),
    new Mutation( array(
      'column' => 'entry:num',
      'value' => '-1'
    ) ),
  );
  $client->mutateRow( $t, $row, $mutations, $dummy_attributes );
  printRow( $client->getRow( $t, $row, $dummy_attributes ) );

  $mutations = array(
    new Mutation( array(
      'column' => "entry:num",
      'value' => $e
    ) ),
    new Mutation( array(
      'column' => "entry:sqr",
      'value' => $e * $e
    ) ),
  );
  $client->mutateRow( $t, $row, $mutations, $dummy_attributes );
  printRow( $client->getRow( $t, $row, $dummy_attributes ));

  $mutations = array(
    new Mutation( array(
      'column' => 'entry:num',
      'value' => '-999'
    ) ),
    new Mutation( array(
      'column' => 'entry:sqr',
      'isDelete' => 1
    ) ),
  );
  $client->mutateRowTs( $t, $row, $mutations, 1, $dummy_attributes ); # shouldn't override latest
  printRow( $client->getRow( $t, $row, $dummy_attributes ) );

  $versions = $client->getVer( $t, $row, "entry:num", 10, $dummy_attributes );
  echo( "row: {$row}, values: \n" );
  foreach ( $versions as $v ) echo( "  {$v->value};\n" );

  try {
    $client->get( $t, $row, "entry:foo", $dummy_attributes );
    throw new Exception ( "shouldn't get here! " );
  } catch ( NotFound $nf ) {
    # blank
  }

}

$columns = array();
foreach ( $client->getColumnDescriptors($t) as $col=>$desc ) {
  echo("column with name: {$desc->name}\n");
  $columns[] = $desc->name.":";
}

echo( "Starting scanner...\n" );
$scanner = $client->scannerOpenWithStop( $t, "00020", "00040", $columns, $dummy_attributes );
try {
  while (true) printRow( $client->scannerGet( $scanner ) );
} catch ( NotFound $nf ) {
  $client->scannerClose( $scanner );
  echo( "Scanner finished\n" );
}

$transport->close();

?>
</pre>
</body>
</html>


text:
class AliFemtoPair;
class AliFemtoModelManager;
class TH3F;
class TRandom;

/// \class AliFemtoModelCorrFctnTrueQ3D
/// \brief Correlation function storing true momentum in LCMS frame.
///
///
/// Build with the parameters class
///
/// ```cpp
/// AliFemtoModelCorrFctnTrueQ3D *cf = AliFemtoModelCorrFctnTrueQ3D::Build()
///                                        .NamePrefix("MRC")
///                                        .QRange(-.2, .2)
///                                        .BinCount(87)
///                                        .Manager(mc_manager);
///
/// ```
///
/// \author Andrew Kubera, The Ohio State University <andrew.michael.kubera@cern.ch>
///
class AliFemtoModelCorrFctnTrueQ3D : public AliFemtoCorrFctn {
public:

  struct Parameters {
    UInt_t bin_count;
    Double_t qmin;
    Double_t qmax;
    TString prefix;
    bool enable_extra_hists;
    bool enable_extra_denoms;
    AliFemtoModelManager *mc_manager;

    /// Build Parameters object with default values
    static Parameters Default()
    {
      return {
        56, -0.14, 0.14, // histogram bin-count & range
        "CF_TrueQ3D",    // Prefix
        false,           // Enable extra histograms
        false,           // Enable extra denoms
        NULL             // pointer to MC manager
      };
    }

    Parameters NamePrefix(const TString& prefix) const {
      Parameters p(*this);
      p.prefix = prefix;
      return p;
    }
    Parameters Title(const TString& title) const {
      Parameters p(*this);
      p.prefix = title;
      return p;
    }
    Parameters EnableExtraHists(bool t) const {
      Parameters p(*this);
      p.enable_extra_hists = t;
      return p;
    }
    Parameters EnableWeightedDenominators(bool t) const {
      Parameters p(*this);
      p.enable_extra_denoms = t;
      return p;
    }
    Parameters Manager(AliFemtoModelManager *manager) const {
      Parameters p(*this);
      p.mc_manager = manager;
      return p;
    }
    Parameters QRange(Double_t max) const {
      Parameters p(*this);
      p.qmax = std::abs(max);
      p.qmin = -p.qmax;
      return p;
    }
    Parameters QRange(Double_t min, Double_t max) const {
      Parameters p(*this);
      p.qmax = max;
      p.qmin = min;
      return p;
    }
    Parameters BinCount(UInt_t nbins) const {
      Parameters p(*this);
      p.bin_count = nbins;
      return p;
    }
    Parameters NBin(UInt_t nbins) const {
      Parameters p(*this);
      p.bin_count = nbins;
      return p;
    }
    Parameters AxisInfo(UInt_t nbins, Double_t q_max) const {
      Parameters p(*this);
      p.bin_count = nbins;
      p.qmax = std::abs(q_max);
      p.qmin = -p.qmax;
      return p;
    }
    Parameters AxisInfo(UInt_t nbins, Double_t q_min, Double_t q_max) const {
      Parameters p(*this);
      p.bin_count = nbins;
      p.qmin = q_min;
      p.qmax = q_max;
      return p;
    }

    operator AliFemtoModelCorrFctnTrueQ3D*() const {
      return into_ptr();
    }

    AliFemtoModelCorrFctnTrueQ3D* into_ptr() const {
      return new AliFemtoModelCorrFctnTrueQ3D(*this);
    }
  };

  /// Deafult parameters
  ///
  /// - Prefix: "CF_TrueQ3D"
  /// - Binning Paramters: (56, -0.14, 0.14)
  ///
  AliFemtoModelCorrFctnTrueQ3D();

  /// Construct with name-prefix
  ///
  /// Use default binning parameters
  AliFemtoModelCorrFctnTrueQ3D(const char *prefix);

  /// Symmetric constructor
  ///
  /// Construct with nbins from -qmax to qmax in both directions
  AliFemtoModelCorrFctnTrueQ3D(const char *prefix, UInt_t nbins, Double_t qmax);

  /// Custom constructor
  ///
  AliFemtoModelCorrFctnTrueQ3D(const TString &prefix, UInt_t nbins, Double_t aQinvLo, Double_t aQinvHi);

  /// Big Constructor
  ///
  /// enable_extra_hists -- adds four complimentary weighted/unweighted histograms
  ///
  AliFemtoModelCorrFctnTrueQ3D(const TString &prefix,
                               UInt_t nbins,
                               Double_t aQinvLo,
                               Double_t aQinvHi,
                               Bool_t enable_extra_hists,
                               Bool_t enable_extra_denoms);

  /// Unnamed, q-symmetric constructor
  ///
  AliFemtoModelCorrFctnTrueQ3D(UInt_t nbins, Double_t qmax);

  /// Unnamed constructor
  ///
  AliFemtoModelCorrFctnTrueQ3D(UInt_t nbins, Double_t qmin, Double_t qmax);

  /// Construct from parameter object
  ///
  AliFemtoModelCorrFctnTrueQ3D(const Parameters &params);

  /// copy constructor - Structure preserved - no histogram contents copied
  AliFemtoModelCorrFctnTrueQ3D(const AliFemtoModelCorrFctnTrueQ3D& aCorrFctn);

  /// Assignment Operator - unused
  //   AliFemtoModelCorrFctnTrueQ3D& operator=(const AliFemtoModelCorrFctnTrueQ3D& aCorrFctn);

  /// Destructor - histograms destroyed, ModelManager is NOT
  virtual ~AliFemtoModelCorrFctnTrueQ3D();

  ///
  AliFemtoModelCorrFctnTrueQ3D& operator=(const AliFemtoModelCorrFctnTrueQ3D&);

  /// Set the MC model manager
  virtual void SetManager(AliFemtoModelManager *);

  virtual AliFemtoString Report();

  virtual void AddRealPair(AliFemtoPair* aPair);
  virtual void AddMixedPair(AliFemtoPair* aPair);

  /// Finish Data
  virtual void Finish();

  virtual TList* GetOutputList();
  virtual void AddOutputObjectsTo(TCollection &);
  virtual TList* AppendOutputList(TList &);

  virtual AliFemtoCorrFctn* Clone() const;

  Double_t GetQinvTrue(AliFemtoPair*);

  //Special MC analysis for K selected by PDG code -->
  void SetKaonPDG(Bool_t aSetKaonAna);

  /// Get a builder-pattern constructor object
  static Parameters Build()
    { return Parameters(); }

protected:
  AliFemtoModelManager *fManager; //!<! Link back to the manager to retrieve weights

  /// Numerator made with pairs using monte-carlo generated momentum
  TH3F *fNumeratorGenerated;

  /// Numerator made with pairs from the same event
  TH3F *fNumeratorReconstructed;

  /// Numerator made with pairs from the same event - no femto weighting
  TH3F *fNumeratorGenUnweighted;
  TH3F *fNumeratorRecUnweighted;

  /// Denominator with the monte-carlo generated momentum
  TH3F *fDenominatorGenerated;

  /// Denominator with reconstructed data
  TH3F *fDenominatorReconstructed;

  TH3F *fDenominatorGenWeighted;
  TH3F *fDenominatorRecWeighted;

};

inline
void
AliFemtoModelCorrFctnTrueQ3D::SetManager(AliFemtoModelManager *manager)
{
  fManager = manager;
}

inline
AliFemtoCorrFctn*
AliFemtoModelCorrFctnTrueQ3D::Clone() const
{
  return new AliFemtoModelCorrFctnTrueQ3D(*this);
}

#endif


text:
package org.apache.camel.component.elasticsearch5;

import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.impl.DefaultEndpoint;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * The elasticsearch component is used for interfacing with ElasticSearch server using 5.x API.
 */
@UriEndpoint(firstVersion = "2.19.0", scheme = "elasticsearch5", title = "Elasticsearch5", syntax = "elasticsearch5:clusterName", producerOnly = true, label = "monitoring,search")
public class ElasticsearchEndpoint extends DefaultEndpoint {

    private static final Logger LOG = LoggerFactory.getLogger(ElasticsearchEndpoint.class);

    @UriParam
    protected final ElasticsearchConfiguration configuration;

    public ElasticsearchEndpoint(String uri, ElasticsearchComponent component, ElasticsearchConfiguration config) throws Exception {
        super(uri, component);
        this.configuration = config;
    }

    public Producer createProducer() throws Exception {
        return new ElasticsearchProducer(this, configuration);
    }

    public Consumer createConsumer(Processor processor) throws Exception {
        throw new UnsupportedOperationException("Cannot consume from an ElasticsearchEndpoint: " + getEndpointUri());
    }

    public boolean isSingleton() {
        return true;
    }
}


text:
promise_test(async t => {
  const runOrder = [];
  const schedule = (id, priority) => scheduler.postTask(() => { runOrder.push(id); }, {priority});

  // Post tasks in reverse priority order and expect they are run from highest
  // to lowest priority.
  const tasks = [];
  tasks.push(schedule('B1', 'background'));
  tasks.push(schedule('B2', 'background'));
  tasks.push(schedule('UV1', 'user-visible'));
  tasks.push(schedule('UV2', 'user-visible'));
  tasks.push(schedule('UB1', 'user-blocking'));
  tasks.push(schedule('UB2', 'user-blocking'));

  await Promise.all(tasks);

  assert_equals(runOrder.toString(),'UB1,UB2,UV1,UV2,B1,B2');
}, 'Test scheduler.postTask task run in priority order');


text:
import test from 'ava';
import Resource from '../src/Resource';
import applyHooks from './helpers/applyHooks';
import { model } from '../src';

applyHooks(test);

test('should remove a user\'s company', async t => {
  try {
    const user = await model('user').fetchResource('1')
      .then(userResource => (
        userResource.remove('company')
      ));

    t.truthy(user instanceof Resource);
    t.is(user.relationship('company').record._related, false);
  } catch (err) {
    t.fail(err.message);
  }
});


text:
package com.cloud.api.query.dao;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import org.apache.cloudstack.api.response.ProjectInvitationResponse;

import com.cloud.api.query.vo.ProjectInvitationJoinVO;
import com.cloud.projects.ProjectInvitation;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;

@Component
public class ProjectInvitationJoinDaoImpl extends GenericDaoBase<ProjectInvitationJoinVO, Long> implements ProjectInvitationJoinDao {
    public static final Logger s_logger = Logger.getLogger(ProjectInvitationJoinDaoImpl.class);

    private SearchBuilder<ProjectInvitationJoinVO> piIdSearch;

    protected ProjectInvitationJoinDaoImpl() {

        piIdSearch = createSearchBuilder();
        piIdSearch.and("id", piIdSearch.entity().getId(), SearchCriteria.Op.EQ);
        piIdSearch.done();

        this._count = "select count(distinct id) from project_invitation_view WHERE ";
    }

    @Override
    public ProjectInvitationResponse newProjectInvitationResponse(ProjectInvitationJoinVO invite) {
        ProjectInvitationResponse response = new ProjectInvitationResponse();
        response.setId(invite.getUuid());
        response.setProjectId(invite.getProjectUuid());
        response.setProjectName(invite.getProjectName());
        if (invite.getState() != null) {
            response.setInvitationState(invite.getState().toString());
        }

        if (invite.getAccountName() != null) {
            response.setAccountName(invite.getAccountName());
        } else {
            response.setEmail(invite.getEmail());
        }

        response.setDomainId(invite.getDomainUuid());
        response.setDomainName(invite.getDomainName());

        response.setObjectName("projectinvitation");
        return response;
    }

    @Override
    public ProjectInvitationJoinVO newProjectInvitationView(ProjectInvitation proj) {
        SearchCriteria<ProjectInvitationJoinVO> sc = piIdSearch.create();
        sc.setParameters("id", proj.getId());
        List<ProjectInvitationJoinVO> grps = searchIncludingRemoved(sc, null, null, false);
        assert grps != null && grps.size() == 1 : "No project invitation found for id  " + proj.getId();
        return grps.get(0);
    }

}


text:
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import AUtextInput from '@gov.au/text-inputs/lib/js/react.js'
import AUbutton from '@gov.au/buttons/lib/js/react.js'
import AUselect from '@gov.au/select/lib/js/react.js'
import { findSuppliers } from 'marketplace/actions/supplierActions'
import styles from './SellerSelect.scss'

const PanelCategorySelectView = props => (

    <label htmlFor={`${props.id}-category-select`}>{props.label}

      {props.helpLabel}

    {props.description && {props.description}}
    <AUselect
      block
      id={`${props.id}-category-select`}
      options={props.categories}
      onChange={props.onChange}
      defaultValue={props.selectedCategory}
    />

)

export const PanelCategorySelect = props => (

    <PanelCategorySelectView
      id={props.id}
      categories={props.categories}
      onChange={props.onChange}
      selectedCategory={props.selectedCategory}
      label={props.label}
      description={props.description}
      helpLabel={props.helpLabel}
    />

)

PanelCategorySelect.defaultProps = {
  onChange: () => {},
  selectedCategory: '',
  label: 'Panel category',
  helpLabel: 'What you can buy in each category',
  description: ''
}

PanelCategorySelect.propTypes = {
  id: PropTypes.string.isRequired,
  categories: PropTypes.array.isRequired,
  onChange: PropTypes.func,
  selectedCategory: PropTypes.string,
  label: PropTypes.string,
  description: PropTypes.string,
  helpLabel: PropTypes.string
}

const SellerSelectView = props => (

    {props.label}
    {props.showSellerCatalogueLink && (

        View seller catalogue

    )}
    {typeof props.description === 'string' ? (
      {props.description}
    ) : (
      props.description
    )}
    <AUtextInput
      id={props.id}
      placeholder={props.placeholder}
      onChange={props.handleSearchChange}
      value={props.inputValue}
      className={props.className}
      block
    />
    {props.showSearchButton && <AUbutton onClick={props.handleSearchClick}>Search</AUbutton>}

)

const SellerSelectResultsView = props => {
  const { category } = props
  const searchUri = category ? `/search/sellers?role=${encodeURIComponent(category)}&sort_by=a-z` : '/search/sellers'

  return (

 3 ? props.hasManyResultsClassName : ''
      }`}
    >
      {props.noResults && props.searchFor && (

          {props.notFoundMessage}

            Search sellers

      )}
      {props.sellers.map(seller => (

          <a href={`#${seller.code}`} onClick={e => props.handleSellerSelectClick(seller, e)}>
            {seller.name}

      ))}

  )
}

let timeoutHandle = null

export class SellerSelect extends Component {
  constructor(props) {
    super(props)
    this.state = {
      sellers: [],
      inputValue: '',
      noResults: false
    }
    this.handleCategoryChange = this.handleCategoryChange.bind(this)
    this.handleSearchChange = this.handleSearchChange.bind(this)
    this.handleSellerSelectClick = this.handleSellerSelectClick.bind(this)
    this.handleSearchClick = this.handleSearchClick.bind(this)
  }

  categoryIsValid() {
    return (this.props.showCategorySelect && this.props.selectedCategory) || !this.props.showCategorySelect
  }

  handleCategoryChange(e) {
    this.props.onSellerCategorySelect(e.target.value)
    this.setState({
      inputValue: '',
      sellers: []
    })
  }

  handleSearchChange(e) {
    const { briefId } = this.props
    const keyword = e.target.value

    this.setState({
      inputValue: keyword,
      noResults: false
    })

    if (timeoutHandle) {
      clearTimeout(timeoutHandle)
    }

    timeoutHandle = setTimeout(() => {
      if (keyword && keyword.length >= this.props.minimumSearchChars && this.categoryIsValid()) {
        findSuppliers(keyword, this.props.selectedCategory, this.props.allSuppliers ? 'true' : '', briefId)
          .then(data => {
            const noResults = !data.sellers.length > 0
            this.setState({
              sellers: data.sellers,
              noResults
            })
          })
          .catch(() => {})
      } else {
        this.setState({
          sellers: []
        })
      }
    }, 500)
  }

  handleSellerSelectClick(seller, e) {
    e.preventDefault()
    this.setState(curState => {
      const newState = { ...curState }
      newState.sellers = []
      newState.inputValue = this.props.showSelected ? seller.name : ''
      this.props.onSellerSelect(seller)
      return newState
    })
  }

  handleSearchClick() {
    this.props.onSearch(this.state.inputValue)
  }

  render() {
    const categoryData = this.props.categories.find(category => category.value === this.props.selectedCategory)
    const category = categoryData ? categoryData.text : null

    return (

        {this.props.showCategorySelect && (
          <PanelCategorySelectView
            id={this.props.id}
            categories={this.props.categories}
            onChange={this.handleCategoryChange}
            selectedCategory={this.props.selectedCategory}
          />
        )}
        {this.categoryIsValid() && (

            <SellerSelectView
              id={this.props.id}
              placeholder={this.props.placeholder}
              label={this.props.label}
              description={this.props.description}
              handleSearchChange={this.handleSearchChange}
              inputValue={this.state.inputValue}
              className={this.props.showSearchButton ? styles.noRightRadius : ''}
              showSearchButton={this.props.showSearchButton}
              handleSearchClick={this.handleSearchClick}
              showSellerCatalogueLink={this.props.showSellerCatalogueLink}
            />
            {this.state.inputValue.length >= this.props.minimumSearchChars && (
              <SellerSelectResultsView
                category={category}
                className={styles.selectList}
                hasResultsClassName={styles.hasResults}
                hasManyResultsClassName={styles.manyResults}
                sellers={this.state.sellers}
                noResults={this.state.noResults}
                searchFor={this.state.inputValue}
                notFoundMessage={this.props.notFoundMessage}
                handleSellerSelectClick={this.handleSellerSelectClick}
              />
            )}

        )}

    )
  }
}

SellerSelect.defaultProps = {
  briefId: null,
  id: 'seller-search',
  placeholder: '',
  label: '',
  description: '',
  selectedCategory: '',
  notFoundMessage: 'Seller cannot be found in this category.',
  showSelected: true,
  showSearchButton: true,
  showCategorySelect: false,
  allSuppliers: false,
  categories: [],
  minimumSearchChars: 2,
  onSellerSelect: () => {},
  onSellerCategorySelect: () => {},
  onSearch: () => {},
  showSellerCatalogueLink: false
}

SellerSelect.propTypes = {
  briefId: PropTypes.number,
  id: PropTypes.string,
  placeholder: PropTypes.string,
  label: PropTypes.string,
  description: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
  selectedCategory: PropTypes.string,
  notFoundMessage: PropTypes.string,
  showSelected: PropTypes.bool,
  showSearchButton: PropTypes.bool,
  showCategorySelect: PropTypes.bool,
  allSuppliers: PropTypes.bool,
  categories: PropTypes.array,
  minimumSearchChars: PropTypes.number,
  onSellerSelect: PropTypes.func,
  onSellerCategorySelect: PropTypes.func,
  onSearch: PropTypes.func,
  showSellerCatalogueLink: PropTypes.bool
}

export default SellerSelect


text:
angular.module('espacoVC').directive('photoGallery', function() {
  return {
  	restrict: 'E',
  	scope:{ data: '=data', interval:'=interval', idweek:'=idweek'},
    templateUrl: 'directives/photo-gallery/photo-gallery.html',
    controller: function ($scope, myService, $modal){

	  	$scope.setPhotos = function (id){
	  		if(id == 0){
	  			$scope.photos=$scope.data;
	  		}
	  		else{
	  			$scope.photos=[];
	  			angular.forEach($scope.data, function(photo){
	  				if(photo.yearweek == id){
	  					$scope.photos.push(photo);
	  				}
	  			});
	  		}
	  	};

	  	$scope.setWeek = function(idweek){
	  		$scope.week="Todas as Fotos";
	  		if($scope.photos != "" && $scope.photos != null && $scope.photos != undefined){
		  		for(var i = 0; i<$scope.photos.length;i++){
		  			if($scope.photos[i].yearweek == idweek){
		  				$scope.week = "Semana: "+$scope.photos[i].startdate + " - " + $scope.photos[i].enddate;
		  				return;
		  			}
		  		}
		  	}
	  	};

	  	$scope.$watch('idweek', function() {
       		$scope.setPhotos($scope.idweek);
       		$scope.setWeek($scope.idweek);
   		});

	  	$scope.open = function (index) {

    		var modalInstance = $modal.open({
		      templateUrl: 'modals/photo-modal/photo-modal.html',
		      controller: 'photoModalCtrl',
		      size: 'lg',
		      resolve: {
		        items: function () {
		          return $scope.photos;
		        },
		        index: function (){
		        	return index;
		        }
		      }
    		});
    	};

    	$scope.setPhotos();

    	// $filter('orderBy')(array, expression, reverse)

    	//implement sort of array

    }
  };
});


text:
Django Location Field
==

Let users pick locations using a map widget and store its latitude and longitude.

**Stable version:** [1.6.1](https://pypi.python.org/pypi/django-location-field/1.6.1)
**Beta version:** [2.0.0b0](https://pypi.python.org/pypi/django-location-field/2.0.0b0)

**License:** MIT

Development Notice
--

The master branch contains unstable code for the 2.x release, that is not ready for production.

You must refer to the [1.6.1 tag](https://github.com/caioariede/django-location-field/tree/1.6.1) for a stable release.

Status
--

[![Build Status](https://travis-ci.org/caioariede/django-location-field.svg?branch=master)](https://travis-ci.org/caioariede/django-location-field)

Tests are performed with Python 2.7, Django 1.7 1.8 and SpatiaLite. We'd like to have automated tests for Python 3 too, but it looks like pysqlite (which is used for testing) does not support it yet, so it's blocking us. You can get more details in the [tox.ini](https://github.com/caioariede/django-location-field/blob/master/tox.ini#L40) file.

Features
--

* Support for multiple map engines, like Google Maps, OpenStreetMap and Mapbox.
* Works with both Spatial and non-Spatial databases.

Compatibility
--

* Django 1.7 to 1.9
* Python 2.7 to 3.5

Spatial Databases
--

* PostGIS
* SpatiaLite

Installation
--

1. Install through pip (or manually place it on your `PYTHONPATH`).

    `pip install django-location-field`

2. Add `location_field.apps.DefaultConfig` to `INSTALLED_APPS` your **settings.py** file

For example, PostGIS:

    https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/postgis/

Basic usage (using Spatial Database)
--

    from django.contrib.gis.db import models
    from django.contrib.gis.geos import Point
    from location_field.models.spatial import LocationField

    class Place(models.Model):
        city = models.CharField(max_length=255)
        location = LocationField(based_fields=['city'], zoom=7, default=Point(1.0, 1.0))
        objects = models.GeoManager()

Look that you must put `models.GeoManager()` in your model, or some errors will occur.

Basic usage (without Spatial Database)
--

    from django.db import models
    from location_field.models.plain import PlainLocationField

    class Place(models.Model):
        city = models.CharField(max_length=255)
        location = PlainLocationField(based_fields=['city'], zoom=7)

Screenshot
--

![Screenshot](https://github.com/caioariede/django-location-field/raw/master/screenshot.png)


text:
<?php

class Settings_Profiles_Detail_View extends Settings_Vtiger_Index_View {

	public function process(Vtiger_Request $request) {
		$recordId = $request->get('record');
		$moduleName = $request->getModule();
		$qualifiedModuleName = $request->getModule(false);

		$recordModel = Settings_Profiles_Record_Model::getInstanceById($recordId);

		$viewer = $this->getViewer($request);
		$viewer->assign('MODULE', $moduleName);
		$viewer->assign('RECORD_ID', $recordId);
		$viewer->assign('RECORD_MODEL', $recordModel);
		$viewer->assign('ALL_BASIC_ACTIONS', Vtiger_Action_Model::getAllBasic(true));
		$viewer->assign('ALL_UTILITY_ACTIONS', Vtiger_Action_Model::getAllUtility(true));
		$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());

		$viewer->view('DetailView.tpl', $qualifiedModuleName);
	}

}


text:
package info.re4k.asfc.croudia;

import java.util.ArrayList;
import java.util.List;

public interface ResponseList<T,E> extends List<T>{
	public E getParam();

	public ArrayList<T> getList();
}


text:
newproperty(:contents) do
  include EasyType

  desc "What does the tablespace contain? permanent, temporary of undo data"

  newvalues(:permanent, :temporary, :undo)

  to_translate_to_resource do | raw_resource|
    value = raw_resource.column_data('CONTENTS').downcase.to_sym
    if value == :permanent
    	nil
    else
    	value
    end
  end
end