text:
package play;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import com.jamonapi.Monitor;
import com.jamonapi.MonitorFactory;
import com.jamonapi.utils.Misc;
import org.apache.commons.lang.StringUtils;
import play.Play.Mode;
import play.classloading.ApplicationClasses.ApplicationClass;
import play.classloading.enhancers.*;
import play.exceptions.UnexpectedException;
import play.libs.Crypto;
import play.mvc.Http.Header;
import play.mvc.Http.Request;
import play.mvc.Http.Response;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.*;

import static java.util.Arrays.asList;

/**
 * Plugin used for core tasks
 */
public class CorePlugin extends PlayPlugin {

    /**
     * Get the application status
     */
    public static String computeApplicationStatus(boolean json) {
        if (json) {
            JsonObject o = new JsonObject();
            for (PlayPlugin plugin : Play.pluginCollection.getEnabledPlugins()) {
                try {
                    JsonObject status = plugin.getJsonStatus();
                    if (status != null) {
                        o.add(plugin.getClass().getName(), status);
                    }
                } catch (Throwable e) {
                    JsonObject error = new JsonObject();
                    error.add("error", new JsonPrimitive(e.getMessage()));
                    o.add(plugin.getClass().getName(), error);
                }
            }
            return o.toString();
        }
        StringBuilder dump = new StringBuilder(16);
        for (PlayPlugin plugin : Play.pluginCollection.getEnabledPlugins()) {
            try {
                String status = plugin.getStatus();
                if (status != null) {
                    dump.append(status);
                    dump.append("\n");
                }
            } catch (Throwable e) {
                dump.append(plugin.getClass().getName()).append(".getStatus() has failed (").append(e.getMessage()).append(")");
            }
        }
        return dump.toString();
    }

    /**
     * Intercept /@status and check that the Authorization header is valid.
     * Then ask each plugin for a status dump and send it over the HTTP response.
     *
     * You can ask the /@status using the authorization header and putting your status secret key in it.
     * Prior to that you would be required to start play with  a -DstatusKey=yourkey
     */
    @Override
    public boolean rawInvocation(Request request, Response response) throws Exception {
        if (Play.mode == Mode.DEV && request.path.equals("/@kill")) {
            System.out.println("@KILLED");
            if (Play.standalonePlayServer) {
                System.exit(0);
            } else {
                Logger.error("Cannot execute @kill since Play is not running as standalone server");
            }
        }
        if (request.path.equals("/@status") || request.path.equals("/@status.json")) {
            if(!Play.started) {
                response.print("Application is not started");
                response.status = 503;
                return true;
            }
            response.contentType = request.path.contains(".json") ? "application/json" : "text/plain";
            Header authorization = request.headers.get("authorization");
            if (authorization != null && (Crypto.sign("@status").equals(authorization.value()) || System.getProperty("statusKey", Play.secretKey).equals(authorization.value()))) {
                response.print(computeApplicationStatus(request.path.contains(".json")));
                response.status = 200;
                return true;
            }
            response.status = 401;
            if (response.contentType.equals("application/json")) {
                response.print("{\"error\": \"Not authorized\"}");
            } else {
                response.print("Not authorized");
            }
            return true;
        }
        return super.rawInvocation(request, response);
    }

    /**
     * Retrieve status about play core.
     */
    @Override
    public String getStatus() {
        StringWriter sw = new StringWriter();
        PrintWriter out = new PrintWriter(sw);
        out.println("Java:");
        out.println("~~~~~");
        out.println("Version: " + System.getProperty("java.version"));
        out.println("Home: " + System.getProperty("java.home"));
        out.println("Max memory: " + Runtime.getRuntime().maxMemory());
        out.println("Free memory: " + Runtime.getRuntime().freeMemory());
        out.println("Total memory: " + Runtime.getRuntime().totalMemory());
        out.println("Available processors: " + Runtime.getRuntime().availableProcessors());
        out.println();
        out.println("Play framework:");
        out.println("~~~~~~~~~~~~~~~");
        out.println("Version: " + Play.version);
        out.println("Path: " + Play.frameworkPath);
        out.println("ID: " + (StringUtils.isEmpty(Play.id) ? "(not set)" : Play.id));
        out.println("Mode: " + Play.mode);
        out.println("Tmp dir: " + (Play.tmpDir == null ? "(no tmp dir)" : Play.tmpDir));
        out.println();
        out.println("Application:");
        out.println("~~~~~~~~~~~~");
        out.println("Path: " + Play.applicationPath);
        out.println("Name: " + Play.configuration.getProperty("application.name", "(not set)"));
        out.println("Started at: " + (Play.started ? new SimpleDateFormat("MM/dd/yyyy HH:mm").format(new Date(Play.startedAt)) : "Not yet started"));
        out.println();
        out.println("Loaded modules:");
        out.println("~~~~~~~~~~~~~~");
        for (String module : Play.modules.keySet()) {
            out.println(module + " at " + Play.modules.get(module).getRealFile());
        }
        out.println();
        out.println("Loaded plugins:");
        out.println("~~~~~~~~~~~~~~");
        for (PlayPlugin plugin : Play.pluginCollection.getAllPlugins()) {
            out.println(plugin.index + ":" + plugin.getClass().getName() + " [" + (Play.pluginCollection.isEnabled(plugin) ? "enabled" : "disabled") + "]");
        }
        out.println();
        out.println("Threads:");
        out.println("~~~~~~~~");
        try {
            visit(out, getRootThread(), 0);
        } catch (Throwable e) {
            out.println("Oops; " + e.getMessage());
        }
        out.println();
        out.println("Requests execution pool:");
        out.println("~~~~~~~~~~~~~~~~~~~~~~~~");
        out.println("Pool size: " + Invoker.executor.getPoolSize());
        out.println("Active count: " + Invoker.executor.getActiveCount());
        out.println("Scheduled task count: " + Invoker.executor.getTaskCount());
        out.println("Queue size: " + Invoker.executor.getQueue().size());
        out.println();
        try {
            out.println("Monitors:");
            out.println("~~~~~~~~");
            List<Monitor> monitors = new ArrayList<>(asList(MonitorFactory.getRootMonitor().getMonitors()));
            Collections.sort(monitors, new Comparator<Monitor>() {
                @Override public int compare(Monitor m1, Monitor m2) {
                    return Double.compare(m2.getTotal(), m1.getTotal());
                }
            });
            int lm = 10;
            for (Monitor monitor : monitors) {
                if (monitor.getLabel().length() > lm) {
                    lm = monitor.getLabel().length();
                }
            }
            for (Monitor monitor : monitors) {
                if (monitor.getHits() > 0) {
                    out.println(String.format("%-" + lm + "s -> %8.0f hits; %8.1f avg; %8.1f min; %8.1f max;",
                        monitor.getLabel(), monitor.getHits(), monitor.getAvg(), monitor.getMin(), monitor.getMax()));
                }
            }
        } catch (Exception e) {
            out.println("No monitors found: " + e);
        }
        return sw.toString();
    }

