text:
package org.isisaddons.wicket.gmap3.fixture.dom;

import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;

import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.VersionStrategy;

import com.google.common.base.Objects;
import com.google.common.base.Predicate;
import com.google.common.collect.Ordering;

import org.apache.isis.applib.DomainObjectContainer;
import org.apache.isis.applib.annotation.BookmarkPolicy;
import org.apache.isis.applib.annotation.CollectionLayout;
import org.apache.isis.applib.annotation.DomainObject;
import org.apache.isis.applib.annotation.DomainObjectLayout;
import org.apache.isis.applib.annotation.Editing;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.annotation.MinLength;
import org.apache.isis.applib.annotation.Optionality;
import org.apache.isis.applib.annotation.ParameterLayout;
import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
import org.apache.isis.applib.annotation.RenderType;
import org.apache.isis.applib.annotation.Where;
import org.apache.isis.applib.services.clock.ClockService;
import org.apache.isis.applib.util.ObjectContracts;
import org.apache.isis.applib.util.TitleBuffer;

import org.isisaddons.wicket.gmap3.cpt.applib.Locatable;
import org.isisaddons.wicket.gmap3.cpt.applib.Location;
import org.isisaddons.wicket.gmap3.cpt.service.LocationLookupService;

@javax.jdo.annotations.PersistenceCapable(identityType=IdentityType.DATASTORE)
@javax.jdo.annotations.DatastoreIdentity(
        strategy=javax.jdo.annotations.IdGeneratorStrategy.IDENTITY,
         column="id")
@javax.jdo.annotations.Version(
        strategy=VersionStrategy.VERSION_NUMBER,
        column="version")
@javax.jdo.annotations.Uniques({
    @javax.jdo.annotations.Unique(
            name="ToDoItem_description_must_be_unique",
            members={"ownedBy","description"})
})
@javax.jdo.annotations.Queries( {
    @javax.jdo.annotations.Query(
            name = "todo_all",
            value = "SELECT "
                    + "FROM org.isisaddons.wicket.gmap3.fixture.dom.Gmap3ToDoItem "
                    + "WHERE ownedBy == :ownedBy"),
    @javax.jdo.annotations.Query(
            name = "todo_notYetComplete",
            value = "SELECT "
                    + "FROM org.isisaddons.wicket.gmap3.fixture.dom.Gmap3ToDoItem "
                    + "WHERE ownedBy == :ownedBy "
                    + "   && complete == false"),
    @javax.jdo.annotations.Query(
            name = "todo_complete",
            value = "SELECT "
                    + "FROM org.isisaddons.wicket.gmap3.fixture.dom.Gmap3ToDoItem "
                    + "WHERE ownedBy == :ownedBy "
                    + "&& complete == true"),
    @javax.jdo.annotations.Query(
            name = "todo_autoComplete",
            value = "SELECT "
                    + "FROM org.isisaddons.wicket.gmap3.fixture.dom.Gmap3ToDoItem "
                    + "WHERE ownedBy == :ownedBy && "
                    + "description.indexOf(:description) >= 0")
})
@DomainObject(
        objectType = "TODO",
        autoCompleteRepository = Gmap3WicketToDoItems.class
)
@DomainObjectLayout(
        named = "ToDo Item",
        bookmarking = BookmarkPolicy.AS_ROOT
)
public class Gmap3ToDoItem implements Comparable<Gmap3ToDoItem>, Locatable {

    //region > identification in the UI

    public String title() {
        final TitleBuffer buf = new TitleBuffer();
        buf.append(getDescription());
        if (isComplete()) {
            buf.append("- Completed!");
        }
        return buf.toString();
    }

    public String iconName() {
        return "ToDoItem-" + (!isComplete() ? "todo" : "done");
    }

    //endregion

    //region > description (property)

    private String description;

    @javax.jdo.annotations.Column(allowsNull="false", length=100)
    @MemberOrder(sequence="1")
    @Property(
            regexPattern = "\\w[@&:\\-\\,\\.\\+ \\w]*"
    )
    @PropertyLayout(
            typicalLength = 50
    )
    public String getDescription() {
        return description;
    }

    public void setDescription(final String description) {
        this.description = description;
    }

    //endregion

    //region > ownedBy (property)

    private String ownedBy;

    @javax.jdo.annotations.Column(allowsNull="false")
    @Property(
            hidden = Where.EVERYWHERE
    )
    public String getOwnedBy() {
        return ownedBy;
    }

    public void setOwnedBy(final String ownedBy) {
        this.ownedBy = ownedBy;
    }

    //endregion

    //region > complete (property), completed (action), notYetCompleted (action)

    private boolean complete;

    @Property(
            editing = Editing.DISABLED
    )
    @MemberOrder(sequence="2")
    public boolean isComplete() {
        return complete;
    }

    public void setComplete(final boolean complete) {
        this.complete = complete;
    }

    @MemberOrder(name="complete", sequence="1")
    public Gmap3ToDoItem completed() {
        setComplete(true);
        return this;
    }
    // disable action dependent on state of object
    public String disableCompleted() {
        return isComplete() ? "Already completed" : null;
    }

    @MemberOrder(name="complete", sequence="2")
    public Gmap3ToDoItem notYetCompleted() {
        setComplete(false);

        return this;
    }
    // disable action dependent on state of object
    public String disableNotYetCompleted() {
        return !complete ? "Not yet completed" : null;
    }

    //endregion

    //region > location

    private Double locationLatitude;
    private Double locationLongitude;

    @Property(
            optionality = Optionality.OPTIONAL,
            editing = Editing.DISABLED
    )
    @MemberOrder(sequence="3")
    public Location getLocation() {
        return locationLatitude != null && locationLongitude != null? new Location(locationLatitude, locationLongitude): null;
    }
    public void setLocation(final Location location) {
        locationLongitude = location != null ? location.getLongitude() : null;
        locationLatitude = location != null ? location.getLatitude() : null;
    }

    @MemberOrder(name="location", sequence="1")
    public Gmap3ToDoItem updateLocation(
            @ParameterLayout(named="Address") final String address) {
        final Location location = this.locationLookupService.lookup(address);
        setLocation(location);
        return this;
    }

    //endregion

    //region > dependencies (collection), add (action), remove (action)

    // overrides the natural ordering
    public static class DependenciesComparator implements Comparator<Gmap3ToDoItem> {
        @Override
        public int compare(final Gmap3ToDoItem p, final Gmap3ToDoItem q) {
            final Ordering<Gmap3ToDoItem> byDescription = new Ordering<Gmap3ToDoItem>() {
                public int compare(final Gmap3ToDoItem p, final Gmap3ToDoItem q) {
                    return Ordering.natural().nullsFirst().compare(p.getDescription(), q.getDescription());
                }
            };
            return byDescription
                    .compound(Ordering.<Gmap3ToDoItem>natural())
                    .compare(p, q);
        }
    }

    @javax.jdo.annotations.Persistent(table="Gmap3ToDoItemDependencies")
    @javax.jdo.annotations.Join(column="dependingId")
    @javax.jdo.annotations.Element(column="dependentId")
    private SortedSet<Gmap3ToDoItem> dependencies = new TreeSet<>();

    @CollectionLayout(
            sortedBy = DependenciesComparator.class,
            render = RenderType.EAGERLY
    )
    public SortedSet<Gmap3ToDoItem> getDependencies() {
        return dependencies;
    }

    public void setDependencies(final SortedSet<Gmap3ToDoItem> dependencies) {
        this.dependencies = dependencies;
    }

    @MemberOrder(name="dependencies", sequence="1")
    public Gmap3ToDoItem add(final Gmap3ToDoItem toDoItem) {
        getDependencies().add(toDoItem);
        return this;
    }
    public List<Gmap3ToDoItem> autoComplete0Add(final @MinLength(2) String search) {
        final List<Gmap3ToDoItem> list = toDoItems.autoComplete(search);
        list.removeAll(getDependencies());
        list.remove(this);
        return list;
    }

    public String disableAdd(final Gmap3ToDoItem toDoItem) {
        if(isComplete()) {
            return "Cannot add dependencies for items that are complete";
        }
        return null;
    }
    // validate the provided argument prior to invoking action
    public String validateAdd(final Gmap3ToDoItem toDoItem) {
        if(getDependencies().contains(toDoItem)) {
            return "Already a dependency";
        }
        if(toDoItem == this) {
            return "Can't set up a dependency to self";
        }
        return null;
    }

