text:
/* include/config.h.  Generated from config.h.in by configure.  */
/* include/config.h.in.  Generated from configure.ac by autoheader.  */

/* Block signals before mutex operations */
/* #undef CONFIG_BLOCK_SIGNALS */

/* Enable Debug Frame */
#define CONFIG_DEBUG_FRAME 1

/* Support for Microsoft ABI extensions */
/* This is required to understand floating point registers on x86-64 */
#define CONFIG_MSABI_SUPPORT 1

/* Define to 1 if you want every memory access validated */
#define CONSERVATIVE_CHECKS 1

/* Allocate large structures rather than place them on the stack. */
#define CONSERVE_STACK /**/

/* Define to 1 if you have the <asm/ptrace_offsets.h> header file. */
/* #undef HAVE_ASM_PTRACE_OFFSETS_H */

/* Define to 1 if you have the <atomic_ops.h> header file. */
/* #undef HAVE_ATOMIC_OPS_H */

/* Define to 1 if you have the <byteswap.h> header file. */
#define HAVE_BYTESWAP_H 1

/* Define to 1 if you have the declaration of `PTRACE_CONT', and to 0 if you
   don't. */
#define HAVE_DECL_PTRACE_CONT 1

/* Define to 1 if you have the declaration of `PTRACE_POKEDATA', and to 0 if
   you don't. */
#define HAVE_DECL_PTRACE_POKEDATA 1

/* Define to 1 if you have the declaration of `PTRACE_POKEUSER', and to 0 if
   you don't. */
#if defined(__aarch64__) || defined(__mips__)
#define HAVE_DECL_PTRACE_POKEUSER 0
#else
#define HAVE_DECL_PTRACE_POKEUSER 1
#endif

/* Define to 1 if you have the declaration of `PTRACE_SINGLESTEP', and to 0 if
   you don't. */
#define HAVE_DECL_PTRACE_SINGLESTEP 1

/* Define to 1 if you have the declaration of `PTRACE_SYSCALL', and to 0 if
   you don't. */
#define HAVE_DECL_PTRACE_SYSCALL 1

/* Define to 1 if you have the declaration of `PTRACE_TRACEME', and to 0 if
   you don't. */
#define HAVE_DECL_PTRACE_TRACEME 1

/* Define to 1 if you have the declaration of `PT_CONTINUE', and to 0 if you
   don't. */
#define HAVE_DECL_PT_CONTINUE 0

/* Define to 1 if you have the declaration of `PT_GETFPREGS', and to 0 if you
   don't. */
#define HAVE_DECL_PT_GETFPREGS 0

/* Define to 1 if you have the declaration of `PT_GETREGS', and to 0 if you
   don't. */
#if defined(__mips__)
#define HAVE_DECL_PT_GETREGS 1
#else
#define HAVE_DECL_PT_GETREGS 0
#endif

/* Define to 1 if you have the declaration of `PT_GETREGSET', and to 0 if you
   don't. */
#if defined(__aarch64__)
#define HAVE_DECL_PT_GETREGSET 1
#else
#define HAVE_DECL_PT_GETREGSET 0
#endif

/* Define to 1 if you have the declaration of `PT_IO', and to 0 if you don't.
   */
#define HAVE_DECL_PT_IO 0

/* Define to 1 if you have the declaration of `PT_STEP', and to 0 if you
   don't. */
#define HAVE_DECL_PT_STEP 0

/* Define to 1 if you have the declaration of `PT_SYSCALL', and to 0 if you
   don't. */
#define HAVE_DECL_PT_SYSCALL 0

/* Define to 1 if you have the declaration of `PT_TRACE_ME', and to 0 if you
   don't. */
#define HAVE_DECL_PT_TRACE_ME 0

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you have the `dlmodinfo' function. */
#define HAVE_DLMODINFO 1

/* Define to 1 if you have the `dl_iterate_phdr' function. */
#define HAVE_DL_ITERATE_PHDR 1

/* Define to 1 if you have the `dl_phdr_removals_counter' function. */
#define HAVE_DL_PHDR_REMOVALS_COUNTER 1

/* Define to 1 if you have the <elf.h> header file. */
#define HAVE_ELF_H 1

/* Define to 1 if you have the <endian.h> header file. */
#define HAVE_ENDIAN_H 1

/* Define to 1 if you have the <execinfo.h> header file. */
/* #undef HAVE_EXECINFO_H */

/* Define to 1 if you have the `getunwind' function. */
#define HAVE_GETUNWIND 1

/* Define to 1 if you have the <ia64intrin.h> header file. */
/* #undef HAVE_IA64INTRIN_H */

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the `uca' library (-luca). */
/* #undef HAVE_LIBUCA */

/* Define to 1 if you have the <link.h> header file. */
#define HAVE_LINK_H 1

/* Define if you have liblzma */
/* #undef HAVE_LZMA */

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `mincore' function. */
#define HAVE_MINCORE 1

/* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if `dlpi_subs' is a member of `struct dl_phdr_info'. */
/* #undef HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS */

/* Define to 1 if the system has the type `struct elf_prstatus'. */
/* #undef HAVE_STRUCT_ELF_PRSTATUS */

/* Define to 1 if the system has the type `struct prstatus'. */
/* #undef HAVE_STRUCT_PRSTATUS */

/* Defined if __sync atomics are available */
#define HAVE_SYNC_ATOMICS 1

/* Define to 1 if you have the <sys/elf.h> header file. */
/* #undef HAVE_SYS_ELF_H */

/* Define to 1 if you have the <sys/endian.h> header file. */
#define HAVE_SYS_ENDIAN_H 1

/* Define to 1 if you have the <sys/link.h> header file. */
/* #undef HAVE_SYS_LINK_H */

/* Define to 1 if you have the <sys/procfs.h> header file. */
/* #undef HAVE_SYS_PROCFS_H */

/* Define to 1 if you have the <sys/ptrace.h> header file. */
#define HAVE_SYS_PTRACE_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <sys/uc_access.h> header file. */
/* #undef HAVE_SYS_UC_ACCESS_H */

/* Define to 1 if you have the `ttrace' function. */
/* #undef HAVE_TTRACE */

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Defined if __builtin_unreachable() is available */
#define HAVE__BUILTIN_UNREACHABLE 1

/* Defined if __builtin___clear_cache() is available */
#define HAVE__BUILTIN___CLEAR_CACHE 1

/* Define to 1 if __thread keyword is supported by the C compiler. */
#define HAVE___THREAD 1

/* Define to the sub-directory in which libtool stores uninstalled libraries.
   */
#define LT_OBJDIR ".libs/"

/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */

/* Name of package */
#define PACKAGE "libunwind"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "libunwind-devel@nongnu.org"

/* Define to the full name of this package. */
#define PACKAGE_NAME "libunwind"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libunwind 1.1"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libunwind"

/* Define to the home page for this package. */
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "1.1"

/* The size of `off_t', as computed by sizeof. */
#define SIZEOF_OFF_T 4

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Version number of package */
#define VERSION "1.1"

/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */

/* Define to `__inline__' or `__inline' if that's what the C compiler
   calls it, or to nothing if 'inline' is not supported under any name.  */
#ifndef __cplusplus
/* #undef inline */
#endif

/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */


text:
package org.teavm.dependency;