    @Override
    public JsonObject getJsonStatus() {
        JsonObject status = new JsonObject();

        {
            JsonObject java = new JsonObject();
            java.addProperty("version", System.getProperty("java.version"));
            status.add("java", java);
        }

        {
            JsonObject memory = new JsonObject();
            memory.addProperty("max", Runtime.getRuntime().maxMemory());
            memory.addProperty("free", Runtime.getRuntime().freeMemory());
            memory.addProperty("total", Runtime.getRuntime().totalMemory());
            status.add("memory", memory);
        }

        {
            JsonObject application = new JsonObject();
            application.addProperty("uptime", Play.started ? System.currentTimeMillis() - Play.startedAt : -1);
            application.addProperty("path", Play.applicationPath.getAbsolutePath());
            status.add("application", application);
        }

        {
            JsonObject pool = new JsonObject();
            pool.addProperty("size", Invoker.executor.getPoolSize());
            pool.addProperty("active", Invoker.executor.getActiveCount());
            pool.addProperty("scheduled", Invoker.executor.getTaskCount());
            pool.addProperty("queue", Invoker.executor.getQueue().size());
            status.add("pool", pool);
        }

        {
            JsonArray monitors = new JsonArray();
            try {
                Object[][] data = Misc.sort(MonitorFactory.getRootMonitor().getBasicData(), 3, "desc");
                for (Object[] row : data) {
                    if (((Double) row[1]) > 0) {
                        JsonObject o = new JsonObject();
                        o.addProperty("name", row[0].toString());
                        o.addProperty("hits", (Double) row[1]);
                        o.addProperty("avg", (Double) row[2]);
                        o.addProperty("min", (Double) row[6]);
                        o.addProperty("max", (Double) row[7]);
                        monitors.add(o);
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            status.add("monitors", monitors);
        }

        return status;
    }

    /**
     * Recursively visit all JVM threads
     */
    static void visit(PrintWriter out, ThreadGroup group, int level) {
        // Get threads in `group'
        int numThreads = group.activeCount();
        Thread[] threads = new Thread[numThreads * 2];
        numThreads = group.enumerate(threads, false);

        // Enumerate each thread in `group'
        for (int i = 0; i < numThreads; i++) {
            // Get thread
            Thread thread = threads[i];
            out.println(thread + " " + thread.getState());
        }

        // Get thread subgroups of `group'
        int numGroups = group.activeGroupCount();
        ThreadGroup[] groups = new ThreadGroup[numGroups * 2];
        numGroups = group.enumerate(groups, false);

        // Recursively visit each subgroup
        for (int i = 0; i < numGroups; i++) {
            visit(out, groups[i], level + 1);
        }
    }

    /**
     * Retrieve the JVM root thread group.
     */
    static ThreadGroup getRootThread() {
        ThreadGroup root = Thread.currentThread().getThreadGroup().getParent();
        while (root.getParent() != null) {
            root = root.getParent();
        }
        return root;
    }

    protected Enhancer[] defaultEnhancers() {
        return new Enhancer[] {
            new PropertiesEnhancer(),
            new ContinuationEnhancer(),
            new SigEnhancer(),
            new ControllersEnhancer(),
            new MailerEnhancer(),
            new LocalvariablesNamesEnhancer()
        };
    }

    @Override
    public void enhance(ApplicationClass applicationClass) throws Exception {
        for (Enhancer enhancer : defaultEnhancers()) {
            try {
                long start = System.currentTimeMillis();
                enhancer.enhanceThisClass(applicationClass);
                if (Logger.isTraceEnabled()) {
                    Logger.trace("%sms to apply %s to %s", System.currentTimeMillis() - start, enhancer.getClass().getSimpleName(), applicationClass.name);
                }
            } catch (Exception e) {
                throw new UnexpectedException("While applying " + enhancer + " on " + applicationClass.name, e);
            }
        }
    }
}


text:
function handle = createArrow(R0, t0, param, varargin)
% CREATEARROW
%   handle = createArrow(R0, t0, param, ...)
%
%   R0 is the 3x3 orientation matrix of the Arrow
%   t0 is the 3x1 position of the tail of the arrow
%   param is a struct containing the fields
%       radius - radius of arrow body
%       length - length of entire arrow
%       head_radius - radius of arrow head
%       head_height - height of arrow head
%
%   Additional parameters include:
%       'Color':        default: [0;0;0]
%       'FaceAlpha':    default: 1
%       'EdgeAlpha':    default: 1
%
%   Depends on the following drawing package files:
%       createCylinder.m
%       attachPrefix.m
%       combineRigidBodies.m
%
%   see also CREATECYLINDER
%
%   retursn handle to drawing structure

    flags = {'Color', 'FaceAlpha', 'EdgeAlpha'};
    defaults = {[0;0;0], 1, 0};

    opt_values = mrbv_parse_input(varargin, flags, defaults);
    c = opt_values{1};
    fa = opt_values{2};
    ea = opt_values{3};

    z0 = [0;0;1];

    shaft_param.radius = param.radius;
    shaft_param.height = param.length - param.head_height;
    t_shaft = t0 + shaft_param.height/2*R0*z0;

    head_param.radius2 = param.head_radius;
    head_param.radius = 0;
    head_param.height = param.head_height;
    t_head = t0 + (shaft_param.height + head_param.height/2)*R0*z0;

    arrow_props = {'FaceColor',c,'EdgeColor',[0;0;0], ...
                    'FaceAlpha',fa,'EdgeAlpha',ea};

    shaft = createCylinder(R0,t_shaft,shaft_param,arrow_props{:});
    head = createCylinder(R0,t_head,head_param,arrow_props{:});
    shaft.labels = attachPrefix('arrow_shaft_',shaft.labels);
    head.labels = attachPrefix('arrow_head_',head.labels);

    handle = combineRigidBodies(shaft,head);
end

redpajama_set_name: RedPajamaGithub


text:
package org.gradle.foundation;

/**
 * Small helper class that aids walking a full task path which can be multiple projects deep with a task on the end.
 */
public class PathParserPortion {
    private String firstPart;
    private String remainder;

    public PathParserPortion(String path) {
        if (path != null && path.length() > 0) {
            if (path.startsWith(":"))    //skip the first character, if its a colon. This is optional and makes it absolute, vs relative.
            {
                path = path.substring(1);
            }

            int indexOfColon = path.indexOf(':');
            if (indexOfColon == -1) {
                firstPart = path;
            } else {
                firstPart = path.substring(0, indexOfColon);  //get everyting up to the colon
                remainder = path.substring(indexOfColon + 1); //everything else
            }
        }
    }

    public String getFirstPart() {
        return firstPart;
    }

    public String getRemainder() {
        return remainder;
    }

    public boolean hasRemainder() {
        return remainder != null;
    }

    public String toString() {
        return firstPart + " -> " + remainder;
    }
}


text:
#ifndef _FRONTENDS_P4_STRUCTINITIALIZERS_H_
#define _FRONTENDS_P4_STRUCTINITIALIZERS_H_

#include "ir/ir.h"
#include "frontends/p4/typeChecking/typeChecker.h"

namespace P4 {

/// Converts some list expressions into struct initializers.
class CreateStructInitializers : public Transform {
    ReferenceMap* refMap;
    TypeMap* typeMap;
 public:
    CreateStructInitializers(ReferenceMap* refMap, TypeMap* typeMap):
            refMap(refMap), typeMap(typeMap) {
        setName("CreateStructInitializers");
        CHECK_NULL(refMap); CHECK_NULL(typeMap);
    }

    const IR::Node* postorder(IR::AssignmentStatement* statement) override;
    const IR::Node* postorder(IR::MethodCallExpression* expression) override;
    const IR::Node* postorder(IR::Operation_Relation* expression) override;
    const IR::Node* postorder(IR::Declaration_Variable* statement) override;
};

class StructInitializers : public PassManager {
 public:
    StructInitializers(ReferenceMap* refMap, TypeMap* typeMap) {
        setName("StructInitializers");
        passes.push_back(new TypeChecking(refMap, typeMap));
        passes.push_back(new CreateStructInitializers(refMap, typeMap));
        passes.push_back(new ClearTypeMap(typeMap));
    }
};

}  // namespace P4

#endif /* _FRONTENDS_P4_STRUCTINITIALIZERS_H_ */


text:
Calibrate::Calibrate(Testing::testID_t id):Client::Suite(id)
{
}

void Calibrate::empty()
{
}

void Calibrate::setUp(Testing::testID_t,std::vector<Testing::param_t>& ,Client::PatternMgr *)
{
}

void Calibrate::tearDown(Testing::testID_t,Client::PatternMgr *)
{

}


text:
package org.apache.harmony.unpack200.tests;

import junit.framework.TestCase;

import org.apache.harmony.unpack200.IMatcher;
import org.apache.harmony.unpack200.SegmentUtils;

public class SegmentUtilsTest extends TestCase {

    private static class MultipleMatches implements IMatcher {

        private final int divisor;

        public MultipleMatches(int divisor) {
            this.divisor = divisor;
        }

        public boolean matches(long value) {
            return value % divisor == 0;
        }

    }

    public static final IMatcher even = new MultipleMatches(2);
    public static final IMatcher five = new MultipleMatches(5);

    public void testCountArgs() {
        assertEquals(0, SegmentUtils.countArgs("()V"));
        assertEquals(1, SegmentUtils.countArgs("(D)V"));
        assertEquals(1, SegmentUtils.countArgs("([D)V"));
        assertEquals(1, SegmentUtils.countArgs("([[D)V"));
        assertEquals(2, SegmentUtils.countArgs("(DD)V"));
        assertEquals(3, SegmentUtils.countArgs("(DDD)V"));
        assertEquals(2, SegmentUtils.countArgs("(Lblah/blah;D)V"));
        assertEquals(3, SegmentUtils.countArgs("(Lblah/blah;DLbLah;)V"));
    }

    public void testCountInvokeInterfaceArgs() {
        assertEquals(1, SegmentUtils.countInvokeInterfaceArgs("(Z)V"));
        assertEquals(2, SegmentUtils.countInvokeInterfaceArgs("(D)V"));
        assertEquals(2, SegmentUtils.countInvokeInterfaceArgs("(J)V"));
        assertEquals(1, SegmentUtils.countInvokeInterfaceArgs("([D)V"));
        assertEquals(1, SegmentUtils.countInvokeInterfaceArgs("([[D)V"));
        assertEquals(4, SegmentUtils.countInvokeInterfaceArgs("(DD)V"));
        assertEquals(3, SegmentUtils
                .countInvokeInterfaceArgs("(Lblah/blah;D)V"));
        assertEquals(4, SegmentUtils
                .countInvokeInterfaceArgs("(Lblah/blah;DLbLah;)V"));
        assertEquals(4, SegmentUtils
                .countInvokeInterfaceArgs("([Lblah/blah;DLbLah;)V"));
    }

    public void testMatches() {
        long[] oneToTen = new long[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
        assertEquals(6, SegmentUtils.countMatches(new long[][] { oneToTen,
                new long[] { 5, 6, 7 } }, even));
        assertEquals(5, SegmentUtils.countMatches(new long[][] { oneToTen },
                even));
        assertEquals(5, SegmentUtils.countMatches(oneToTen, even));
        assertEquals(3, SegmentUtils.countMatches(new long[][] { oneToTen,
                new long[] { 5, 6, 7 } }, five));
        assertEquals(2, SegmentUtils.countMatches(new long[][] { oneToTen },
                five));
        assertEquals(2, SegmentUtils.countMatches(oneToTen, five));
    }
}


text:
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics.Contracts;
using System;

// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
// Disable the "this variable is never assigned to".
#pragma warning disable 0067
// Disable the "this event is never assigned to".
#pragma warning disable 0649
// Disable the "this variable is never used".
#pragma warning disable 0169
// Disable the "new keyword not required" warning.
#pragma warning disable 0109
// Disable the "extern without DllImport" warning.
#pragma warning disable 0626
// Disable the "could hide other member" warning, can happen on certain properties.
#pragma warning disable 0108

namespace System.ComponentModel
{
  abstract public partial class License : IDisposable
  {
    #region Methods and constructors
    public abstract void Dispose();

    protected License()
    {
    }
    #endregion

    #region Properties and indexers
    public abstract string LicenseKey
    {
      get;
    }
    #endregion
  }
}


text:
#include "../../../StroikaPreComp.h"

#include "../../../Characters/StringBuilder.h"
#include "../../../Characters/String_Constant.h"
#include "../../../Characters/ToString.h"
#include "../../../Streams/TextReader.h"
#include "../HTTP/Headers.h"

#include "Request.h"

using namespace Stroika::Foundation;
using namespace Stroika::Foundation::Characters;
using namespace Stroika::Foundation::IO::Network;
using namespace Stroika::Foundation::IO::Network::Transfer;

/*
 ********************************************************************************
 ******************************* Transfer::Request ******************************
 ********************************************************************************
 */
InternetMediaType Request::GetContentType () const
{
    optional<String> i = fOverrideHeaders.Lookup (String_Constant{HTTP::HeaderName::kContentType});
    if (i) {
        return InternetMediaType (*i);
    }
    return InternetMediaType ();
}

void Request::SetContentType (const InternetMediaType& ct)
{
    fOverrideHeaders.Add (String_Constant{HTTP::HeaderName::kContentType}, ct.As<String> ());
}

String Request::ToString () const
{
    StringBuilder sb;
    sb += L"{";
    sb += L"Method: " + Characters::ToString (fMethod) + L",";
    sb += L"fAuthorityRelativeURL: " + Characters::ToString (fAuthorityRelativeURL) + L",";
    sb += L"fOverrideHeaders: " + Characters::ToString (fOverrideHeaders) + L",";
    sb += L"fData: " + Characters::ToString (fData) + L",";
    sb += L"}";
    return sb.str ();
}


text:
FROM whlee21/centos6-cdh5-base

MAINTAINER Wanhee Lee <whlee21@gmail.com>

RUN yum --disablerepo=epel --enablerepo=local-cdh5 install -y hive-server2 hive-hbase hive-hcatalog; yum clean all

ADD ./conf /etc/hive/conf.docker
RUN alternatives --install /etc/hive/conf hive-conf /etc/hive/conf.docker 50
RUN alternatives --set hive-conf /etc/hive/conf.docker

RUN mv -f /etc/supervisord.conf /etc/supervisord.conf.org
ADD ./supervisord.conf /etc/

# for sshd
EXPOSE 22

CMD ["/usr/bin/supervisord"]


text:
@interface MLDeviceInfoModel : NSObject

@property (nonatomic, strong) NSString *deviceID;
@property (nonatomic, strong) NSString *profileVersion;
@property (nonatomic, strong) NSString *firmwareVersion;
@property (nonatomic) NSUInteger feature;
@property (nonatomic) NSUInteger appearence;
@property (nonatomic) NSUInteger hardwareVersion;

- (instancetype)initWithData:(NSData *)data;
- (NSData *)data;

@end


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

import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.junit.BeforeClass;
import org.junit.Test;

public class UndertowMethodRestricTest extends BaseUndertowTest {

    private static String url;

    @BeforeClass
    public static void init() {
        url = "http://localhost:" + getPort() + "/methodRestrict";
    }

    @Test
    public void testProperHttpMethod() throws Exception {
        HttpClient httpClient = new HttpClient();
        PostMethod httpPost = new PostMethod(url);

        StringRequestEntity reqEntity = new StringRequestEntity("This is a test", null, null);
        httpPost.setRequestEntity(reqEntity);

        int status = httpClient.executeMethod(httpPost);

        assertEquals(200, status);

        String result = httpPost.getResponseBodyAsString();
        assertEquals("This is a test response", result);
    }

    @Test
    public void testImproperHttpMethod() throws Exception {
        HttpClient httpClient = new HttpClient();
        GetMethod httpGet = new GetMethod(url);
        int status = httpClient.executeMethod(httpGet);

        assertEquals("Get a wrong response status", 405, status);
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("undertow://http://localhost:{{port}}/methodRestrict?httpMethodRestrict=POST").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        Message in = exchange.getIn();
                        String request = in.getBody(String.class);
                        exchange.getOut().setBody(request + " response");
                    }
                });
            }
        };
    }
}