    @MemberOrder(name="dependencies", sequence="2")
    public Gmap3ToDoItem remove(final Gmap3ToDoItem toDoItem) {
        getDependencies().remove(toDoItem);
        return this;
    }
    // disable action dependent on state of object
    public String disableRemove(final Gmap3ToDoItem toDoItem) {
        if(isComplete()) {
            return "Cannot remove dependencies for items that are complete";
        }
        return getDependencies().isEmpty()? "No dependencies to remove": null;
    }
    // validate the provided argument prior to invoking action
    public String validateRemove(final Gmap3ToDoItem toDoItem) {
        if(!getDependencies().contains(toDoItem)) {
            return "Not a dependency";
        }
        return null;
    }
    // provide a drop-down
    public Collection<Gmap3ToDoItem> choices0Remove() {
        return getDependencies();
    }

    //endregion

    //region > predicates

    public static class Predicates {

        public static Predicate<Gmap3ToDoItem> thoseOwnedBy(final String currentUser) {
            return new Predicate<Gmap3ToDoItem>() {
                @Override
                public boolean apply(final Gmap3ToDoItem toDoItem) {
                    return Objects.equal(toDoItem.getOwnedBy(), currentUser);
                }
            };
        }

        public static Predicate<Gmap3ToDoItem> thoseCompleted(
                final boolean completed) {
            return new Predicate<Gmap3ToDoItem>() {
                @Override
                public boolean apply(final Gmap3ToDoItem t) {
                    return Objects.equal(t.isComplete(), completed);
                }
            };
        }

        public static Predicate<Gmap3ToDoItem> thoseWithSimilarDescription(final String description) {
            return new Predicate<Gmap3ToDoItem>() {
                @Override
                public boolean apply(final Gmap3ToDoItem t) {
                    return t.getDescription().contains(description);
                }
            };
        }

        public static Predicate<Gmap3ToDoItem> thoseNot(final Gmap3ToDoItem toDoItem) {
            return new Predicate<Gmap3ToDoItem>() {
                @Override
                public boolean apply(final Gmap3ToDoItem t) {
                    return t != toDoItem;
                }
            };
        }

    }

    //endregion

    //region > toString, compareTo

    @Override
    public String toString() {
        return ObjectContracts.toString(this, "description,complete,ownedBy");
    }

    @Override
    public int compareTo(final Gmap3ToDoItem other) {
        return ObjectContracts.compare(this, other, "complete,description");
    }

    //endregion

    //region > injected services

    @javax.inject.Inject
    @SuppressWarnings("unused")
    private DomainObjectContainer container;

    @javax.inject.Inject
    private Gmap3WicketToDoItems toDoItems;

    @javax.inject.Inject
    @SuppressWarnings("unused")
    private ClockService clockService;

    @javax.inject.Inject
    private LocationLookupService locationLookupService;

    //endregion

}


text:
@implementation SMArtistWebInfoHttpGetJson
{
@private
    NSURLConnection *_urlConnection;
    NSMutableData *_responseData;
    SMArtistWebInfoTimeMeasurement *_timeMeasurement;
}

- (id)init
{
	[self doesNotRecognizeSelector:_cmd];
	return nil;
}

- (id)initWithConfiguration:(SMRootFactory *)rootFactory withDelegate:(id<SMRequestableDelegate>)delegate withQueue:(SMRateLimitedQueue *)theQueue
{
    self = [super initWithConfiguration:rootFactory withDelegate:delegate withQueue:theQueue];
    if (self) {
        // Initialization code here.
        _timeMeasurement = [[SMArtistWebInfoTimeMeasurement alloc] init];
    }

    return self;
}

#pragma mark - Protected Overridden Methods

- (void)setResultDetails:(SMArtistResult *)result {
	result.info = [NSDictionary dictionaryWithObject:[NSArray arrayWithArray:_timeMeasurement.timesTaken] forKey:@"time taken"];
	[super setResultDetails:result];
}

#pragma mark - Abstract Protected Methods

- (NSTimeInterval)urlRequestTimeoutInterval
{
	[self doesNotRecognizeSelector:_cmd];
	return 0;
}

- (void)processJsonResponse:(id)response
{
	[self doesNotRecognizeSelector:_cmd];
}

#pragma mark Make Actual Web Request

- (void)doAndProcessHttpUrlRequestForUrl:(NSString *)url
{
    [_timeMeasurement startTimeMeasurement];
	_responseData = [NSMutableData data];
	[_timeMeasurement setTimeMeasurePointForNow:@"url request setoff"];

	// don't cache at all, additionally provide protocol method connection:willCacheResponse:
	NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:[self urlRequestTimeoutInterval]];
	// default: NSURLRequestUseProtocolCachePolicy

	_urlConnection = [[self.rootFactory urlconnectionFactory] newUrlConnectionWithRequest:request withDelegate:self];
}

#pragma mark JSON Parsing

- (void)handleWebserviceResponse:(NSData *)response
{
	__autoreleasing NSError* error = nil;
    id info = [NSJSONSerialization JSONObjectWithData:response options:kNilOptions error:&error];

	if (error != nil) {
        [self sendOutErrorResultWithError:error];
    } else {
        [_timeMeasurement setTimeMeasurePointForNow:@"parse finished"];
		[self processJsonResponse:info];
    }

	[_timeMeasurement endTimeMeasurement];
}

#pragma mark - NSURLConnection Delegate Methods

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
    NSInteger statusCode = [httpResponse statusCode];
    if (403 == statusCode || 404 == statusCode || 500 <= statusCode) {
        [connection cancel];
        NSString *errorString = [NSHTTPURLResponse localizedStringForStatusCode:statusCode];
        [self sendOutErrorResultWithErrorString:errorString];
    } else {
        [_responseData setLength:0];
        [_timeMeasurement setTimeMeasurePointForNow:@"url response"];
    }
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
	[_responseData appendData:data];
}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
    [self sendOutErrorResultWithError:error];
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
    [_timeMeasurement setTimeMeasurePointForNow:@"receiving finished"];
    [self handleWebserviceResponse:_responseData];
}

// don't cache
- (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse {
    return nil;
}

@end

redpajama_set_name: RedPajamaGithub


text: export { DewPoint32 as default } from "../../";


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Experiment',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=200)),
                ('objective', models.TextField()),
                ('notes', models.TextField()),
                ('status', models.CharField(default=b'O', max_length=1, choices=[(b'C', b'Completed'), (b'A', b'Abandoned'), (b'O', b'Ongoing')])),
            ],
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=200)),
                ('objective', models.TextField()),
                ('notes', models.TextField()),
                ('status', models.CharField(default=b'O', max_length=1, choices=[(b'C', b'Completed'), (b'A', b'Abandoned'), (b'O', b'Ongoing')])),
            ],
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=200)),
                ('objective', models.TextField()),
                ('notes', models.TextField()),
                ('status', models.CharField(default=b'O', max_length=1, choices=[(b'C', b'Completed'), (b'A', b'Abandoned'), (b'O', b'Ongoing')])),
                ('date', models.DateField()),
                ('experiment', models.ForeignKey(to='plans.Experiment')),
            ],
        ),
        migrations.AddField(
            model_name='experiment',
            name='project',
            field=models.ForeignKey(to='plans.Project'),
        ),
    ]


text:
package eu.scape_project.planning.services.notification;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.UUID;

import javax.annotation.Resource;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.UserTransaction;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import org.slf4j.Logger;

import eu.scape_project.planning.model.Notification;
import eu.scape_project.planning.model.User;

@Path("/")
@Consumes({"application/json"})
@Produces({"application/json"})
public class NotificationResource {
    static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(NotificationResource.class);

    @PersistenceContext
    private EntityManager em;

    @Resource
    UserTransaction ut;