import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.teavm.backend.javascript.JavaScriptTarget;
import org.teavm.common.DisjointSet;
import org.teavm.diagnostics.Problem;
import org.teavm.model.BasicBlock;
import org.teavm.model.ClassHierarchy;
import org.teavm.model.ClassHolderSource;
import org.teavm.model.Instruction;
import org.teavm.model.MethodHolder;
import org.teavm.model.MethodReference;
import org.teavm.model.Program;
import org.teavm.model.ReferenceCache;
import org.teavm.model.TextLocation;
import org.teavm.model.ValueType;
import org.teavm.model.analysis.ClassInference;
import org.teavm.model.instructions.AbstractInstructionVisitor;
import org.teavm.model.instructions.AssignInstruction;
import org.teavm.model.instructions.ClassConstantInstruction;
import org.teavm.model.instructions.InvokeInstruction;
import org.teavm.model.instructions.PutElementInstruction;
import org.teavm.model.instructions.UnwrapArrayInstruction;
import org.teavm.parsing.ClasspathClassHolderSource;
import org.teavm.vm.TeaVM;
import org.teavm.vm.TeaVMBuilder;
import org.teavm.vm.TeaVMPhase;
import org.teavm.vm.TeaVMProgressFeedback;
import org.teavm.vm.TeaVMProgressListener;

public class DependencyTest {
    @Rule
    public final TestName testName = new TestName();

    private static ClassHolderSource classSource;

    @BeforeClass
    public static void prepare() {
        classSource = new ClasspathClassHolderSource(DependencyTest.class.getClassLoader(),
                new ReferenceCache());
    }

    @AfterClass
    public static void cleanup() {
        classSource = null;
    }

    @Test
    public void virtualCall() {
        doTest();
    }

    @Test
    public void instanceOf() {
        doTest();
    }

    @Test
    public void catchException() {
        doTest();
    }

    @Test
    public void propagateException() {
        doTest();
    }

    @Test
    public void arrays() {
        doTest();
    }

    @Test
    public void arraysPassed() {
        doTest();
    }

    @Test
    public void arraysRetrieved() {
        doTest();
    }

    private void doTest() {
        TeaVM vm = new TeaVMBuilder(new JavaScriptTarget())
                .setClassLoader(DependencyTest.class.getClassLoader())
                .setClassSource(classSource)
                .build();
        vm.setProgressListener(new TeaVMProgressListener() {
            @Override
            public TeaVMProgressFeedback phaseStarted(TeaVMPhase phase, int count) {
                return phase == TeaVMPhase.DEPENDENCY_ANALYSIS
                        ? TeaVMProgressFeedback.CONTINUE
                        : TeaVMProgressFeedback.CANCEL;
            }

            @Override
            public TeaVMProgressFeedback progressReached(int progress) {
                return TeaVMProgressFeedback.CONTINUE;
            }
        });
        vm.add(new DependencyTestPatcher(DependencyTestData.class.getName(), testName.getMethodName()));
        vm.installPlugins();

        MethodReference testMethod = new MethodReference(DependencyTestData.class,
                testName.getMethodName(), void.class);
        vm.entryPoint(DependencyTestData.class.getName());
        vm.build(fileName -> new ByteArrayOutputStream(), "out");

        List<Problem> problems = vm.getProblemProvider().getSevereProblems();
        if (!problems.isEmpty()) {
            Problem problem = problems.get(0);
            Assert.fail("Error at " + problem.getLocation().getSourceLocation() + ": " + problem.getText());
        }

        MethodHolder method = classSource.get(testMethod.getClassName()).getMethod(testMethod.getDescriptor());
        List<Assertion> assertions = collectAssertions(method);
        processAssertions(assertions, vm.getDependencyInfo().getMethod(testMethod), vm.getDependencyInfo(),
                method.getProgram());
    }

    private void processAssertions(List<Assertion> assertions, MethodDependencyInfo methodDep,
            DependencyInfo dependencyInfo, Program program) {
        ClassInference classInference = new ClassInference(dependencyInfo, new ClassHierarchy(
                dependencyInfo.getClassSource()));
        classInference.infer(program, methodDep.getReference());

        for (Assertion assertion : assertions) {
            ValueDependencyInfo valueDep = methodDep.getVariable(assertion.value);
            String[] actualTypes = valueDep.getTypes();
            String[] expectedTypes = assertion.expectedTypes.clone();
            Arrays.sort(actualTypes);
            Arrays.sort(expectedTypes);
            Assert.assertArrayEquals("Assertion at " + assertion.location, expectedTypes, actualTypes);

            actualTypes = classInference.classesOf(assertion.value);
            Arrays.sort(actualTypes);
            Assert.assertArrayEquals("Assertion at " + assertion.location + " (class inference)",
                    expectedTypes, actualTypes);
        }
    }

    private List<Assertion> collectAssertions(MethodHolder method) {
        Program program = method.getProgram();

        AliasCollector aliasCollector = new AliasCollector(program.variableCount());
        for (BasicBlock block : program.getBasicBlocks()) {
            for (Instruction instruction : block) {
                instruction.acceptVisitor(aliasCollector);
            }
        }
        int[] aliases = aliasCollector.disjointSet.pack(program.variableCount());

        AssertionCollector assertionCollector = new AssertionCollector(aliases);
        for (BasicBlock block : program.getBasicBlocks()) {
            for (Instruction instruction : block) {
                instruction.acceptVisitor(assertionCollector);
            }
        }
        assertionCollector.postProcess();

        return assertionCollector.assertions;
    }

    static class AliasCollector extends AbstractInstructionVisitor {
        DisjointSet disjointSet = new DisjointSet();

        AliasCollector(int variableCount) {
            for (int i = 0; i < variableCount; ++i) {
                disjointSet.create();
            }
        }

        @Override
        public void visit(AssignInstruction insn) {
            disjointSet.union(insn.getReceiver().getIndex(), insn.getAssignee().getIndex());
        }

        @Override
        public void visit(UnwrapArrayInstruction insn) {
            disjointSet.union(insn.getReceiver().getIndex(), insn.getArray().getIndex());
        }
    }

    static class AssertionCollector extends AbstractInstructionVisitor {
        static final MethodReference assertionMethod = new MethodReference(MetaAssertions.class,
                "assertTypes", Object.class, Class[].class, void.class);
        int[] aliases;
        List<Assertion> assertions = new ArrayList<>();
        IntSet[] arrayContent;
        ValueType[] classConstants;

        AssertionCollector(int[] aliases) {
            this.aliases = aliases;
            classConstants = new ValueType[aliases.length];
            arrayContent = new IntSet[aliases.length];
        }

        void postProcess() {
            int[] aliasInstances = new int[aliases.length];
            Arrays.fill(aliasInstances, -1);
            for (int i = 0; i < aliases.length; ++i) {
                int alias = aliases[i];
                if (aliasInstances[alias] < 0) {
                    aliasInstances[alias] = i;
                }
            }

            for (Assertion assertion : assertions) {
                IntSet items = arrayContent[assertion.array];
                if (items != null) {
                    Set<String> expectedClasses = new HashSet<>();
                    for (int item : items.toArray()) {
                        ValueType constant = classConstants[item];
                        if (constant != null) {
                            String expectedClass;
                            if (constant instanceof ValueType.Object) {
                                expectedClass = ((ValueType.Object) constant).getClassName();
                            } else {
                                expectedClass = constant.toString();
                            }
                            expectedClasses.add(expectedClass);
                        }
                    }
                    assertion.expectedTypes = expectedClasses.toArray(new String[0]);
                } else {
                    assertion.expectedTypes = new String[0];
                }

                assertion.value = aliasInstances[assertion.value];
            }
        }