text:
<?php

require_once 'PHPUnit/Util/Filter.php';
require_once 'PHPUnit/Runner/IncludePathTestCollector.php';
require_once 'PHPUnit/Util/XML.php';

PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');

/**
 * Wrapper for the PHPUnit XML configuration file.
 *
 * Example XML configuration file:
 * <code>
 * <?xml version="1.0" encoding="utf-8" ?>
 *
 * <phpunit backupGlobals="true"
 *          backupStaticAttributes="false"
 *          bootstrap="/path/to/bootstrap.php"
 *          colors="false"
 *          convertErrorsToExceptions="true"
 *          convertNoticesToExceptions="true"
 *          convertWarningsToExceptions="true"
 *          processIsolation="false"
 *          stopOnFailure="false"
 *          syntaxCheck="false"
 *          testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader">
 *   <testsuites>
 *     <testsuite name="My Test Suite">
 *       <directory suffix="Test.php">/path/to/files</directory>
 *       <file>/path/to/MyTest.php</file>
 *     </testsuite>
 *   </testsuites>
 *
 *   <groups>
 *     <include>
 *       <group>name</group>
 *     </include>
 *     <exclude>
 *       <group>name</group>
 *     </exclude>
 *   </groups>
 *
 *   <filter>
 *     <blacklist>
 *       <directory suffix=".php">/path/to/files</directory>
 *       <file>/path/to/file</file>
 *       <exclude>
 *         <directory suffix=".php">/path/to/files</directory>
 *         <file>/path/to/file</file>
 *       </exclude>
 *     </blacklist>
 *     <whitelist addUncoveredFilesFromWhitelist="true">
 *       <directory suffix=".php">/path/to/files</directory>
 *       <file>/path/to/file</file>
 *       <exclude>
 *         <directory suffix=".php">/path/to/files</directory>
 *         <file>/path/to/file</file>
 *       </exclude>
 *     </whitelist>
 *   </filter>
 *
 *   <listeners>
 *     <listener class="MyListener" file="/optional/path/to/MyListener.php">
 *       <arguments>
 *         <array>
 *           <element key="0">
 *             <string>Sebastian</string>
 *           </element>
 *         </array>
 *         <integer>22</integer>
 *         <string>April</string>
 *         <double>19.78</double>
 *         <null/>
 *         <object class="stdClass"/>
 *       </arguments>
 *     </listener>
 *   </listeners>
 *
 *   <logging>
 *     <log type="coverage-html" target="/tmp/report" title="My Project"
            charset="UTF-8" yui="true" highlight="false"
 *          lowUpperBound="35" highLowerBound="70"/>
 *     <log type="coverage-clover" target="/tmp/clover.xml"/>
 *     <log type="coverage-source" target="/tmp/coverage"/>
 *     <log type="graphviz" target="/tmp/logfile.dot"/>
 *     <log type="json" target="/tmp/logfile.json"/>
 *     <log type="metrics-xml" target="/tmp/metrics.xml"/>
 *     <log type="plain" target="/tmp/logfile.txt"/>
 *     <log type="pmd-xml" target="/tmp/pmd.xml" cpdMinLines="5" cpdMinMatches="70"/>
 *     <log type="tap" target="/tmp/logfile.tap"/>
 *     <log type="junit" target="/tmp/logfile.xml" logIncompleteSkipped="false"/>
 *     <log type="story-html" target="/tmp/story.html"/>
 *     <log type="story-text" target="/tmp/story.txt"/>
 *     <log type="testdox-html" target="/tmp/testdox.html"/>
 *     <log type="testdox-text" target="/tmp/testdox.txt"/>
 *
 *     <pmd>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Project_CRAP"
 *             threshold="5,30" priority="1"/>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Class_DepthOfInheritanceTree"
 *             threshold="6" priority="1"/>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Class_EfferentCoupling"
 *             threshold="20" priority="1"/>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Class_ExcessiveClassLength"
 *             threshold="1000" priority="1"/>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Class_ExcessivePublicCount"
 *             threshold="45" priority="1"/>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Class_TooManyFields"
 *             threshold="15" priority="1"/>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Function_CodeCoverage"
 *             threshold="35,70" priority="1"/>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Function_CRAP"
 *             threshold="30" priority="1"/>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Function_CyclomaticComplexity"
 *             threshold="20" priority="1"/>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Function_ExcessiveMethodLength"
 *             threshold="100" priority="1"/>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Function_ExcessiveParameterList"
 *             threshold="10" priority="1"/>
 *       <rule class="PHPUnit_Util_Log_PMD_Rule_Function_NPathComplexity"
 *             threshold="200" priority="1"/>
 *     </pmd>
 *   </logging>
 *
 *   <php>
 *     <ini name="foo" value="bar"/>
 *     <const name="foo" value="bar"/>
 *     <var name="foo" value="bar"/>
 *   </php>
 *
 *   <selenium>
 *     <browser name="Firefox on Linux"
 *              browser="*firefox /usr/lib/firefox/firefox-bin"
 *              host="my.linux.box"
 *              port="4444"
 *              timeout="30000"/>
 *   </selenium>
 * </phpunit>
 * </code>
 *
 * @category   Testing
 * @package    PHPUnit
 * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @copyright  2002-2010 Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: @package_version@
 * @link       http://www.phpunit.de/
 * @since      Class available since Release 3.2.0
 */
