text:
package com.xconns.peerdevicenet.utils;

import java.io.IOException;
import java.io.InputStream;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;

import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManagerFactory;

import android.content.Context;
import android.util.Log;

import com.xconns.peerdevicenet.router.R;

public class SecureSocketFactory implements SocketFactory {
	public final static String TAG = "SecureSocketFactory";
	private static volatile SecureSocketFactory instance = null;
	private static volatile Object lock = new Object();

	private Context context = null;
	private static final String keystorePassword = "SamQuah";

	// SSL related
	SSLContext sslContext = null;
	TrustManagerFactory trustManagerFactory = null;
	KeyManagerFactory keyManagerFactory = null;

	protected SecureSocketFactory(Context c) {
		context = c;
		initSSLContext();
	}

	public static SecureSocketFactory getInstance(Context c) {
		if (instance == null) {
			synchronized (lock) {
				if (instance == null) {
					instance = new SecureSocketFactory(c);
				}
			}
		}
		Log.d(TAG, "SecureSocketFactory instance returned");

		return instance;
	}

	private void initSSLContext() {
		Log.d(TAG, "Creating SSL socket factory");

		InputStream clientTruststoreIs = context.getResources()
				.openRawResource(R.raw.routertruststore);
		KeyStore trustStore = null;
		try {
			trustStore = KeyStore.getInstance("BKS");
			trustStore.load(clientTruststoreIs, keystorePassword.toCharArray());
			clientTruststoreIs.close();

			System.out.println("Loaded peer certificate: " + trustStore.size());
		} catch (KeyStoreException kse) {
			kse.printStackTrace();
		} catch (CertificateException ce) {
			ce.printStackTrace();
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		} catch (IOException ioe) {
			ioe.printStackTrace();
		}

		// initialize trust manager factory with the read truststore
		try {
			trustManagerFactory = TrustManagerFactory
					.getInstance(TrustManagerFactory.getDefaultAlgorithm());
			trustManagerFactory.init(trustStore);
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		} catch (KeyStoreException kse) {
			kse.printStackTrace();
		}

		// setup client certificate

		// load client certificate
		InputStream keyStoreStream = context.getResources().openRawResource(
				R.raw.router);
		KeyStore keyStore = null;

		try {
			keyStore = KeyStore.getInstance("BKS");
			keyStore.load(keyStoreStream, keystorePassword.toCharArray());
			keyStoreStream.close();

			System.out.println("Loaded my certificates: " + keyStore.size());
		} catch (KeyStoreException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NoSuchAlgorithmException ne) {
			// TODO Auto-generated catch block
			ne.printStackTrace();
		} catch (CertificateException ce) {
			// TODO Auto-generated catch block
			ce.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		// initialize key manager factory with the read client certificate
		try {
			keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory
					.getDefaultAlgorithm());
			keyManagerFactory.init(keyStore, keystorePassword.toCharArray());
		} catch (KeyStoreException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NoSuchAlgorithmException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnrecoverableKeyException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		// initialize SSL context
		try {
			sslContext = SSLContext.getInstance("TLS");
			sslContext.init(keyManagerFactory.getKeyManagers(),
					trustManagerFactory.getTrustManagers(), null);
		} catch (KeyManagementException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NoSuchAlgorithmException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public SSLServerSocket newServerSocket() {
		SSLServerSocketFactory fact = (SSLServerSocketFactory) sslContext.getServerSocketFactory();
		SSLServerSocket sock = null;
		try {
			sock = (SSLServerSocket)fact.createServerSocket();
		} catch(IOException ioe) {
			Log.d(TAG, ioe.getMessage());
		}
		return sock;
	}

	public SSLServerSocket newServerSocket(int port) {
		SSLServerSocketFactory fact = (SSLServerSocketFactory) sslContext.getServerSocketFactory();
		SSLServerSocket sock = null;
		try {
			sock = (SSLServerSocket)fact.createServerSocket(port);
		} catch(IOException ioe) {
			Log.d(TAG, ioe.getMessage());
		}
		return sock;
	}

	public SSLSocket newClientSocket() {
		SSLSocketFactory fact = (SSLSocketFactory) sslContext.getSocketFactory();
		SSLSocket sock = null;
		try {
			sock = (SSLSocket)fact.createSocket();
		} catch(IOException ioe) {
			Log.d(TAG, ioe.getMessage());
		}
		return sock;
	}
}


text:
package voldemort.client;

import voldemort.VoldemortException;

/**
 * The exception thrown when bootstrapping the store from the cluster fails
 * (e.g. because none of the given nodes could be connected to). This is
 * generally an unrecoverable failure.
 *
 * @author jay
 *
 */
public class BootstrapFailureException extends VoldemortException {

    private static final long serialVersionUID = 1L;

    public BootstrapFailureException() {}

    public BootstrapFailureException(String message, Throwable cause) {
        super(message, cause);
    }

    public BootstrapFailureException(String message) {
        super(message);
    }

    public BootstrapFailureException(Throwable cause) {
        super(cause);
    }

}

redpajama_set_name: RedPajamaGithub


text:
select top(5) FirstName, LastName from Employees
order by Salary desc


text:
class SwiProlog < Formula
  desc "ISO/Edinburgh-style Prolog interpreter"
  homepage "http://www.swi-prolog.org/"
  url "http://www.swi-prolog.org/download/stable/src/swipl-7.2.3.tar.gz"
  sha256 "43657d51b7c5887bc2d2bced50a9822b86a08a6841399b8e76ee877f51d646b5"

  bottle do
    sha256 "9466d3335c7675046a2ef8e5886a2c3eb852a6d1e13b3bc064e76b9a9a775b29" => :el_capitan
    sha256 "b6dbf92ebdc159642b9e4e8d5e7689d2fdb4bd51ee106f325c85d97885b7b40e" => :yosemite
    sha256 "50ba51c36829d3a39c3bcda5e842175199d216d2a8e6ec2c11adc91a656dc5f0" => :mavericks
  end

  devel do
    url "http://www.swi-prolog.org/download/devel/src/swipl-7.3.24.tar.gz"
    sha256 "4fd337d0817373c7c8d59cce5324e068be316d28dc3e81877075cd51168dd7cd"
  end

  head do
    url "https://github.com/SWI-Prolog/swipl-devel.git"

    depends_on "autoconf" => :build
  end

  option "with-lite", "Disable all packages"
  option "with-jpl", "Enable JPL (Java Prolog Bridge)"
  option "with-xpce", "Enable XPCE (Prolog Native GUI Library)"

  deprecated_option "lite" => "with-lite"

  depends_on "pkg-config" => :build
  depends_on "readline"
  depends_on "gmp"
  depends_on "openssl"
  depends_on "libarchive" => :optional

  if build.with? "xpce"
    depends_on :x11
    depends_on "jpeg"
  end

  fails_with :llvm do
    build 2335
    cause "Exported procedure chr_translate:chr_translate_line_info/3 is not defined"
  end

  def install
    # The archive package hard-codes a check for MacPort libarchive
    # Replace this with a check for Homebrew's libarchive, or nowhere
    if build.with? "libarchive"
      inreplace "packages/archive/configure.in", "/opt/local",
                                                 Formula["libarchive"].opt_prefix
    else
      ENV.append "DISABLE_PKGS", "archive"
    end

    args = ["--prefix=#{libexec}", "--mandir=#{man}"]
    ENV.append "DISABLE_PKGS", "jpl" if build.without? "jpl"
    ENV.append "DISABLE_PKGS", "xpce" if build.without? "xpce"

    # SWI-Prolog's Makefiles don't add CPPFLAGS to the compile command, but do
    # include CIFLAGS. Setting it here. Also, they clobber CFLAGS, so including
    # the Homebrew-generated CFLAGS into COFLAGS here.
    ENV["CIFLAGS"] = ENV.cppflags
    ENV["COFLAGS"] = ENV.cflags

    # Build the packages unless --with-lite option specified
    args << "--with-world" if build.without? "lite"

    # './prepare' prompts the user to build documentation
    # (which requires other modules). '3' is the option
    # to ignore documentation.
    system "echo 3 | ./prepare" if build.head?
    system "./configure", *args
    system "make"
    system "make", "install"

    bin.write_exec_script Dir["#{libexec}/bin/*"]
  end

  test do
    (testpath/"test.pl").write <<-EOS.undent
      test :-
          write('Homebrew').
    EOS
    assert_equal "Homebrew", shell_output("#{bin}/swipl -s #{testpath}/test.pl -g test -t halt")
  end
end


text:
package com.piticlistudio.playednext.collection.model.entity.datasource;

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
import io.realm.annotations.Required;

/**
 * Representation on Realm of ICollection entity
 * @see ICollectionData
 * Created by jorge.garcia on 10/02/2017.
 */

public class RealmCollection extends RealmObject implements ICollectionData {

    @PrimaryKey
    private int id;

    @Required
    private String name;

    public RealmCollection() {
        // Empty
    }

    public RealmCollection(int id, String name) {
        this.id = id;
        this.name = name;
    }

    /**
     * Returns the id
     *
     * @return the id
     */
    @Override
    public int getId() {
        return id;
    }

    /**
     * Returns the name
     *
     * @return the name
     */
    @Override
    public String getName() {
        return name;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
    <!-- scan service package all the type with annotation -->
    <context:component-scan base-package="com.netease.seckill.service.impl"/>

    <!-- transaction config manager -->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <!-- annotation config -->
    <tx:annotation-driven transaction-manager="transactionManager"/>
</beans>


text:
using System;
using System.Collections;
using System.IO;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Channels.Ipc;
using System.Runtime.Remoting.Channels;
using System.Runtime.Serialization.Formatters;
using System.Security.Principal;
using System.Runtime.Remoting;
using System.Security.Permissions;
using System.Threading;
using System.Windows.Forms;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.TestTools.TestAdapter;
using Microsoft.VisualStudio.TestTools.Vsip;
using Microsoft.Win32;
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;

namespace Microsoft.TC.TestHostAdapters
{
    ///
    /// Interface used by Host Adapter (Agent side) to get the Addin from Visual Studio process.
    ///
    [ComVisible(true)]
    [Guid(Constants.IVsIdeTestHostAddinGuidString)]
    [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Vs")]
    [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Addin")]
    public interface IVsIdeTestHostAddin
    {
        [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]   // This is not a simle property and does things behind the scene.
        ITestAdapter GetHostSide();
        object RemoteExecute(string path, string className, string FunctionName, params object[] objs);
        int GetHostProcessId();

    }

    ///
    /// The object implementing Visual Studio Addin.
    /// Hosts an instance of HostAdapterHostSide that is used to drive/run tests in Visual Studio process.
    ///
    /// <seealso class='IDTExtensibility2' />
    [Guid(Constants.VsIdeTestHostAddinGuidString)]
    [ComVisible(true)]
    [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")]  // Lifetime is managed by VS Addin manager, so don't do IDisposable.
    [SuppressMessage("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase")]  // Be consistent with VS Primary Interop Assemblies.
    [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Addin")]
    public sealed class VsIdeTestHostAddin : MarshalByRefObject, IDTExtensibility2, IVsIdeTestHostAddin
    {
        private DTE2 m_applicationObject;
        private IChannel m_serverChannel;
        private IChannel m_clientChannel;
        private HostAdapterHostSide m_hostSide;
        private ServiceProvider m_serviceProvider;
        private object m_hostLock = new object();
        private ManualResetEvent m_hostInitializedEvent = new ManualResetEvent(false);
        private bool m_hostInitialized; // Whether VS we use to run the tests is initialized; static in case if VS creaes 2 instances.

        [SuppressMessage("Microsoft.Performance", "CA1802:UseLiteralsWhereAppropriate")]     // Cannot use const for initializer that calls a property.
        private static readonly int s_onConnectionTimeout = RegistrySettings.BaseTimeout * 5;

        /// Constructor.
        public VsIdeTestHostAddin()
        {
        }

        /// Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded.
        /// <param term='application'>Root object of the host application.</param>
        /// <param term='connectMode'>Describes how the Add-in is being loaded.</param>
        /// <param term='addInInst'>Object representing this Add-in.</param>
        /// <seealso class='IDTExtensibility2' />
        [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#")]
        [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "1#")]
        [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "2#")]
        [CLSCompliant(false)]
        [SecurityPermission(SecurityAction.Demand, Unrestricted = true)] // Process.Id has LinkDemand for Unrestricted.
        public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
        {
            Trace.WriteLine(string.Format(
                CultureInfo.InvariantCulture,
                "[pid={0,4}, tid={1,2}, {2:yyyy}/{2:MM}/{2:dd} {2:HH}:{2:mm}:{2:ss}.{2:fff}] VsIdeTestHostAddin.OnConnection",
                System.Diagnostics.Process.GetCurrentProcess().Id,
                System.Threading.Thread.CurrentThread.ManagedThreadId,
                DateTime.Now));

            if (RegistryHelper<int>.GetValueIgnoringExceptions(
                    Registry.CurrentUser, RegistrySettings.HostAdapterRegistryKeyName,
                    "EnableDebugBreak",
                    0) == 1)
            {
                System.Diagnostics.Debugger.Break();
            }

            // The idea about connection modes is to make sure we are initialized
            // after 1st OnConnection is called. Because this is when VS thinks that
            // addin is ready and returns it to outside.
            if (connectMode == ext_ConnectMode.ext_cm_UISetup ||    // When VS sets up UI for Addin.
                connectMode == ext_ConnectMode.ext_cm_Startup ||    // When VS is started.
                connectMode == ext_ConnectMode.ext_cm_AfterStartup) // When loading from Tools->Addin Manager.
            {
                try
                {
                    lock (m_hostLock)   // Protect from calling with different modes at the same time.
                    {
                        DTE2 dteApplication = (DTE2)application;
                        Debug.Assert(dteApplication != null, "OnConnect: (DTE2)application = null!");

                        if (!m_hostInitialized) // When loading from Tools->Addin Manager.
                        {
                            m_applicationObject = dteApplication;

                            SetupChannels();

                            InitHostSide();

                            m_hostInitialized = true;
                            m_hostInitializedEvent.Set();
                        }
                    }
                }
                catch (Exception ex)
                {
                    Debug.Fail("Addin.OnConnection: " + ex.ToString());
                    throw;
                }
            }
        }

        ///
        /// Initialize the Host Side.
        /// This can be called from OnConnect by Addin AND from GetHostSide by Host Adapter.
        ///
        private void InitHostSide()
        {
            try
            {
                lock (m_hostLock)
                {
                    if (m_hostSide == null)
                    {
                        Debug.Assert(m_applicationObject != null, "HostSide.InitHostSide: m_applicationObject is null!");

                        m_serviceProvider = new ServiceProvider((IOleServiceProvider)m_applicationObject);
                        Debug.Assert(m_serviceProvider != null, "VsIdeTestHostAddin.InitHostSide: failed to init service provider!");

                        m_hostSide = new HostAdapterHostSide(m_serviceProvider);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.Fail("HA.InitHostSide: " + ex.ToString());
                throw;
            }
        }

        /// Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded.
        /// <param term='disconnectMode'>Describes how the Add-in is being unloaded.</param>
        /// <param term='custom'>Array of parameters that are host application specific.</param>
        /// <seealso class='IDTExtensibility2' />
        [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#")]
        [CLSCompliant(false)]
        [SecurityPermission(SecurityAction.Demand, Infrastructure = true)]    // RemotingServices.Disconnect has LinkDemand for Infrastructure.
        public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
        {
            m_hostSide.Dispose();
            CleanupChannels();
            RemotingServices.Disconnect(this);
        }

        /// Implements the OnAddInsUpdate method of the IDTExtensibility2 interface. Receives notification when the collection of Add-ins has changed.
        /// <param term='custom'>Array of parameters that are host application specific.</param>
        /// <seealso class='IDTExtensibility2' />
        public void OnAddInsUpdate(ref Array custom)
        {
        }

        /// Implements the OnStartupComplete method of the IDTExtensibility2 interface. Receives notification that the host application has completed loading.
        /// <param term='custom'>Array of parameters that are host application specific.</param>
        /// <seealso class='IDTExtensibility2' />
        public void OnStartupComplete(ref Array custom)
        {
        }

        /// Implements the OnBeginShutdown method of the IDTExtensibility2 interface. Receives notification that the host application is being unloaded.
        /// <param term='custom'>Array of parameters that are host application specific.</param>
        /// <seealso class='IDTExtensibility2' />
        public void OnBeginShutdown(ref Array custom)
        {
        }

        ///
        /// Obtains the Host Side.
        ///
        [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]   // This is not a simle property and does things behind the scene.
        ITestAdapter IVsIdeTestHostAddin.GetHostSide()
        {
            // Wait for OnConnection to initialize the addin.
            bool waitSucceeded = m_hostInitializedEvent.WaitOne(s_onConnectionTimeout, false);
            Debug.Assert(waitSucceeded, "Timed out waiting for OnConnection to initialize.");

            lock (m_hostLock)
            {
                Debug.Assert(m_hostInitialized, "Addin.GetHostSide: m_hostInitialized is false!");

                InitHostSide();
                Debug.Assert(m_hostSide != null, "m_hostSide is null!");
            }

            return m_hostSide;
        }

        object IVsIdeTestHostAddin.RemoteExecute(string path, string className, string FunctionName, params object[] objs)
        {
            object retObject = null;
            Assembly testAssembly = null;
            Type typ = null;

            try
            {
                testAssembly = Assembly.LoadFrom(path);
            }
            catch (Exception e)
            {
                throw new Exception("Exception during load assembly", e);
            }

            typ = testAssembly.GetType(className);
            if (typ == null)
                throw new Exception(string.Format("Class {0} not found in test assembly {1}", className, testAssembly.FullName));

            MethodInfo mi = typ.GetMethod(FunctionName);
            if (mi == null)
                throw new Exception(string.Format("Method {0} not found in class {1}. Check the VS method name to Invoke for typos", FunctionName, className));

            try
            {
                // get required method by specifying name and invoke it
                retObject = mi.Invoke(0, objs);
            }
            catch (ArgumentException e)
            {
                throw new Exception("ArgumentException during invokation of VS method - check your arguments to Invoke", e);
            }
            catch (Exception e)
            {
                throw new Exception("Exception during invokation of VS Method", e);
            }

            return retObject;
        }

        int IVsIdeTestHostAddin.GetHostProcessId()
        {
            return System.Diagnostics.Process.GetCurrentProcess().Id;
        }

        ///
        /// Set up remoting communication channels.
        ///
        private void SetupChannels()
        {
            lock (m_hostLock)
            {
                // If channels are not set up yet, set them up.
                if (m_serverChannel == null)
                {
                    Debug.Assert(m_clientChannel == null);

                    // This channel is used for debugging session, when TA connects to authoring vs instance.
                    BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
                    serverProvider.TypeFilterLevel = TypeFilterLevel.Full;  // Enable remoting objects as arguments.
                    Hashtable props = new Hashtable();
                    string channelNamePrefix = "EqtVsIdeHostAdapterAddin_";
                    string serverChannelName = channelNamePrefix + Guid.NewGuid() + "_ServerChannel";
                    props["name"] = serverChannelName;
                    props["portName"] = serverChannelName;           // Must be different from client's port.
                    // Default IpcChannel security is: allow for all users who can authorize on this machine.
                    props["authorizedGroup"] = WindowsIdentity.GetCurrent().Name;
                    m_serverChannel = new IpcServerChannel(props, serverProvider);
                    ChannelServices.RegisterChannel(m_serverChannel, false);

                    // This channel is used for connecting to both authoring and host side VS.
                    m_clientChannel = new IpcClientChannel(channelNamePrefix + Guid.NewGuid() + "_ClientChannel", new BinaryClientFormatterSinkProvider());
                    ChannelServices.RegisterChannel(m_clientChannel, false);
                }
            }
        }

        ///
        /// Clean up communication channels.
        ///
        private void CleanupChannels()
        {
            lock (m_hostLock)
            {
                if (m_serverChannel != null)
                {
                    ChannelServices.UnregisterChannel(m_serverChannel);
                    m_serverChannel = null;
                }

                if (m_clientChannel != null)
                {
                    ChannelServices.UnregisterChannel(m_clientChannel);
                    m_clientChannel = null;
                }
            }
        }

        ///
        /// Controls lifetime of the object.
        /// We return null which means infinite lifetime since we in OnDisconnect to manually unregister the object from .Net remoting.
        ///
        [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
        public override object InitializeLifetimeService()
        {
            return null;
        }
    }
}


text:
require "jcrop_ahead/engine"

module JcropAhead
end

require "jcrop_ahead/attachable"


text:
package tomas.ochoa;

/**
 * Created by Tom's Desktop on 3/10/2016.
 *
 *      You operate several hot dog stands distributed throughout town. Define a class
 * named HotDogStand that has;
 *      1. An instance variable for the hot dog stand's ID number
 *      2. An instance variable for how many hot dogs the stand has sold that day
 *
 *      - Create a constructor that allows a user of the class to initialize both values
 *
 *      - Create a method named justSold that increments by one the number of hot
 *        dogs the stand has sold
 *        - The idea is that this method will be invoked each time the stand sells a hot dog
 *          so that you can track the total number of hot dogs sold by the stand.
 *
 *      - A method that returns the number of hot dogs sold
 *      - A static variable that tracks the total number of hot dogs sold by all hot dog stands
 *      - A static method that returns the value in this variable
 *
 *      - Write a main method to test your class with at least three hot dog stands that each
 *      sell a variety of hot dogs.
 *
 */
public class HotDogStand
{
//static variable to keep track of the total number of dogs sold
    private static int TOTAL_HOT_DOGS_SOLD = 0;

    private int id;                 //id num of stand
    private int hotDogsSoldToday;   //variable to hold dogs sold that day

    /**
     *  Two argument Constructor.
     * @param i
     *      The ID number of the stand
     * @param sold
     *      The amount of hot dogs sold
     * */
    public HotDogStand(int i, int sold)
    {
        id = i;
        hotDogsSoldToday = sold;
        TOTAL_HOT_DOGS_SOLD += hotDogsSoldToday;
    }
    /**
     * Method that increments both the amount of hot dogs sold that day
     * and the total sold by the stand.
     * */
    public void justSold()
    {
        hotDogsSoldToday++;
        TOTAL_HOT_DOGS_SOLD++;
    }
    /**
     * Accessor method that returns the number of hot dogs sold that day by the stand
     * @return Returns the value of dogs sold that day
     * */
    public int getHotDogsSoldToday()
    {
        return this.hotDogsSoldToday;
    }
    /**
     * Static accessor method that returns the total amount of hot dogs sold
     * @return Returns the total amount sold by all stands
     * */
    public static int getTotalHotDogsSold()
    {
        return TOTAL_HOT_DOGS_SOLD;
    }

    public static void main(String args[])
    {
        // Class variables
        HotDogStand stand1 = new HotDogStand(1,45);
        HotDogStand stand2 = new HotDogStand(2,85);
        HotDogStand stand3 = new HotDogStand(3,1234);

        // Loop to sell hot dogs for stand1
        for (int i = 0;i < 10;i ++)
        {
            // Each stand just sold 1 hot dog
            stand1.justSold();

        }
        // Loop to sell hot dogs for stand2
        for (int i = 0;i < 100;i ++)
        {
            // Each stand just sold 1 hot dog
            stand2.justSold();
        }
        // Loop to sell hot dogs for stand3
        for (int i = 0;i < 1000;i ++)
        {
            // Each stand just sold 1 hot dog
            stand3.justSold();
        }
        // Display results
        System.out.println("Stand 1 has now sold " + stand1.getHotDogsSoldToday() + " hot dogs!");
        System.out.println("Stand 2 has now sold " + stand2.getHotDogsSoldToday() + " hot dogs!");
        System.out.println("Stand 3 has now sold " + stand3.getHotDogsSoldToday() + " hot dogs!\n");
        System.out.println("The stands have accumulateively sold " + getTotalHotDogsSold() + " today!");
    }
}


text:
Rent A Cat

A warm cuddly murder-beast for you to enjoy and return.

About Cattr

Cat ipsum dolor sit amet, love to play with owner's hair tie eat a plant, kill a hand. Chase imaginary bugs burrow under covers. Missing until dinner time chase the pig around the house for behind the couch, yet chase the pig around the house damn that dog lick butt. Peer out window, chatter at birds, lure them to mouth refuse to drink water except out of someone's glass or attack feet behind the couch, and sun bathe, yet hunt anything that moves.

Unwrap toilet paper. White cat sleeps on a black shirt scratch leg; meow for can opener to feed me refuse to drink water except out of someone's glass use lap as chair, but the dog smells bad and immediately regret falling into bathtub for refuse to drink water except out of someone's glass.

Poop in litter box, scratch the walls eat from dog's food and find empty spot in cupboard and sleep all day for jump around on couch, meow constantly until given food, so purr while eating. Hide head under blanket so no one can see fall over dead (not really but gets sypathy) mew for bathe private parts with tongue then lick owner's face or spit up on light gray carpet instead of adjacent linoleum.

Get Started!

You can have a cat on your doorstep in less than 24 hours!

dssdf

                    Get Your Cat Now!

Contact Cattr

Feel free to email us to provide some feedback on our services, give us suggestions for new services and breeds, or to just say hello!

feedback@cattr.com

                         Twitter

                         Github


text:
require "chef/knife"
require "chef/knife/supermarket_unshare"

class Chef
  class Knife
    class CookbookSiteUnshare < Knife::SupermarketUnshare

    # Handle the subclassing (knife doesn't do this :()
      dependency_loaders.concat(superclass.dependency_loaders)
      options.merge!(superclass.options)

      banner "knife cookbook site unshare COOKBOOK (options)"
      category "cookbook site"

    end
  end
end


text:
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gauge.Example.Implementation.Pages
{
    public class BankingLoginPage : BasePage
    {
        public static string Url = BaseUrl;

        [FindsBy(How = How.Name, Using = "uid")]
        public IWebElement txtUserID;

        [FindsBy(How = How.Name, Using = "password")]
        public IWebElement txtPassword;

        [FindsBy(How = How.Name, Using = "btnLogin")]
        public IWebElement btnLogin;
    }
}


text:
package tabix

import (
	"encoding/binary"
	"errors"
	"fmt"
	"io"
	"strings"

	"github.com/biogo/hts/bgzf"
	"github.com/biogo/hts/bgzf/index"
	"github.com/biogo/hts/internal"
)

// Index is a tabix index.
type Index struct {
	Format    byte
	ZeroBased bool

	NameColumn  int32
	BeginColumn int32
	EndColumn   int32

	MetaChar rune
	Skip     int32

	refNames []string
	nameMap  map[string]int

	idx internal.Index
}

// New returns a new tabix index.
func New() *Index {
	return &Index{nameMap: make(map[string]int)}
}

// NumRefs returns the number of references in the index.
func (i *Index) NumRefs() int {
	return len(i.idx.Refs)
}

// Names returns the reference names in the index. The returned
// slice should not be altered.
func (i *Index) Names() []string {
	return i.refNames
}

// IDs returns a map of strings to integer IDs. The returned
// map should not be altered.
func (i *Index) IDs() map[string]int {
	return i.nameMap
}

// ReferenceStats returns the index statistics for the given reference and true
// if the statistics are valid.
func (i *Index) ReferenceStats(id int) (stats index.ReferenceStats, ok bool) {
	s := i.idx.Refs[id].Stats
	if s == nil {
		return index.ReferenceStats{}, false
	}
	return index.ReferenceStats(*s), true
}

// Unmapped returns the number of unmapped reads and true if the count is valid.
func (i *Index) Unmapped() (n uint64, ok bool) {
	if i.idx.Unmapped == nil {
		return 0, false
	}
	return *i.idx.Unmapped, true
}

// Record wraps types that may be indexed by an Index.
type Record interface {
	RefName() string
	Start() int
	End() int
}

type tabixShim struct {
	id, start, end int
}

func (r tabixShim) RefID() int { return r.id }
func (r tabixShim) Start() int { return r.start }
func (r tabixShim) End() int   { return r.end }

// Add records the SAM record as having being located at the given chunk.
func (i *Index) Add(r Record, c bgzf.Chunk, placed, mapped bool) error {
	refName := r.RefName()
	rid, ok := i.nameMap[refName]
	if !ok {
		rid = len(i.refNames)
		i.refNames = append(i.refNames, refName)
	}
	shim := tabixShim{id: rid, start: r.Start(), end: r.End()}
	return i.idx.Add(shim, internal.BinFor(r.Start(), r.End()), c, placed, mapped)
}

// Chunks returns a []bgzf.Chunk that corresponds to the given genomic interval.
func (i *Index) Chunks(ref string, beg, end int) ([]bgzf.Chunk, error) {
	id, ok := i.nameMap[ref]
	if !ok {
		return nil, index.ErrNoReference
	}
	chunks, err := i.idx.Chunks(id, beg, end)
	if err != nil {
		return nil, err
	}
	return adjacent(chunks), nil
}

var adjacent = index.Adjacent

// MergeChunks applies the given MergeStrategy to all bins in the Index.
func (i *Index) MergeChunks(s index.MergeStrategy) {
	i.idx.MergeChunks(s)
}

var tbiMagic = [4]byte{'T', 'B', 'I', 0x1}

// ReadFrom reads the tabix index from the given io.Reader. Note that
// the tabix specification states that the index is stored as BGZF, but
// ReadFrom does not perform decompression.
func ReadFrom(r io.Reader) (*Index, error) {
	var (
		idx   Index
		magic [4]byte
		err   error
	)
	err = binary.Read(r, binary.LittleEndian, &magic)
	if err != nil {
		return nil, err
	}
	if magic != tbiMagic {
		return nil, errors.New("tabix: magic number mismatch")
	}

	var n int32
	err = binary.Read(r, binary.LittleEndian, &n)
	if err != nil {
		return nil, err
	}
	if n == 0 {
		return nil, nil
	}

	err = readTabixHeader(r, &idx)
	if err != nil {
		return nil, err
	}
	if len(idx.refNames) != int(n) {
		return nil, fmt.Errorf("tabix: name count mismatch: %d != %d", len(idx.refNames), n)
	}
	idx.nameMap = make(map[string]int)
	for i, n := range idx.refNames {
		idx.nameMap[n] = i
	}

	idx.idx, err = internal.ReadIndex(r, n, "tabix")
	if err != nil {
		return nil, err
	}
	return &idx, nil
}

func readTabixHeader(r io.Reader, idx *Index) error {
	var (
		format int32
		err    error
	)
	err = binary.Read(r, binary.LittleEndian, &format)
	if err != nil {
		return fmt.Errorf("tabix: failed to read format: %v", err)
	}
	idx.Format = byte(format)
	idx.ZeroBased = format&0x10000 != 0

	err = binary.Read(r, binary.LittleEndian, &idx.NameColumn)
	if err != nil {
		return fmt.Errorf("tabix: failed to read name column index: %v", err)
	}
	err = binary.Read(r, binary.LittleEndian, &idx.BeginColumn)
	if err != nil {
		return fmt.Errorf("tabix: failed to read begin column index: %v", err)
	}
	err = binary.Read(r, binary.LittleEndian, &idx.EndColumn)
	if err != nil {
		return fmt.Errorf("tabix: failed to read end column index: %v", err)
	}
	err = binary.Read(r, binary.LittleEndian, &idx.MetaChar)
	if err != nil {
		return fmt.Errorf("tabix: failed to read metacharacter: %v", err)
	}
	err = binary.Read(r, binary.LittleEndian, &idx.Skip)
	if err != nil {
		return fmt.Errorf("tabix: failed to read skip count: %v", err)
	}
	var n int32
	err = binary.Read(r, binary.LittleEndian, &n)
	if err != nil {
		return fmt.Errorf("tabix: failed to read name lengths: %v", err)
	}
	nameBytes := make([]byte, n)
	_, err = io.ReadFull(r, nameBytes)
	if err != nil {
		return fmt.Errorf("tabix: failed to read names: %v", err)
	}
	names := string(nameBytes)
	if names[len(names)-1] != 0 {
		return errors.New("tabix: last name not zero-terminated")
	}
	idx.refNames = strings.Split(names[:len(names)-1], string(rune(0)))

	return nil
}

// WriteTo writes the index to the given io.Writer. Note that
// the tabix specification states that the index is stored as BGZF, but
// WriteTo does not perform compression.
func WriteTo(w io.Writer, idx *Index) error {
	err := binary.Write(w, binary.LittleEndian, tbiMagic)
	if err != nil {
		return err
	}

	err = binary.Write(w, binary.LittleEndian, int32(len(idx.idx.Refs)))
	if err != nil {
		return err
	}
	err = writeTabixHeader(w, idx)
	if err != nil {
		return err
	}

	return internal.WriteIndex(w, &idx.idx, "tabix")
}

func writeTabixHeader(w io.Writer, idx *Index) error {
	var err error
	format := int32(idx.Format)
	if idx.ZeroBased {
		format |= 0x10000
	}
	err = binary.Write(w, binary.LittleEndian, format)
	if err != nil {
		return fmt.Errorf("tabix: failed to write format: %v", err)
	}
	err = binary.Write(w, binary.LittleEndian, idx.NameColumn)
	if err != nil {
		return fmt.Errorf("tabix: failed to write name column index: %v", err)
	}
	err = binary.Write(w, binary.LittleEndian, idx.BeginColumn)
	if err != nil {
		return fmt.Errorf("tabix: failed to write begin column index: %v", err)
	}
	err = binary.Write(w, binary.LittleEndian, idx.EndColumn)
	if err != nil {
		return fmt.Errorf("tabix: failed to write end column index: %v", err)
	}
	err = binary.Write(w, binary.LittleEndian, idx.MetaChar)
	if err != nil {
		return fmt.Errorf("tabix: failed to write metacharacter: %v", err)
	}
	err = binary.Write(w, binary.LittleEndian, idx.Skip)
	if err != nil {
		return fmt.Errorf("tabix: failed to write skip count: %v", err)
	}
	var n int32
	for _, name := range idx.refNames {
		n += int32(len(name) + 1)
	}
	err = binary.Write(w, binary.LittleEndian, n)
	if err != nil {
		return fmt.Errorf("tabix: failed to write name lengths: %v", err)
	}
	for _, name := range idx.refNames {
		_, err = w.Write([]byte(name))
		if err != nil {
			return fmt.Errorf("tabix: failed to write name: %v", err)
		}
		_, err = w.Write([]byte{0})
		if err != nil {
			return fmt.Errorf("tabix: failed to write name: %v", err)
		}
	}
	return nil
}


text:
<!DOCTYPE html>

    <title>Drools Workbench</title>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="-1">

    <link rel="stylesheet" href="org.drools.workbench.DroolsWorkbench/css/patternfly.min.css">
    <link rel="stylesheet" href="org.drools.workbench.DroolsWorkbench/css/uberfire-loading.css">
    <link rel="stylesheet" href="org.drools.workbench.DroolsWorkbench/css/uberfire-showcase.css">

    <link rel="shortcut icon" href="images/drools.gif" type="image/gif"/>
    <link rel="icon" href="images/drools.gif" type="image/gif"/>

Please wait

                Loading application...


text:
<Record>
<Term>Pneumoperitoneum</Term>
<SemanticType>Disease or Syndrome</SemanticType>
<ParentTerm>Peritoneal Diseases</ParentTerm>
<ClassificationPath>Digestive System Diseases/Peritoneal Diseases/Pneumoperitoneum</ClassificationPath>
<BroaderTerm>Pneumoperitoneum</BroaderTerm>
<BroaderTerm>Digestive System Diseases</BroaderTerm>
<BroaderTerm>Peritoneal Diseases</BroaderTerm>
<Synonym>Pneumoperitoneum</Synonym>
<Description>A condition with trapped gas or air in the PERITONEAL CAVITY, usually secondary to perforation of the internal organs such as the LUNG and the GASTROINTESTINAL TRACT, or to recent surgery. Pneumoperitoneum may be purposely introduced to aid radiological examination.</Description>
<Source>MeSH</Source>
</Record>


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Annls Sci. Nat. , Bot. , sér. 6 19: 212 (1884)

#### Original name
Mucor parasiticus Bainier, 1884

### Remarks
null


text:
package co.phoenixlab.hearthstone.hearthcapturelib.packets;

/**
 * Unknown packet. From Hearthy.
 *
 * @author Vincent Zhang
 */
public class Packet123DebugConsoleCommand extends CapturePacket {

    //  No fields?

}


text:
package com.adriencadet.wanderer.services;

/**
 * ServiceErrors
 * <p>
 */
public class ServiceErrors {
    private ServiceErrors() {
    }

    public static class NoConnection extends Throwable {

    }

    public static class ServerError extends Throwable {

    }
}


text:
/* { dg-do run } */
/* { dg-options "-O2 -ffast-math -msse -mfpmath=sse -mrecip" } */
/* { dg-require-effective-target sse } */
#include "sse-check.h"

extern float sqrtf (float);
float __attribute__((noinline)) broken (float a, float b)
{
  return sqrtf (a / b);
}

extern void abort (void);
extern void *memcpy (void *, const void *, __SIZE_TYPE__);
static void
sse_test (void)
{
  int i;
  float x;
  char buf[sizeof (float)];
  x = broken (0.0f, 10000.0f);
  /* A convoluted way to check for the correct result (zero) for all
     floating point formats.
     We can't use ==, !=, or range checks, or isinf/isnan/isunordered,
     because all of these will not do the right thing under -ffast-math,
     as they can assume that neither nan nor inf are returned.  */
  memcpy (&buf, &x, sizeof (float));
  for (i = 0; i < sizeof (float); i++)
    if (buf[i] != 0)
      abort ();
}


text:
@interface BEScannerView : UIView

@property (nonatomic, readonly) BOOL isAnimating;
@property (nonatomic, assign) CGFloat maskAlpha;
@property (nonatomic, assign) CGFloat sweepDuration;
@property (nonatomic, assign) CGFloat fadeDuration;

- (void)hide;
- (void)hide:(BOOL)animate;
- (void)hide:(BOOL)animate completion:(void(^)(BOOL finished))completion;
- (void)show;
- (void)show:(BOOL)animate;
- (void)show:(BOOL)animate completion:(void(^)(BOOL finished))completion;

@end


text:
package org.template.ecommercerecommendation

import io.prediction.controller.IEngineFactory
import io.prediction.controller.Engine

case class Query(
  user: String,
  num: Int,
  categories: Option[Set[String]],
  whiteList: Option[Set[String]],
  blackList: Option[Set[String]]
) extends Serializable

case class PredictedResult(
  itemScores: Array[ItemScore]
) extends Serializable

case class ItemScore(
  item: String,
  score: Double
) extends Serializable

object ECommerceRecommendationEngine extends IEngineFactory {
  def apply() = {
    new Engine(
      classOf[DataSource],
      classOf[Preparator],
      Map("als" -> classOf[ALSAlgorithm]),
      classOf[Serving])
  }
}


text:
package ru.mipt.acsl;

public class FlyingDeviceComponent
{
	public static final String FQN = "ru.mipt.acsl.FlyingDevice";

}


text:
layout: post
title: Thanks for registering for SRCCON
logo: srccon_logo.png
---

WOO! You are registered for SRCCON and should have a confirmation in your inbox. Next, you may want to check our hotel and travel recommendations and local logistics info or look over the sessions selected for SRCCON.

If you don’t see the email in the next few minutes, please check your spam folder and double-check your Eventbrite email address settings.


text:
/*
 * Discovered -o-link from,
 * http://groups.google.com/groups?q=opera+styles+xml&start=10&hl=en&lr=&ie=UTF-8&newwindow=1&selm=opr6pgr0tgicz8n2%40news.opera.com&rnum=18
 */
ulink {
	-o-link: attr(url);
	-o-link-source: current;
}

/*
 * Given the above rule, it makes sense to have this here too, though it's
 * not Opera-specific
 */
ulink:focus {
	outline: 1px dotted invert;
}

/* this was in the example I found, but it doesn't achive much */
imagedata {
	-o-replace: attr(fileref)
}


text:
package org.jetbrains.idea.svn.integrate;

/**
 * Created with IntelliJ IDEA.
 * User: Irina.Chernushina
 * Date: 3/27/13
 * Time: 7:53 PM
 */
public enum QuickMergeContentsVariants {
  all, select, cancel, showLatest
}


text:
<?php

// Intelligently remove extra P and BR tags around shortcodes that WordPress likes to add
function cf_shortcode_empty_paragraph_fix($content) {
  $array = array (
    '
[' => '[',
    ']
' => ']',
    ']
' => ']',
    ']
' => ']'
  );

  $content = strtr( $content, $array );
  return $content;
}
add_filter( 'acf_the_content', 'cf_shortcode_empty_paragraph_fix' );

// We need to be able to figure out the attributes of a wrapped shortcode
function bs_attribute_map($str, $att = null) {
    $res = array();
    $return = array();
    $reg = get_shortcode_regex();
    preg_match_all('~'.$reg.'~',$str, $matches);
    foreach($matches[2] as $key => $name) {
        $parsed = shortcode_parse_atts($matches[3][$key]);
        $parsed = is_array($parsed) ? $parsed : array();

            $res[$name] = $parsed;
            $return[] = $res;
        }
    return $return;
}

// anchor shortcode
function anchor_func( $atts ) {

  extract( shortcode_atts( array(
    'name' => 'example'
  ), $atts ) );

  $anchor = ' ';

  return $anchor;
}
add_shortcode( 'anchor', 'anchor_func' );

// row shortcode
function row_func( $atts, $content = null ) {

  $row = '
'.do_shortcode($content).'
';

   return $row;
}
add_shortcode( 'row', 'row_func' );

// columns shortcode
function column_func( $atts, $content = null ) {

  extract( shortcode_atts( array(
    'width' => '6',
    'breakpoint' => 'md'
  ), $atts ) );

  $column = '
'.do_shortcode($content).'
';

  return $column;
}
add_shortcode( 'col', 'column_func' );

// card shortcode
function card_func( $atts, $content = null ) {

  extract( shortcode_atts( array(
    'title' => 'Sample Title',
    'color' => 'gold'
  ), $atts ) );

  $card  = '
'.esc_attr($title).'';
  $card .=   '
';
  $card .=     '
';
  $card .=       do_shortcode($content);
  $card .=     '
';
  $card .=   '
';
  $card .= '
';

  return $card;
}
add_shortcode( 'card', 'card_func' );

// contact form shortcode
function contact_func( $atts, $content = null ) {

  $lasso_account = get_field('lasso_account', 'option');
  $lasso_uid = get_field('lasso_uid', 'option');
  $lasso_client = get_field('lasso_client', 'option');
  $lasso_project = get_field('lasso_project', 'option');

  $pages = get_pages(array(
    'meta_key' => '_wp_page_template',
    'meta_value' => 'template-process-contact.php'
  ));
  $processForm = array_pop($pages);

  $contact  =  '<form method="post" action="'.get_permalink($processForm->ID).'" id="contact-form">';
  $contact .=    '<input type="hidden" name="domainAccountId" value="'.$lasso_account.'">';
  $contact .=    '<input type="hidden" name="guid" value="">';
  $contact .=    '<input type="hidden" name="LassoUID" value="'.$lasso_uid.'">';
  $contact .=    '<input type="hidden" name="ClientID" value="'.$lasso_client.'">';
  $contact .=    '<input type="hidden" name="ProjectID" value="'.$lasso_project.'">';
  $contact .=    '
';
  $contact .=      '<fieldset>';
  $contact .=        '
';
  $contact .=          'Desired Home*';
  $contact .=          '
';
  $contact .=            '
';
  $contact .=              '<select id="contact_home" name="contact_home" class="required">';
  $contact .=                '<option value="">Please Choose</option>';
  $contact .=                '<option value="189380">Estate Collection</option>';
  $contact .=                '<option value="189379">City Collection</option>';
  $contact .=              '</select>Please Choose';
  $contact .=              '
';
  $contact .=                '
Please Choose
';
  $contact .=                '
Estate Collection
';
  $contact .=                '
City Collection
';
  $contact .=              '
';
  $contact .=            '
';
  $contact .=          '
';
  $contact .=        '
';
  $contact .=        '
';
  $contact .=          'First Name*';
  $contact .=          '
';
  $contact .=            '<input type="text" id="contact_fname" name="contact_fname" class="form-control">';
  $contact .=          '
';
  $contact .=        '
';
  $contact .=        '
';
  $contact .=          'Last Name*';
  $contact .=          '
';
  $contact .=            '<input type="text" id="contact_lname" name="contact_lname" class="form-control">';
  $contact .=          '
';
  $contact .=        '
';
  $contact .=        '
';
  $contact .=          'Phone Number*';
  $contact .=          '
';
  $contact .=            '<input type="text" id="contact_phone" name="contact_phone" placeholder="555-555-5555" class="form-control">';
  $contact .=          '
';
  $contact .=        '
';
  $contact .=        '
';
  $contact .=          'Email Address*';
  $contact .=          '
';
  $contact .=            '<input type="text" id="contact_email" name="contact_email" class="form-control">';
  $contact .=          '
';
  $contact .=        '
';
  $contact .=        '
';
  $contact .=          '
';
  $contact .=            'Do You Have a Broker?';
  $contact .=            '
';
  $contact .=              '';
  $contact .=                '<input type="radio" name="contact_broker" value="148931">Yes';
  $contact .=              '';
  $contact .=              '';
  $contact .=                '<input type="radio" name="contact_broker" value="148932">No';
  $contact .=              '';
  $contact .=            '
';
  $contact .=          '
';
  $contact .=          '
';
  $contact .=            'Referral Source';
  $contact .=            '
';
  $contact .=              '<input type="text" id="contact_referral" name="contact_referral" placeholder="Washington Post" class="form-control">';
  $contact .=            '
';
  $contact .=          '
';
  $contact .=        '
';
  $contact .=      '</fieldset>';
  $contact .=      '
';
  $contact .=        '<button type="submit" class="btn submit">Submit</button>*required';
  $contact .=      '
';
  $contact .=    '
';
  $contact .=    '
'.do_shortcode($content).'
';
  $contact .=  '</form>';

  return $contact;
}
add_shortcode( 'contact_form', 'contact_func' );

/*--------------------------------------------------------------------------------------
    *
    * bs_tabs
    *
    * @author Filip Stefansson
    * @since 1.0
    * Modified by TwItCh twitch@designweapon.com
    * Now acts a whole nav/tab/pill shortcode solution!
    *-------------------------------------------------------------------------------------*/
  function bs_tabs( $atts, $content = null ) {

    if( isset( $GLOBALS['tabs_count'] ) )
      $GLOBALS['tabs_count']++;
    else
      $GLOBALS['tabs_count'] = 0;

    $GLOBALS['tabs_default_count'] = 0;

    $div_class = 'tabs-wrapper';

    $id = 'custom-tabs-'. $GLOBALS['tabs_count'];

    $atts_map = bs_attribute_map( $content );

    // Extract the tab titles for use in the tab widget.
    if ( $atts_map ) {
      $tabs = array();
      $GLOBALS['tabs_default_active'] = true;
      foreach( $atts_map as $check ) {
          if( !empty($check["tab"]["active"]) ) {
              $GLOBALS['tabs_default_active'] = false;
          }
      }
      $i = 0;
      foreach( $atts_map as $tab ) {

        $class  ='';
        $class .= ( !empty($tab["tab"]["active"]) || ($GLOBALS['tabs_default_active'] && $i == 0) ) ? 'active' : '';
        $class .= ( !empty($tab["tab"]["xclass"]) ) ? ' ' . $tab["tab"]["xclass"] : '';

        $tabs[] = sprintf(
          '

%s

',
          ( !empty($class) ) ? ' class="' . $class . '"' : '',
          'custom-tab-' . $GLOBALS['tabs_count'] . '-' . md5($tab["tab"]["title"]),
          $tab["tab"]["title"]
        );
        $i++;
      }
    }
    return sprintf(
      '
%s

%s
',
      esc_attr( $id ),
      ( $tabs )  ? implode( $tabs ) : '',
      esc_attr( $div_class ),
      do_shortcode( $content )
    );
  }
  add_shortcode( 'tabs', 'bs_tabs' );

  /*--------------------------------------------------------------------------------------
    *
    * bs_tab
    *
    * @author Filip Stefansson
    * @since 1.0
    *
    *-------------------------------------------------------------------------------------*/
  function bs_tab( $atts, $content = null ) {

  $atts = shortcode_atts( array(
      'title'   => false,
      'active'  => false,
  ), $atts );

    if( $GLOBALS['tabs_default_active'] && $GLOBALS['tabs_default_count'] == 0 ) {
        $atts['active'] = true;
    }
    $GLOBALS['tabs_default_count']++;

    $class  = 'tab';
    $class .= ( $atts['active'] == 'true' ) ? ' active' : '';

    $id = 'custom-tab-'. $GLOBALS['tabs_count'] . '-'. md5( $atts['title'] );

    return sprintf(
      '
%s
',
      esc_attr( $id ),
      esc_attr( $class ),
      do_shortcode( $content )
    );

  }
add_shortcode( 'tab', 'bs_tab' );


text:
package org.apache.camel.example.cxf.httptojms;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.cxf.CxfComponent;
import org.apache.camel.component.cxf.CxfEndpoint;
import org.apache.camel.component.properties.PropertiesComponent;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.test.AvailablePortFinder;
import org.apache.hello_world_soap_http.Greeter;

/**
 * An example for demonstrating how Camel works as a Router.
 * This example shows how Camel can route a SOAP client's HTTP request
 * to a SOAP over JMS Service.
 */
public final class CamelCxfExample {
    private static final String ROUTER_ADDRESS = "http://localhost:{{routerPort}}/SoapContext/SoapPort";
    private static final String SERVICE_ADDRESS = "jms:jndi:dynamicQueues/test.soap.jmstransport.queue?jndiInitialContextFactory="
            + "org.apache.activemq.jndi.ActiveMQInitialContextFactory&jndiConnectionFactoryName="
            + "ConnectionFactory&jndiURL=vm://localhost";
    private static final String SERVICE_CLASS = "serviceClass=org.apache.hello_world_soap_http.Greeter";
    private static final String WSDL_LOCATION = "wsdlURL=wsdl/hello_world.wsdl";
    private static final String SERVICE_NAME = "serviceName={http://apache.org/hello_world_soap_http}SOAPService";
    private static final String SOAP_OVER_HTTP_ROUTER = "portName={http://apache.org/hello_world_soap_http}SoapOverHttpRouter";

    private static final String ROUTER_ENDPOINT_URI = "cxf://" + ROUTER_ADDRESS + "?" + SERVICE_CLASS + "&"
                                                   + WSDL_LOCATION + "&" + SERVICE_NAME + "&" + SOAP_OVER_HTTP_ROUTER + "&dataFormat=POJO";

    private CamelCxfExample() {
    }

    public static class MyRouteBuilder extends RouteBuilder {

        @Override
        public void configure() throws Exception {
            // Set system properties for use with Camel property placeholders for running the example tests.
            System.setProperty("routerPort", String.valueOf(AvailablePortFinder.getNextAvailable()));
            System.setProperty("servicePort", String.valueOf(AvailablePortFinder.getNextAvailable()));
            CxfComponent cxfComponent = new CxfComponent(getContext());
            CxfEndpoint serviceEndpoint = new CxfEndpoint(SERVICE_ADDRESS, cxfComponent);
            serviceEndpoint.setServiceClass(Greeter.class);

            // Here we just pass the exception back, don't need to use errorHandler
            errorHandler(noErrorHandler());
            from(ROUTER_ENDPOINT_URI).to(serviceEndpoint);
        }

    }

    public static void main(String args[]) throws Exception {

        // Set system properties for use with Camel property placeholders for running the examples.
        System.setProperty("routerPort", "9001");
        System.setProperty("servicePort", "9003");

        // START SNIPPET: e1
        CamelContext context = new DefaultCamelContext();
        // END SNIPPET: e1
        PropertiesComponent pc = new PropertiesComponent();
        context.addComponent("properties", pc);
        // Set up the JMS broker and the CXF SOAP over JMS server
        // START SNIPPET: e2
        JmsBroker broker = new JmsBroker();
        Server server = new Server();
        try {
            broker.start();
            server.start();
            // END SNIPPET: e2
            // Add some configuration by hand ...
            // START SNIPPET: e3
            context.addRoutes(new RouteBuilder() {
                public void configure() {
                    CxfComponent cxfComponent = new CxfComponent(getContext());
                    CxfEndpoint serviceEndpoint = new CxfEndpoint(SERVICE_ADDRESS, cxfComponent);
                    serviceEndpoint.setServiceClass(Greeter.class);
                    // Here we just pass the exception back, don't need to use errorHandler
                    errorHandler(noErrorHandler());
                    from(ROUTER_ENDPOINT_URI).to(serviceEndpoint);
                }
            });
            // END SNIPPET: e3
            String address = ROUTER_ADDRESS.replace("{{routerPort}}", System.getProperty("routerPort"));
            // Starting the routing context
            // Using the CXF Client to kick off the invocations
            // START SNIPPET: e4
            context.start();
            Client client = new Client(address + "?wsdl");
            // END SNIPPET: e4
            // Now everything is set up - let's start the context

            client.invoke();
            Thread.sleep(1000);
            context.stop();
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
            server.stop();
            broker.stop();
            System.exit(0);
        }

    }
}


text:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>

  <!-- General -->
  <category label="001">
    <setting id="debug" type="bool" label="002" default="false" />
    <setting id="autostart" type="bool" label="003" default="true" />
    <setting id="port" type="number" label="005" default="59994" />
    <setting id="timeout" type="number" label="004" enable="!eq(-1,true)" default="15" />
  </category>
</settings>


text:
namespace gfx {

GLImageIOSurface::GLImageIOSurface(const gfx::Size& size) : size_(size) {
}

GLImageIOSurface::~GLImageIOSurface() {
  DCHECK(!io_surface_);
}

bool GLImageIOSurface::Initialize(const gfx::GpuMemoryBufferHandle& handle) {
  io_surface_.reset(IOSurfaceLookup(handle.io_surface_id));
  if (!io_surface_) {
    LOG(ERROR) << "IOSurface lookup failed";
    return false;
  }

  return true;
}

void GLImageIOSurface::Destroy(bool have_context) {
  io_surface_.reset();
}

gfx::Size GLImageIOSurface::GetSize() { return size_; }

bool GLImageIOSurface::BindTexImage(unsigned target) {
  if (target != GL_TEXTURE_RECTANGLE_ARB) {
    // This might be supported in the future. For now, perform strict
    // validation so we know what's going on.
    LOG(ERROR) << "IOSurface requires TEXTURE_RECTANGLE_ARB target";
    return false;
  }

  CGLContextObj cgl_context =
      static_cast<CGLContextObj>(GLContext::GetCurrent()->GetHandle());

  DCHECK(io_surface_);
  CGLError cgl_error = CGLTexImageIOSurface2D(cgl_context,
                                              target,
                                              GL_RGBA,
                                              size_.width(),
                                              size_.height(),
                                              GL_BGRA,
                                              GL_UNSIGNED_INT_8_8_8_8_REV,
                                              io_surface_.get(),
                                              0);
  if (cgl_error != kCGLNoError) {
    LOG(ERROR) << "Error in CGLTexImageIOSurface2D";
    return false;
  }

  return true;
}

bool GLImageIOSurface::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
                                            int z_order,
                                            OverlayTransform transform,
                                            const Rect& bounds_rect,
                                            const RectF& crop_rect) {
  return false;
}

}  // namespace gfx


text:
<?php

namespace digiwebdev\spaceman\views;

class Head {

     public static function html ( $array ) {
        ?>
<!DOCTYPE html>

<html <?= $array[ 'lang' ] ?> id="no-js">
    <head>
        <title><?= self::title( $array ) ?></title>
        <meta charset="<?= self::charSet( $array ) ?>">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <?= self::metaData( $array );
            self::links( $array );
            self::scripts( $array ) ?>
    </head>
        <?php
     }
}


text:
class Episode < ApplicationRecord
  include EpisodeBase

  belongs_to :novel

  scope :synthesized, -> { where(synthesized: true) }
  scope :unsynthesized, -> { where(synthesized: false) }

  delegate :ncode, to: :novel

  def archive!
    transaction do
      ArchivedEpisode.create!(
        ncode: ncode,
        number: number,
        title: title,
      )
      destroy!
    end
  end
end


text:
const addEventStepper = (state = {stepIndex: 0}, action) => {
  switch (action.type) {
    case 'ADD_EVENT_NEXT':
      // console.log(action.values)
      // console.log('next step')
      return {stepIndex: state.stepIndex + 1}
    case 'ADD_EVENT_PREV':
      return {stepIndex: state.stepIndex - 1}
    case 'ADD_EVENT_RESET':
      return {stepIndex: 0}
    default:
      return state
  }
}

export default addEventStepper


text:
#pragma once

#include "CSSSelector.h"

namespace WebCore {

struct PseudoClassOrCompatibilityPseudoElement {
    CSSSelector::PseudoClassType pseudoClass;
    CSSSelector::PseudoElementType compatibilityPseudoElement;
};

PseudoClassOrCompatibilityPseudoElement parsePseudoClassAndCompatibilityElementString(const StringView& pseudoTypeString);
CSSSelector::PseudoElementType parsePseudoElementString(const StringImpl& pseudoTypeString);

} // namespace WebCore


text:
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
    <name>Naming_Exclusions__c</name>
    <help>[世帯名] オプションを選択すると、この取引先責任者が世帯名から除外されます。注意: 現在、[世帯の公式の挨拶] オプションと [世帯の非公式の挨拶] オプションは既存の製品機能に結び付けられていません。</help>
    <label>命名除外</label>
    <picklistValues>
        <masterLabel>Household__c.Name</masterLabel>
        <translation>Household__c.Name</translation>
    </picklistValues>
    <picklistValues>
        <masterLabel>Household__c.Formal_Greeting__c</masterLabel>
        <translation>Household__c.Formal_Greeting__c</translation>
    </picklistValues>
    <picklistValues>
        <masterLabel>Household__c.Informal_Greeting__c</masterLabel>
        <translation>Household__c.Informal_Greeting__c</translation>
    </picklistValues>
</CustomFieldTranslation>


text:
<?php
require "allscripturls.php";
header("Content-type: text/javascript");

$removeLogging = ("false" != $_POST["logging"]);

function doCommand($js, $commandStr) {
	$file = fopen("temp.js", "w");
	fwrite($file, $js);
	fclose($file);
	system($commandStr . " >tempout.js");
	$output = file_get_contents("tempout.js");
	unlink("temp.js");
	unlink("tempout.js");
	return $output;
}

function googleSimple($js) {
	return doCommand($js, "java -jar compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS <temp.js");
}

function googleAdvanced($js) {
	return doCommand($js, "java -jar compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS <temp.js");
}

for ($i = 0, $len = count($scripts); $i < $len; $i++) {
    if ($removeLogging) {
        $scriptLines = file('../js/' . $scripts[$i]);
        $allLines = array();
        for ($j = 0, $jLen = count($scriptLines); $j < $jLen; $j++) {
            $line = $scriptLines[$j];
            if (    !preg_match("/^\\s*log\\.(trace|debug|info|warn|error|fatal|time|timeEnd|group|groupEnd)/", $line) &&
                    !preg_match("/^\\s*var\s+log\\s*=/", $line)) {
                $allLines[] = $line;
            }
        }
        if ($_GET['compress']) {
            echo googleSimple(implode($allLines));
        } else {
            echo implode($allLines);
        }
    } else {
        require '../js/' . $scripts[$i];
    }
}

?>


text:
require 'test/unit'
require 'helper'
class TestSearchBiomodel < Test::Unit::TestCase

  def setup
    @instance = SysMODB::SearchBiomodel.instance
  end

  def test_find_all_models
    puts "\n\n ---------------------find all models---------------------\n\n"
    response = []
    i=0
    response = @instance.get_all_models
    response.each { |x| puts "Response #{i+=1}:   #{x[:key].to_s} " }
    response.each { |x| assert_not_nil x[:key] }
    assert_not_nil response
  end

  def test_search_by_chebiid
    puts "\n\n ---------------------search by chebiid---------------------\n\n"
    response = []
    i = 0
    response = @instance.search_by_chebiid("CHEBI:15422")
    response.each { |x| puts "Response #{i+=1}:   #{x} " }
    response.each { |x| assert_not_nil x }
    assert_not_nil response
  end

  def test_search_by_incorrect_chebiid
    puts "\n\n ---------------------search by incorrect chebiid---------------------\n\n"
    response = []
    i = 0
    response = @instance.search_by_chebiid("THIS IS NOT A VALID CHEBIID!!!!!

")
    response.each { |x| puts "Response #{i+=1}:   #{x} " }
    response.each { |x| assert_not_nil x }
    assert_not_nil response
  end

  def test_search_by_name
    puts "\n\n ---------------------model ID by name---------------------\n\n"
    response = []
    i = 0
    response = @instance.search_by_name("Kolomeisky2003") #_MyosinV_Processivity")
    response.each { |x| puts "Response #{i+=1}:   #{x} " }
    response.each { |x| assert_not_nil x }
    assert_not_nil response
  end

  def test_search_by_incorrect_name
    puts "\n\n ---------------------model ID by incorrect name---------------------\n\n"
    response = []
    i = 0
    response = @instance.search_by_name("THIS IS NOT A VALID NAME!!!!!

") #_MyosinV_Processivity")
    response.each { |x| puts "Response #{i+=1}:   #{x} " }
    response.each { |x| assert_not_nil x }
    assert_not_nil response
  end

  def test_get_model_name_by_id
    puts "\n\n ---------------------model name by ID---------------------\n\n"
    response = @instance.get_model_name_by_id("BIOMD0000000190")
    puts response
    assert_not_nil response
  end

  def test_get_model_name_by_incorrect_id
    puts "\n\n ---------------------model name by incorrect ID---------------------\n\n"
    response = @instance.get_model_name_by_id("THIS IS NOT A VALID ID!!!!!

")
    puts response
    assert_not_nil response
  end

  def test_search_id_by_person
    puts "\n\n ---------------------model ID by person---------------------\n\n"
    response = []
    i=0
    response = @instance.search_by_person("Jim")
    response.each { |x| puts "Response #{i+=1}:    #{x} " }
    response.each { |x| assert_not_nil x }
    assert_not_nil response
  end

  def test_search_by_incorrect_person
    puts "\n\n ---------------------model ID by incorrect person---------------------\n\n"
    response = []
    i=0
    response = @instance.search_by_person("THIS IS NOT A VALID PERSONS NAME!!!!!

")
    response.each { |x| puts "Response #{i+=1}:    #{x} " }
    response.each { |x| assert_not_nil x }
    assert_not_nil response
  end

end


text:
import * as React from "react";

import type { Nullable } from "core/types";
import type { Observer } from "core/Misc/observable";
import type { IExplorerAdditionalNode, IExplorerExtensibilityGroup } from "core/Debug/debugLayer";
import type { Scene } from "core/scene";
import { EngineStore } from "core/Engines/engineStore";

import { TreeItemComponent } from "./treeItemComponent";
import Resizable from "re-resizable";
import { HeaderComponent } from "../headerComponent";
import { SceneTreeItemComponent } from "./entities/sceneTreeItemComponent";
import { Tools } from "../../tools";
import type { GlobalState } from "../../components/globalState";
import { DefaultRenderingPipeline } from "core/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline";
import { Vector3 } from "core/Maths/math";
import { PointLight } from "core/Lights/pointLight";
import { FreeCamera } from "core/Cameras/freeCamera";
import { DirectionalLight } from "core/Lights/directionalLight";
import { SSAORenderingPipeline } from "core/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline";
import { NodeMaterial } from "core/Materials/Node/nodeMaterial";
import { ParticleHelper } from "core/Particles/particleHelper";
import { GPUParticleSystem } from "core/Particles/gpuParticleSystem";
import { SSAO2RenderingPipeline } from "core/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline";
import { StandardMaterial } from "core/Materials/standardMaterial";
import { PBRMaterial } from "core/Materials/PBR/pbrMaterial";
import { SpriteManager } from "core/Sprites/spriteManager";
import type { TargetCamera } from "core/Cameras/targetCamera";
import type { Camera } from "core/Cameras/camera";

// side effects
import "core/Sprites/spriteSceneComponent";
import "core/Audio/audioSceneComponent";
import "core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent";

import "./sceneExplorer.scss";

interface ISceneExplorerFilterComponentProps {
    onFilter: (filter: string) => void;
}

export class SceneExplorerFilterComponent extends React.Component<ISceneExplorerFilterComponentProps> {
    constructor(props: ISceneExplorerFilterComponentProps) {
        super(props);
    }

    render() {
        return (

                <input type="text" placeholder="Filter" onChange={(evt) => this.props.onFilter(evt.target.value)} />

        );
    }
}

interface ISceneExplorerComponentProps {
    scene: Scene;
    gizmoCamera?: Camera;
    noCommands?: boolean;
    noHeader?: boolean;
    noExpand?: boolean;
    noClose?: boolean;
    extensibilityGroups?: IExplorerExtensibilityGroup[];
    additionalNodes?: IExplorerAdditionalNode[];
    globalState: GlobalState;
    popupMode?: boolean;
    onPopup?: () => void;
    onClose?: () => void;
}

export class SceneExplorerComponent extends React.Component<ISceneExplorerComponentProps, { filter: Nullable<string>; selectedEntity: any; scene: Scene }> {
    private _onSelectionChangeObserver: Nullable<Observer<any>>;
    private _onSelectionRenamedObserver: Nullable<Observer<void>>;
    private _onNewSceneAddedObserver: Nullable<Observer<Scene>>;
    private _onNewSceneObserver: Nullable<Observer<Scene>>;
    private _sceneExplorerRef: React.RefObject<Resizable>;
    private _mutationTimeout: Nullable<number> = null;

    private _once = true;
    private _hooked = false;

    private _sceneMutationFunc: () => void;

    constructor(props: ISceneExplorerComponentProps) {
        super(props);

        this.state = { filter: null, selectedEntity: null, scene: this.props.scene };

        this._sceneMutationFunc = this.processMutation.bind(this);

        this._sceneExplorerRef = React.createRef();
        this._onNewSceneObserver = this.props.globalState.onNewSceneObservable.add((scene: Scene) => {
            this.setState({
                scene,
            });
        });
    }

    processMutation() {
        if (this.props.globalState.blockMutationUpdates) {
            return;
        }

        // To avoid perf hits we want to make sure that we are not rebuilding the entire tree on each call
        if (this._mutationTimeout !== null) {
            window.clearTimeout(this._mutationTimeout);
        }

        this._mutationTimeout = window.setTimeout(() => {
            this._mutationTimeout = null;
            this.forceUpdate();
        }, 32);
    }

    componentDidMount() {
        this._onSelectionChangeObserver = this.props.globalState.onSelectionChangedObservable.add((entity) => {
            if (this.state.selectedEntity !== entity) {
                this.setState({ selectedEntity: entity });
            }
        });

        this._onSelectionRenamedObserver = this.props.globalState.onSelectionRenamedObservable.add(() => {
            this.forceUpdate();
        });
    }

    componentWillUnmount() {
        if (this._onSelectionChangeObserver) {
            this.props.globalState.onSelectionChangedObservable.remove(this._onSelectionChangeObserver);
        }

        if (this._onSelectionRenamedObserver) {
            this.props.globalState.onSelectionRenamedObservable.remove(this._onSelectionRenamedObserver);
        }

        if (this._onNewSceneAddedObserver) {
            EngineStore.LastCreatedEngine!.onNewSceneAddedObservable.remove(this._onNewSceneAddedObserver);
        }

        if (this._onNewSceneObserver) {
            this.props.globalState.onNewSceneObservable.remove(this._onNewSceneObserver);
        }

        const scene = this.state.scene;

        scene.onNewSkeletonAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewCameraAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewLightAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewMaterialAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewMeshAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewTextureAddedObservable.removeCallback(this._sceneMutationFunc);
        scene.onNewTransformNodeAddedObservable.removeCallback(this._sceneMutationFunc);

        scene.onSkeletonRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onMeshRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onCameraRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onLightRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onMaterialRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onTransformNodeRemovedObservable.removeCallback(this._sceneMutationFunc);
        scene.onTextureRemovedObservable.removeCallback(this._sceneMutationFunc);
    }

    filterContent(filter: string) {
        this.setState({ filter: filter });
    }

    findSiblings(parent: any, items: any[], target: any, goNext: boolean, data: { previousOne?: any; found?: boolean }): boolean {
        if (!items) {
            return false;
        }

        const sortedItems = Tools.SortAndFilter(parent, items);

        if (!items || sortedItems.length === 0) {
            return false;
        }

        for (const item of sortedItems) {
            if (item === target) {
                // found the current selection!
                data.found = true;
                if (!goNext) {
                    if (data.previousOne) {
                        this.props.globalState.onSelectionChangedObservable.notifyObservers(data.previousOne);
                    }
                    return true;
                }
            } else {
                if (data.found) {
                    this.props.globalState.onSelectionChangedObservable.notifyObservers(item);
                    return true;
                }
                data.previousOne = item;
            }

            if (item.getChildren && item.reservedDataStore && item.reservedDataStore.isExpanded) {
                if (this.findSiblings(item, item.getChildren(), target, goNext, data)) {
                    return true;
                }
            }
        }

        return false;
    }

    processKeys(keyEvent: React.KeyboardEvent<HTMLDivElement>) {
        if (!this.state.selectedEntity) {
            return;
        }

        const scene = this.state.scene;
        let search = false;
        let goNext = false;

        if (keyEvent.keyCode === 38) {
            // up
            search = true;
        } else if (keyEvent.keyCode === 40) {
            // down
            goNext = true;
            search = true;
        } else if (keyEvent.keyCode === 13 || keyEvent.keyCode === 39) {
            // enter or right
            const reservedDataStore = this.state.selectedEntity.reservedDataStore;
            if (reservedDataStore && reservedDataStore.setExpandedState) {
                reservedDataStore.setExpandedState(true);
            }
            keyEvent.preventDefault();
            return;
        } else if (keyEvent.keyCode === 37) {
            // left
            const reservedDataStore = this.state.selectedEntity.reservedDataStore;
            if (reservedDataStore && reservedDataStore.setExpandedState) {
                reservedDataStore.setExpandedState(false);
            }
            keyEvent.preventDefault();
            return;
        } else if (keyEvent.keyCode === 46) {
            // delete
            this.state.selectedEntity.dispose();
        }

        if (!search) {
            return;
        }

        keyEvent.preventDefault();

        const data = {};
        if (!this.findSiblings(null, scene.rootNodes, this.state.selectedEntity, goNext, data)) {
            if (!this.findSiblings(null, scene.materials, this.state.selectedEntity, goNext, data)) {
                this.findSiblings(null, scene.textures, this.state.selectedEntity, goNext, data);
            }
        }
    }

    renderContent() {
        const scene = this.state.scene;

        if (!scene) {
            this._onNewSceneAddedObserver = EngineStore.LastCreatedEngine!.onNewSceneAddedObservable.addOnce((scene) => this.setState({ scene: scene }));
            return null;
        }

        if (!this._hooked) {
            this._hooked = true;
            scene.onNewSkeletonAddedObservable.add(this._sceneMutationFunc);
            scene.onNewCameraAddedObservable.add(this._sceneMutationFunc);
            scene.onNewLightAddedObservable.add(this._sceneMutationFunc);
            scene.onNewMaterialAddedObservable.add(this._sceneMutationFunc);
            scene.onNewMeshAddedObservable.add(this._sceneMutationFunc);
            scene.onNewTextureAddedObservable.add(this._sceneMutationFunc);
            scene.onNewTransformNodeAddedObservable.add(this._sceneMutationFunc);

            scene.onSkeletonRemovedObservable.add(this._sceneMutationFunc);
            scene.onMeshRemovedObservable.add(this._sceneMutationFunc);
            scene.onCameraRemovedObservable.add(this._sceneMutationFunc);
            scene.onLightRemovedObservable.add(this._sceneMutationFunc);
            scene.onMaterialRemovedObservable.add(this._sceneMutationFunc);
            scene.onTransformNodeRemovedObservable.add(this._sceneMutationFunc);
            scene.onTextureRemovedObservable.add(this._sceneMutationFunc);
        }

        const guiElements = scene.textures.filter((t) => t.getClassName() === "AdvancedDynamicTexture");
        const textures = scene.textures.filter((t) => t.getClassName() !== "AdvancedDynamicTexture");
        const postProcessses = scene.postProcesses;
        const pipelines = scene.postProcessRenderPipelineManager.supportedPipelines;

        // Context menus
        const pipelineContextMenus: { label: string; action: () => void }[] = [];

        if (scene.activeCamera) {
            if (!pipelines.some((p) => p.getClassName() === "DefaultRenderingPipeline")) {
                pipelineContextMenus.push({
                    label: "Add new Default Rendering Pipeline",
                    action: () => {
                        const newPipeline = new DefaultRenderingPipeline("Default rendering pipeline", true, scene, scene.cameras);
                        this.props.globalState.onSelectionChangedObservable.notifyObservers(newPipeline);
                    },
                });
            }

            if (!pipelines.some((p) => p.getClassName() === "SSAORenderingPipeline")) {
                pipelineContextMenus.push({
                    label: "Add new SSAO Rendering Pipeline",
                    action: () => {
                        const newPipeline = new SSAORenderingPipeline("SSAO rendering pipeline", scene, 1, scene.cameras);
                        this.props.globalState.onSelectionChangedObservable.notifyObservers(newPipeline);
                    },
                });
            }

            if (scene.getEngine().getCaps().drawBuffersExtension && !pipelines.some((p) => p.getClassName() === "SSAORenderingPipeline")) {
                pipelineContextMenus.push({
                    label: "Add new SSAO2 Rendering Pipeline",
                    action: () => {
                        const newPipeline = new SSAO2RenderingPipeline("SSAO2 rendering pipeline", scene, 1, scene.cameras);
                        this.props.globalState.onSelectionChangedObservable.notifyObservers(newPipeline);
                    },
                });
            }
        }

        const nodeContextMenus: { label: string; action: () => void }[] = [];
        nodeContextMenus.push({
            label: "Add new point light",
            action: () => {
                const newPointLight = new PointLight("point light", Vector3.Zero(), scene);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newPointLight);
            },
        });
        nodeContextMenus.push({
            label: "Add new directional light",
            action: () => {
                const newDirectionalLight = new DirectionalLight("directional light", new Vector3(-1, -1, -0.5), scene);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newDirectionalLight);
            },
        });
        nodeContextMenus.push({
            label: "Add new free camera",
            action: () => {
                const newFreeCamera = new FreeCamera("free camera", scene.activeCamera ? scene.activeCamera.globalPosition : new Vector3(0, 0, -5), scene);

                if (scene.activeCamera) {
                    newFreeCamera.minZ = scene.activeCamera.minZ;
                    newFreeCamera.maxZ = scene.activeCamera.maxZ;
                    if ((scene.activeCamera as any).getTarget) {
                        newFreeCamera.setTarget((scene.activeCamera as TargetCamera).getTarget());
                    }
                }

                this.props.globalState.onSelectionChangedObservable.notifyObservers(newFreeCamera);
            },
        });

        const getUniqueName = (name: string): string => {
            let idSubscript = 1;
            while (scene.getMaterialById(name)) {
                name = name + " " + idSubscript++;
            }
            return name;
        };

        // Materials
        const materialsContextMenus: { label: string; action: () => void }[] = [];
        materialsContextMenus.push({
            label: "Add new standard material",
            action: () => {
                const newStdMaterial = new StandardMaterial(getUniqueName("Standard material"), scene);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newStdMaterial);
            },
        });
        materialsContextMenus.push({
            label: "Add new PBR material",
            action: () => {
                const newPBRMaterial = new PBRMaterial(getUniqueName("PBR material"), scene);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newPBRMaterial);
            },
        });
        materialsContextMenus.push({
            label: "Add new node material",
            action: () => {
                const newNodeMaterial = new NodeMaterial(getUniqueName("node material"), scene);
                newNodeMaterial.setToDefault();
                newNodeMaterial.build();
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newNodeMaterial);
            },
        });

        const materials = [];

        materials.push(...scene.materials);

        if (scene.multiMaterials && scene.multiMaterials.length) {
            materials.push(...scene.multiMaterials);
        }

        // Sprite Managers
        const spriteManagersContextMenus: { label: string; action: () => void }[] = [];
        spriteManagersContextMenus.push({
            label: "Add new sprite manager",
            action: () => {
                const newSpriteManager = new SpriteManager("Default sprite manager", "//playground.babylonjs.com/textures/player.png", 500, 64, scene);
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newSpriteManager);
            },
        });

        // Particle systems
        const particleSystemsContextMenus: { label: string; action: () => void }[] = [];
        particleSystemsContextMenus.push({
            label: "Add new CPU particle system",
            action: () => {
                const newSystem = ParticleHelper.CreateDefault(Vector3.Zero(), 10000, scene);
                newSystem.name = "CPU particle system";
                newSystem.start();
                this.props.globalState.onSelectionChangedObservable.notifyObservers(newSystem);
            },
        });

        if (GPUParticleSystem.IsSupported) {
            particleSystemsContextMenus.push({
                label: "Add new GPU particle system",
                action: () => {
                    const newSystem = ParticleHelper.CreateDefault(Vector3.Zero(), 10000, scene, true);
                    newSystem.name = "GPU particle system";
                    newSystem.start();
                    this.props.globalState.onSelectionChangedObservable.notifyObservers(newSystem);
                },
            });
        }

        const rootNodes = scene.rootNodes.slice(0);

        // Adding nodes parented to a bone
        for (const mesh of scene.meshes) {
            if (mesh.parent && mesh.parent.getClassName() === "Bone") {
                rootNodes.push(mesh);
            }
        }

        return (

 e.preventDefault()}>
                <SceneExplorerFilterComponent onFilter={(filter) => this.filterContent(filter)} />
                <SceneTreeItemComponent
                    globalState={this.props.globalState}
                    gizmoCamera={this.props.gizmoCamera}
                    extensibilityGroups={this.props.extensibilityGroups}
                    selectedEntity={this.state.selectedEntity}
                    scene={scene}
                    onRefresh={() => this.forceUpdate()}
                    onSelectionChangedObservable={this.props.globalState.onSelectionChangedObservable}
                />
                <TreeItemComponent
                    globalState={this.props.globalState}
                    contextMenuItems={nodeContextMenus}
                    extensibilityGroups={this.props.extensibilityGroups}
                    selectedEntity={this.state.selectedEntity}
                    items={rootNodes}
                    label="Nodes"
                    offset={1}
                    filter={this.state.filter}
                />
                {scene.skeletons.length > 0 && (
                    <TreeItemComponent
                        globalState={this.props.globalState}
                        extensibilityGroups={this.props.extensibilityGroups}
                        selectedEntity={this.state.selectedEntity}
                        items={scene.skeletons}
                        label="Skeletons"
                        offset={1}
                        filter={this.state.filter}
                    />
                )}
                <TreeItemComponent
                    globalState={this.props.globalState}
                    extensibilityGroups={this.props.extensibilityGroups}
                    selectedEntity={this.state.selectedEntity}
                    items={materials}
                    contextMenuItems={materialsContextMenus}
                    label="Materials"
                    offset={1}
                    filter={this.state.filter}
                />
                <TreeItemComponent
                    globalState={this.props.globalState}
                    extensibilityGroups={this.props.extensibilityGroups}
                    selectedEntity={this.state.selectedEntity}
                    items={textures}
                    label="Textures"
                    offset={1}
                    filter={this.state.filter}
                />
                {postProcessses.length > 0 && (
                    <TreeItemComponent
                        globalState={this.props.globalState}
                        extensibilityGroups={this.props.extensibilityGroups}
                        selectedEntity={this.state.selectedEntity}
                        items={postProcessses}
                        label="Post-processes"
                        offset={1}
                        filter={this.state.filter}
                    />
                )}
                <TreeItemComponent
                    globalState={this.props.globalState}
                    extensibilityGroups={this.props.extensibilityGroups}
                    contextMenuItems={pipelineContextMenus}
                    selectedEntity={this.state.selectedEntity}
                    items={pipelines}
                    label="Rendering pipelines"
                    offset={1}
                    filter={this.state.filter}
                />
                {scene.effectLayers && scene.effectLayers.length > 0 && (
                    <TreeItemComponent
                        globalState={this.props.globalState}
                        extensibilityGroups={this.props.extensibilityGroups}
                        selectedEntity={this.state.selectedEntity}
                        items={scene.effectLayers}
                        label="Effect layers"
                        offset={1}
                        filter={this.state.filter}
                    />
                )}
                <TreeItemComponent
                    globalState={this.props.globalState}
                    contextMenuItems={particleSystemsContextMenus}
                    extensibilityGroups={this.props.extensibilityGroups}
                    selectedEntity={this.state.selectedEntity}
                    items={scene.particleSystems}
                    label="Particle systems"
                    offset={1}
                    filter={this.state.filter}
                />
                <TreeItemComponent
                    globalState={this.props.globalState}
                    contextMenuItems={spriteManagersContextMenus}
                    forceSubitems={true}
                    extensibilityGroups={this.props.extensibilityGroups}
                    selectedEntity={this.state.selectedEntity}
                    items={scene.spriteManagers}
                    label="Sprite managers"
                    offset={1}
                    filter={this.state.filter}
                />
                {guiElements && guiElements.length > 0 && (
                    <TreeItemComponent
                        globalState={this.props.globalState}
                        extensibilityGroups={this.props.extensibilityGroups}
                        selectedEntity={this.state.selectedEntity}
                        items={guiElements}
                        label="GUI"
                        offset={1}
                        filter={this.state.filter}
                    />
                )}
                {scene.animationGroups.length > 0 && (
                    <TreeItemComponent
                        globalState={this.props.globalState}
                        extensibilityGroups={this.props.extensibilityGroups}
                        selectedEntity={this.state.selectedEntity}
                        items={scene.animationGroups}
                        label="Animation groups"
                        offset={1}
                        filter={this.state.filter}
                    />
                )}
                {scene.mainSoundTrack && scene.mainSoundTrack.soundCollection.length > 0 && (
                    <TreeItemComponent
                        globalState={this.props.globalState}
                        extensibilityGroups={this.props.extensibilityGroups}
                        selectedEntity={this.state.selectedEntity}
                        items={scene.mainSoundTrack.soundCollection}
                        label="Sounds"
                        offset={1}
                        filter={this.state.filter}
                    />
                )}
                {this.props.additionalNodes &&
                    this.props.additionalNodes.map((additionalNode) => {
                        return (
                            <TreeItemComponent
                                key={additionalNode.name}
                                globalState={this.props.globalState}
                                extensibilityGroups={this.props.extensibilityGroups}
                                selectedEntity={this.state.selectedEntity}
                                items={additionalNode.getContent()}
                                label={additionalNode.name}
                                offset={1}
                                filter={this.state.filter}
                            />
                        );
                    })}

        );
    }

    onClose() {
        if (!this.props.onClose) {
            return;
        }

        this.props.onClose();
    }

    onPopup() {
        if (!this.props.onPopup) {
            return;
        }

        this.props.onPopup();
    }

    render() {
        if (this.props.popupMode) {
            return (

 this.processKeys(keyEvent)}>
                    {!this.props.noHeader && (
                        <HeaderComponent
                            title="SCENE EXPLORER"
                            noClose={this.props.noClose}
                            noExpand={this.props.noExpand}
                            noCommands={this.props.noCommands}
                            onClose={() => this.onClose()}
                            onPopup={() => this.onPopup()}
                        />
                    )}
                    {this.renderContent()}

            );
        }

        if (this._once) {
            this._once = false;
            // A bit hacky but no other way to force the initial width to 300px and not auto
            setTimeout(() => {
                const element = document.getElementById("sceneExplorer");
                if (!element) {
                    return;
                }
                element.style.width = "300px";
            }, 150);
        }

        return (
            <Resizable
                tabIndex={-1}
                id="sceneExplorer"
                ref={this._sceneExplorerRef}
                size={{ height: "100%" }}
                minWidth={300}
                maxWidth={600}
                minHeight="100%"
                enable={{ top: false, right: true, bottom: false, left: false, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }}
                onKeyDown={(keyEvent) => this.processKeys(keyEvent)}
            >
                {!this.props.noHeader && (
                    <HeaderComponent
                        title="SCENE EXPLORER"
                        noClose={this.props.noClose}
                        noExpand={this.props.noExpand}
                        noCommands={this.props.noCommands}
                        onClose={() => this.onClose()}
                        onPopup={() => this.onPopup()}
                    />
                )}
                {this.renderContent()}
            </Resizable>
        );
    }
}


text:
//
//  YZMonitorRunloop.h
//  rongxin4
//
//  Created by eagle on 2019/6/18.
//  Copyright © 2019 yongzhen. All rights reserved.
//
// 获取设备类型等 参考 https://github.com/didi/DoraemonKit
#import <Foundation/Foundation.h>

@interface YZAppInfoUtil : NSObject

/**
 DeviceInfo:获取当前设备的 用户自定义的别名,例如:库克的 iPhone 9

 @return 当前设备的 用户自定义的别名,例如:库克的 iPhone 9
 */
+ (NSString *)iphoneName;

/**
 DeviceInfo:获取当前设备的 系统名称,例如:iOS 13.1

 @return 当前设备的 系统名称,例如:iOS 13.1
 */
+ (NSString *)iphoneSystemVersion;

+ (NSString *)bundleIdentifier;

+ (NSString *)bundleVersion;

+ (NSString *)bundleShortVersionString;

+ (NSString *)iphoneType;

+ (BOOL)isIPhoneXSeries;

+ (NSString *)locationAuthority;

+ (NSString *)pushAuthority;

+ (NSString *)cameraAuthority;

+ (NSString *)audioAuthority;

+ (NSString *)photoAuthority;

+ (NSString *)addressAuthority;

+ (NSString *)calendarAuthority;

+ (NSString *)remindAuthority;

+ (NSString *)bluetoothAuthority;

@end