        @Override
        public void visit(InvokeInstruction insn) {
            if (insn.getMethod().equals(assertionMethod)) {
                Assertion assertion = new Assertion();
                assertion.value = aliases[insn.getArguments().get(0).getIndex()];
                assertion.array = aliases[insn.getArguments().get(1).getIndex()];
                assertion.location = insn.getLocation();
                assertions.add(assertion);
            }
        }

        @Override
        public void visit(ClassConstantInstruction insn) {
            classConstants[aliases[insn.getReceiver().getIndex()]] = insn.getConstant();
        }

        @Override
        public void visit(PutElementInstruction insn) {
            int array = aliases[insn.getArray().getIndex()];
            int value = aliases[insn.getValue().getIndex()];
            IntSet items = arrayContent[array];
            if (items == null) {
                items = new IntHashSet();
                arrayContent[array] = items;
            }
            items.add(value);
        }
    }

    private static class Assertion {
        int value;
        int array;
        TextLocation location;
        String[] expectedTypes;
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using Scientia.HtmlRenderer.WinForms;

namespace Scientia.HtmlRenderer.Demo.WinForms
{
    public partial class PerfForm : Form
    {
        #region Fields and Consts

        /// <summary>
        /// the html samples to show in the demo
        /// </summary>
        private readonly Dictionary<string, string> Samples = new Dictionary<string, string>();

        /// <summary>
        /// the HTML samples to run on
        /// </summary>
        private static readonly List<string> PerfTestSamples = new List<string>();

        private const int Iterations = 3;

        #endregion

        /// <summary>
        /// Init.
        /// </summary>
        public PerfForm()
        {
            this.InitializeComponent();

            this.Icon = DemoForm.GetIcon();

            this.StartPosition = FormStartPosition.CenterScreen;
            this.Size = new Size(1200, 800);

            this.LoadSamples();
        }

        /// <summary>
        /// Used to execute performance test run for memory profiler so the form is not loaded,
        /// only html container is working.
        /// </summary>
        public static void Run(bool layout, bool paint)
        {
            try
            {
                LoadRunSamples();

                var htmlContainer = new HtmlContainer();
                htmlContainer.MaxSize = new SizeF(800, 0);

                GC.Collect();
                Thread.Sleep(3000);

                using (var img = new Bitmap(1, 1))
                using (var g = Graphics.FromImage(img))
                {
                    for (int i = 0; i < Iterations; i++)
                    {
                        foreach (var html in PerfTestSamples)
                        {
                            htmlContainer.SetHtml(html);

                            if (layout)
                            {
                                htmlContainer.PerformLayout(g);
                            }

                            if (paint)
                            {
                                htmlContainer.PerformPaint(g);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error");
            }
        }

        #region Private methods

        /// <summary>
        /// Loads the tree of document samples
        /// </summary>
        private static void LoadRunSamples()
        {
            var names = Assembly.GetExecutingAssembly().GetManifestResourceNames();
            Array.Sort(names);
            foreach (string name in names)
            {
                int extPos = name.LastIndexOf('.');
                string ext = name.Substring(extPos >= 0 ? extPos : 0);

                if (".htm".IndexOf(ext, StringComparison.Ordinal) >= 0)
                {
                    var resourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name);
                    if (resourceStream != null)
                    {
                        using (var sreader = new StreamReader(resourceStream, Encoding.Default))
                        {
                            var html = sreader.ReadToEnd();
                            PerfTestSamples.Add(html);
                        }
                    }
                }
            }
        }

        /// <summary>
        /// Loads the tree of document samples
        /// </summary>
        private void LoadSamples()
        {
            var root = new TreeNode("HTML Renderer");
            this._samplesTreeView.Nodes.Add(root);

            var names = Assembly.GetExecutingAssembly().GetManifestResourceNames();
            Array.Sort(names);
            foreach (string name in names)
            {
                int extPos = name.LastIndexOf('.');
                int namePos = extPos > 0 && name.Length > 1 ? name.LastIndexOf('.', extPos - 1) : 0;
                string ext = name.Substring(extPos >= 0 ? extPos : 0);
                string shortName = namePos > 0 && name.Length > 2 ? name.Substring(namePos + 1, name.Length - namePos - ext.Length - 1) : name;

                if (".htm".IndexOf(ext, StringComparison.Ordinal) >= 0)
                {
                    if (name.IndexOf("PerfSamples", StringComparison.OrdinalIgnoreCase) > -1)
                    {
                        var resourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name);
                        if (resourceStream != null)
                        {
                            using (var sreader = new StreamReader(resourceStream, Encoding.Default))
                            {
                                this.Samples[name] = sreader.ReadToEnd();
                            }

                            string nameWithSzie = string.Format("{0} ({1:N0} KB)", shortName, this.Samples[name].Length * 2 / 1024);
                            var node = new TreeNode(nameWithSzie);
                            root.Nodes.Add(node);
                            node.Tag = name;
                        }
                    }
                }
            }

            root.Expand();
        }

        /// <summary>
        /// On tree view node click load the html to the html panel and html editor.
        /// </summary>
        private void OnSamplesTreeViewAfterSelect(object sender, TreeViewEventArgs e)
        {
            var name = e.Node.Tag as string;
            if (!string.IsNullOrEmpty(name))
            {
                this._htmlPanel.Text = this.Samples[name];
            }
        }

        /// <summary>
        /// Clear the html in the renderer
        /// </summary>
        private void OnClearLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this._samplesTreeView.SelectedNode = null;
            this._htmlPanel.Text = null;
            GC.Collect();
        }

        /// <summary>
        /// Execute performance test by setting all sample htmls in a loop.
        /// </summary>
        private void OnRunTestButtonClick(object sender, EventArgs e)
        {
            if (this._samplesTreeView.SelectedNode != null && this._samplesTreeView.SelectedNode.Tag != null)
            {
                this._runTestButton.Text = "Running..";
                this._runTestButton.Enabled = false;
                Application.DoEvents();

                var iterations = (float)this._iterations.Value;
                var html = this.Samples[(string)this._samplesTreeView.SelectedNode.Tag];

                GC.Collect();

                double totalMem = 0;
                long startMemory = 0;
                if (Environment.Version.Major >= 4)
                {
                    typeof(AppDomain).GetProperty("MonitoringIsEnabled").SetValue(null, true, null);
                    startMemory = (long)AppDomain.CurrentDomain.GetType().GetProperty("MonitoringTotalAllocatedMemorySize").GetValue(AppDomain.CurrentDomain, null);
                }

                var sw = Stopwatch.StartNew();

                for (int i = 0; i < this._iterations.Value; i++)
                {
                    this._htmlPanel.Text = html;
                    Application.DoEvents(); // so paint will be called
                }

                sw.Stop();

                if (Environment.Version.Major >= 4)
                {
                    var endMemory = (long)AppDomain.CurrentDomain.GetType().GetProperty("MonitoringTotalAllocatedMemorySize").GetValue(AppDomain.CurrentDomain, null);
                    totalMem = (endMemory - startMemory) / 1024f;
                }

                float htmlSize = html.Length * 2 / 1024f;

                var msg = string.Format("1 HTML ({0:N0} KB)\r\n{1} Iterations", htmlSize, this._iterations.Value);
                msg += "\r\n\r\n";
                msg += string.Format(
                    "CPU:\r\nTotal: {0} msec\r\nIterationAvg: {1:N2} msec",
                    sw.ElapsedMilliseconds,
                    sw.ElapsedMilliseconds / iterations);
                msg += "\r\n\r\n";
                msg += string.Format(
                    "Memory:\r\nTotal: {0:N0} KB\r\nIterationAvg: {1:N0} KB\r\nOverhead: {2:N0}%",
                    totalMem,
                    totalMem / iterations,
                    100 * (totalMem / iterations) / htmlSize);

                Clipboard.SetDataObject(msg);
                MessageBox.Show(msg, "Test run results");

                this._runTestButton.Text = "Run Tests";
                this._runTestButton.Enabled = true;
            }
        }

        #endregion
    }
}


text:
package com.study.hystrix.cache;

import com.netflix.config.ConfigurationManager;
import com.netflix.hystrix.HystrixCommandProperties.ExecutionIsolationStrategy;

public class SemaphoreMain {