class PHPUnit_Util_Configuration
{
    private static $instances = array();

    protected $document;
    protected $xpath;

    /**
     * Loads a PHPUnit configuration file.
     *
     * @param  string $filename
     */
    protected function __construct($filename)
    {
        $this->document = PHPUnit_Util_XML::loadFile($filename);
        $this->xpath    = new DOMXPath($this->document);
    }

    /**
     * @since  Method available since Release 3.4.0
     */
    private final function __clone()
    {
    }

    /**
     * Returns a PHPUnit configuration object.
     *
     * @param  string $filename
     * @return PHPUnit_Util_Configuration
     * @since  Method available since Release 3.4.0
     */
    public static function getInstance($filename) {
        $realpath = realpath($filename);

        if ($realpath === FALSE) {
            throw new PHPUnit_Framework_Exception(
              sprintf(
                'Could not read "%s".',
                $filename
              )
            );
        }

        if (!isset(self::$instances[$realpath])) {
            self::$instances[$realpath] = new PHPUnit_Util_Configuration($realpath);
        }

        return self::$instances[$realpath];
    }

    /**
     * Returns the configuration for SUT filtering.
     *
     * @return array
     * @since  Method available since Release 3.2.1
     */
    public function getFilterConfiguration()
    {
        $addUncoveredFilesFromWhitelist = TRUE;

        $tmp = $this->xpath->query('filter/whitelist');

        if ($tmp->length == 1 &&
            $tmp->item(0)->hasAttribute('addUncoveredFilesFromWhitelist')) {
            $addUncoveredFilesFromWhitelist = $this->getBoolean(
              (string)$tmp->item(0)->getAttribute('addUncoveredFilesFromWhitelist'),
              TRUE
            );
        }

        return array(
          'blacklist' => array(
            'include' => array(
              'directory' => $this->readFilterDirectories(
                'filter/blacklist/directory'
              ),
              'file' => $this->readFilterFiles(
                'filter/blacklist/file'
              )
            ),
            'exclude' => array(
              'directory' => $this->readFilterDirectories(
                'filter/blacklist/exclude/directory'
               ),
              'file' => $this->readFilterFiles(
                'filter/blacklist/exclude/file'
              )
            )
          ),
          'whitelist' => array(
            'addUncoveredFilesFromWhitelist' => $addUncoveredFilesFromWhitelist,
            'include' => array(
              'directory' => $this->readFilterDirectories(
                'filter/whitelist/directory'
              ),
              'file' => $this->readFilterFiles(
                'filter/whitelist/file'
              )
            ),
            'exclude' => array(
              'directory' => $this->readFilterDirectories(
                'filter/whitelist/exclude/directory'
              ),
              'file' => $this->readFilterFiles(
                'filter/whitelist/exclude/file'
              )
            )
          )
        );
    }

    /**
     * Returns the configuration for groups.
     *
     * @return array
     * @since  Method available since Release 3.2.1
     */
    public function getGroupConfiguration()
    {
        $groups = array(
          'include' => array(),
          'exclude' => array()
        );

        foreach ($this->xpath->query('groups/include/group') as $group) {
            $groups['include'][] = (string)$group->nodeValue;
        }

        foreach ($this->xpath->query('groups/exclude/group') as $group) {
            $groups['exclude'][] = (string)$group->nodeValue;
        }

        return $groups;
    }

    /**
     * Returns the configuration for listeners.
     *
     * @return array
     * @since  Method available since Release 3.4.0
     */
    public function getListenerConfiguration()
    {
        $result = array();

        foreach ($this->xpath->query('listeners/listener') as $listener) {
            $class     = (string)$listener->getAttribute('class');
            $file      = '';
            $arguments = array();

            if ($listener->hasAttribute('file')) {
                $file = (string)$listener->getAttribute('file');
            }

            if ($listener->childNodes->item(1) instanceof DOMElement &&
                $listener->childNodes->item(1)->tagName == 'arguments') {
                foreach ($listener->childNodes->item(1)->childNodes as $argument) {
                    if ($argument instanceof DOMElement) {
                        $arguments[] = PHPUnit_Util_XML::xmlToVariable($argument);
                    }
                }
            }

            $result[] = array(
              'class'     => $class,
              'file'      => $file,
              'arguments' => $arguments
            );
        }

        return $result;
    }

    /**
     * Returns the logging configuration.
     *
     * @return array
     */
    public function getLoggingConfiguration()
    {
        $result = array();

        foreach ($this->xpath->query('logging/log') as $log) {
            $type   = (string)$log->getAttribute('type');
            $target = (string)$log->getAttribute('target');

            if ($type == 'coverage-html') {
                if ($log->hasAttribute('title')) {
                    $result['title'] = (string)$log->getAttribute('title');
                }

                if ($log->hasAttribute('charset')) {
                    $result['charset'] = (string)$log->getAttribute('charset');
                }

                if ($log->hasAttribute('lowUpperBound')) {
                    $result['lowUpperBound'] = (string)$log->getAttribute('lowUpperBound');
                }

                if ($log->hasAttribute('highLowerBound')) {
                    $result['highLowerBound'] = (string)$log->getAttribute('highLowerBound');
                }

                if ($log->hasAttribute('yui')) {
                    $result['yui'] = $this->getBoolean(
                      (string)$log->getAttribute('yui'),
                      FALSE
                    );
                }

                if ($log->hasAttribute('highlight')) {
                    $result['highlight'] = $this->getBoolean(
                      (string)$log->getAttribute('highlight'),
                      FALSE
                    );
                }
            }

            else if ($type == 'pmd-xml') {
                if ($log->hasAttribute('cpdMinLines')) {
                    $result['cpdMinLines'] = (string)$log->getAttribute('cpdMinLines');
                }

                if ($log->hasAttribute('cpdMinMatches')) {
                    $result['cpdMinMatches'] = (string)$log->getAttribute('cpdMinMatches');
                }
            }

            else if ($type == 'junit' || $type == 'test-xml') {
                if ($log->hasAttribute('logIncompleteSkipped')) {
                    $result['logIncompleteSkipped'] = $this->getBoolean(
                      (string)$log->getAttribute('logIncompleteSkipped'),
                      FALSE
                    );
                }
            }

            $result[$type] = $target;
        }

        return $result;
    }

    /**
     * Returns the PHP configuration.
     *
     * @return array
     * @since  Method available since Release 3.2.1
     */
    public function getPHPConfiguration()
    {
        $result = array(
          'ini'   => array(),
          'const' => array(),
          'var'   => array()
        );

        foreach ($this->xpath->query('php/ini') as $ini) {
            $name  = (string)$ini->getAttribute('name');
            $value = (string)$ini->getAttribute('value');

            $result['ini'][$name] = $value;
        }

        foreach ($this->xpath->query('php/const') as $const) {
            $name  = (string)$const->getAttribute('name');
            $value = (string)$const->getAttribute('value');

            if (strtolower($value) == 'false') {
                $value = FALSE;
            }

            else if (strtolower($value) == 'true') {
                $value = TRUE;
            }

            $result['const'][$name] = $value;
        }

        foreach ($this->xpath->query('php/var') as $var) {
            $name  = (string)$var->getAttribute('name');
            $value = (string)$var->getAttribute('value');

            if (strtolower($value) == 'false') {
                $value = FALSE;
            }

            else if (strtolower($value) == 'true') {
                $value = TRUE;
            }

            $result['var'][$name] = $value;
        }

        return $result;
    }

    /**
     * Handles the PHP configuration.
     *
     * @since  Method available since Release 3.2.20
     */
    public function handlePHPConfiguration()
    {
        $configuration = $this->getPHPConfiguration();

        foreach ($configuration['ini'] as $name => $value) {
            if (defined($value)) {
                $value = constant($value);
            }

            ini_set($name, $value);
        }

        foreach ($configuration['const'] as $name => $value) {
            if (!defined($name)) {
                define($name, $value);
            }
        }

        foreach ($configuration['var'] as $name => $value) {
            $GLOBALS[$name] = $value;
        }
    }