    /**
     * adds the notification in the system.
     * If there is a user with email equal to plannerEmail registered, a notification is stored.
     *
     * @param notification
     * @return
     */
    @PUT
    @Path("/notification")
    public boolean addNotification(WatchNotification notification) {
        LOGGER.info("recieved a notification: {}", notification.getMessage());

        List<User> recipients = new ArrayList<User>();

        if (notification.getPlannerEmail() != null) {
            User recipient = em.createQuery("select u from User u where u.email = :email", User.class)
                .setParameter("email", notification.getPlannerEmail()).getSingleResult();
            if (recipient != null) {
                recipients.add(recipient);
            }
        }
        // TODO add users related to plan with repository id planId
        // ..
        if (recipients.size() > 0) {
            String notificationID = UUID.randomUUID().toString();
            Date notificationTime = new Date();

            String message = notification.getMessage();

            try {
                ut.begin();
                for (User recipient : recipients) {
                    Notification n = new Notification(notificationID, notificationTime, "SCOUT", message, recipient);
                    em.persist(n);
                }
                ut.commit();
                return true;
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        return false;
    }

    @GET
    @Path("/notifications")
    public Collection<WatchNotification> getNotifications() {
        ArrayList<WatchNotification> list = new ArrayList<WatchNotification>();
        WatchNotification n = new WatchNotification(null, "test message", null, null, "test@test.com");
        list.add(n);
        return list;
    }
}


text:
import { CREATE_BRANCH_REQUEST,
         UPDATE_BRANCHES_FILTER,
         DELETE_BRANCH_REQUEST,
         BRANCH_ADDED,
         CREATE_BRANCH_RESPONSE,
         DELETE_BRANCH_RESPONSE,
         BRANCH_DELETED,
         TOGGLED_BRANCH_ROW,
         TOGGLE_SOURCE_BRANCH,
         SET_USER,
         TOGGLE_CREATE_ONLY_XAP_BRANCH
  } from "./actionTypes"

export function updateBranchesFilterRequest(filterText) {
//    console.info("updateBranchesFilterRequest", filterText)
    return {type:UPDATE_BRANCHES_FILTER, filterText};
}

export function deleteBranchRequest(name) {
//    console.info("deleteBranchRequest", name);
    return function(dispatch){
        if (!name){
            return
        }
        dispatch({type:DELETE_BRANCH_REQUEST, name});
        fetch('/api/delete_branch/' + name, {
                    method: 'delete',
                    credentials: 'same-origin',
                    cache: 'no-cache'
                }).then(function(response) {
                    return response.json()
                }).then(function(branch){
                    dispatch(deleteBranchResponse(name, null))
                }).catch(function(err) {
                    console.info("err is ", err)
                });
    }
}

export function deleteBranchResponse(name, err){
//    console.info("deleteBranchResponse", name, err)
    return function(dispatch){
        dispatch({type:DELETE_BRANCH_RESPONSE, name, err:err});
        if(!err){
            dispatch(branchDeleted(name));
        }
    }
}

export function branchAdded(name, repositories, readOnly) {
    return {type:BRANCH_ADDED, name, repositories, readOnly};
}

export function setUser(login) {
    return {type:SET_USER, login};
}

export function branchDeleted(name) {
//    console.info("branch deleted", name)
    return {type:BRANCH_DELETED, name};
}

export function createBranchRequest(name, from, isXAPOnly) {
    from = !from ? "master" : from;
    return function(dispatch){
        if (!name){
            return
        }
        const branchName = name;
        dispatch({type:CREATE_BRANCH_REQUEST, branchName});
        fetch('/api/create_branch/' + branchName +'?from=' + encodeURIComponent(from) + '&isXAPOnly=' + encodeURIComponent(isXAPOnly), {
            method: 'get',
            credentials: 'same-origin',
            cache: 'no-cache'
        }).then(function(response) {
            return response.json()
        }).then(function(statuses){
            dispatch(createBranchResponse(branchName, statuses, null))
        }).catch(function(err) {
            console.info("err is ", err)
        });
    }
}

export function createBranchResponse(name, statuses, err) {
    return function(dispatch){
        dispatch({type:CREATE_BRANCH_RESPONSE, name, statuses, err:err});
        if(!err){
            dispatch(branchAdded(name, Object.keys(statuses).filter(k => statuses[k])));
        }
    }
}

export function toggleRow(name){
    return { "type":TOGGLED_BRANCH_ROW, "name":name };
}

export function toggleSourceBranch(name){
    return { "type":TOGGLE_SOURCE_BRANCH, "name":name };
}
export function toggleXAPRequest(){
    return { "type":TOGGLE_CREATE_ONLY_XAP_BRANCH};
}


text:
<?php

namespace lithium\test\filter;

use lithium\analysis\Parser;
use lithium\analysis\Inspector;

/**
 * Calculates the cyclomatic complexity of class methods, and shows worst-offenders and statistics.
 */
class Complexity extends \lithium\test\Filter {

	/**
	 * The list of tokens which represent the starting point of a code branch.
	 */
	protected static $_include = array(
		'T_CASE', 'T_DEFAULT', 'T_CATCH', 'T_IF', 'T_FOR',
		'T_FOREACH', 'T_WHILE', 'T_DO', 'T_ELSEIF'
	);

	/**
	 * Takes an instance of an object (usually a Collection object) containing test
	 * instances. Introspects the test subject classes to extract cyclomatic complexity data.
	 *
	 * @param object $report Instance of Report which is calling apply.
	 * @param array $tests The test to apply this filter on
	 * @param array $options Not used.
	 * @return object Returns the instance of `$tests`.
	 */
	public static function apply($report, $tests, array $options = array()) {
		$results = array();
		foreach ($tests->invoke('subject') as $class) {
			$results[$class] = array();

			if (!$methods = Inspector::methods($class, 'ranges', array('public' => false))) {
				continue;
			}
			foreach ($methods as $method => $lines) {
				$lines = Inspector::lines($class, $lines);
				$branches = Parser::tokenize(join("\n", (array) $lines), array(
					'include' => static::$_include
				));
				$results[$class][$method] = count($branches) + 1;
				$report->collect(__CLASS__, $results);
			}
		}
		return $tests;
	}

	/**
	 * Analyzes the results of a test run and returns the result of the analysis.
	 *
	 * @param object $report The report instance running this filter and aggregating results
	 * @param array $options Not used.
	 * @return array The results of the analysis.
	 */
	public static function analyze($report, array $options = array()) {
		$filterResults = static::collect($report->results['filters'][__CLASS__]);
		$metrics = array('max' => array(), 'class' => array());

		foreach ($filterResults as $class => $methods) {
			if (!$methods) {
				continue;
			}
			$metrics['class'][$class] = array_sum($methods) / count($methods);

			foreach ($methods as $method => $count) {
				$metrics['max']["{$class}::{$method}()"] = $count;
			}
		}

		arsort($metrics['max']);
		arsort($metrics['class']);
		return $metrics;
	}

	/**
	 * Collects raw data aggregated in Report and prepares it for analysis
	 *
	 * @param array $filterResults The results of the filter on the test run.
	 * @return array The packaged results.
	 */
	public static function collect($filterResults) {
		$packagedResults = array();

		foreach ($filterResults as $result) {
			foreach ($result as $class => $method) {
				if (!isset($packagedResults[$class])) {
					$packagedResults[$class] = array();
				}
				$classResult = (array) $result[$class];
				$packagedResults[$class] = array_merge($classResult, $packagedResults[$class]);
			}
		}

		return $packagedResults;
	}
}

?>


text:
// TODO: asm.js

export function appendByteArray(buffer1, buffer2) {
    let tmp = new Uint8Array((buffer1.byteLength|0) + (buffer2.byteLength|0));
    tmp.set(buffer1, 0);
    tmp.set(buffer2, buffer1.byteLength|0);
    return tmp;
}

export function appendByteArrayAsync(buffer1, buffer2) {
    return new Promise((resolve, reject)=>{
        let blob = new Blob([buffer1, buffer2]);
        let reader = new FileReader();
        reader.addEventListener("loadend", function() {
            resolve();
        });
        reader.readAsArrayBuffer(blob);
    });
}
export function base64ToArrayBuffer(base64) {
    var binary_string =  window.atob(base64);
    var len = binary_string.length;
    var bytes = new Uint8Array( len );
    for (var i = 0; i < len; i++)        {
        bytes[i] = binary_string.charCodeAt(i);
    }
    return bytes.buffer;
}

export function hexToByteArray(hex) {
    let len = hex.length >> 1;
    var bufView = new Uint8Array(len);
    for (var i = 0; i < len; i++) {
        bufView[i] = parseInt(hex.substr(i<<1,2),16);
    }
    return bufView;
}

export function concatenate(resultConstructor, ...arrays) {
    let totalLength = 0;
    for (let arr of arrays) {
        totalLength += arr.length;
    }
    let result = new resultConstructor(totalLength);
    let offset = 0;
    for (let arr of arrays) {
        result.set(arr, offset);
        offset += arr.length;
    }
    return result;
}

export function bitSlice(bytearray, start=0, end=bytearray.byteLength*8) {
    let byteLen = Math.ceil((end-start)/8);
    let res = new Uint8Array(byteLen);
    let startByte = start >>> 3;   // /8
    let endByte = (end>>>3) - 1;    // /8
    let bitOffset = start & 0x7;     // %8
    let nBitOffset = 8 - bitOffset;
    let endOffset = 8 - end & 0x7;   // %8
    for (let i=0; i<byteLen; ++i) {
        let tail = 0;
        if (i<endByte) {
            tail = bytearray[startByte+i+1] >> nBitOffset;
            if (i == endByte-1 && endOffset < 8) {
                tail >>= endOffset;
                tail <<= endOffset;
            }
        }
        res[i]=(bytearray[startByte+i]<<bitOffset) | tail;
    }
    return res;
}

export class BitArray {

    constructor(src) {
        this.src    = new DataView(src.buffer, src.byteOffset, src.byteLength);
        this.bitpos = 0;
        this.byte   = this.src.getUint8(0); /* This should really be undefined, uint wont allow it though */
        this.bytepos = 0;
    }

    readBits(length) {
        if (32 < (length|0) || 0 === (length|0)) {
            /* To big for an uint */
            throw new Error("too big");
        }

        let result = 0;
        for (let i = length; i > 0; --i) {

            /* Shift result one left to make room for another bit,
             then add the next bit on the stream. */
            result = ((result|0) << 1) | (((this.byte|0) >> (8 - (++this.bitpos))) & 0x01);
            if ((this.bitpos|0)>=8) {
                this.byte = this.src.getUint8(++this.bytepos);
                this.bitpos &= 0x7;
            }
        }

        return result;
    }
    skipBits(length) {
        this.bitpos += (length|0) & 0x7; // %8
        this.bytepos += (length|0) >>> 3;  // *8
        if (this.bitpos > 7) {
            this.bitpos &= 0x7;
            ++this.bytepos;
        }

        if (!this.finished()) {
            this.byte = this.src.getUint8(this.bytepos);
            return 0;
        } else {
            return this.bytepos-this.src.byteLength-this.src.bitpos;
        }
    }

    finished() {
        return this.bytepos >= this.src.byteLength;
    }
}


text:
<?php
$bavotasan_theme_data = wp_get_theme();
define( 'BAVOTASAN_THEME_URL', get_template_directory_uri() );
define( 'BAVOTASAN_THEME_TEMPLATE', get_template_directory() );
define( 'BAVOTASAN_THEME_NAME', $bavotasan_theme_data->Name );
define( 'BAVOTASAN_PRO_UPGRADE_NAME', 'Gridiculous Pro' );

/**
 * Includes
 *
 * @since 1.0.0
 */
require( BAVOTASAN_THEME_TEMPLATE . '/library/theme-options.php' ); // Functions for theme options page
require( BAVOTASAN_THEME_TEMPLATE . '/library/preview-pro.php' ); // Functions for preview pro page
require( BAVOTASAN_THEME_TEMPLATE . '/library/message-bar.php' ); // Functions for message bar

/**
 * Prepare the content width
 *
 * @since 1.0.0
 */
$bavotasan_theme_options = bavotasan_theme_options();
$array_width = array( '' => 1200, 'w960' => 960, 'w640' => 640, 'w320' => 320, 'wfull' => 1200 );
$array_content = array( 'c2' => .17, 'c3' => .25, 'c4' => .34, 'c5' => .42, 'c6' => .5, 'c7' => .58, 'c8' => .66, 'c9' => .75, 'c10' => .83, 'c12' => 1 );
$bavotasan_main_content =  $array_content[$bavotasan_theme_options['primary']] * $array_width[$bavotasan_theme_options['width']] - 40;

if ( ! isset( $content_width ) )
	$content_width = $bavotasan_main_content;

add_action( 'after_setup_theme', 'bavotasan_setup' );
if ( ! function_exists( 'bavotasan_setup' ) ) :
/**
 * Initial setup for Gridiculous theme
 *
 * This function is attached to the 'after_setup_theme' action hook.
 *
 * @uses	load_theme_textdomain()
 * @uses	get_locale()
 * @uses	BAVOTASAN_THEME_TEMPLATE
 * @uses	add_theme_support()
 * @uses	add_editor_style()
 * @uses	add_custom_background()
 * @uses	add_custom_image_header()
 * @uses	register_default_headers()
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_setup() {
	load_theme_textdomain( 'gridiculous', BAVOTASAN_THEME_TEMPLATE . '/library/languages' );

	// Add default posts and comments RSS feed links to .
	add_theme_support( 'automatic-feed-links' );

	// This theme styles the visual editor with editor-style.css to match the theme style.
	add_editor_style();

	// This theme uses wp_nav_menu() in one location.
	register_nav_menu( 'primary', __( 'Primary Menu', 'gridiculous' ) );

	// Add support for a variety of post formats
	add_theme_support( 'post-formats', array( 'gallery', 'image', 'video', 'audio', 'quote', 'link', 'status', 'aside' ) );

	// This theme uses Featured Images (also known as post thumbnails) for archive pages
	add_theme_support( 'post-thumbnails' );

	// Add a filter to bavotasan_header_image_width and bavotasan_header_image_height to change the width and height of your custom header.
	$custom_header_support = array(
		'default-text-color' => '333',
		'flex-height' => true,
		'flex-width' => true,
		'random-default' => true,
		'width' => apply_filters( 'bavotasan_header_image_width', 1280 ),
		'height' => apply_filters( 'bavotasan_header_image_height', 288 ),
		'wp-head-callback' => 'bavotasan_header_style',
		'admin-head-callback' => 'bavotasan_admin_header_style',
		'admin-preview-callback' => 'bavotasan_admin_header_image'
	);

	add_theme_support( 'custom-header', $custom_header_support );

	// Add support for custom backgrounds
	$custom_background_support = array(
		'default-image' => BAVOTASAN_THEME_URL . '/library/images/solid.png',
		'admin-head-callback' => 'bavotasan_admin_background_style'
	);

	add_theme_support( 'custom-background', $custom_background_support );

	// Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
	register_default_headers( array(
		'froggy' => array(
			'url' => '%s/library/images/froggy.jpg',
			'thumbnail_url' => '%s/library/images/froggy-thumbnail.jpg',
			'description' => __( 'Froggy', 'gridiculous' )
		)
	) );

	// Add HTML5 elements
	add_theme_support( 'html5', array( 'comment-list', 'search-form', 'comment-form', ) );
}
endif; // bavotasan_setup

if ( ! function_exists( 'bavotasan_admin_background_style' ) ) :
/**
 * Styles the background displayed on the Appearance > Background admin panel.
 *
 * Referenced via add_custom_background() in bavotasan_setup().
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_admin_background_style() {
	?>

	<?php
}
endif; // bavotasan_admin_background_style

if ( ! function_exists( 'bavotasan_header_style' ) ) :
/**
 * Styles the header image and text displayed on the blog
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_header_style() {
	$text_color = get_header_textcolor();

	// If no custom options for text are set, let's bail.
	if ( $text_color == HEADER_TEXTCOLOR )
		return;

	// If we get this far, we have custom styles. Let's do this.
	?>

	<?php
}
endif; // bavotasan_header_style

if ( ! function_exists( 'bavotasan_admin_header_style' ) ) :
/**
 * Styles the header image displayed on the Appearance > Header admin panel.
 *
 * Referenced via add_custom_image_header() in bavotasan_setup().
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_admin_header_style() {
	?>

	<?php
}
endif; // bavotasan_admin_header_style

if ( ! function_exists( 'bavotasan_admin_header_image' ) ) :
/**
 * Custom header image markup displayed on the Appearance > Header admin panel.
 *
 * Referenced via add_custom_image_header() in bavotasan_setup().
 *
 * @uses	get_theme_mod()
 * @uses	bloginfo()
 * @uses	get_header_image()
 * @uses	home_url()
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_admin_header_image() {
	?>

		<?php
		if ( 'blank' == get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) || '' == get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) )
			$style = ' style="display:none;"';
		else
			$style = ' style="color:#' . get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) . ';"';
		?>

<a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?>

		<div id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?>

		<?php $header_image = get_header_image();

		if ( ! empty( $header_image ) ) : ?>
			<img src="<?php echo esc_url( $header_image ); ?>" alt="" />
		<?php endif; ?>

	<?php
}
endif; // bavotasan_admin_header_image

add_action( 'wp_head', 'bavotasan_styles' );
/**
 * Add a style block to the theme for the current link color.
 *
 * This function is attached to the 'wp_head' action hook.
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_styles() {
	$bavotasan_theme_options = bavotasan_theme_options();
	?>

	<?php
}

add_action( 'pre_get_posts', 'bavotasan_home_query' );
if ( ! function_exists( 'bavotasan_home_query' ) ) :
/**
 * Remove sticky posts from home page query
 *
 * This function is attached to the 'pre_get_posts' action hook.
 *
 * @param	array $query
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_home_query( $query = '' ) {
	if ( ! is_home() || ! is_a( $query, 'WP_Query' ) || ! $query->is_main_query() )
		return;

	$query->set( 'post__not_in', get_option( 'sticky_posts' ) );
}
endif;

add_action( 'wp_enqueue_scripts', 'bavotasan_add_js' );
if ( ! function_exists( 'bavotasan_add_js' ) ) :
/**
 * Load all JavaScript to header
 *
 * This function is attached to the 'wp_enqueue_scripts' action hook.
 *
 * @uses	is_admin()
 * @uses	is_singular()
 * @uses	get_option()
 * @uses	wp_enqueue_script()
 * @uses	BAVOTASAN_THEME_URL
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_add_js() {
	if ( is_singular() && get_option( 'thread_comments' ) )
		wp_enqueue_script( 'comment-reply' );

	wp_enqueue_script( 'harvey', BAVOTASAN_THEME_URL .'/library/js/harvey.js', '', '', true );
	wp_enqueue_script( 'theme_js', BAVOTASAN_THEME_URL .'/library/js/theme.js', array( 'jquery' ), '', true );

	wp_enqueue_style( 'theme_stylesheet', get_stylesheet_uri() );
	wp_enqueue_style( 'google_fonts', 'http://fonts.googleapis.com/css?family=Lato:300,900|Russo+One', false, null, 'all' );
}
endif; // bavotasan_add_js

add_action( 'widgets_init', 'bavotasan_widgets_init' );
if ( ! function_exists( 'bavotasan_widgets_init' ) ) :
/**
 * Creating the two sidebars
 *
 * This function is attached to the 'widgets_init' action hook.
 *
 * @uses	register_sidebar()
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_widgets_init() {
	register_sidebar( array(
		'name' => __( 'First Sidebar', 'gridiculous' ),
		'id' => 'sidebar',
		'description' => __( 'This is the sidebar widgetized area. All defaults widgets work great here.', 'gridiculous' ),
		'before_widget' => '',
		'after_widget' => '',
		'before_title' => '
',
		'after_title' => '
',
	) );

	register_sidebar( array(
		'name' => __( 'Header Area', 'gridiculous' ),
		'id' => 'header-area',
		'description' => __( 'Widgetized area in the header to the right of the site name. Great place for a search box or a banner ad.', 'gridiculous' ),
		'before_widget' => '',
		'after_widget' => '',
		'before_title' => '
',
		'after_title' => '
',
	) );

	register_sidebar( array(
		'name' => __( 'Home Page Top Area', 'gridiculous' ),
		'id' => 'home-page-top-area',
		'description' => __( 'Widgetized area on the home page directly below the navigation menu. Specifically designed for 3 text widgets. Must be turned on in the Layout options on the Customize Gridiculous admin page.', 'gridiculous' ),
		'before_widget' => '',
		'after_widget' => '',
		'before_title' => '
',
		'after_title' => '
',
	) );
}
endif; // bavotasan_widgets_init

if ( !function_exists( 'bavotasan_pagination' ) ) :
/**
 * Add pagination
 *
 * @uses	paginate_links()
 * @uses	add_query_arg()
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_pagination() {
	global $wp_query;

	$current = max( 1, get_query_var('paged') );
	$big = 999999999; // need an unlikely integer

	$pagination_return = paginate_links( array(
		'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
		'format' => '?paged=%#%',
		'current' => $current,
		'total' => $wp_query->max_num_pages,
		'next_text' => '»',
		'prev_text' => '«'
	) );

	if ( ! empty( $pagination_return ) ) {
		echo '
';
		echo '
';
		printf( __( 'Page %1$s of %2$s', 'gridiculous' ), $current, $wp_query->max_num_pages );
		echo '
';
		echo $pagination_return;
		echo '
';
	}
}
endif; // bavotasan_pagination

add_filter( 'wp_title', 'bavotasan_filter_wp_title', 10, 2 );
if ( !function_exists( 'bavotasan_filter_wp_title' ) ) :
/**
 * Filters the page title appropriately depending on the current page
 *
 * @uses	get_bloginfo()
 * @uses	is_home()
 * @uses	is_front_page()
 *
 * @since Gridiculous 1.0.1
 */
function bavotasan_filter_wp_title( $title, $sep ) {
	global $paged, $page;

	if ( is_feed() )
		return $title;

	// Add the site name.
	$title .= get_bloginfo( 'name' );

	// Add the site description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		$title = "$title $sep $site_description";

	// Add a page number if necessary.
	if ( $paged >= 2 || $page >= 2 )
		$title = "$title $sep " . sprintf( __( 'Page %s', 'gridiculous' ), max( $paged, $page ) );

	return $title;
}
endif; // bavotasan_filter_wp_title

if ( ! function_exists( 'bavotasan_comment' ) ) :
/**
 * Callback function for comments
 *
 * Referenced via wp_list_comments() in comments.php.
 *
 * @uses	get_avatar()
 * @uses	get_comment_author_link()
 * @uses	get_comment_date()
 * @uses	get_comment_time()
 * @uses	edit_comment_link()
 * @uses	comment_text()
 * @uses	comments_open()
 * @uses	comment_reply_link()
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_comment( $comment, $args, $depth ) {
	$GLOBALS['comment'] = $comment;

	switch ( $comment->comment_type ) :
		case '' :
		?>
		<li <?php comment_class(); ?>>
			<div id="comment-<?php comment_ID(); ?>" class="comment-body">

					<?php echo get_avatar( $comment, 60 ); ?>

						<?php echo get_comment_author_link() . ' '; ?>

						<?php
						printf( __( '%1$s at %2$s', 'gridiculous' ), get_comment_date(), get_comment_time() );
						edit_comment_link( __( '(edit)', 'gridiculous' ), '  ', '' );
						?>

						<?php if ( '0' == $comment->comment_approved ) { echo '' . __( 'Your comment is awaiting moderation.', 'gridiculous' ) . ''; } ?>
						<?php comment_text() ?>

					<?php if ( $args['max_depth'] != $depth && comments_open() && 'pingback' != $comment->comment_type ) { ?>

						<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>

					<?php } ?>

			<?php
			break;

		case 'pingback'  :
		case 'trackback' :
		?>
		<li id="comment-<?php comment_ID(); ?>" class="pingback">

				<?php _e( 'Pingback:', 'gridiculous' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(edit)', 'gridiculous' ), ' ' ); ?>

			<?php
			break;
	endswitch;
}
endif; // bavotasan_comment

/**
 * Custom function to display post/page content pagination links
 *
 * @param	array $args
 *
 * @return	Pagenum links
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_link_pages( $args = '' ) {
	global $page, $numpages, $multipage, $more, $pagenow;

	$defaults = array(
        'before' => '
' . __( 'Post Pages menu', 'gridiculous' ) . '
',
		'after' => ''
	);

	$output = '';
	$r = wp_parse_args( $args, $defaults );
	$r = apply_filters( 'wp_link_pages_args', $r );
	extract( $r, EXTR_SKIP );

	if ( $multipage ) {
	    $output .= $before;
	    for ( $i = 1; $i < ( $numpages + 1 ); $i = $i + 1 ) {
			$j = str_replace( '%', $i, '%' );

			$output .= ' ';
			$output .= ( $i != $page || ( ( ! $more ) && ( $page == 1 ) ) ) ? _wp_link_page( $i ) :'';
			$output .= $j;
			$output .= ( $i != $page || ( ( ! $more ) && ( $page == 1 ) ) ) ? '' : '';
	    }
	    $output .= $after;
	}
	return $output;
}

add_filter( 'the_content_more_link', 'bavotasan_remove_more_jump_link' );
if ( ! function_exists( 'bavotasan_remove_more_jump_link' ) ) :
/**
 * Removese the jump link from the content more link
 *
 * @param	string $link
 *
 * @return	Custom read more link
 *
 * @since Gridiculous Pro 1.0.2
 */
function bavotasan_remove_more_jump_link( $link ) {
	$offset = strpos( $link, '#more-' );
	if ( $offset )
		$end = strpos( $link, '"',$offset );

	if ( $end )
		$link = substr_replace( $link, '', $offset, $end - $offset );

	return '
' . $link . '
';
}
endif;

add_filter( 'excerpt_more', 'bavotasan_excerpt_more' );
if ( ! function_exists( 'bavotasan_excerpt_more' ) ) :
/**
 * Adds a read more link to all excerpts
 *
 * @param	int $more
 *
 * @return	Custom read more link
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_excerpt_more( $more ) {
	return '…
' . __( 'Read more →', 'gridiculous' ) . '
';
}
endif; // bavotasan_excerpt_more

add_filter( 'excerpt_length', 'bavotasan_excerpt_length', 999 );
if ( ! function_exists( 'bavotasan_excerpt_length' ) ) :
/**
 * Custom excerpt length
 *
 * @param	int $length
 *
 * @return	Custom excerpt length
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_excerpt_length( $length ) {
	return 40;
}
endif;

/*
 * Remove default gallery styles
 */
add_filter( 'use_default_gallery_style', '__return_false' );

/**
 * Create the required attributes for the #primary container
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_primary_attr() {
	$bavotasan_theme_options = bavotasan_theme_options();

	$column = $bavotasan_theme_options['primary'];
	$layout = $bavotasan_theme_options['layout'];
	$class = ( 3 == $layout ) ? $column . ' centered' : $column;
	$style = ( 1 == $layout ) ? ' style="float: right;"' : '';

	echo 'class="' . $class . '"' . $style;
}

/**
 * Create the required classes for the #secondary sidebar container
 *
 * @since Gridiculous 1.0.0
 */
function bavotasan_sidebar_class() {
	$bavotasan_theme_options = bavotasan_theme_options();

	$end = ( 2 == $bavotasan_theme_options['layout'] ) ? ' end' : '';
	$class = str_replace( 'c', '', $bavotasan_theme_options['primary'] );
	$class = 'c' . ( 12 - $class ) . $end;

	echo 'class="' . $class . '"';
}

add_action( 'admin_bar_menu', 'bavotasan_admin_bar_menu', 999 );
/**
 * Add menu item to toolbar
 *
 * This function is attached to the 'admin_bar_menu' action hook.
 *
 * @param	array $wp_admin_bar
 *
 * @since 2.0.4
 */
function bavotasan_admin_bar_menu( $wp_admin_bar ) {
    if ( current_user_can( 'edit_theme_options' ) && is_admin_bar_showing() )
    	$wp_admin_bar->add_node( array( 'id' => 'bavotasan_toolbar', 'title' => BAVOTASAN_THEME_NAME, 'href' => esc_url( admin_url( 'customize.php' ) ) ) );
}

add_filter( 'body_class','bavotasan_custom_body_class' );
/**
 * Adds class if first sidebar located on left side
 *
 * @since 1.0.8
 */
function bavotasan_custom_body_class( $classes ) {
	$bavotasan_theme_options = bavotasan_theme_options();
	$arr = array( 1, 3, 5 );
	if ( in_array( $bavotasan_theme_options['layout'], $arr ) )
		$classes[] = 'left-sidebar';

	return $classes;
}

/**
 * Add class to sub-menu parent items
 *
 * @author Kirk Wight <http://kwight.ca/adding-a-sub-menu-indicator-to-parent-menu-items/>
 * @since 1.0.8
 */
class Bavotasan_Page_Navigation_Walker extends Walker_Nav_Menu {
    function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
        $id_field = $this->db_fields['id'];
        if ( !empty( $children_elements[ $element->$id_field ] ) )
            $element->classes[] = 'sub-menu-parent';

        Walker_Nav_Menu::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
    }
}

add_filter( 'wp_nav_menu_args', 'bavotasan_nav_menu_args' );
/**
 * Set our new walker only if a menu is assigned and a child theme hasn't modified it to one level deep
 *
 * This function is attached to the 'wp_nav_menu_args' filter hook.
 *
 * @author Kirk Wight <http://kwight.ca/adding-a-sub-menu-indicator-to-parent-menu-items/>
 * @since 1.0.8
 */
function bavotasan_nav_menu_args( $args ) {
    if ( 1 !== $args[ 'depth' ] && has_nav_menu( 'primary' ) )
        $args[ 'walker' ] = new Bavotasan_Page_Navigation_Walker;

    return $args;
}

/**
 * Retrieves the IDs for images in a gallery.
 *
 * @uses get_post_galleries() first, if available. Falls back to shortcode parsing,
 * then as last option uses a get_posts() call.
 *
 * @since 1.0.9
 *
 * @return array List of image IDs from the post gallery.
 */
function bavotasan_get_gallery_images() {
	$images = array();

	if ( function_exists( 'get_post_galleries' ) ) {
		$galleries = get_post_galleries( get_the_ID(), false );
		if ( isset( $galleries[0]['ids'] ) )
		 	$images = explode( ',', $galleries[0]['ids'] );
	} else {
		$pattern = get_shortcode_regex();
		preg_match( "/$pattern/s", get_the_content(), $match );
		$atts = shortcode_parse_atts( $match[3] );
		if ( isset( $atts['ids'] ) )
			$images = explode( ',', $atts['ids'] );
	}

	if ( ! $images ) {
		$images = get_posts( array(
			'fields' => 'ids',
			'numberposts' => 999,
			'order' => 'ASC',
			'orderby' => 'menu_order',
			'post_mime_type' => 'image',
			'post_parent' => get_the_ID(),
			'post_type' => 'attachment',
		) );
	}

	return $images;
}


text:
'use strict';

describe('sector-component', function () {
    var controller, scope, backEndServer;

    beforeEach(function () {
        this.addMatchers({
            toEqualData: function (expected) {
                return angular.equals(this.actual, expected);
            }
        });
    });

    beforeEach(module('testSPA.sectorComponent'));

    beforeEach(inject(function ($rootScope, $controller) {
        backEndServer = {
            data: {}, done: false, isDone: function () { return backEndServer.done; },
            getSectors: jasmine.createSpy().andCallFake(function (params) {
                return {
                    then: function (fn) {
                        setTimeout(function () { fn(backEndServer.data); backEndServer.done = true; }, 10);
                    }
                };
            })
        };

        scope = $rootScope.$new();
        scope.search = { name: '', json: function () { return { name: scope.search.name }; } };
        controller = $controller('SectorComponentCtrl', { $scope: scope, backEndServer: backEndServer });
    }));

    it('should initialise and load full sector list', function () {
        runs(function () {
            backEndServer.data = [{ name: 'sector-1' }];
            expect(scope.sectors).toBeUndefined();
            scope.$digest();
        });

        waitsFor(backEndServer.isDone, "Server call should be complete", 20);

        runs(function () {
            expect(scope.sectors).toEqualData([{ name: 'sector-1' }]);
        });
    });

    it('should query filtered sector list when search changes', function (done) {
        runs(function () {
            backEndServer.data = [{ name: 'filtered-1' }];
            expect(scope.sectors).toBeUndefined();

            scope.search.name = 'test-filter';
            scope.$digest();
        });

        waitsFor(backEndServer.isDone, "Server call should be complete", 20);

        runs(function () {
            expect(backEndServer.getSectors).toHaveBeenCalledWith({ name: 'test-filter' });
            expect(scope.sectors).toEqualData([{ name: 'filtered-1' }]);
        });
    });

});


text:
package cz.zipek.minicloud.api.upload.events;

import cz.zipek.minicloud.api.upload.UploadEvent;

/**
 *
 * @author Jan Zípek
 */
public class UploadAllDoneEvent extends UploadEvent {

}


text:
namespace qt
{
namespace common
{
class QtRenderOGLContext : public dp::OGLContext
{
public:
  QtRenderOGLContext(QOpenGLContext * rootContext, QOffscreenSurface * surface);