	public static void main(String[] args) throws Exception {
		ConfigurationManager.getConfigInstance().setProperty(
				"hystrix.command.default.execution.isolation.strategy", ExecutionIsolationStrategy.SEMAPHORE);
		ConfigurationManager.getConfigInstance().setProperty(
				"hystrix.command.default.execution.isolation.semaphore.maxConcurrentRequests", 3);
		for(int i = 0; i < 6; i++) {
			final int index = i;
			Thread t = new Thread() {
				@Override
                public void run() {
					MyCommand c = new MyCommand(index);
					c.execute();
				}
			};
			t.start();
		}
		Thread.sleep(5000);
	}

}


text:
console.log('runs');
$(function(){
  setTimeout(function(){
    $('.markdown_content').flowtype({
     fontRatio : 30,
     lineRatio : 1.45
    });
  }, 400);
});

// HACK: dev to generate timestamp
// TODO: create cli
window.dateString = (new Date).toISOString().replace(/:/g, '-').replace('.', '-')


text:
package mil.nga.giat.geowave.core.store.operations.remote.options;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import org.apache.commons.lang3.StringUtils;

import com.beust.jcommander.ParametersDelegate;

import mil.nga.giat.geowave.core.cli.api.DefaultPluginOptions;
import mil.nga.giat.geowave.core.cli.api.PluginOptions;

/**
 * Index group contains a list of indexes that are created from existing index
 * configurations.
 */
public class IndexGroupPluginOptions extends
		DefaultPluginOptions implements
		PluginOptions
{

	public final static String INDEXGROUP_PROPERTY_NAMESPACE = "indexgroup";

	/**
	 * This is indexed by index name, instead of what you'd expect, which would
	 * be index type.
	 */
	@ParametersDelegate
	private Map<String, IndexPluginOptions> dimensionalityPlugins = new HashMap<String, IndexPluginOptions>();

	public IndexGroupPluginOptions() {

	}

	/**
	 * The name of this index group.
	 */
	@Override
	public void selectPlugin(
			String qualifier ) {
		// This is specified as so: name=type,name=type,...
		if (qualifier != null && qualifier.length() > 0) {
			for (String name : qualifier.split(",")) {
				String[] parts = name.split("=");
				addIndex(
						parts[0].trim(),
						parts[1].trim());
			}
		}
	}

	@Override
	public String getType() {
		List<String> typeString = new ArrayList<String>();
		for (Entry<String, IndexPluginOptions> entry : getDimensionalityPlugins().entrySet()) {
			typeString.add(String.format(
					"%s=%s",
					entry.getKey(),
					entry.getValue().getType()));
		}
		if (typeString.isEmpty()) {
			return null;
		}
		return StringUtils.join(
				typeString,
				",");
	}

	public void addIndex(
			String name,
			String type ) {
		if (name != null && type != null) {
			IndexPluginOptions indexOptions = new IndexPluginOptions();
			indexOptions.selectPlugin(type);
			getDimensionalityPlugins().put(
					name,
					indexOptions);
		}
	}

	public Map<String, IndexPluginOptions> getDimensionalityPlugins() {
		return dimensionalityPlugins;
	}

	public static String getIndexGroupNamespace(
			String groupName ) {
		return String.format(
				"%s.%s",
				INDEXGROUP_PROPERTY_NAMESPACE,
				groupName);
	}

}


text:
import zstackwoodpecker.test_state as ts_header
TestAction = ts_header.TestAction
def path():
    return dict(initial_formation="template2",\
                path_list=[[TestAction.create_volume, "volume1", "=scsi,shareable"], \
		[TestAction.attach_volume, "vm1", "volume1"], \
		[TestAction.create_volume, "volume2", "=scsi,shareable"], \
		[TestAction.attach_volume, "vm1", "volume2"], \
		[TestAction.create_volume, "volume3", "=scsi,shareable"], \
		[TestAction.attach_volume, "vm1", "volume3"], \
		[TestAction.create_volume, "volume4", "=scsi,shareable"], \
		[TestAction.attach_volume, "vm1", "volume4"], \
		[TestAction.create_volume, "volume5", "=scsi,shareable"], \
		[TestAction.attach_volume, "vm1", "volume5"], \
		[TestAction.create_volume, "volume6", "=scsi,shareable"], \
		[TestAction.attach_volume, "vm1", "volume6"], \
		[TestAction.create_volume, "volume7", "=scsi,shareable"], \
		[TestAction.attach_volume, "vm1", "volume7"], \
		[TestAction.create_volume, "volume8", "=scsi,shareable"], \
		[TestAction.attach_volume, "vm1", "volume8"], \
		[TestAction.detach_volume, "volume1", "vm1"], \
		[TestAction.detach_volume, "volume2", "vm1"], \
		[TestAction.detach_volume, "volume3", "vm1"], \
		[TestAction.detach_volume, "volume4", "vm1"], \
		[TestAction.detach_volume, "volume5", "vm1"], \
		[TestAction.detach_volume, "volume6", "vm1"], \
		[TestAction.detach_volume, "volume7", "vm1"], \
		[TestAction.detach_volume, "volume8", "vm1"], \
		[TestAction.clone_vm, "vm1", "vm2", "full"], \
		[TestAction.stop_vm, "vm2"], \
		[TestAction.ps_migrate_volume, "vm2-root"], \
		[TestAction.resize_data_volume, "volume1", 5*1024*1024], \
		[TestAction.delete_volume, "volume1"], \
		[TestAction.migrate_vm, "vm1"], \
		[TestAction.migrate_vm, "vm1"], \
		[TestAction.resize_data_volume, "volume2", 5*1024*1024], \
		[TestAction.delete_volume, "volume2"], \
		[TestAction.stop_vm, "vm1"], \
		[TestAction.reinit_vm, "vm1"], \
		[TestAction.create_volume_snapshot, "volume3", 'snapshot1'], \
		[TestAction.start_vm, "vm1"], \
		[TestAction.reboot_vm, "vm1"]])


text:
{% extends "base.html" %}
{% load i18n %}

{% block  main %}

{% trans "Forgotten your password? Enter your email address below, and we'll email instructions for setting a new one." %}

<form method="post" class="form-signin">{% csrf_token %}
{{ form.email.errors }}

{% trans 'Email address:' %} <input id="{{ form.email.id_for_label }}" class="form-control" name="email" type="text" placeholder="Email address" required/>

<input type="submit" class="btn btn-primary btn-block" value="{% trans 'Reset my password' %}" />

</form>

{% endblock %}


text:
/**
 */
package gluemodel.substationStandard.Enumerations;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.common.util.Enumerator;

/**
 *
 * A representation of the literals of the enumeration 'Severity Kind',
 * and utility methods for working with them.
 *
 * @see gluemodel.substationStandard.Enumerations.EnumerationsPackage#getSeverityKind()
 * @model
 * @generated
 */
public enum SeverityKind implements Enumerator {
	/**
	 * The 'Unknown' literal object.
	 *
	 *
	 * @see #UNKNOWN_VALUE
	 * @generated
	 * @ordered
	 */
	UNKNOWN(0, "unknown", "unknown"),