    /**
     * Returns the PHPUnit configuration.
     *
     * @return array
     * @since  Method available since Release 3.2.14
     */
    public function getPHPUnitConfiguration()
    {
        $result = array();

        if ($this->document->documentElement->hasAttribute('colors')) {
            $result['colors'] = $this->getBoolean(
              (string)$this->document->documentElement->getAttribute('colors'),
              FALSE
            );
        }

        else if ($this->document->documentElement->hasAttribute('ansi')) {
            $result['colors'] = $this->getBoolean(
              (string)$this->document->documentElement->getAttribute('ansi'),
              FALSE
            );
        }

        if ($this->document->documentElement->hasAttribute('backupGlobals')) {
            $result['backupGlobals'] = $this->getBoolean(
              (string)$this->document->documentElement->getAttribute('backupGlobals'),
              TRUE
            );
        }

        if ($this->document->documentElement->hasAttribute('backupStaticAttributes')) {
            $result['backupStaticAttributes'] = $this->getBoolean(
              (string)$this->document->documentElement->getAttribute('backupStaticAttributes'),
              FALSE
            );
        }

        if ($this->document->documentElement->hasAttribute('bootstrap')) {
            $result['bootstrap'] = (string)$this->document->documentElement->getAttribute('bootstrap');
        }

        if ($this->document->documentElement->hasAttribute('convertErrorsToExceptions')) {
            $result['convertErrorsToExceptions'] = $this->getBoolean(
              (string)$this->document->documentElement->getAttribute('convertErrorsToExceptions'),
              TRUE
            );
        }

        if ($this->document->documentElement->hasAttribute('convertNoticesToExceptions')) {
            $result['convertNoticesToExceptions'] = $this->getBoolean(
              (string)$this->document->documentElement->getAttribute('convertNoticesToExceptions'),
              TRUE
            );
        }

        if ($this->document->documentElement->hasAttribute('convertWarningsToExceptions')) {
            $result['convertWarningsToExceptions'] = $this->getBoolean(
              (string)$this->document->documentElement->getAttribute('convertWarningsToExceptions'),
              TRUE
            );
        }

        if ($this->document->documentElement->hasAttribute('processIsolation')) {
            $result['processIsolation'] = $this->getBoolean(
              (string)$this->document->documentElement->getAttribute('processIsolation'),
              FALSE
            );
        }

        if ($this->document->documentElement->hasAttribute('stopOnFailure')) {
            $result['stopOnFailure'] = $this->getBoolean(
              (string)$this->document->documentElement->getAttribute('stopOnFailure'),
              FALSE
            );
        }

        if ($this->document->documentElement->hasAttribute('syntaxCheck')) {
            $result['syntaxCheck'] = $this->getBoolean(
              (string)$this->document->documentElement->getAttribute('syntaxCheck'),
              FALSE
            );
        }

        if ($this->document->documentElement->hasAttribute('testSuiteLoaderClass')) {
            $result['testSuiteLoaderClass'] = (string)$this->document->documentElement->getAttribute('testSuiteLoaderClass');
        }

        if ($this->document->documentElement->hasAttribute('testSuiteLoaderFile')) {
            $result['testSuiteLoaderFile'] = (string)$this->document->documentElement->getAttribute('testSuiteLoaderFile');
        }

        return $result;
    }

    /**
     * Returns the configuration for PMD rules.
     *
     * @return array
     */
    public function getPMDConfiguration()
    {
        $result = array();

        foreach ($this->xpath->query('logging/pmd/rule') as $rule) {
            $class     = (string)$rule->getAttribute('class');

            $threshold = (string)$rule->getAttribute('threshold');
            $threshold = explode(',', $threshold);

            if (count($threshold) == 1) {
                $threshold = $threshold[0];
            }

            $priority = (int)$rule->getAttribute('priority');

            $result[$class] = array(
              'threshold' => $threshold,
              'priority'  => $priority
            );
        }

        return $result;
    }

    /**
     * Returns the SeleniumTestCase browser configuration.
     *
     * @return array
     * @since  Method available since Release 3.2.9
     */
    public function getSeleniumBrowserConfiguration()
    {
        $result = array();

        foreach ($this->xpath->query('selenium/browser') as $config) {
            $name    = (string)$config->getAttribute('name');
            $browser = (string)$config->getAttribute('browser');

            if ($config->hasAttribute('host')) {
                $host = (string)$config->getAttribute('host');
            } else {
                $host = 'localhost';
            }

            if ($config->hasAttribute('port')) {
                $port = (int)$config->getAttribute('port');
            } else {
                $port = 4444;
            }

            if ($config->hasAttribute('timeout')) {
                $timeout = (int)$config->getAttribute('timeout');
            } else {
                $timeout = 30000;
            }

            $result[] = array(
              'name'    => $name,
              'browser' => $browser,
              'host'    => $host,
              'port'    => $port,
              'timeout' => $timeout
            );
        }

        return $result;
    }

    /**
     * Returns the test suite configuration.
     *
     * @param  boolean $syntaxCheck
     * @return PHPUnit_Framework_TestSuite
     * @since  Method available since Release 3.2.1
     */
    public function getTestSuiteConfiguration($syntaxCheck = FALSE)
    {
        $testSuiteNodes = $this->xpath->query('testsuites/testsuite');

        if ($testSuiteNodes->length == 0) {
            $testSuiteNodes = $this->xpath->query('testsuite');
        }

        if ($testSuiteNodes->length == 1) {
            return $this->getTestSuite($testSuiteNodes->item(0), $syntaxCheck);
        }

        if ($testSuiteNodes->length > 1) {
            $suite = new PHPUnit_Framework_TestSuite;

            foreach ($testSuiteNodes as $testSuiteNode) {
                $suite->addTestSuite(
                  $this->getTestSuite($testSuiteNode, $syntaxCheck)
                );
            }

            return $suite;
        }
    }

    /**
     * @param  DOMElement $testSuiteNode
     * @param  boolean    $syntaxCheck
     * @return PHPUnit_Framework_TestSuite
     * @since  Method available since Release 3.4.0
     */
    protected function getTestSuite(DOMElement $testSuiteNode, $syntaxCheck)
    {
        if ($testSuiteNode->hasAttribute('name')) {
            $suite = new PHPUnit_Framework_TestSuite(
              (string)$testSuiteNode->getAttribute('name')
            );
        } else {
            $suite = new PHPUnit_Framework_TestSuite;
        }

        foreach ($testSuiteNode->getElementsByTagName('directory') as $directoryNode) {
            $directory = (string)$directoryNode->nodeValue;

            if (empty($directory)) {
                continue;
            }

            if ($directoryNode->hasAttribute('prefix')) {
                $prefix = (string)$directoryNode->getAttribute('prefix');
            } else {
                $prefix = '';
            }

            if ($directoryNode->hasAttribute('suffix')) {
                $suffix = (string)$directoryNode->getAttribute('suffix');
            } else {
                $suffix = 'Test.php';
            }

            $testCollector = new PHPUnit_Runner_IncludePathTestCollector(
              array($directory), $suffix, $prefix
            );

            $suite->addTestFiles($testCollector->collectTests(), $syntaxCheck);
        }

        foreach ($testSuiteNode->getElementsByTagName('file') as $fileNode) {
            $file = (string)$fileNode->nodeValue;

            if (empty($file)) {
                continue;
            }

            $suite->addTestFile($file, $syntaxCheck);
        }

        return $suite;
    }

    /**
     * @param  string  $value
     * @param  boolean $default
     * @return boolean
     * @since  Method available since Release 3.2.3
     */
    protected function getBoolean($value, $default)
    {
        if (strtolower($value) == 'false') {
            return FALSE;
        }

        else if (strtolower($value) == 'true') {
            return TRUE;
        }

        return $default;
    }

    /**
     * @param  string $query
     * @return array
     * @since  Method available since Release 3.2.3
     */
    protected function readFilterDirectories($query)
    {
        $directories = array();

        foreach ($this->xpath->query($query) as $directory) {
            if ($directory->hasAttribute('prefix')) {
                $prefix = (string)$directory->getAttribute('prefix');
            } else {
                $prefix = '';
            }

            if ($directory->hasAttribute('suffix')) {
                $suffix = (string)$directory->getAttribute('suffix');
            } else {
                $suffix = '.php';
            }

            if ($directory->hasAttribute('group')) {
                $group = (string)$directory->getAttribute('group');
            } else {
                $group = 'DEFAULT';
            }

            $directories[] = array(
              'path'   => (string)$directory->nodeValue,
              'prefix' => $prefix,
              'suffix' => $suffix,
              'group'  => $group
            );
        }

        return $directories;
    }

    /**
     * @param  string $query
     * @return array
     * @since  Method available since Release 3.2.3
     */
    protected function readFilterFiles($query)
    {
        $files = array();

        foreach ($this->xpath->query($query) as $file) {
            $files[] = (string)$file->nodeValue;
        }

        return $files;
    }
}
?>