  // dp::OGLContext overrides:
  void present() override;
  void makeCurrent() override;
  void doneCurrent() override;
  void setDefaultFramebuffer() override;
  void resize(int w, int h) override;

  void lockFrame();
  GLuint getTextureHandle() const;
  QRectF const & getTexRect() const;
  void unlockFrame();

private:
  QOffscreenSurface * m_surface = nullptr;
  std::unique_ptr<QOpenGLContext> m_ctx;

  std::unique_ptr<QOpenGLFramebufferObject> m_frontFrame;
  std::unique_ptr<QOpenGLFramebufferObject> m_backFrame;
  QRectF m_texRect = QRectF(0.0, 0.0, 0.0, 0.0);

  mutex m_lock;
  bool m_resizeLock = false;
};

class QtUploadOGLContext: public dp::OGLContext
{
public:
  QtUploadOGLContext(QOpenGLContext * rootContext, QOffscreenSurface * surface);

  // dp::OGLContext overrides:
  void present() override;
  void makeCurrent() override;
  void doneCurrent() override;
  void setDefaultFramebuffer() override;

private:
  QOffscreenSurface * m_surface = nullptr;  // non-owning ptr
  std::unique_ptr<QOpenGLContext> m_ctx;
};
}  // namespace common
}  // namespace qt


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string-array name="intent_categories_labels">
        <item>ALTERNATIVE</item>
        <item>APP_BROWSER</item>
        <item>APP_CALCULATOR</item>
        <item>APP_CALENDAR</item>
        <item>APP_CONTACTS</item>
        <item>APP_EMAIL</item>
        <item>APP_GALLERY</item>
        <item>APP_MAPS</item>
        <item>APP_MARKET</item>
        <item>APP_MESSAGING</item>
        <item>APP_MUSIC</item>
        <item>BROWSABLE</item>
        <item>CAR_DOCK</item>
        <item>CAR_MODE</item>
        <item>DEFAULT</item>
        <item>DESK_DOCK</item>
        <item>DEVELOPMENT_PREFERENCE</item>
        <item>EMBED</item>
        <item>FRAMEWORK_INSTRUMENTATION_TEST</item>
        <item>HE_DESK_DOCK</item>
        <item>HOME</item>
        <item>INFO</item>
        <item>LAUNCHER</item>
        <item>LE_DESK_DOCK</item>
        <item>MONKEY</item>
        <item>OPENABLE</item>
        <item>PREFERENCE</item>
        <item>SAMPLE_CODE</item>
        <item>SELECTED_ALTERNATIVE</item>
        <item>TAB</item>
        <item>TEST</item>
        <item>UNIT_TEST</item>
    </string-array>

</resources>


text:
[![Build status](https://ci.appveyor.com/api/projects/status/fnfnxdoanv5aux3f?svg=true)](https://ci.appveyor.com/project/bin3377/sumologic-net-appenders)
[![SumoLogic.Logging.Common](https://img.shields.io/nuget/v/SumoLogic.Logging.Common.svg?label=SumoLogic.Logging.Common&logo=nuget&logoColor=C0C0C0)](https://www.nuget.org/packages/SumoLogic.Logging.Common/)
[![SumoLogic.Logging.Log4Net](https://img.shields.io/nuget/v/SumoLogic.Logging.Log4Net.svg?label=SumoLogic.Logging.Log4Net&logo=nuget&logoColor=C0C0C0)](https://www.nuget.org/packages/SumoLogic.Logging.Log4Net/)
[![SumoLogic.Logging.NLog](https://img.shields.io/nuget/v/SumoLogic.Logging.NLog.svg?label=SumoLogic.Logging.NLog&logo=nuget&logoColor=C0C0C0)](https://www.nuget.org/packages/SumoLogic.Logging.NLog/)
[![SumoLogic.Logging.Serilog](https://img.shields.io/nuget/v/SumoLogic.Logging.Serilog.svg?label=SumoLogic.Logging.Serilog&logo=nuget&logoColor=C0C0C0)](https://www.nuget.org/packages/SumoLogic.Logging.Serilog/)
[![SumoLogic.Logging.AspNetCore](https://img.shields.io/nuget/v/SumoLogic.Logging.AspNetCore.svg?label=SumoLogic.Logging.AspNetCore&logo=nuget&logoColor=C0C0C0)](https://www.nuget.org/packages/SumoLogic.Logging.AspNetCore/)

Appenders for .NET logging frameworks which send data to Sumo Logic HTTP sources.

## Prerequisites

- .NET 4.5 or later or .NET Standard 1.5
- ASP.NET Core 2.0 or later for ASP.NET Core Logging provider
- A Sumo Logic Account (trial can be started [here](https://www.sumologic.com/))

## Appenders

Appenders are provided for the following .NET logging frameworks

- NLog
- Log4Net
- Serilog
- ASP.NET Core Logging Provider (Beta)

All appenders have two implementations: a buffering and a non-buffering version.
The non-buffering implementations will send each log message to Sumo Logic in a distinct HTTP request. The buffering
implementations will queue messages until a size, count, or time threshold is met, then send in batch.

## NuGet Installation

### NLog

To install the NLog target, use the following steps

```ps
Install-Package SumoLogic.Logging.NLog
```

#### Example Appender Configuration for NLog

```xml
<?xml version="1.0" encoding="utf-8" ?>
<nlog autoReload="true" internalLogToConsole="true">
  <extensions>
    <add assembly="SumoLogic.Logging.NLog"/>
  </extensions>
  <targets>
    <target name="sumoLogic" type="SumoLogicTarget"	layout="${date:format=yyyy-MM-dd HH\:mm\:ss.fff} ${level}, ${message}${exception:format=tostring}${newline}">
      <Url>https://collectors.us2.sumologic.com/receiver/v1/http/==your_endpoint_here==</Url>
      <ConnectionTimeout>30000</ConnectionTimeout>
      <SourceName>ExampleNameNLogTarget</SourceName>
      <SourceCategory>ExampleCategoryNLogTarget</SourceCategory>
      <SourceHost>ExampleHostNLogTarget</SourceHost>
      <UseConsoleLog>true</UseConsoleLog>
    </target>
    <target name="bufferedSumoLogic" type="BufferedSumoLogicTarget" layout="${date:format=yyyy-MM-dd HH\:mm\:ss.fff} ${level}, ${message}${exception:format=tostring}${newline}">
      <Url>https://collectors.us2.sumologic.com/receiver/v1/http/==your_endpoint_here==</Url>
      <SourceName>ExampleNameNLogBufferedTarget</SourceName>
      <SourceCategory>ExampleCategoryNLogBufferedTarget</SourceCategory>
      <SourceHost>ExampleHostNLogBufferedTarget</SourceHost>
      <ConnectionTimeout>30000</ConnectionTimeout>
      <RetryInterval>5000</RetryInterval>
      <MessagesPerRequest>10</MessagesPerRequest>
      <MaxFlushInterval>10000</MaxFlushInterval>
      <FlushingAccuracy>250</FlushingAccuracy>
      <MaxQueueSizeBytes>500000</MaxQueueSizeBytes>
      <UseConsoleLog>true</UseConsoleLog>
    </target>
  </targets>
  <rules>
    <logger name="*" minLevel="Debug" writeTo="sumoLogic"/>
    <logger name="*" minLevel="Debug" writeTo="bufferedSumoLogic"/>
  </rules>
</nlog>
```

#### Example Code For NLog

```csharp
public static class Program
{
    /// <summary>
    /// An example application that logs.
    /// </summary>
    public static void Main()
    {
        Logger logger = LogManager.GetCurrentClassLogger();
        logger.Debug("Log message");
        Console.Read();
    }
}
```

More about NLog target configuration: [SumoLogic.Logging.NLog](docs/sumologic.logging.nlog.md)

### Log4Net

To install the Log4Net appender, use the following steps:

```ps
Install-Package SumoLogic.Logging.Log4Net
```

#### Example Appender Configuration for Log4Net

```xml
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
  </configSections>
  <log4net debug="true">
    <appender name="SumoLogicAppender" type="SumoLogic.Logging.Log4Net.SumoLogicAppender, SumoLogic.Logging.Log4Net">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline"/>
      </layout>
      <Url value="https://collectors.us2.sumologic.com/receiver/v1/http/==your_endpoint_here==" />
      <ConnectionTimeout value="30000" /> <!-- in milliseconds -->
      <SourceName value="ExampleNameLog4NetAppender" />
      <SourceCategory value="ExampleCategoryLog4NetAppender" />
      <SourceHost value="ExampleHostLog4NetAppender" />
      <UseConsoleLog value="true" />
    </appender>
    <appender name="BufferedSumoLogicAppender" type="SumoLogic.Logging.Log4Net.BufferedSumoLogicAppender, SumoLogic.Logging.Log4Net">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline"/>
      </layout>
      <Url value="https://collectors.us2.sumologic.com/receiver/v1/http/==your_endpoint_here==" />
      <SourceName value="ExampleNameLog4NetBufferedAppender" />
      <SourceCategory value="ExampleCategoryLog4NetBufferedAppender" />
      <SourceHost value="ExampleHostLog4NetBufferedAppender" />
      <ConnectionTimeout value="30000" />
      <RetryInterval value="5000" />
      <MessagesPerRequest value="10" />
      <MaxFlushInterval value="10000" />
      <FlushingAccuracy value="250" />
      <MaxQueueSizeBytes value="500000" />
      <UseConsoleLog value="true" />
    </appender>
    <root>
      <priority value="ALL"/>
      <level value="ALL"/>
      <appender-ref ref="SumoLogicAppender"/>
      <appender-ref ref="BufferedSumoLogicAppender"/>
    </root>
    <logger name="SumoLogic.Logging.Log4Net.Example.Program">
      <level value="ALL"/>
    </logger>
  </log4net>

  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>
```

#### Example Code for Log4Net

```csharp
public static class Program
{
    /// <summary>
    /// The log4net log.
    /// </summary>
    private static ILog log4netLog = LogManager.GetLogger(typeof(Program));

    /// <summary>
    /// An example application that logs.
    /// </summary>
    public static void Main()
    {
        Console.WriteLine("Hello world!");
        log4netLog.Info("Hello world!");
        Console.ReadKey();
    }
}
```

More about Log4Net appender configuration: [SumoLogic.Logging.Log4Net](docs/sumologic.logging.log4net.md)

### Serilog

To install the Serilog sink, use the following steps:

```ps
Install-Package SumoLogic.Logging.Serilog
```

#### Example Code (instantiation and configuration)

```csharp
Logger log = new LoggerConfiguration()
    .WriteTo.BufferedSumoLogic(
        new Uri("https://collectors.us2.sumologic.com/receiver/v1/http/==your_endpoint_here=="),
        sourceName: "ExampleNameSerilogBufferedSink",
        sourceCategory: "ExampleCategorySerilogBufferedSink",
        sourceHost: "ExampleHostSerilogBufferedSink",
        connectionTimeout: 30000,
        retryInterval: 5000,
        messagesPerRequest: 10,
        maxFlushInterval: 10000,
        flushingAccuracy: 250,
        maxQueueSizeBytes: 500000)
    .CreateLogger();

log.Information("Hello world!");
```

More about Serilog sink configuration: [SumoLogic.Logging.Serilog](docs/sumologic.logging.serilog.md)

### ASP.NET Core Logging Provider

To install the logging provider, use the following steps:

```ps
Install-Package SumoLogic.Logging.AspNetCore
```

More about ASP.NET Core logging provider configuration: [SumoLogic.Logging.AspNetCore](docs/sumologic.logging.aspnetcore.md)

## TLS 1.2 Requirement

Sumo Logic only accepts connections from clients using TLS version 1.2 or greater. To utilize the content of this repo, ensure that it's running in an execution environment that is configured to use TLS 1.2 or greater.

## License

[Apache 2.0](LICENSE)


text:
"Tweets to CSV" is a PHP web-based utility for creating a CSV file from a Twitter user's timeline or mentions.

Here is what it looks like in a browser:

![Tweets to CSV](screenshot.png?raw=true)

This project uses [CodeIgniter](http://www.codeigniter.com), [SASS](http://sass-lang.com), [Bourbon](http://bourbon.io) & @[abraham](https://github.com/abraham)'s [twitteroauth](https://github.com/abraham/twitteroauth).

For those unfamiliar with [CodeIgniter](http://ellislab.com/codeigniter) you can find the project-specific PHP classes in the [application/models](application/models), [application/views](application/views), and [application/controllers](application/controllers) folders.

## Configuration

In order for "Tweets to CSV" to function, you need to define your own OAuth credentials inside the [twitter_model.php](application/models/twitter_model.php) *(lines 14-17)*:

```php
$auth = array(
	'consumer_key'    => '',
	'consumer_secret' => '',
	'access_token'    => '',
	'access_secret'   => ''
);
```

## License

"Tweets to CSV" can be used freely for any open source or commercial works and is released under a [MIT license](http://en.wikipedia.org/wiki/MIT_License).

## Author

[Aaron Clinger](http://aaronclinger.com)


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

<TITLE>
org.apache.pig.data (Pig 0.7.0 API)
</TITLE>

<META NAME="date" CONTENT="2010-05-05">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package org.apache.pig.data

Data types for Pig.

See:

          Description

Interface Summary

DataBag
A collection of Tuples.

Tuple
An ordered list of Data.

Class Summary

AccumulativeBag

AmendableTuple

BagFactory
Factory for constructing different types of bags.

DataByteArray
An implementation of byte array.

DataReaderWriter
A class to handle reading and writing of intermediate results of data
 types.

DataType
A class of static final values used to encode data type and a number of
 static helper funcitons for manipulating data objects.

DefaultAbstractBag
Default implementation of DataBag.

DefaultAbstractBag.BagDelimiterTuple

DefaultAbstractBag.EndBag

DefaultAbstractBag.StartBag

DefaultBagFactory
Default implementation of BagFactory.

DefaultDataBag
An unordered collection of Tuples (possibly) with multiples.

DefaultTuple
A default implementation of Tuple.

DefaultTupleFactory
Default implementation of TupleFactory.

DistinctDataBag
An unordered collection of Tuples with no multiples.

InternalCachedBag

InternalDistinctBag
An unordered collection of Tuples with no multiples.

InternalMap
This class is an empty extension of Map<Object, Object>.

InternalSortedBag
An ordered collection of Tuples (possibly) with multiples.

NonSpillableDataBag
An unordered collection of Tuples (possibly) with multiples.

ReadOnceBag
This bag is specifically created for use by POPackageLite.

SingleTupleBag
A simple performant implementation of the DataBag
 interface which only holds a single tuple.

SortedDataBag
An ordered collection of Tuples (possibly) with multiples.

TargetedTuple
A tuple composed with the operators to which
 it needs be attached

TimestampedTuple

TupleFactory
A factory to construct tuples.

Package org.apache.pig.data Description

Data types for Pig.

This package contains implementations of Pig specific data types as well as
support functions for reading, writing, and using all Pig data types.

Whenever possible, Pig utilizes Java provided data types.  These include
Integer, Long, Float, Double, Boolean, String, and Map.  Tuple, Bag, and
DataByteArray are implemented in this package.

 Design

The choice was made to utilize Java provided types for two main reasons.  One,
it minimizes the burden on UDF developers, as they will have full access to
these types with no need to convert to and from Pig specific types.  Two,
maintenance costs will be lower as there is no need to implement and maintain
Pig specific data classes.  The drawback is that the only common parent of all
these types is Object.  Thus Pig is often required to treat its data objects
as Objects and then implement static methods to manipulate these Objects,
rather than being able to define a PigDatum class with common funcitons.

Three data types were implemented as Pig specific classes:
DataByteArray, Tuple,
and DataBag.

DataByteArray represents an array of bytes, with no interpretation of those
bytes provided or assumed.  This could have been represented as byte[], but a
separate class was constructed to provide common functions needed to
manipulate these objects.

Tuple represents an ordered collection of data elements.  Every field in a
tuple can contain any Pig data type.  Tuple is presented as an interface to
allow differing implementations in cases where users have unique
representations of their data that they wish to preserve in their in memory
representations.  The TupleFactory is an
abstract class, to enable a user who has defined his own tuples to provide a
factory that creates those tuples.  Default implementations of Tuple and
TupleFactory are provided and used by default.

DataBag represents a collection of Tuples.  DataBags can be of default type
(no extra features), sorted (tuples are sorted according to a provided
comparator function), or distinct (no duplicate tuples).  As with Tuple,
DataBag is presented as an interface, and
BagFactory is an abstract class.  Default implementations of DataBag,
BagFactory, and all three types of bags are provided.

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Copyright © ${year} The Apache Software Foundation