	/**
	 * The 'Critical' literal object.
	 *
	 *
	 * @see #CRITICAL_VALUE
	 * @generated
	 * @ordered
	 */
	CRITICAL(0, "critical", "critical"),

	/**
	 * The 'Major' literal object.
	 *
	 *
	 * @see #MAJOR_VALUE
	 * @generated
	 * @ordered
	 */
	MAJOR(0, "major", "major"),

	/**
	 * The 'Minor' literal object.
	 *
	 *
	 * @see #MINOR_VALUE
	 * @generated
	 * @ordered
	 */
	MINOR(0, "minor", "minor"),

	/**
	 * The 'Warning' literal object.
	 *
	 *
	 * @see #WARNING_VALUE
	 * @generated
	 * @ordered
	 */
	WARNING(0, "warning", "warning");

	/**
	 * The 'Unknown' literal value.
	 *
	 *

	 * If the meaning of 'Unknown' literal object isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @see #UNKNOWN
	 * @model name="unknown"
	 * @generated
	 * @ordered
	 */
	public static final int UNKNOWN_VALUE = 0;

	/**
	 * The 'Critical' literal value.
	 *
	 *

	 * If the meaning of 'Critical' literal object isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @see #CRITICAL
	 * @model name="critical"
	 * @generated
	 * @ordered
	 */
	public static final int CRITICAL_VALUE = 0;

	/**
	 * The 'Major' literal value.
	 *
	 *

	 * If the meaning of 'Major' literal object isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @see #MAJOR
	 * @model name="major"
	 * @generated
	 * @ordered
	 */
	public static final int MAJOR_VALUE = 0;

	/**
	 * The 'Minor' literal value.
	 *
	 *

	 * If the meaning of 'Minor' literal object isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @see #MINOR
	 * @model name="minor"
	 * @generated
	 * @ordered
	 */
	public static final int MINOR_VALUE = 0;

	/**
	 * The 'Warning' literal value.
	 *
	 *

	 * If the meaning of 'Warning' literal object isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @see #WARNING
	 * @model name="warning"
	 * @generated
	 * @ordered
	 */
	public static final int WARNING_VALUE = 0;

	/**
	 * An array of all the 'Severity Kind' enumerators.
	 *
	 *
	 * @generated
	 */
	private static final SeverityKind[] VALUES_ARRAY =
		new SeverityKind[] {
			UNKNOWN,
			CRITICAL,
			MAJOR,
			MINOR,
			WARNING,
		};

	/**
	 * A public read-only list of all the 'Severity Kind' enumerators.
	 *
	 *
	 * @generated
	 */
	public static final List<SeverityKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));