text:
/* eslint-env node, mocha */
(function(root) {
    "use strict";

    //
    // Run in either Mocha, Karma or Browser environments
    //
    if (typeof root === "undefined") {
        root = {};
    }

    var utd = root.UserTimingDecompression ?
        root.UserTimingDecompression :
        require("../dist/usertiming-decompression");

    var chai = root.chai ? root.chai : require("chai");
    var expect = chai.expect;

    //
    // UserTimingDecompression
    //
    describe("UserTimingDecompression", function() {
        //
        // decompressFromString
        //
        describe(".decompressFromString()", function() {
            it("should return an empty list for an empty string", function() {
                expect(utd.decompressFromString("")).to.deep.equal([]);
            });

            it("should return an empty list for non-objects/strings", function() {
                expect(utd.decompressFromString()).to.deep.equal([]);
                expect(utd.decompressFromString(null)).to.deep.equal([]);
                expect(utd.decompressFromString(1)).to.deep.equal([]);
                expect(utd.decompressFromString(0)).to.deep.equal([]);
                expect(utd.decompressFromString({})).to.deep.equal([]);
                expect(utd.decompressFromString(undefined)).to.deep.equal([]);
                expect(utd.decompressFromString(true)).to.deep.equal([]);
                expect(utd.decompressFromString(false)).to.deep.equal([]);
            });

            it("should return a single mark for an array-encoded URI", function() {
                expect(utd.decompressFromString("0mark1~1")).to.deep.equal([{
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1
                }]);
            });

            it("should return a single mark for an trie-encoded URI", function() {
                expect(utd.decompressFromString("('mark1'~'1')")).to.deep.equal([{
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1
                }]);
            });

            it("should return a single measure for an trie-encoded URI", function() {
                expect(utd.decompressFromString("('mark1'~'1_a')")).to.deep.equal([{
                    name: "mark1",
                    entryType: "measure",
                    startTime: 1,
                    duration: 10
                }]);
            });
        });

        //
        // decompressUriTrie
        //
        describe(".decompressUriTrie()", function() {
            it("should return an empty list for an empty object", function() {
                expect(utd.decompressUriTrie({})).to.deep.equal([]);
            });

            it("should return an empty list for non-objects/strings", function() {
                expect(utd.decompressUriTrie()).to.deep.equal([]);
                expect(utd.decompressUriTrie(null)).to.deep.equal([]);
                expect(utd.decompressUriTrie(1)).to.deep.equal([]);
                expect(utd.decompressUriTrie(0)).to.deep.equal([]);
                expect(utd.decompressUriTrie("")).to.deep.equal([]);
                expect(utd.decompressUriTrie(undefined)).to.deep.equal([]);
                expect(utd.decompressUriTrie(true)).to.deep.equal([]);
                expect(utd.decompressUriTrie(false)).to.deep.equal([]);
            });

            it("should return an empty object for strings that aren't valid uri-JSON", function() {
                expect(utd.decompressUriTrie("a")).to.deep.equal([]);
                expect(utd.decompressUriTrie("a:/")).to.deep.equal([]);
                expect(utd.decompressUriTrie("{a:~")).to.deep.equal([]);
                expect(utd.decompressUriTrie("b")).to.deep.equal([]);
            });

            it("should return UserTimings for a simple mark object-JSON", function() {
                expect(utd.decompressUriTrie({ "a": "1" })).to.deep.equal([{
                    name: "a",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1
                }]);
            });

            it("should return UserTimings for a simple mark object-JSON URI-encoded", function() {
                expect(utd.decompressUriTrie("('a'~'1')")).to.deep.equal([{
                    name: "a",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1
                }]);
            });

            it("should return UserTimings for a simple mark JSURL encoded", function() {
                expect(utd.decompressUriTrie("~(a~'1)")).to.deep.equal([{
                    name: "a",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1
                }]);
            });

            it("should return UserTimings for a simple measure JSURL encoded", function() {
                expect(utd.decompressUriTrie("~(a~'1_a)")).to.deep.equal([{
                    name: "a",
                    entryType: "measure",
                    startTime: 1,
                    duration: 10
                }]);
            });
        });

        //
        // decompressUriArray
        //
        describe(".decompressUriArray()", function() {
            it("should return an empty array for non-strings", function() {
                expect(utd.decompressUriArray()).to.deep.equal([]);
                expect(utd.decompressUriArray(null)).to.deep.equal([]);
                expect(utd.decompressUriArray(1)).to.deep.equal([]);
                expect(utd.decompressUriArray(0)).to.deep.equal([]);
                expect(utd.decompressUriArray([])).to.deep.equal([]);
                expect(utd.decompressUriArray(undefined)).to.deep.equal([]);
                expect(utd.decompressUriArray(true)).to.deep.equal([]);
                expect(utd.decompressUriArray(false)).to.deep.equal([]);
                expect(utd.decompressUriArray([])).to.deep.equal([]);
            });

            it("should decompress a the value 'mark1~1'", function() {
                expect(utd.decompressUriArray("mark1~1")).to.deep.equal([{
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1
                }]);
            });

            it("should decompress a the value 'mark1~10'", function() {
                expect(utd.decompressUriArray("mark1~10")).to.deep.equal([{
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 36
                }]);
            });

            it("should decompress a the value 'mark1~a'", function() {
                expect(utd.decompressUriArray("mark1~a")).to.deep.equal([{
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 10
                }]);
            });

            it("should decompress a the value 'measure~a_1'", function() {
                expect(utd.decompressUriArray("measure~a_1")).to.deep.equal([{
                    name: "measure",
                    entryType: "measure",
                    startTime: 10,
                    duration: 1
                }]);
            });

            it("should decompress a the value 'measure~1_a'", function() {
                expect(utd.decompressUriArray("measure~1_a")).to.deep.equal([{
                    name: "measure",
                    entryType: "measure",
                    startTime: 1,
                    duration: 10
                }]);
            });

            it("should decompress a the value 'mark1~1*'", function() {
                expect(utd.decompressUriArray("mark1~1*")).to.deep.equal([{
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1
                },
                {
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 2
                }]);
            });

            it("should decompress a the value 'mark1~1*2'", function() {
                expect(utd.decompressUriArray("mark1~1*2")).to.deep.equal([{
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1
                },
                {
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 2
                }]);
            });

            it("should decompress a the value 'mark1~1.2'", function() {
                expect(utd.decompressUriArray("mark1~1.2")).to.deep.equal([{
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1
                },
                {
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 3
                }]);
            });

            it("should decompress the value 'mark1~1.2.'", function() {
                expect(utd.decompressUriArray("mark1~1.2.")).to.deep.equal([{
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1
                },
                {
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 3
                },
                {
                    name: "mark1",
                    entryType: "mark",
                    duration: 0,
                    startTime: 3
                }]);
            });

            it("should decompress a the value 'mark1~1.2*3.3*.", function() {
                expect(utd.decompressUriArray("mark1~1.2*3.3*.")).to.deep
                    .equal([{
                        name: "mark1",
                        entryType: "mark",
                        duration: 0,
                        startTime: 1
                    },
                    {
                        name: "mark1",
                        entryType: "mark",
                        duration: 0,
                        startTime: 3
                    },
                    {
                        name: "mark1",
                        entryType: "mark",
                        duration: 0,
                        startTime: 5
                    },
                    {
                        name: "mark1",
                        entryType: "mark",
                        duration: 0,
                        startTime: 7
                    },
                    {
                        name: "mark1",
                        entryType: "mark",
                        duration: 0,
                        startTime: 10
                    },
                    {
                        name: "mark1",
                        entryType: "mark",
                        duration: 0,
                        startTime: 13
                    },
                    {
                        name: "mark1",
                        entryType: "mark",
                        duration: 0,
                        startTime: 13
                    }]);
            });

            it("should decompress a the value 'mark1~1~mark2~2", function() {
                expect(utd.decompressUriArray("mark1~1~mark2~2")).to.deep
                    .equal([{
                        name: "mark1",
                        entryType: "mark",
                        duration: 0,
                        startTime: 1
                    },
                    {
                        name: "mark2",
                        entryType: "mark",
                        duration: 0,
                        startTime: 2
                    }]);
            });

            it("should decompress a the value 'mark1~1~mark2~2~mark3~3", function() {
                expect(utd.decompressUriArray("mark1~1~mark2~2~mark3~3")).to.deep
                    .equal([{
                        name: "mark1",
                        entryType: "mark",
                        duration: 0,
                        startTime: 1
                    },
                    {
                        name: "mark2",
                        entryType: "mark",
                        duration: 0,
                        startTime: 2
                    },
                    {
                        name: "mark3",
                        entryType: "mark",
                        duration: 0,
                        startTime: 3
                    }]);
            });

            it("should decompress a the value 'mark1~1~measure2~2_a", function() {
                expect(utd.decompressUriArray("mark1~1~measure2~2_a")).to.deep
                    .equal([{
                        name: "mark1",
                        entryType: "mark",
                        duration: 0,
                        startTime: 1
                    },
                    {
                        name: "measure2",
                        entryType: "measure",
                        startTime: 2,
                        duration: 10
                    }]);
            });
        });

        //
        // generateUserTimings
        //
        describe(".generateUserTimings()", function() {
            it("should return an empty list when given non-string parameters", function() {
                expect(utd.generateUserTimings()).to.deep.equal([]);
                expect(utd.generateUserTimings(null)).to.deep.equal([]);
                expect(utd.generateUserTimings(0)).to.deep.equal([]);
                expect(utd.generateUserTimings(1)).to.deep.equal([]);
                expect(utd.generateUserTimings(false)).to.deep.equal([]);
                expect(utd.generateUserTimings(true)).to.deep.equal([]);
                expect(utd.generateUserTimings(undefined)).to.deep.equal([]);
                expect(utd.generateUserTimings({})).to.deep.equal([]);
                expect(utd.generateUserTimings([])).to.deep.equal([]);
                expect(utd.generateUserTimings("a", null)).to.deep.equal([]);
                expect(utd.generateUserTimings("a", false)).to.deep.equal([]);
                expect(utd.generateUserTimings("a", true)).to.deep.equal([]);
                expect(utd.generateUserTimings("a", undefined)).to.deep.equal([]);
                expect(utd.generateUserTimings("a", {})).to.deep.equal([]);
                expect(utd.generateUserTimings("a", [])).to.deep.equal([]);
            });

            it("should return an single mark when given an array with a single timing", function() {
                expect(utd.generateUserTimings("mark", "a")).to.deep.equal([{
                    name: "mark",
                    entryType: "mark",
                    duration: 0,
                    startTime: 10
                }]);
            });

            it("should return an single mark when given an array with a single timing that is numeric", function() {
                expect(utd.generateUserTimings("mark", 1)).to.deep.equal([{
                    name: "mark",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1
                }]);
            });

            it("should return an single mark when given an array with a large timing that is numeric", function() {
                expect(utd.generateUserTimings("mark", 123)).to.deep.equal([{
                    name: "mark",
                    entryType: "mark",
                    duration: 0,
                    startTime: 1371
                }]);
            });

            it("should return an single measure when given an array with a single timing", function() {
                expect(utd.generateUserTimings("measure", "a_a")).to.deep.equal([{
                    name: "measure",
                    entryType: "measure",
                    startTime: 10,
                    duration: 10
                }]);
            });

            it("should return two elements when given an array with a two timings", function() {
                expect(utd.generateUserTimings("mark", "a*")).to.deep.equal([{
                    name: "mark",
                    entryType: "mark",
                    duration: 0,
                    startTime: 10
                },
                {
                    name: "mark",
                    entryType: "mark",
                    duration: 0,
                    startTime: 20
                }]);
            });

            it("should return three elements when given an array with a three timings", function() {
                expect(utd.generateUserTimings("mark", "a*3")).to.deep.equal([{
                    name: "mark",
                    entryType: "mark",
                    duration: 0,
                    startTime: 10
                },
                {
                    name: "mark",
                    entryType: "mark",
                    duration: 0,
                    startTime: 20
                },
                {
                    name: "mark",
                    entryType: "mark",
                    duration: 0,
                    startTime: 30
                }]);
            });

            it("should return three elements when given an array with a three timings (non-repeating)", function() {
                expect(utd.generateUserTimings("mark", "a.b.c")).to.deep.equal([{
                    name: "mark",
                    entryType: "mark",
                    duration: 0,
                    startTime: 10
                },
                {
                    name: "mark",
                    entryType: "mark",
                    duration: 0,
                    startTime: 21
                },
                {
                    name: "mark",
                    entryType: "mark",
                    duration: 0,
                    startTime: 33
                }]);
            });

            it("should return three elements when given an array with a three timings (non-repeating)", function() {
                expect(utd.generateUserTimings("measure", "a_a.b_b.c_c")).to.deep.equal([{
                    name: "measure",
                    entryType: "measure",
                    startTime: 10,
                    duration: 10
                },
                {
                    name: "measure",
                    entryType: "measure",
                    startTime: 21,
                    duration: 11
                },
                {
                    name: "measure",
                    entryType: "measure",
                    startTime: 33,
                    duration: 12
                }]);
            });
        });

        //
        // decompressArray
        //
        describe(".decompressArray()", function() {
            it("should return an empty array for non-strings", function() {
                expect(utd.decompressArray()).to.deep.equal([]);
                expect(utd.decompressArray(null)).to.deep.equal([]);
                expect(utd.decompressArray(1)).to.deep.equal([]);
                expect(utd.decompressArray(0)).to.deep.equal([]);
                expect(utd.decompressArray({})).to.deep.equal([]);
                expect(utd.decompressArray(undefined)).to.deep.equal([]);
                expect(utd.decompressArray(true)).to.deep.equal([]);
                expect(utd.decompressArray(false)).to.deep.equal([]);
            });

            it("should decompress a the value '1'", function() {
                expect(utd.decompressArray("1")).to.deep.equal(["1"]);
            });

            it("should decompress a the value '10'", function() {
                expect(utd.decompressArray("10")).to.deep.equal(["10"]);
            });

            it("should decompress a the value 'a'", function() {
                expect(utd.decompressArray("a")).to.deep.equal(["a"]);
            });

            it("should decompress a the value '1*'", function() {
                expect(utd.decompressArray("1*")).to.deep.equal(["1", "1"]);
            });

            it("should decompress a the value '1*2'", function() {
                expect(utd.decompressArray("1*2")).to.deep.equal(["1", "1"]);
            });

            it("should decompress a the value '1.2'", function() {
                expect(utd.decompressArray("1.2")).to.deep.equal(["1", "2"]);
            });

            it("should decompress a the value '1.2.'", function() {
                expect(utd.decompressArray("1.2.")).to.deep.equal(["1", "2", "0"]);
            });

            it("should decompress a the value '1.2*3.3*.", function() {
                expect(utd.decompressArray("1.2*3.3*.")).to.deep.equal(["1", "2", "2", "2", "3", "3", "0"]);
            });

            it("should decompress a the value '1_a'", function() {
                expect(utd.decompressArray("1_a")).to.deep.equal(["1_a"]);
            });

            it("should decompress a the value '1_a*2'", function() {
                expect(utd.decompressArray("1_a*2")).to.deep.equal(["1_a", "1_a"]);
            });
        });

        //
        // decompressUserTiming
        //
        describe(".decompressUserTiming()", function() {
            it("should return an empty array for non-strings", function() {
                expect(utd.decompressUserTiming()).to.deep.equal([]);
                expect(utd.decompressUserTiming(null)).to.deep.equal([]);
                expect(utd.decompressUserTiming(1)).to.deep.equal([]);
                expect(utd.decompressUserTiming(0)).to.deep.equal([]);
                expect(utd.decompressUserTiming({})).to.deep.equal([]);
                expect(utd.decompressUserTiming(undefined)).to.deep.equal([]);
                expect(utd.decompressUserTiming(true)).to.deep.equal([]);
                expect(utd.decompressUserTiming(false)).to.deep.equal([]);
            });

            it("should return UserTimings marks for a simple object-JSON", function() {
                expect(utd.decompressUserTiming("{\"a\": \"1\"}")).to.deep.equal([{
                    name: "a",
                    startTime: 1,
                    duration: 0,
                    entryType: "mark"
                }]);
            });

            it("should return UserTimings marks for a simple object-JSON URI-encoded", function() {
                expect(utd.decompressUserTiming("('a'~'1')")).to.deep.equal([{
                    name: "a",
                    startTime: 1,
                    duration: 0,
                    entryType: "mark"
                }]);
            });

            it("should return UserTimings marks or a simple JSURL encoded", function() {
                expect(utd.decompressUserTiming("~(a~'1)")).to.deep.equal([{
                    name: "a",
                    startTime: 1,
                    duration: 0,
                    entryType: "mark"
                }]);
            });

            it("should return UserTimings measures for a simple object-JSON", function() {
                expect(utd.decompressUserTiming("{\"a\": \"1_2\"}")).to.deep.equal([{
                    name: "a",
                    startTime: 1,
                    entryType: "measure",
                    duration: 2
                }]);
            });

            it("should return UserTimings measures for a simple object-JSON URI-encoded", function() {
                expect(utd.decompressUserTiming("('a'~'1_2')")).to.deep.equal([{
                    name: "a",
                    startTime: 1,
                    entryType: "measure",
                    duration: 2
                }]);
            });

            it("should return UserTimings measures for a simple JSURL encoded", function() {
                expect(utd.decompressUserTiming("~(a~'1_2)")).to.deep.equal([{
                    name: "a",
                    startTime: 1,
                    entryType: "measure",
                    duration: 2
                }]);
            });

            it("should return UserTimings marks and measures for a simple object-JSON", function() {
                expect(utd.decompressUserTiming("{\"a\": \"1_2.1\"}")).to.deep.equal([{
                    name: "a",
                    startTime: 1,
                    entryType: "measure",
                    duration: 2
                },
                {
                    name: "a",
                    startTime: 2,
                    duration: 0,
                    entryType: "mark"
                }]);
            });

            it("should return UserTimings marks and measures for a simple object-JSON URI-encoded", function() {
                expect(utd.decompressUserTiming("('a'~'1_2.1')")).to.deep.equal([{
                    name: "a",
                    startTime: 1,
                    entryType: "measure",
                    duration: 2
                },
                {
                    name: "a",
                    startTime: 2,
                    duration: 0,
                    entryType: "mark"
                }]);
            });

            it("should return UserTimings marks and measures for a simple JSURL encoded", function() {
                expect(utd.decompressUserTiming("~(a~'1_2.1)")).to.deep.equal([{
                    name: "a",
                    startTime: 1,
                    entryType: "measure",
                    duration: 2
                },
                {
                    name: "a",
                    startTime: 2,
                    duration: 0,
                    entryType: "mark"
                }]);
            });
        });
    });
}(typeof window !== "undefined" ? window : undefined));


text:
#import <iWorkImport/TSCH3DAnimationTiming.h>

@class NSString;

// Not exported
@interface TSCH3DAnimationValueTiming : TSCH3DAnimationTiming
{
    NSString *mName;
    box_e9f23397 mValueRange;
}

+ (id)timingWithName:(id)arg1 valueRange:(const box_e9f23397 *)arg2;
+ (id)timingWithName:(id)arg1;
@property(retain, nonatomic) NSString *name; // @synthesize name=mName;
@property(nonatomic) box_e9f23397 valueRange; // @synthesize valueRange=mValueRange;
- (id).cxx_construct;
- (void)evaluate:(float)arg1 context:(id)arg2;
- (id)description;
- (void)dealloc;
- (id)initWithName:(id)arg1 valueRange:(const box_e9f23397 *)arg2;
- (id)initWithName:(id)arg1;

@end


text:
import EditModal from '../../../../src/components/input/EditModal'
import Modal from 'react-bootstrap/lib/Modal'

function setup() {
	EditModal.prototype.updateTranslation = sinon.spy()
	let props = {
			showeditmodal: true,
			closeEditModal: sinon.spy(),
			data: {
				"_id": "56d7037a0b70e760104ddf10",
				"en-US": "Edit",
				"key": "ui.common.edit",
				"project": ["p1"],
				"zh-TW": "編輯"
			},
			errors: [],
			updateTranslation: sinon.spy(),
			alertErrors: sinon.spy(),
			clearErrors: sinon.spy()
		},
		wrapper = shallow(<EditModal {...props}/>);

	return {
		props,
		wrapper
	}
}