	/**
	 * Returns the 'Severity Kind' literal with the specified literal value.
	 *
	 *
	 * @param literal the literal.
	 * @return the matching enumerator or null.
	 * @generated
	 */
	public static SeverityKind get(String literal) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			SeverityKind result = VALUES_ARRAY[i];
			if (result.toString().equals(literal)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the 'Severity Kind' literal with the specified name.
	 *
	 *
	 * @param name the name.
	 * @return the matching enumerator or null.
	 * @generated
	 */
	public static SeverityKind getByName(String name) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			SeverityKind result = VALUES_ARRAY[i];
			if (result.getName().equals(name)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the 'Severity Kind' literal with the specified integer value.
	 *
	 *
	 * @param value the integer value.
	 * @return the matching enumerator or null.
	 * @generated
	 */
	public static SeverityKind get(int value) {
		switch (value) {
			case UNKNOWN_VALUE: return UNKNOWN;
		}
		return null;
	}

	/**
	 *
	 *
	 * @generated
	 */
	private final int value;

	/**
	 *
	 *
	 * @generated
	 */
	private final String name;

	/**
	 *
	 *
	 * @generated
	 */
	private final String literal;

	/**
	 * Only this class can construct instances.
	 *
	 *
	 * @generated
	 */
	private SeverityKind(int value, String name, String literal) {
		this.value = value;
		this.name = name;
		this.literal = literal;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public int getValue() {
	  return value;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public String getName() {
	  return name;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public String getLiteral() {
	  return literal;
	}

	/**
	 * Returns the literal value of the enumerator, which is its string representation.
	 *
	 *
	 * @generated
	 */
	@Override
	public String toString() {
		return literal;
	}

} //SeverityKind


text: Remake of Cipher-com


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="2dp"
        android:layout_marginRight="5dp"
        android:layout_marginLeft="5dp"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:paddingBottom="5dp"
        android:paddingTop="5dp"
        android:background="@color/listgray"
        android:orientation="vertical">

        <TextView
            android:id="@+id/lbllistTitulo_history_loan"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ellipsize="end"
            android:singleLine="true"
            android:text="Título do Livro"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/lbllistAutor_history_loan"
            android:layout_below="@+id/lbllistTitulo_history_loan"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:ellipsize="end"
            android:singleLine="true"
            android:text="Nome do Autor"
            android:textSize="12sp" />

        <TextView
            android:id="@+id/lbllistBiblioteca_history_loan"
            android:layout_below="@+id/lbllistAutor_history_loan"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingTop="2dp"
            android:textSize="12sp"
            android:text="Nome da Biblioteca"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/lbllistDtDevolucao_history_loan"
            android:layout_below="@+id/lbllistBiblioteca_history_loan"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingBottom="2dp"
            android:paddingTop="2dp"
            android:text="Devolução: 00/00/00 00:00"
            android:textSize="12sp" />
    </LinearLayout>

</RelativeLayout>


text:
<head>
    <title>Meet Me Halfway 2015</title>
    <link href='http://fonts.googleapis.com/css?family=Glegoo|Fauna+One' rel='stylesheet' type='text/css'>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
    <link rel="icon" sizes="16x16 32x32" href="/favicon.ico?v=2">
</head>


text:
/**
 * @file
 * json.h
 */

/******************************************************************************
 *
 * This file has been directly derived from the json-cpp distribution from
 * www.json.org which has been dedicated to the Public Domain
 *
 ******************************************************************************/

#ifndef JSON_JSON_H_INCLUDED
# define JSON_JSON_H_INCLUDED

# include "autolink.h"
# include "value.h"
# include "reader.h"
# include "writer.h"
# include "json_features.h"

#endif // JSON_JSON_H_INCLUDED


text:
Aria.classDefinition({
    $classpath : "test.aria.utils.sandbox.DOMPropertiesTestCase",
    $extends : "aria.jsunit.TestCase",
    $dependencies : ["aria.utils.sandbox.DOMProperties"],
    $prototype : {
        testGetPropertyAccess : function () {
            var domProperties = aria.utils.sandbox.DOMProperties;
            this.assertTrue(domProperties.getPropertyAccess("a", "parentNode") == "--");
            this.assertTrue(domProperties.getPropertyAccess("a", "childNodes") == "--");
            this.assertTrue(domProperties.getPropertyAccess("IMG", "childNodes") == "--");
            this.assertTrue(domProperties.getPropertyAccess("h1", "childNodes") == "--");
            this.assertTrue(domProperties.getPropertyAccess("a", "href") == "rw");
            this.assertTrue(domProperties.getPropertyAccess("a", "src") == "--");
            this.assertTrue(domProperties.getPropertyAccess("img", "href") == "--");
            this.assertTrue(domProperties.getPropertyAccess("img", "src") == "rw");
            this.assertTrue(domProperties.getPropertyAccess("a", "baseURI") == "r-");
            this.assertTrue(domProperties.getPropertyAccess("a", "id") == "r-");
            this.assertTrue(domProperties.getPropertyAccess("IMG", "id") == "r-");
            this.assertTrue(domProperties.getPropertyAccess("H1", "id") == "r-");
            this.assertTrue(domProperties.getPropertyAccess("table", "rows") == "--");
            this.assertTrue(domProperties.getPropertyAccess("textarea", "rows") == "rw");
            this.assertTrue(domProperties.getPropertyAccess("p", "textContent") == "r-");
            this.assertTrue(domProperties.getPropertyAccess("p", "innerHTML") == "r-");
        },

        testIsReadSafe : function () {
            var domProperties = aria.utils.sandbox.DOMProperties;
            this.assertTrue(domProperties.isReadSafe("a", "parentNode") === false);
            this.assertTrue(domProperties.isReadSafe("a", "childNodes") === false);
            this.assertTrue(domProperties.isReadSafe("IMG", "childNodes") === false);
            this.assertTrue(domProperties.isReadSafe("h1", "childNodes") === false);
            this.assertTrue(domProperties.isReadSafe("a", "href") === true);
            this.assertTrue(domProperties.isReadSafe("a", "src") === false);
            this.assertTrue(domProperties.isReadSafe("img", "href") === false);
            this.assertTrue(domProperties.isReadSafe("img", "src") === true);
            this.assertTrue(domProperties.isReadSafe("a", "baseURI") === true);
            this.assertTrue(domProperties.isReadSafe("a", "id") === true);
            this.assertTrue(domProperties.isReadSafe("IMG", "id") === true);
            this.assertTrue(domProperties.isReadSafe("H1", "id") === true);
            this.assertTrue(domProperties.isReadSafe("table", "rows") === false);
            this.assertTrue(domProperties.isReadSafe("textarea", "rows") === true);
            this.assertTrue(domProperties.isReadSafe("p", "textContent") === true);
            this.assertTrue(domProperties.isReadSafe("p", "innerHTML") === true);
        },

        testIsWriteSafe : function () {
            var domProperties = aria.utils.sandbox.DOMProperties;
            this.assertTrue(domProperties.isWriteSafe("a", "parentNode") === false);
            this.assertTrue(domProperties.isWriteSafe("a", "childNodes") === false);
            this.assertTrue(domProperties.isWriteSafe("IMG", "childNodes") === false);
            this.assertTrue(domProperties.isWriteSafe("h1", "childNodes") === false);
            this.assertTrue(domProperties.isWriteSafe("a", "href") === true);
            this.assertTrue(domProperties.isWriteSafe("a", "src") === false);
            this.assertTrue(domProperties.isWriteSafe("img", "href") === false);
            this.assertTrue(domProperties.isWriteSafe("img", "src") === true);
            this.assertTrue(domProperties.isWriteSafe("a", "baseURI") === false);
            this.assertTrue(domProperties.isWriteSafe("a", "id") === false);
            this.assertTrue(domProperties.isWriteSafe("IMG", "id") === false);
            this.assertTrue(domProperties.isWriteSafe("H1", "id") === false);
            this.assertTrue(domProperties.isWriteSafe("table", "rows") === false);
            this.assertTrue(domProperties.isWriteSafe("textarea", "rows") === true);
            this.assertTrue(domProperties.isWriteSafe("p", "textContent") === false);
            this.assertTrue(domProperties.isWriteSafe("p", "innerHTML") === false);
        }
    }
});


text:
<?php
namespace TundraTech\Alpine\Tools;

class Explore
{
	public static $is_themed = false;

	public static $theme = "

	";

	/**
	 * Create a formatted link containing the filename and start/end lines of a function
	 *
	 * @param   string  $start     The starting line of the function's code
	 * @param   string  $end       The end line of the function's code
	 * @param   string  $filename  Name of the file which contains the function
	 * @return  string             Formatted URL linking to the file with the filename and start/end lines of the function
	 */
	public static function get_func_url($start = '', $end = '', $filename = '')
	{
		$line = "File: [$start-$end] $filename";
		return "$line".str_repeat('~', 0)."\n\n";
	}

	/**
	 * Clean irregularly formatted docblick comments
	 *
	 * @param   string   $docs              The docblok to clean
	 * @param   boolean  $highlight_syntax  Enable/disable syntax highlighting
	 * @param   string   $undocumented      Default Undocumented messgae for undocumented docbloks
	 * @return  string                      The formatted docblok.
	 */
	public static function clean_docblok($docs = '', $highlight_syntax = false, $undocumented = "Undocumented class or function.")
	{
		# Default for undocumented
		$docs = $docs ?: "/**\n * $undocumented\n * \n */";
		# Convert tabs to spaces
		$docs = preg_replace('/\t+/', '    ', $docs);
		# Realign offset offset docbloks
		$docs = preg_replace('/\s\s+\*/', "\n *", $docs);
		# Return clean, aligned, and optionally highlighted
		$docs = $highlight_syntax ? Syntax::php($docs, 'doc') : $docs;

		return $docs;
	}

	/**
	 * Create a list containing anchor links to all methods within a class.
	 *
	 * @param   object  $obj  The object to inspect and build the list from.
	 * @return  string        Formatted list of link tags.
	 */
	public static function build_func_list($obj)
	{
		$method = get_class_methods($obj);
		asort($method);
		$links = [];
		foreach ($method as $k => $v) {
			$link = "$v()";
			$links[] = $link;
		}
		$links = implode("\n", $links);

		return $links ? Syntax::php("
Methods:
", 'operators').$links : '';
	}

	/**
	 * Create a syntax highlighted diagram of a class, including parent dependencies,  memebers and functions.
	 *
	 * @param   object  $obj  The object to explore.
	 * @return  string        The formatted diagram of the object.
	 */
	public static function classes($obj)
	{
		echo self::$is_themed ? '' : self::$theme;

		$current_class = new \ReflectionObject($obj);
		$class         = new \ReflectionClass($current_class->getName());
		$parents       = array();

		while ($parent = $class->getParentClass())
		{
			$mod = "
$parstr".implode(' ', \Reflection::getModifierNames($class->getModifiers()));
			$nam = "Class ".$class->getName()."
";
			$lin = self::get_func_url($class->getStartLine(), $class->getEndLine(), $class->getFileName());
			$doc = self::clean_docblok($class->getdocComment(), false, "Undocumented $parstr"."Class");

			$parents[] = "
";
			$parents[] = $lin;
			$parents[] = Syntax::php(trim($mod.$nam), 'all');
			$parents[] = "$doc";
			$properties = implode($class->getProperties());
			$properties = str_replace('<default>', '', $properties);
			$properties = str_replace('Property [ ', '', $properties);
			$properties = str_replace(' ]', '', $properties);
			$properties = explode(' ', $properties);

			$len = 0;
			foreach ($properties as $k => $v) {
				if ($k % 2 !== 0) {
					$test = strlen($v);
					$len = $test > $len ? $test + 1 : $len;
				}
			}

			foreach ($properties as $k => $v) {
				$properties[$k] = ltrim(sprintf("%-{$len}s", $v));
			}
			$properties = implode('', $properties);
			$properties = explode("\n", $properties);
			asort($properties);
			$properties = "
Properties:
".implode("\n", $properties);

			$parents[] = Syntax::php($properties, 'all');
			if ($parstr !== 'Parent ') {
				$parents[] = self::build_func_list($obj);
			}
			$parents[] = "
";

			$parstr = "Parent ";
			$class = $parent;
		}

		$class_info =  "Parents: ".implode(", ", $parents);
		$class_info = Syntax::php($class_info, 'all');

		$classinfo = implode($parents);
		echo $classinfo;

		/*
			$class = new \ReflectionObject($obj);
			ReflectionObject::export($obj);
			$test  = new \ReflectionClass($obj);
			print_r($test->getProperties());

			echo 'getConstants()        '; print_r(         $class->getConstants()                ) .PHP_EOL;
			echo 'getDefaultProperties()'; print_r(         $class->getDefaultProperties()        ) .PHP_EOL;
			echo 'getInterfaceNames()   '; print_r(         $class->getInterfaceNames()           ) .PHP_EOL;
			echo 'getInterfaces()       '; print_r(         $class->getInterfaces()               ) .PHP_EOL;
			echo 'getMethods()          '; print_r(         $class->getMethods()                  ) .PHP_EOL;
			echo 'getProperties()       '; print_r(         $class->getProperties()               ) .PHP_EOL;
			echo 'getStaticProperties() '; print_r(         $class->getStaticProperties()         ) .PHP_EOL;
			echo 'getTraitAliases()     '; print_r(         $class->getTraitAliases()             ) .PHP_EOL;
			echo 'getTraitNames()       '; print_r(         $class->getTraitNames()               ) .PHP_EOL;
			echo 'getTraits()           '; print_r(         $class->getTraits()                   ) .PHP_EOL;
			echo 'hasConstant()         '. AT::boolstr( $class->hasConstant($class->getName())) .PHP_EOL;
			echo 'inNamespace()         '. AT::boolstr( $class->inNamespace()                 ) .PHP_EOL;
			echo 'isAbstract()          '. AT::boolstr( $class->isAbstract()                  ) .PHP_EOL;
			echo 'isCloneable()         '. AT::boolstr( $class->isCloneable()                 ) .PHP_EOL;
			echo 'isFinal()             '. AT::boolstr( $class->isFinal()                     ) .PHP_EOL;
			echo 'isInstantiable()      '. AT::boolstr( $class->isInstantiable()              ) .PHP_EOL;
			echo 'isInterface()         '. AT::boolstr( $class->isInterface()                 ) .PHP_EOL;
			echo 'isInternal()          '. AT::boolstr( $class->isInternal()                  ) .PHP_EOL;
			echo 'isIterateable()       '. AT::boolstr( $class->isIterateable()               ) .PHP_EOL;
			echo 'isTrait()             '. AT::boolstr( $class->isTrait()                     ) .PHP_EOL;
			echo 'isUserDefined()       '. AT::boolstr( $class->isUserDefined()               ) .PHP_EOL;
			echo 'getEndLine()          '.                  $class->getEndLine()                    .PHP_EOL;
			echo 'getModifiers()        '.                  $class->getModifiers()                  .PHP_EOL;
			echo 'getStartLine()        '.                  $class->getStartLine()                  .PHP_EOL;
			echo 'getDocComment()       '.                  $class->getDocComment()                 .PHP_EOL;
			echo 'getExtensionName()    '.                  $class->getExtensionName()              .PHP_EOL;
			echo 'getFileName()         '.                  $class->getFileName()                   .PHP_EOL;
			echo 'getName()             '.                  $class->getName()                       .PHP_EOL;
			echo 'getNamespaceName()    '.                  $class->getNamespaceName()              .PHP_EOL;
			echo 'getShortName()        '.                  $class->getShortName()                  .PHP_EOL;
		*/
	}

	/**
	 * Create a syntax highlighted diagram of class functions, and optionally the current output of each method.
	 * Only use the autofire if you are sure ALL METHODS perform a non-permanent functions.
	 *
	 * --== WARNING, USING AUTOFIRE IS DANGEROUS AND CAN DESTROY DATA PERMANENTLY ==--
	 *
	 * For instance,  autofiring a function called delete_all_users() ...will do exactly that!
	 *
	 * You have been warned!
	 *
	 * @param   object   $obj       The object to explore.
	 * @param   boolean  $autofire  Fire each method, to acertain its current return value.
	 * @return  [type]              [description]
	 */
	public static function methods($obj, $autofire = false)
	{
		echo self::$is_themed ? '' : self::$theme;

		$methods = get_class_methods($obj);
		asort($methods);
		echo "
".PHP_EOL;

		self::classes($obj);
		$cnt = 0;
		foreach ($methods as $m) {
			echo "
";
			$fnc = new \ReflectionMethod($obj, $m);
			$num = $fnc->getNumberOfParameters();
			$req = $fnc->getNumberOfRequiredParameters();
			$arg = $fnc->getParameters();
			$mod = implode(' ', \Reflection::getModifierNames($fnc->getModifiers())).' ';
			$lin = self::get_func_url($fnc->getStartLine(), $fnc->getEndLine(), $fnc->getFileName());
			$exp = $fnc->getEndLine();
			$dbk = $fnc->getDocComment();
			$nam = "function $m";

			# Parse method arguments
			if ($num > 0) {
				$arg = implode($arg, ', ');
				preg_match_all('/\[(.*?)\]/', $arg, $arg);
				$arg = implode($arg[1], ',');
				# Remove optional required tags
				$arg = preg_replace('/<required>|<optional>|/', "", $arg);
				# Strip double spaces
				$arg = preg_replace('/\s+/', "", $arg);
				# Add nice spacing
				$arg = preg_replace('/,/', ', ', $arg);
				# Add Function brackets
				$arg = "($arg)";
			} else {
				# No arguments with this function, empty brackets
				$arg = '()';
			}

			# Completed function string
			$function = $mod.$nam.$arg;

			# Docblock
			$dbk = self::clean_docblok($dbk);
			# Convert tabs to space
			$dbk = preg_replace('/\t+/', '    ', $dbk);
			# Realign offset offset docbloks
			$dbk = preg_replace('/\s\s+\*/', "\n *", $dbk);
			# Completed docblok string
			$dokblock = $dbk;

			# Return Defaults
			$result = 'autofire disabled ';
			$type   = 'safemode';

			# Parse return value
			if ($autofire) {
				if ($req) {
					$result = "...Untested $req required argument(s) needed";
				} else {
					$result = $obj->{$m}();
					$type = gettype($result);
					if ($type === "boolean") {
						$type = AlpStrings::boolstr($result);
						$result = '';
					}
					if ($type === "integer") {
					}
					if ($type === "double") {
					}
					if ($type === "string") {
						$result = "'$result'";
					}
					if ($type === "array") {
						$result = PHP_EOL.PHP_EOL.'{ARR}'.print_r($result, true).'{/ARR}';
					}
					if ($type === "object") {
						$result = 'object';
						#recurse!
					}
					if ($type === "resource") {
						$result = $type;
					}
					if ($type === "NULL") {
						$result = "...Check page src for possible function echo";
					}
					if ($type === "unknown type") {
						$result = $type;
					}
				}
			}

			#divider and Line Info

			# Completed return string
			$result = "".trim("Returned ($type)")." $result";

			$method_info = $dokblock.PHP_EOL.PHP_EOL.$function.PHP_EOL.PHP_EOL.$result;

			$method_info = Syntax::php($method_info, 'all');

			echo $lin;
			echo $method_info;

			echo "
";
		}

		echo '
';

		return;

		/*
			#echo implode(' ', Reflection::getModifierNames($fnc->getModifiers())).PHP_EOL;

			#echo 'getParameters()                 : '.print_r(         $fnc->getParameters()).PHP_EOL;
			#echo 'getStaticVariables()            : '.print_r(         $fnc->getStaticVariables()).PHP_EOL;
			#echo 'isAbstract()                    : '.AT::boolstr( $fnc->isAbstract()).PHP_EOL;
			#echo 'isConstructor()                 : '.AT::boolstr( $fnc->isConstructor()).PHP_EOL;
			#echo 'isDestructor()                  : '.AT::boolstr( $fnc->isDestructor()).PHP_EOL;
			#echo 'isFinal()                       : '.AT::boolstr( $fnc->isFinal()).PHP_EOL;
			#echo 'isPrivate()                     : '.AT::boolstr( $fnc->isPrivate()).PHP_EOL;
			#echo 'isProtected()                   : '.AT::boolstr( $fnc->isProtected()).PHP_EOL;
			#echo 'isPublic()                      : '.AT::boolstr( $fnc->isPublic()).PHP_EOL;
			#echo 'isStatic()                      : '.AT::boolstr( $fnc->isStatic()).PHP_EOL;
			#echo 'inNamespace()                   : '.AT::boolstr( $fnc->inNamespace()).PHP_EOL;
			#echo 'isClosure()                     : '.AT::boolstr( $fnc->isClosure()).PHP_EOL;
			#echo 'isDeprecated()                  : '.AT::boolstr( $fnc->isDeprecated()).PHP_EOL;
			#echo 'isGenerator()                   : '.AT::boolstr( $fnc->isGenerator()).PHP_EOL;
			#echo 'isInternal()                    : '.AT::boolstr( $fnc->isInternal()).PHP_EOL;
			#echo 'isUserDefined()                 : '.AT::boolstr( $fnc->isUserDefined()).PHP_EOL;
			#echo 'returnsReference()              : '.AT::boolstr( $fnc->returnsReference()).PHP_EOL;
			#echo 'Name                            : '.                 $fnc->name.PHP_EOL;
			#echo 'Class                           : '.                 $fnc->class.PHP_EOL;
			#echo 'getModifiers()                  : '.                 implode(' ', Reflection::getModifierNames($fnc->getModifiers())).PHP_EOL;
			#echo 'getEndLine()                    : '.                 $fnc->getEndLine().PHP_EOL;
			#echo 'getNumberOfParameters()         : '.                 $fnc->getNumberOfParameters().PHP_EOL;
			#echo 'getNumberOfRequiredParameters() : '.                 $fnc->getNumberOfRequiredParameters().PHP_EOL;
			#echo 'getStartLine()                  : '.                 $fnc->getStartLine().PHP_EOL;
			#echo 'getDocComment()                 : '.                 $fnc->getDocComment().PHP_EOL;
			#echo 'getExtensionName()              : '.                 $fnc->getExtensionName().PHP_EOL;
			#echo 'getFileName()                   : '.                 $fnc->getFileName().PHP_EOL;
			#echo 'getName()                       : '.                 $fnc->getName().PHP_EOL;
			#echo 'getNamespaceName()              : '.                 $fnc->getNamespaceName().PHP_EOL;
			#echo 'getShortName()                  : '.                 $fnc->getShortName().PHP_EOL;
		*/
	}
}


text:
define(["require", "exports", "doodad/Doodad", "entity/creature/Creature", "entity/npc/NPC", "item/Item", "./RemoveItem"], function (require, exports, Doodad_1, Creature_1, NPC_1, Item_1, RemoveItem_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    function default_1(action, target) {
        if (target instanceof Creature_1.default)
            return creatureManager.remove(target);
        if (target instanceof NPC_1.default)
            return npcManager.remove(target);
        if (target instanceof Doodad_1.default)
            return doodadManager.remove(target, true);
        if (target instanceof Item_1.default)
            return RemoveItem_1.default(action, target);
        if (tileEventManager.is(target))
            return tileEventManager.remove(target);
        if (corpseManager.is(target))
            return corpseManager.remove(target);
    }
    exports.default = default_1;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVtb3ZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2FjdGlvbi9oZWxwZXJzL1JlbW92ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7SUFXQSxtQkFBeUIsTUFBMEIsRUFBRSxNQUE0RDtRQUNoSCxJQUFJLE1BQU0sWUFBWSxrQkFBUTtZQUFFLE9BQU8sZUFBZSxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUN0RSxJQUFJLE1BQU0sWUFBWSxhQUFHO1lBQUUsT0FBTyxVQUFVLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDO1FBQzVELElBQUksTUFBTSxZQUFZLGdCQUFNO1lBQUUsT0FBTyxhQUFhLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRSxJQUFJLENBQUMsQ0FBQztRQUN4RSxJQUFJLE1BQU0sWUFBWSxjQUFJO1lBQUUsT0FBTyxvQkFBVSxDQUFDLE1BQU0sRUFBRSxNQUFNLENBQUMsQ0FBQztRQUM5RCxJQUFJLGdCQUFnQixDQUFDLEVBQUUsQ0FBQyxNQUFNLENBQUM7WUFBRSxPQUFPLGdCQUFnQixDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUN4RSxJQUFJLGFBQWEsQ0FBQyxFQUFFLENBQUMsTUFBTSxDQUFDO1lBQUUsT0FBTyxhQUFhLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQ25FLENBQUM7SUFQRCw0QkFPQyJ9


text:
@echo off
php -d display_errors=stderr -d log_errors=On -d error_log=Off %~dp0\protoc-gen-php.php %*