describe('(component) EditModal', () => {
	it('should render as a <Modal>', () => {
		const { wrapper } = setup()
		expect(wrapper.type()).to.eql(Modal);
	});

	it('should contain <AlertPanel>', () => {
		const { wrapper } = setup()
		console.log(wrapper.debug())
		expect(wrapper.find('[clearErrors]')).to.have.length(1);
	});

	it('should contain <FormPanel>', () => {
		const { wrapper } = setup()
		expect(wrapper.find('FormPanel')).to.have.length(1);
	});

	it('should contain a Confirm button with "primary" class', () => {
		const { wrapper } = setup()
		expect(wrapper.find('Button').first().props().bsStyle).to.eql('primary');
	});

	it('should contain a Dismiss button with "default" class', () => {
		const { wrapper } = setup()
		expect(wrapper.find('Button').last().props().bsStyle).to.eql('default');
	});

	describe('child: confirm button', () => {
		it('should call updateTranslation() if clicked', () => {
			const { props, wrapper } = setup()
			wrapper.find('Button').first().simulate('click');
			expect(EditModal.prototype.updateTranslation).calledOnce;
		});
	});

	describe('child: dismiss button', () => {
		it('should call props.closeEditModal() if clicked', () => {
			const { props, wrapper } = setup()
			wrapper.find('Button').last().simulate('click');
			expect(props.closeEditModal).calledOnce;
		});
	});
});


text:
import { setBrand } from './utils/colors.js'
import { isSSR } from './plugins/platform.js'

function getBodyClasses ({ is, has, within }, cfg) {
  const cls = [
    process.env.THEME,
    is.desktop ? 'desktop' : 'mobile',
    has.touch ? 'touch' : 'no-touch',
    `platform-${is.ios ? 'ios' : 'mat'}`
  ]

  if (is.cordova) {
    cls.push('cordova')

    if (is.ios && (cfg.cordova === void 0 || cfg.cordova.iosStatusBarPadding !== false)) {
      const
        ratio = window.devicePixelRatio || 1,
        width = window.screen.width * ratio,
        height = window.screen.height * ratio

      if (width === 1125 && height === 2436) { // iPhoneX fullscreen
        cls.push('u-ios-statusbar-x')
      }
      if (width !== 1125 || height !== 2001) { // not iPhoneX on non-fullscreen
        cls.push('u-ios-statusbar-padding')
      }
    }
  }
  within.iframe && cls.push('within-iframe')
  is.electron && cls.push('electron')

  return cls
}

function bodyInit (Platform, cfg) {
  console.log(Platform)
  const cls = getBodyClasses(Platform, cfg)

  if (Platform.is.ie && Platform.is.versionNumber === 11) {
    cls.forEach(c => document.body.classList.add(c))
  }
  else {
    document.body.classList.add.apply(document.body.classList, cls)
  }

  if (Platform.is.ios) {
    // needed for iOS button active state
    document.body.addEventListener('touchstart', () => {})
  }
}

function setColors (brand) {
  for (let color in brand) {
    setBrand(color, brand[color])
  }
}

export default {
  install ($uloc, queues, cfg) {
    if (isSSR) {
      queues.server.push((q, ctx) => {
        const
          cls = getBodyClasses(q.platform, cfg),
          fn = ctx.ssr.setBodyClasses

        if (typeof fn === 'function') {
          fn(cls)
        }
        else {
          ctx.ssr.Q_BODY_CLASSES = cls.join(' ')
        }
      })
      return
    }

    cfg.brand && setColors(cfg.brand)
    bodyInit($uloc.platform, cfg)
  }
}


text:
function energy = meshEnergy(vertices, faces)
% Computes the energy of a tesselation, as the sum of second area moments.
%
%   This function can be used to check that the total energy of Centroidal
%   Voronoi Tesselation (CVT) decreases with the iterations of the Lloyd
%   algorithm.
%
%   E = meshEnergy(V, F)
%   V is the list of mesh vertices, and F are faces, as a cell array of
%   vertex indices.
%
%   Example
%   meshEnergy
%
%   See also
%     centroidalVoronoi2d, cvtUpdate, polygonSecondAreaMoments

% ------
% Author: David Legland
% e-mail: david.legland@inra.fr
% Created: 2017-09-01,    using Matlab 9.1.0.441655 (R2016b)
% Copyright 2017 INRA - Cepia Software Platform.

nFaces = meshFaceNumber(vertices, faces);

energyList = zeros(nFaces, 1);

polygons = meshFacePolygons(vertices, faces);
for i = 1:nFaces
    [Ix, Iy, Ixy] = polygonSecondAreaMoments(polygons{i}); %#ok<ASGLU>
    energyList(i) = hypot(Ix, Iy);
end

energy = sum(energyList);


text:
def squareDigitsSequence(a0):
    # Given a sequence of numbers a0, a1, a2, ... an, in which the next element
    # is the sum of the squares of the digits of the previous element, whats the
    # value of n when you find one element that already existed in the sequence?
    ax = a0
    # Set to keep track of existing values.
    seen_values = set([])
    while not (ax in seen_values):
        seen_values.add(ax)
        # Find the next value by adding up the squares of the digits of previous.
        ax = sum([int(digit) ** 2 for digit in str(ax)])

    # The amount of seen values + the last found element which already existed.
    return len(seen_values) + 1


text:
lib_dir = File.dirname(__FILE__)
require File.join(lib_dir, 'resque/plugins/batched_logging')
require File.join(lib_dir, 'resque/plugins/batched_logger')

if RUBY_VERSION < "1.9"
  warn("Warning - Batch job runtimes may be off. It is *highly* recommended to use SystemTimer >= 1.1 with Resque on ruby 1.8") unless defined?(SystemTimer)
end


text:
@interface ContactPickerController : ContentListViewController<ABPersonViewControllerDelegate, UIAlertViewDelegate,ABPeoplePickerNavigationControllerDelegate,EKEventEditViewDelegate> {
	NSArray *contacts;
	NSMutableDictionary *headerDict;
	ABAddressBookRef addressBook;
    NSMutableArray *people;
	NSManagedObject *activity;
	ButtonModel *scheduleItButton;
    BOOL hasActivities;
    BOOL hasContacts;
}

@end


text:
<?php session_start();
if(!isset($_SESSION['user_id']) || !isset($_GET['mess_id']))
{
    $message = '{"status":"failure"}';
}
else{
    try
    {
        /*** connect to database ***/
        include 'vars.php';

        /*** select the users name from the database ***/
        $dbh = new PDO("mysql:host=$mysql_hostname;dbname=$mysql_dbname", $mysql_username, $mysql_password);
        /*** $message = a message saying we have connected ***/

        /*** set the error mode to excptions ***/
        $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

        /*** prepare the insert ***/
        $stmt = $dbh->prepare("UPDATE messages SET  mess_flag =  'deleted' WHERE mess_id = :mess_id AND user_to = :user_id");

        /*** bind the parameters ***/
        $stmt->bindParam(':mess_id', $_GET['mess_id'], PDO::PARAM_INT);
        $stmt->bindParam(':user_id', $_SESSION['user_id'], PDO::PARAM_INT);

        /*** execute the prepared statement ***/
          $stmt->execute();
          $message = '{"status":"success"}';
    }
    catch (Exception $e)
    {
        /*** if we are here, something is wrong in the database ***/
        $message = '{"status":"error"}';
    }
}
echo $message;

?>


text:
<!-- invalid - disallowed metadata attribute - all contexts - should produce 18 errors -->
<tt
  xml:lang="en"
  xmlns="http://www.w3.org/ns/ttml"
  xmlns:ttm="http://www.w3.org/ns/ttml#metadata"
  ttm:role="x-tt">
  <head ttm:role="x-head">
    <ttm:title ttm:role="x-title"/>
    <ttm:desc ttm:role="x-desc"/>
    <ttm:copyright ttm:role="x-copyright"/>
    <ttm:agent xml:id="agent" type="person" ttm:role="x-agent">
      <ttm:name type="full" ttm:role="x-name"/>
    </ttm:agent>
    <ttm:agent type="character">
      <ttm:name type="alias"/>
      <ttm:actor agent="agent" ttm:role="x-agent"/>
    </ttm:agent>
    <profile use="dfxp-full" ttm:role="x-profile" xmlns="http://www.w3.org/ns/ttml#parameter">
      <features ttm:role="x-features">
        <feature ttm:role="x-feature">#core</feature>
      </features>
      <extensions ttm:role="x-extensions">
        <extension ttm:role="x-extension">http://example.com/ns/ttml/extension/#extension</extension>
      </extensions>
    </profile>
    <styling ttm:role="x-styling">
      <style  ttm:role="x-style"/>
    </styling>
    <layout ttm:role="x-layout">
      <region ttm:role="x-region"/>
    </layout>
  </head>
  <body>
    <set ttm:role="x-set"/>
  </body>
</tt>


text:
package com.nymph.bean.component;

import com.nymph.annotation.Bean;
import com.nymph.annotation.Components;

import java.lang.annotation.*;

@Target(ElementType.TYPE)
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Bean
@Components
public @interface EnableBeanRegister {
}