text:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="34" failures="0" disabled="0" errors="0" timestamp="2015-12-11T15:02:52" time="0.037" name="AllTests">
  <testsuite name="ConfigTest/0" tests="3" failures="0" disabled="0" errors="0" time="0.006">
    <testcase name="Get" type_param="double" status="run" time="0.005" classname="ConfigTest/0" />
    <testcase name="Set" type_param="double" status="run" time="0" classname="ConfigTest/0" />
    <testcase name="Other" type_param="double" status="run" time="0" classname="ConfigTest/0" />
  </testsuite>
  <testsuite name="ConfigTest/1" tests="3" failures="0" disabled="0" errors="0" time="0.002">
    <testcase name="Get" type_param="float" status="run" time="0.001" classname="ConfigTest/1" />
    <testcase name="Set" type_param="float" status="run" time="0" classname="ConfigTest/1" />
    <testcase name="Other" type_param="float" status="run" time="0.001" classname="ConfigTest/1" />
  </testsuite>
  <testsuite name="ConfigTest/2" tests="3" failures="0" disabled="0" errors="0" time="0">
    <testcase name="Get" type_param="std::string" status="run" time="0" classname="ConfigTest/2" />
    <testcase name="Set" type_param="std::string" status="run" time="0" classname="ConfigTest/2" />
    <testcase name="Other" type_param="std::string" status="run" time="0" classname="ConfigTest/2" />
  </testsuite>
  <testsuite name="ConfigTest/3" tests="3" failures="0" disabled="0" errors="0" time="0.001">
    <testcase name="Get" type_param="std::complex<double>" status="run" time="0.001" classname="ConfigTest/3" />
    <testcase name="Set" type_param="std::complex<double>" status="run" time="0" classname="ConfigTest/3" />
    <testcase name="Other" type_param="std::complex<double>" status="run" time="0" classname="ConfigTest/3" />
  </testsuite>
  <testsuite name="ConfigTest/4" tests="3" failures="0" disabled="0" errors="0" time="0.001">
    <testcase name="Get" type_param="int" status="run" time="0.001" classname="ConfigTest/4" />
    <testcase name="Set" type_param="int" status="run" time="0" classname="ConfigTest/4" />
    <testcase name="Other" type_param="int" status="run" time="0" classname="ConfigTest/4" />
  </testsuite>
  <testsuite name="ConfigTest/5" tests="3" failures="0" disabled="0" errors="0" time="0.001">
    <testcase name="Get" type_param="unsigned int" status="run" time="0.001" classname="ConfigTest/5" />
    <testcase name="Set" type_param="unsigned int" status="run" time="0" classname="ConfigTest/5" />
    <testcase name="Other" type_param="unsigned int" status="run" time="0" classname="ConfigTest/5" />
  </testsuite>
  <testsuite name="ConfigTest/6" tests="3" failures="0" disabled="0" errors="0" time="0.001">
    <testcase name="Get" type_param="unsigned long" status="run" time="0" classname="ConfigTest/6" />
    <testcase name="Set" type_param="unsigned long" status="run" time="0" classname="ConfigTest/6" />
    <testcase name="Other" type_param="unsigned long" status="run" time="0.001" classname="ConfigTest/6" />
  </testsuite>
  <testsuite name="ConfigTest/7" tests="3" failures="0" disabled="0" errors="0" time="0">
    <testcase name="Get" type_param="long long" status="run" time="0" classname="ConfigTest/7" />
    <testcase name="Set" type_param="long long" status="run" time="0" classname="ConfigTest/7" />
    <testcase name="Other" type_param="long long" status="run" time="0" classname="ConfigTest/7" />
  </testsuite>
  <testsuite name="ConfigTest/8" tests="3" failures="0" disabled="0" errors="0" time="0">
    <testcase name="Get" type_param="char" status="run" time="0" classname="ConfigTest/8" />
    <testcase name="Set" type_param="char" status="run" time="0" classname="ConfigTest/8" />
    <testcase name="Other" type_param="char" status="run" time="0" classname="ConfigTest/8" />
  </testsuite>
  <testsuite name="ConfigurationTest/0" tests="1" failures="0" disabled="0" errors="0" time="0.006">
    <testcase name="behaves_correctly" type_param="CreateByOperator" status="run" time="0.006" classname="ConfigurationTest/0" />
  </testsuite>
  <testsuite name="ConfigurationTest/1" tests="1" failures="0" disabled="0" errors="0" time="0.003">
    <testcase name="behaves_correctly" type_param="CreateByKeyAndValueAndAddConfiguration" status="run" time="0.003" classname="ConfigurationTest/1" />
  </testsuite>
  <testsuite name="ConfigurationTest/2" tests="1" failures="0" disabled="0" errors="0" time="0.003">
    <testcase name="behaves_correctly" type_param="CreateByKeyAndValueAndAddParameterTree" status="run" time="0.003" classname="ConfigurationTest/2" />
  </testsuite>
  <testsuite name="ConfigurationTest/3" tests="1" failures="0" disabled="0" errors="0" time="0.003">
    <testcase name="behaves_correctly" type_param="CreateByKeyAndValueVectorsAndAddParameterTree" status="run" time="0.003" classname="ConfigurationTest/3" />
  </testsuite>
  <testsuite name="ConfigurationTest/4" tests="1" failures="0" disabled="0" errors="0" time="0.002">
    <testcase name="behaves_correctly" type_param="CreateByKeysAndValues" status="run" time="0.002" classname="ConfigurationTest/4" />
  </testsuite>
  <testsuite name="ConfigurationTest/5" tests="1" failures="0" disabled="0" errors="0" time="0.003">
    <testcase name="behaves_correctly" type_param="CreateByParameterTree" status="run" time="0.003" classname="ConfigurationTest/5" />
  </testsuite>
  <testsuite name="ConfigurationTest/6" tests="1" failures="0" disabled="0" errors="0" time="0.003">
    <testcase name="behaves_correctly" type_param="CreateByOperatorAndAssign" status="run" time="0.003" classname="ConfigurationTest/6" />
  </testsuite>
</testsuites>


text:
package io.debezium.function;

import java.util.function.Consumer;

/**
 * A variant of {@link Consumer} that can be blocked and interrupted.
 * @param <T> the type of the input to the operation
 * @author Randall Hauch
 */
@FunctionalInterface
public interface BlockingConsumer<T> {

    /**
     * Performs this operation on the given argument.
     *
     * @param t the input argument
     * @throws InterruptedException if the calling thread is interrupted while blocking
     */
    void accept(T t) throws InterruptedException;
}

redpajama_set_name: RedPajamaGithub


text:
package com.bachelorproject.yasser.findmyfriends.Model;

//import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

//@Generated("org.jsonschema2pojo")
public class Beacon {

    @SerializedName("UUID")
    @Expose
    private String UUID;
    @SerializedName("Location")
    @Expose
    private String Location;
    @SerializedName("x")
    @Expose
    private String x;
    @SerializedName("y")
    @Expose
    private String y;
    @SerializedName("Building")
    @Expose
    private String Building;

    /**
     *
     * @return
     * The UUID
     */
    public String getUUID() {
        return UUID;
    }

    /**
     *
     * @param UUID
     * The UUID
     */
    public void setUUID(String UUID) {
        this.UUID = UUID;
    }

    /**
     *
     * @return
     * The Location
     */
    public String getLocation() {
        return Location;
    }

    /**
     *
     * @param Location
     * The Location
     */
    public void setLocation(String Location) {
        this.Location = Location;
    }

    /**
     *
     * @return
     * The x
     */
    public String getX() {
        return x;
    }

    /**
     *
     * @param x
     * The x
     */
    public void setX(String x) {
        this.x = x;
    }

    /**
     *
     * @return
     * The y
     */
    public String getY() {
        return y;
    }

    /**
     *
     * @param y
     * The y
     */
    public void setY(String y) {
        this.y = y;
    }

    /**
     *
     * @return
     * The Building
     */
    public String getBuilding() {
        return Building;
    }

    /**
     *
     * @param Building
     * The y
     */
    public void setBuilding(String Building) {
        this.Building = Building;
    }

    @Override
    public String toString (){
        return "{"+getUUID()+","+getLocation()+","+getX()+","+getY()+","+getBuilding()+"}";
    }

}


text:
package net.jueb.util4j.collection.bitPathTree.intpath;

import java.util.Iterator;
import java.util.Map.Entry;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

/**
 * 基于路径的双键值存储树
 * @author jaci
 * @param <K>
 * @param <V>
 */
public interface BitIntPathEntry<K,V> extends Iterable<Entry<K,V>>{

	/**
	 * 存储数据
	 * @param bitNumber
	 * @param value
	 * @return
	 */
	Entry<K,V> write(int bitNumber,K key,V value);

	/**
	 * 读取数据
	 * @param bitNumber
	 * @return
	 */
	Entry<K,V> read(int bitNumber);

	/**
	 * 清理数据返回旧数据
	 * @param bitNumber
	 * @return
	 */
	Entry<K,V> clean(int bitNumber);

	int size();

	void clear();

	Iterator<Entry<K,V>> iterator();

    void forEach(BiConsumer<K,V> consumer);

    @Override
    default void forEach(Consumer<? super Entry<K, V>> action) {
    	Iterable.super.forEach(action);
    }
}


text:
package main

import (
	"bufio"
	"bytes"
	"encoding/json"
	"flag"
	"fmt"
	"log"
	"net"
	"net/http"
	"os"
)

// DOMAIN MODEL

// ChatMsg represents a message
type ChatMsg struct {
	Message string
	From    Peer
}

// Peer represents a other chat user and machine
type Peer struct {
	Name    string
	Address string
}

// Peers is the map of Peers with a address as key
type Peers map[string]Peer

// P2PSystem contains the complete p2p system
type P2PSystem struct {
	Self            Peer
	Peers           Peers
	receivedMsg     chan (ChatMsg)
	peerJoins       chan (Peer)
	peerLeft        chan (Peer)
	currentPeers    chan (Peers)
	getCurrentPeers chan (bool)
	userMsg         chan (ChatMsg)
}

// INITIALIZATION

func main() {
	port := flag.String("p", "8000", "Listen on port number")
	name := flag.String("n", "anonymous", "Nickname")
	peer := flag.String("j", "", "Other peer to join")
	flag.Parse()

	system := NewP2PSystem(Peer{*name, getLocalIpv4() + ":" + *port})
	system.start()
	if len(*peer) != 0 {
		system.peerJoins <- Peer{"", *peer}
	}

	system.startStdinListener(system.Self)
}

func getLocalIpv4() string {
	host, _ := os.Hostname()
	addrs, _ := net.LookupIP(host)
	for _, addr := range addrs {
		if ipv4 := addr.To4(); ipv4 != nil {
			return fmt.Sprintf("%s", ipv4)
		}
	}
	return "localhost"
}

// HEART: P2P SYSTEM

// NewP2PSystem initializes a new P2PSystem and return a *P2PSystem
func NewP2PSystem(self Peer) *P2PSystem {
	system := new(P2PSystem)
	system.Self = self
	system.Peers = make(Peers)
	system.peerJoins = make(chan (Peer))
	system.currentPeers = make(chan (Peers))
	system.getCurrentPeers = make(chan (bool))

	system.userMsg = make(chan (ChatMsg))
	system.receivedMsg = make(chan (ChatMsg))
	return system
}

func (system *P2PSystem) start() {
	go system.selectLoop()
	go system.startWebListener()
	fmt.Printf("# \"%s\" listening on %s \n", system.Self.Name, system.Self.Address)
}

func (system *P2PSystem) selectLoop() {
	for {
		select {
		case peer := <-system.peerJoins:
			if !system.knownPeer(peer) {
				fmt.Printf("# Connected to: %s \n", peer.Address)
				system.Peers[peer.Address] = peer
				go system.sendJoin(peer)
			}

		case <-system.getCurrentPeers:
			system.currentPeers <- system.Peers

		case peer := <-system.peerLeft:
			delete(system.Peers, peer.Address)

		case chatMsg := <-system.receivedMsg:
			fmt.Printf("%s writes: %s\n", chatMsg.From.Name, chatMsg.Message)

		case chatMsg := <-system.userMsg:
			fmt.Printf("%s (self) says: %s\n", chatMsg.From.Name, chatMsg.Message)
			for _, peer := range system.Peers {
				go system.sendChat(peer, chatMsg)
			}
		}
	}
}

func (system *P2PSystem) knownPeer(peer Peer) bool {
	if peer.Address == system.Self.Address {
		return true
	}
	_, knownPeer := system.Peers[peer.Address]
	return knownPeer
}

// HTTP CLIENT : SENDING TO OTHER PEERS

func (system *P2PSystem) sendJoin(peer Peer) {
	URL := "http://" + peer.Address + "/join"

	qs, _ := json.Marshal(system.Self)

	resp, err := http.Post(URL, "application/json", bytes.NewBuffer(qs))
	if err != nil {
		system.peerLeft <- peer
		return
	}

	system.peerJoins <- peer

	defer resp.Body.Close()
	otherPeers := Peers{}
	dec := json.NewDecoder(resp.Body)
	err = dec.Decode(&otherPeers)
	for _, peer := range otherPeers {
		system.peerJoins <- peer
	}
}

func (system *P2PSystem) sendChat(peer Peer, msg ChatMsg) {
	URL := "http://" + peer.Address + "/chat"

	qs, _ := json.Marshal(msg)

	_, err := http.Post(URL, "application/json", bytes.NewBuffer(qs))
	if err != nil {
		system.peerLeft <- peer
		return
	}
}

// HTTP SERVER : LISTENING TO OTHER PEERS

func (system *P2PSystem) startWebListener() {
	http.HandleFunc("/chat", createChatHandler(system))
	http.HandleFunc("/join", createJoinHandler(system))

	log.Fatal(http.ListenAndServe(system.Self.Address, nil))
}

func createJoinHandler(system *P2PSystem) func(http.ResponseWriter, *http.Request) {
	return func(w http.ResponseWriter, r *http.Request) {
		joiner := Peer{}
		dec := json.NewDecoder(r.Body)
		err := dec.Decode(&joiner)
		if err != nil {
			log.Printf("Error unmarshalling from: %v", err)
		}

		system.peerJoins <- joiner

		system.getCurrentPeers <- true
		enc := json.NewEncoder(w)
		enc.Encode(<-system.currentPeers)
	}
}

func createChatHandler(system *P2PSystem) func(http.ResponseWriter, *http.Request) {
	return func(w http.ResponseWriter, r *http.Request) {
		cm := ChatMsg{}
		dec := json.NewDecoder(r.Body)
		err := dec.Decode(&cm)
		if err != nil {
			log.Printf("Error unmarshalling from: %v", err)
		}

		system.receivedMsg <- cm
	}
}

// LISTENER STANDARD IN : USER INPUT

func (system *P2PSystem) startStdinListener(sender Peer) {
	reader := bufio.NewReader(os.Stdin)

	for {
		line, _ := reader.ReadString('\n')
		message := line[:len(line)-1]
		system.userMsg <- ChatMsg{message, sender}
	}
}


text:
require 'emory/teleport_config'

module Emory
  module DSL

    class TeleportConfigurationBlockMustBeSuppliedException < Exception; end
    class UndefinedTeleportHandlerException < Exception; end
    class HandlerReferenceMustBeSuppliedException < Exception; end
    class WatchedPathMustBeSuppliedException < Exception; end

    class TeleportConfigBuilder

      LOGGER = Logging.logger[self]

      def initialize(handlers, &block)
        LOGGER.debug('Initializing a new teleport builder')
        raise TeleportConfigurationBlockMustBeSuppliedException, "The configuration block with teleport settings must be supplied" unless block_given?

        @block = block
        @available_handlers = handlers

        LOGGER.debug('Creating a new teleport config instance')
        @teleport_config = TeleportConfig.new
      end

      def build
        LOGGER.debug('Evaluating teleport configuration')
        instance_eval &@block

        raise HandlerReferenceMustBeSuppliedException, "A reference to an existing handler must be supplied in teleport configuration" if @teleport_config.handler.nil?
        raise WatchedPathMustBeSuppliedException, "A watched path must be supplied in teleport configuration" if @teleport_config.watched_path.nil?

        @teleport_config
      end

      private

      def path(path)
        LOGGER.debug('Setting teleport\'s watched path')
        @teleport_config.watched_path = path
      end

      def handler(handler_name)
        LOGGER.debug('Setting teleport\'s handler')
        raise UndefinedTeleportHandlerException, "The handler ':#{handler_name}' wired to teleport could not be found" unless @available_handlers.include?(handler_name)
        @teleport_config.handler = @available_handlers[handler_name]
      end

      def ignore(ignore)
        LOGGER.debug('Setting teleport\'s ignore expression')
        @teleport_config.ignore = ignore
      end

      def filter(filter)
        LOGGER.debug('Setting teleport\'s filter expression')
        @teleport_config.filter = filter
      end

    end

  end
end


text:
class SnapshotNotFoundException(Exception):
    pass


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <script type="text/javascript" data-main="js/index" src="js/bower/requirejs/require.js"></script>
</head>
<body>
    <div ng-view autoscroll="true" class="main"></div>
</body>
</html>


text:
- **Distributed:** *September 28th*
- **Due:** *October 12th*

### Description:

After the falling excitement of Pokemon Go from the summer, Nintendo of America has decided to hire web developers to raise the web presence of the great and exciting world of Pokemon. Nintendo of America is hoping that you will be able to provide a place for fans of Pokemon to come together and bask in their glory. They also want things to be very organized and segmented properly, so they are asking for you to create a website for an individual Pokemon.

### Spec:

- Create a website promoting the glory of your favorite Pokemon
- There should be at least 5 interconnected web pages:
  - Homepage (index.html)
    - basic page, sets standard for the rest of the pages to follow
    - at least one image of your chosen Pokemon
    - the slogan of the club
    - 'upcoming events'
  - About the club (about.html)
    - some information about the club (where they meet IRL, where all their gold is hidden)
    - what the club hopes to accomplish
    - list some of the club members with images (if available) and links to their accomplishments
  - About the Pokemon (${pokemonName}.html)
    - general information about it's evolutionary line and other similar Pokemon
    - powers/strengths - why is this Pokemon the best?
    - weaknesses - which Pokemon should we eradicate so that yours can reign supreme
    - trivia - any other bits of information that will help convince others to lend their support
  - Register new users (join.html)
    - a page holding a form for visitors to join
    - must require a user to register with a valid
      - username
      - password
      - first name/last name
      - e-mail
      - date of birth
      - gender
      - requested title
      - Credit card number
      - favorite type of apple (something in a select box)
    - if the user is already logged in, the page says thanks for supporting
  - Sitemap (sitemap.html)
    - a simple page listing all of the websites pages that can be reached
- Each page should use one general style sheet (club-general.css) that applies a thematic flow to the pages
  - i.e. If I choose to have a fan club for WarGreymon my club-general.css would apply to all of my pages:
    - a yellow background
    - curved, pointy, dinosaur talon-y font
    - steel/metallic colored font for exciting headings
    - maybe some cool metal looking :hover for my links
    - *obviously, you won't be able to use WarGreymon, he's a Digimon*
  - the club-general.css will be linked by every page, give it broad enough rules that will be used everywhere
  - pages may have individual stylesheets (i.e. club-about.css), but no in-line style attributes

## Expectations:

- work in groups of up to 4 people
- html pages will be html5 compliant (tested [here][html5])
- css pages will be css3 compliant (tested [here][css3])
- all source code will show proper/consistent formatting
- no erroneous red code in firefox html preview
- web site will be hosted on people.emich

## Deliverables:

- Final Project:
  1. Print out of all source code due 7:20pm on the 12th
  1. Demo/walkthrough in class
  1. Individual writeup of the responsibilities for the group members

## Requirements for success:

- Regex validation on registration form
- Cookie store for registered users

### Legal Notice

*Please appropriately cite text/images taken straight from wikipedia and other sites*

[html5]: https://validator.w3.org/
[css3]: https://jigsaw.w3.org/css-validator/


text:
package apple.coredata;

import apple.NSObject;
import apple.foundation.NSArray;
import apple.foundation.NSError;
import apple.foundation.NSMethodSignature;
import apple.foundation.NSSet;
import org.moe.natj.c.ann.FunctionPtr;
import org.moe.natj.general.NatJ;
import org.moe.natj.general.Pointer;
import org.moe.natj.general.ann.Generated;
import org.moe.natj.general.ann.Library;
import org.moe.natj.general.ann.Mapped;
import org.moe.natj.general.ann.NInt;
import org.moe.natj.general.ann.NUInt;
import org.moe.natj.general.ann.Owned;
import org.moe.natj.general.ann.ReferenceInfo;
import org.moe.natj.general.ann.Runtime;
import org.moe.natj.general.ptr.Ptr;
import org.moe.natj.general.ptr.VoidPtr;
import org.moe.natj.objc.Class;
import org.moe.natj.objc.ObjCRuntime;
import org.moe.natj.objc.SEL;
import org.moe.natj.objc.ann.ObjCClassBinding;
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.map.ObjCObjectMapper;

@Generated
@Library("CoreData")
@Runtime(ObjCRuntime.class)
@ObjCClassBinding
public class NSEntityMigrationPolicy extends NSObject {
    static {
        NatJ.register();
    }

    @Generated
    protected NSEntityMigrationPolicy(Pointer peer) {
        super(peer);
    }

    @Generated
    @Selector("accessInstanceVariablesDirectly")
    public static native boolean accessInstanceVariablesDirectly();

    @Generated
    @Owned
    @Selector("alloc")
    public static native NSEntityMigrationPolicy alloc();

    @Owned
    @Generated
    @Selector("allocWithZone:")
    public static native NSEntityMigrationPolicy allocWithZone(VoidPtr zone);

    @Generated
    @Selector("automaticallyNotifiesObserversForKey:")
    public static native boolean automaticallyNotifiesObserversForKey(String key);

    @Generated
    @Selector("cancelPreviousPerformRequestsWithTarget:")
    public static native void cancelPreviousPerformRequestsWithTarget(@Mapped(ObjCObjectMapper.class) Object aTarget);

    @Generated
    @Selector("cancelPreviousPerformRequestsWithTarget:selector:object:")
    public static native void cancelPreviousPerformRequestsWithTargetSelectorObject(
            @Mapped(ObjCObjectMapper.class) Object aTarget, SEL aSelector,
            @Mapped(ObjCObjectMapper.class) Object anArgument);

    @Generated
    @Selector("classFallbacksForKeyedArchiver")
    public static native NSArray<String> classFallbacksForKeyedArchiver();

    @Generated
    @Selector("classForKeyedUnarchiver")
    public static native Class classForKeyedUnarchiver();

    @Generated
    @Selector("debugDescription")
    public static native String debugDescription_static();

    @Generated
    @Selector("description")
    public static native String description_static();

    @Generated
    @Selector("hash")
    @NUInt
    public static native long hash_static();

    @Generated
    @Selector("instanceMethodForSelector:")
    @FunctionPtr(name = "call_instanceMethodForSelector_ret")
    public static native NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(SEL aSelector);

    @Generated
    @Selector("instanceMethodSignatureForSelector:")
    public static native NSMethodSignature instanceMethodSignatureForSelector(SEL aSelector);

    @Generated
    @Selector("instancesRespondToSelector:")
    public static native boolean instancesRespondToSelector(SEL aSelector);

    @Generated
    @Selector("isSubclassOfClass:")
    public static native boolean isSubclassOfClass(Class aClass);

    @Generated
    @Selector("keyPathsForValuesAffectingValueForKey:")
    public static native NSSet<String> keyPathsForValuesAffectingValueForKey(String key);

    @Generated
    @Owned
    @Selector("new")
    public static native NSEntityMigrationPolicy new_objc();

    @Generated
    @Selector("resolveClassMethod:")
    public static native boolean resolveClassMethod(SEL sel);

    @Generated
    @Selector("resolveInstanceMethod:")
    public static native boolean resolveInstanceMethod(SEL sel);

    @Generated
    @Selector("setVersion:")
    public static native void setVersion_static(@NInt long aVersion);

    @Generated
    @Selector("superclass")
    public static native Class superclass_static();

    @Generated
    @Selector("version")
    @NInt
    public static native long version_static();

    /**
     * Invoked by the migration manager at the start of a given entity mapping. This is also the precursor to the
     * creation step.
     */
    @Generated
    @Selector("beginEntityMapping:manager:error:")
    public native boolean beginEntityMappingManagerError(NSEntityMapping mapping, NSMigrationManager manager,
            @ReferenceInfo(type = NSError.class) Ptr<NSError> error);

    /**
     * Invoked by the migration manager on each source instance (as specified by the sourceExpression in the mapping) to
     * create the corresponding destination instance. The method also associates the source and destination instances by
     * calling NSMigrationManager's
     * associateSourceInstance:withDestinationInstance:forEntityMapping: method. Subclass implementations of this method
     * must be careful to
     * associate the source and destination instances as required if super is not called. A return value of NO indicates
     * an error.
     */
    @Generated
    @Selector("createDestinationInstancesForSourceInstance:entityMapping:manager:error:")
    public native boolean createDestinationInstancesForSourceInstanceEntityMappingManagerError(
            NSManagedObject sInstance, NSEntityMapping mapping, NSMigrationManager manager,
            @ReferenceInfo(type = NSError.class) Ptr<NSError> error);

    /**
     * Constructs the relationships between the newly-created destination instances. The association lookup methods on
     * the NSMigrationManager can be used to determine the appropriate relationship targets. A return value of NO
     * indicates an error.
     */
    @Generated
    @Selector("createRelationshipsForDestinationInstance:entityMapping:manager:error:")
    public native boolean createRelationshipsForDestinationInstanceEntityMappingManagerError(NSManagedObject dInstance,
            NSEntityMapping mapping, NSMigrationManager manager,
            @ReferenceInfo(type = NSError.class) Ptr<NSError> error);

    /**
     * Invoked by the migration manager at the end of a given entity mapping. This is also the end to the validation
     * step, which is the last step for migration.
     */
    @Generated
    @Selector("endEntityMapping:manager:error:")
    public native boolean endEntityMappingManagerError(NSEntityMapping mapping, NSMigrationManager manager,
            @ReferenceInfo(type = NSError.class) Ptr<NSError> error);

    /**
     * Indicates the end of the creation step for the specified entity mapping, and the precursor to the next migration
     * step. Developers can override this method to set up or clean up information for further migration steps.
     */
    @Generated
    @Selector("endInstanceCreationForEntityMapping:manager:error:")
    public native boolean endInstanceCreationForEntityMappingManagerError(NSEntityMapping mapping,
            NSMigrationManager manager, @ReferenceInfo(type = NSError.class) Ptr<NSError> error);

    /**
     * Indicates the end of the relationship creation step for the specified entity mapping. This method is invoked
     * after the createRelationshipsForDestinationInstance:entityMapping:manager:error: method, and can be used to clean
     * up state from the creation of relationships, or prepare state for the performance of custom validation.
     */
    @Generated
    @Selector("endRelationshipCreationForEntityMapping:manager:error:")
    public native boolean endRelationshipCreationForEntityMappingManagerError(NSEntityMapping mapping,
            NSMigrationManager manager, @ReferenceInfo(type = NSError.class) Ptr<NSError> error);

    @Generated
    @Selector("init")
    public native NSEntityMigrationPolicy init();

    /**
     * Invoked during the validation step of the entity migration policy, providing the option of performing custom
     * validation on migrated objects. (Implementors must manually obtain the collection of objects they are interested
     * in validating.)
     */
    @Generated
    @Selector("performCustomValidationForEntityMapping:manager:error:")
    public native boolean performCustomValidationForEntityMappingManagerError(NSEntityMapping mapping,
            NSMigrationManager manager, @ReferenceInfo(type = NSError.class) Ptr<NSError> error);
}


text:
package net.java.sip.communicator.slick.protocol.yahoo;

import java.util.*;

import junit.framework.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;

/**
 * Tests functionality of the typing notifications operation set.
 *
 * @author Damian Minkov
 */
public class TestOperationSetTypingNotifications
    extends TestCase
{
    private static final Logger logger =
        Logger.getLogger(TestOperationSetTypingNotifications.class);

    private YahooSlickFixture fixture = new YahooSlickFixture();
    private OperationSetTypingNotifications opSetTypingNotifs1 = null;
    private OperationSetPresence opSetPresence1 = null;
    private OperationSetTypingNotifications opSetTypingNotifs2 = null;
    private OperationSetPresence opSetPresence2 = null;

    private OperationSetBasicInstantMessaging opSetBasicIM1 = null;
    private OperationSetBasicInstantMessaging opSetBasicIM2 = null;

    public TestOperationSetTypingNotifications(String name)
    {
            super(name);
    }

    @Override
    protected void setUp() throws Exception
    {
        super.setUp();
        fixture.setUp();

        Map<String, OperationSet> supportedOperationSets1 =
            fixture.provider1.getSupportedOperationSets();

        if ( supportedOperationSets1 == null
            || supportedOperationSets1.size() < 1)
            throw new NullPointerException(
                "No OperationSet implementations are supported by "
                +"this implementation. ");

        //get the operation set presence here.
        opSetTypingNotifs1 =
            (OperationSetTypingNotifications)supportedOperationSets1.get(
                OperationSetTypingNotifications.class.getName());

        //if the op set is null then the implementation doesn't offer a typing.n
        //operation set which is unacceptable.
        if (opSetTypingNotifs1 == null)
        {
            throw new NullPointerException(
                "No implementation for typing notifications was found");
        }

        opSetBasicIM1 =
            (OperationSetBasicInstantMessaging)supportedOperationSets1.get(
                OperationSetBasicInstantMessaging.class.getName());

        if (opSetBasicIM1 == null)
        {
            throw new NullPointerException(
                "No implementation for basic IM was found");
        }

        //we also need the presence op set in order to retrieve contacts.
        opSetPresence1 =
            (OperationSetPresence)supportedOperationSets1.get(
                OperationSetPresence.class.getName());

        //if the op set is null show that we're not happy.
        if (opSetPresence1 == null)
        {
            throw new NullPointerException(
                "An implementation of the service must provide an "
                + "implementation of at least one of the PresenceOperationSets");
        }

        Map<String, OperationSet> supportedOperationSets2 =
            fixture.provider2.getSupportedOperationSets();

        if ( supportedOperationSets2 == null
            || supportedOperationSets2.size() < 1)
            throw new NullPointerException(
                "No OperationSet implementations are supported by "
                +"this implementation. ");

        //get the operation set presence here.
        opSetTypingNotifs2 =
            (OperationSetTypingNotifications)supportedOperationSets2.get(
                OperationSetTypingNotifications.class.getName());

        //if the op set is null then the implementation doesn't offer a typing.n
        //operation set which is unacceptable for.
        if (opSetTypingNotifs2 == null)
        {
            throw new NullPointerException(
                "No implementation for typing notifications was found");
        }

        opSetBasicIM2 =
            (OperationSetBasicInstantMessaging)supportedOperationSets2.get(
                OperationSetBasicInstantMessaging.class.getName());

        if (opSetBasicIM2 == null)
        {
            throw new NullPointerException(
                "No implementation for basic IM was found");
        }

        //we also need the presence op set in order to retrieve contacts.
        opSetPresence2 =
            (OperationSetPresence)supportedOperationSets2.get(
                OperationSetPresence.class.getName());

        //if the op set is null show that we're not happy.
        if (opSetPresence2 == null)
        {
            throw new NullPointerException(
                "An implementation of the service must provide an "
                + "implementation of at least one of the PresenceOperationSets");
        }
    }

    /**
     * Create the list to be sure that contacts exchanging messages
     * exists in each other lists
     * @throws Exception
     */
    public void prepareContactList() throws Exception
    {
        // be sure that contacts are in their lists
        try{
            opSetPresence1.subscribe(fixture.userID2);
        }
        catch (OperationFailedException ex){
            // the contact already exist its OK
        }

        try{
            opSetPresence2.subscribe(fixture.userID1);
        }
        catch (OperationFailedException ex1){
            // the contact already exist its OK
        }

        Object o = new Object();
        synchronized (o)
        {
            o.wait(2000);
        }
    }

    @Override
    protected void tearDown() throws Exception
    {
        super.tearDown();

        fixture.tearDown();
    }

    /**
     * Creates a test suite containing tests of this class in a specific order.
     * We'll first execute a test where we receive a typing notification, and
     * a volatile contact is created for the sender. we'll then be able to
     * retrieve this volatile contact and them a notification on our turn.
     * We need to do things this way as the contact corresponding to the tester
     * agent has been removed in the previous test and we no longer have it
     * in our contact list.
     *
     * @return Test a testsuite containing all tests to execute.
     */
    public static Test suite()
    {
        TestSuite suite = new TestSuite();

        suite.addTest(new TestOperationSetTypingNotifications(
                                "prepareContactList"));

        //the following 2 need to be run in the specified order.
        suite.addTest(new TestOperationSetTypingNotifications(
                                "testTypingNotificationsEventDelivery"));
        return suite;
    }

    /**
     * Sends a typing notification and verifies
     * whether it is properly received by the tested implementation
     */
    public void testTypingNotificationsEventDelivery()
    {
        TypingEventCollector evtCollector = new TypingEventCollector();

        // send message so request for receiving notifications also to be set
        Contact notifingContact =
            opSetPresence1.findContactByID(fixture.userID2);
        opSetBasicIM1.sendInstantMessage(notifingContact,
                                         opSetBasicIM1.createMessage("ping"));

        opSetTypingNotifs1.addTypingNotificationsListener(evtCollector);

        Contact contactToNotify =
            opSetPresence2.findContactByID(fixture.userID1);

        opSetBasicIM2.sendInstantMessage(contactToNotify,
                                         opSetBasicIM2.createMessage("pong"));

        Object w = new Object();
        synchronized(w){try {w.wait(500);}catch (Exception e) {}}

        opSetTypingNotifs2.sendTypingNotification(
            contactToNotify, OperationSetTypingNotifications.STATE_TYPING);

        evtCollector.waitForEvent(10000);

        opSetTypingNotifs1.removeTypingNotificationsListener(evtCollector);

        //check event dispatching
        assertTrue("Number of typing events received was zero."
            , evtCollector.collectedEvents.size() > 0);

        TypingNotificationEvent evt = (TypingNotificationEvent)evtCollector
                                                    .collectedEvents.get(0);

        assertEquals("Source of the typing notification event"
                     , fixture.userID2
                     , evt.getSourceContact().getAddress() );

        assertEquals("Source of the typing notification event"
                     , OperationSetTypingNotifications.STATE_TYPING
                     , evt.getTypingState());
    }

    /**
     * Simply collects allre received events and provides a mechanisim for
     * waiting for the next event.
     */
    private class TypingEventCollector implements TypingNotificationsListener
    {
        private List<EventObject> collectedEvents = new LinkedList<EventObject>();
        /**
         * Called to indicate that a remote <tt>Contact</tt> has sent us a typing
         * notification. The method adds the <tt>event</tt> to the list of
         * captured events.
         * @param event a <tt>TypingNotificationEvent</tt> containing the sender
         * of the notification and its type.
         */
        public void typingNotificationReceived(TypingNotificationEvent event)
        {
            logger.debug("Received a typing notification: " + event);
            synchronized (this)
            {
                collectedEvents.add(event);
                notifyAll();
            }
        }

        /**
         * Called to indicate that sending typing notification has failed.
         *
         * @param event a <tt>TypingNotificationEvent</tt> containing the sender
         * of the notification and its type.
         */
        public void typingNotificationDeliveryFailed(TypingNotificationEvent event)
        {}

        /**
         * Blocks until at least one event is received or until waitFor
         * miliseconds pass (whicever happens first).
         *
         * @param waitFor the number of miliseconds that we should be waiting
         * for an event before simply bailing out.
         */
        public void waitForEvent(long waitFor)
        {
            synchronized(this){

                if(collectedEvents.size() > 0)
                    return;

                try{
                    wait(waitFor);
                }
                catch (InterruptedException ex){
                    logger.debug(
                        "Interrupted while waiting for a subscription evt", ex);
                }
            }
        }
    }
}


text:
<?xml version="1.0"?>
<!DOCTYPE compass-core-mapping PUBLIC
        "-//Compass/Compass Core Mapping DTD 2.3//EN"
        "http://www.compass-project.org/dtd/compass-core-mapping-2.3.dtd">

<compass-core-mapping package="org.compass.core.test.component.poly1">

    <class name="WithoutPolyComponent" alias="rootwithoutpolycomponent">
        <id name="id">
            <meta-data>id</meta-data>
        </id>

        <property name="property">
            <meta-data>property</meta-data>
        </property>

        <component name="simpleComponent"/>

    </class>

    <class name="SimpleComponent" alias="scomponent" root="false">
        <property name="componentProperty">
            <meta-data>componentProperty</meta-data>
        </property>
    </class>

</compass-core-mapping>


text:
% clear
% m = mobiledev;
%
% m.AccelerationSensorEnabled = 1;
% m.AngularVelocitySensorEnabled = 1;
% m.MagneticSensorEnabled = 1;
% m.OrientationSensorEnabled = 1;
% m.PositionSensorEnabled = 1;
% m.SampleRate = 100;
%
% m.Logging = 1;
% pause(200);
% m.Logging = 0;

if(m.AccelerationSensorEnabled)
    m.AccelerationSensorEnabled = 0;
    [a,t] = accellog(m);
end
if(m.AngularVelocitySensorEnabled)
    m.AngularVelocitySensorEnabled = 0;
    [av, tav] = angvellog(m);
end

if(m.MagneticSensorEnabled)
    m.MagneticSensorEnabled = 0;
    [mag,tmag] = magfieldlog(m);
end
if(m.OrientationSensorEnabled)
    m.OrientationSensorEnabled = 0;
    [o, to] = orientlog(m);
end
if(m.PositionSensorEnabled)
    m.PositionSensorEnabled = 0;
    [lat, lon, tpos, spd] = poslog(m);
end

filename = ['ADSLab_', char(datetime('now','Format','MMdd_HHmm'))];
save(filename);
% clear m;


text:
package org.wso2.carbon.device.mgt.core.mock;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;

/**
 * This is the mock statement for the testcases.
 */
public class MockStatement implements Statement {

    @Override
    public ResultSet executeQuery(String sql) throws SQLException {
        return null;
    }

    @Override
    public int executeUpdate(String sql) throws SQLException {
        return 0;
    }

    @Override
    public void close() throws SQLException {

    }

    @Override
    public int getMaxFieldSize() throws SQLException {
        return 0;
    }

    @Override
    public void setMaxFieldSize(int max) throws SQLException {

    }

    @Override
    public int getMaxRows() throws SQLException {
        return 0;
    }

    @Override
    public void setMaxRows(int max) throws SQLException {

    }

    @Override
    public void setEscapeProcessing(boolean enable) throws SQLException {

    }

    @Override
    public int getQueryTimeout() throws SQLException {
        return 0;
    }

    @Override
    public void setQueryTimeout(int seconds) throws SQLException {

    }

    @Override
    public void cancel() throws SQLException {

    }

    @Override
    public SQLWarning getWarnings() throws SQLException {
        return null;
    }

    @Override
    public void clearWarnings() throws SQLException {

    }

    @Override
    public void setCursorName(String name) throws SQLException {

    }

    @Override
    public boolean execute(String sql) throws SQLException {
        return false;
    }

    @Override
    public ResultSet getResultSet() throws SQLException {
        return null;
    }

    @Override
    public int getUpdateCount() throws SQLException {
        return 0;
    }

    @Override
    public boolean getMoreResults() throws SQLException {
        return false;
    }

    @Override
    public void setFetchDirection(int direction) throws SQLException {

    }

    @Override
    public int getFetchDirection() throws SQLException {
        return 0;
    }

    @Override
    public void setFetchSize(int rows) throws SQLException {

    }

    @Override
    public int getFetchSize() throws SQLException {
        return 0;
    }

    @Override
    public int getResultSetConcurrency() throws SQLException {
        return 0;
    }

    @Override
    public int getResultSetType() throws SQLException {
        return 0;
    }

    @Override
    public void addBatch(String sql) throws SQLException {

    }

    @Override
    public void clearBatch() throws SQLException {

    }

    @Override
    public int[] executeBatch() throws SQLException {
        return new int[0];
    }

    @Override
    public Connection getConnection() throws SQLException {
        return null;
    }

    @Override
    public boolean getMoreResults(int current) throws SQLException {
        return false;
    }

    @Override
    public ResultSet getGeneratedKeys() throws SQLException {
        return null;
    }

    @Override
    public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
        return 0;
    }

    @Override
    public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
        return 0;
    }

    @Override
    public int executeUpdate(String sql, String[] columnNames) throws SQLException {
        return 0;
    }

    @Override
    public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
        return false;
    }

    @Override
    public boolean execute(String sql, int[] columnIndexes) throws SQLException {
        return false;
    }

    @Override
    public boolean execute(String sql, String[] columnNames) throws SQLException {
        return false;
    }

    @Override
    public int getResultSetHoldability() throws SQLException {
        return 0;
    }

    @Override
    public boolean isClosed() throws SQLException {
        return false;
    }

    @Override
    public void setPoolable(boolean poolable) throws SQLException {

    }

    @Override
    public boolean isPoolable() throws SQLException {
        return false;
    }

    @Override
    public void closeOnCompletion() throws SQLException {

    }

    @Override
    public boolean isCloseOnCompletion() throws SQLException {
        return false;
    }

    @Override
    public <T> T unwrap(Class<T> iface) throws SQLException {
        return null;
    }

    @Override
    public boolean isWrapperFor(Class<?> iface) throws SQLException {
        return false;
    }
}


text:
namespace upywrap
{
  //Use a function pointer as key for static function pointer maps,
  //this is the most convenient way to make unique instantiations from templates.
  //The function returns the string used as function name.
  //an extern or static const char[] works as well, but:
  //extern is in the global scope which severly limits the names used
  //static class members just involves too much typing
  typedef const char* index_type();

  //Use for creating index_type with same name as function name
  #define func_name_def( n ) static const char* n(){ return #n; }

  //Map type used to store functions
  typedef std::map< void*, void* > function_ptrs;
}

#endif //#ifndef MICROPYTHON_WRAP_DETAIL_INDEX_H


text:
#import "NSObject-Protocol.h"

@protocol WBSFormsMetadataProvider <NSObject>
@property(readonly, nonatomic) unsigned long long formCount;
- (void)enumerateFormsUsingBlock:(id)arg1;
@end


text:
package ro.isdc.wro.model.resource.locator.wildcard;

import static org.apache.commons.io.IOUtils.closeQuietly;
import static org.apache.commons.io.IOUtils.readLines;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Vector;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ro.isdc.wro.config.Context;
import ro.isdc.wro.model.resource.locator.ClasspathUriLocator;
import ro.isdc.wro.model.resource.locator.UriLocator;

/**
 * Tests the {@link JarWildcardStreamLocator} class.
 *
 * @author Matias Mirabelli <matias.mirabelli@globant.com>
 * @since 1.3.6
 */
public class TestJarWildcardStreamLocator {
  private static final Logger LOG = LoggerFactory.getLogger(TestJarWildcardStreamLocator.class);
  private static final String TEST_INFO = "var foo = 'Hello World';";
  private static final String FILE_NAME_JAR = "file:///home/test/myJar.jar!";
  private static final String FILE_NAME_WITH_EMBEDDED_JAR = "file:///home/test/myJar.jar!/com/embedded.jar!/file.txt";

  private JarWildcardStreamLocator jarStreamLocator;
  @Mock
  private JarFile jarFile;

  @BeforeClass
  public static void onBeforeClass() {
    assertEquals(0, Context.countActive());
  }

  @AfterClass
  public static void onAfterClass() {
    assertEquals(0, Context.countActive());
  }

  public TestJarWildcardStreamLocator() {
    initMocks(this);
  }

  @Before
  public void setUp()
      throws IOException {
    final Vector<JarEntry> vector = new Vector<JarEntry>();

    vector.add(new JarEntry("com/test/app/test-resource.js"));

    when(jarFile.entries()).thenReturn(vector.elements());
    when(jarFile.getInputStream(vector.get(0))).thenReturn(new ByteArrayInputStream(TEST_INFO.getBytes()));

    jarStreamLocator = new JarWildcardStreamLocator() {
      @Override
      protected JarFile open(final File file) {
        return jarFile;
      }
    };
  }

  @Test(expected = NullPointerException.class)
  public void cannotLocateStreamWithNullFolder()
      throws Exception {
    jarStreamLocator.locateStream("", null);
  }

  @Test
  public void shouldLocateJarStream()
      throws IOException {
    final InputStream is = jarStreamLocator.locateStream("com/test/app/*.js", new File(FILE_NAME_JAR));
    final List<String> lines = readLines(is);
    LOG.debug("lines: " + lines);
    assertEquals(1, lines.size());
    assertEquals(TEST_INFO, lines.get(0));

    closeQuietly(is);
  }

  @Test(expected = IOException.class)
  public void shouldNotLocateEmbeddedJarStream()
          throws IOException {
    jarStreamLocator.locateStream("com/test/app/*.js", new File(FILE_NAME_WITH_EMBEDDED_JAR));
  }

  @Test
  public void testLocateJarStreamDelegate()
      throws IOException {
    final InputStream is = jarStreamLocator.locateStream("classpath:com/test/app/*.js", new File("src/test/resources/"));
    final String content = readLines(is).get(0);
    assertTrue(content.contains("1.js"));
    assertTrue(content.contains("2.js"));
    assertTrue(content.contains("3.js"));
    assertTrue(!content.contains("1.css"));

    closeQuietly(is);
  }

  @Test(expected = IOException.class)
  public void testLocateJarStreamDelegateFail()
      throws IOException {
    jarStreamLocator.locateStream("com/test/app/*.js", new File("test.jpg"));
  }

  @Test
  public void shouldFindNoResourcesWhenNoneExist()
      throws IOException {
    final ThreadLocal<Collection<String>> filenameListHolder = new ThreadLocal<Collection<String>>();
    final UriLocator uriLocator = createJarLocator(filenameListHolder);
    // there are no js resources in the jar
    uriLocator.locate("classpath:com/**.js");
    final Collection<String> filenameList = filenameListHolder.get();
    assertNotNull(filenameList);
    Assert.assertTrue(filenameList.isEmpty());
  }

  @Test
  public void shouldOrderedAlphabeticallyWildcardResources()
      throws IOException {
    final ThreadLocal<Collection<String>> filenameListHolder = new ThreadLocal<Collection<String>>();
    final UriLocator uriLocator = createJarLocator(filenameListHolder);
    uriLocator.locate("classpath:com/app/**.css");
    final Collection<String> filenameList = filenameListHolder.get();
    assertNotNull(filenameList);
    assertEquals(Arrays.toString(new String[]{
            "com/app/level1/level2/styles/style.css", "com/app/level1/level2/level2.css", "com/app/level1/level1.css"
    }), Arrays.toString(filenameList.toArray()));
  }

  @Test
  public void shouldFindAllChildFoldersAndFiles()
      throws IOException {
    final ThreadLocal<Collection<String>> filenameListHolder = new ThreadLocal<Collection<String>>();
    final UriLocator uriLocator = createJarLocator(filenameListHolder);
    uriLocator.locate("classpath:com/app/**");
    final Collection<String> filenameList = filenameListHolder.get();
    assertNotNull(filenameList);
    assertEquals(
            Arrays.toString(new String[]{
                    "com/app/level1", "com/app/level1/level2", "com/app/level1/level2/styles",
                    "com/app/level1/level2/styles/style.css", "com/app/level1/level2/level2.css", "com/app/level1/level1.css"
            }), Arrays.toString(filenameList.toArray()));
  }

  /**
   * @return creates an instance of {@link UriLocator} which uses {@link JarWildcardStreamLocator} for locating
   *         resources containing wildcards. Also it uses a jar file from test resources.
   */
  private UriLocator createJarLocator(final ThreadLocal<Collection<String>> filenameListHolder) {
    final JarWildcardStreamLocator jarStreamLocator = new JarWildcardStreamLocator() {
      @Override
      File getJarFile(final File folder) {
        // Use a jar from test resources
        return new File(TestJarWildcardStreamLocator.class.getResource("resources.jar").getFile());
      }

      @Override
      void triggerWildcardExpander(final Collection<File> allFiles, final WildcardContext wildcardContext)
          throws IOException {
        final Collection<String> filenameList = new ArrayList<String>();
        for (final File entry : allFiles) {
          filenameList.add(entry.getPath().replace("\\", "/"));
        }
        filenameListHolder.set(filenameList);
      }
    };
    return new ClasspathUriLocator() {
      @Override
      public WildcardStreamLocator newWildcardStreamLocator() {
        return jarStreamLocator;
      }
    };
  }

  @Test
  public void shouldGetJarFileFromFile() {
    final String actual = jarStreamLocator.getJarFile(new File("file:path/to/file!one/two/three.class")).getPath();
    final String expected = FilenameUtils.separatorsToSystem("path/to/file");
    assertEquals(expected, actual);
  }
}


text:
Weave.Services
==============

Library for interacting with the Weave REST API. The API itself is free to use!


text:
using namespace cv;
using namespace std;
namespace po = boost::program_options;

namespace cvdemo
{
	namespace image
	{
		// http://www.boost.org/doc/libs/1_62_0/doc/html/program_options.html

		ProgramOptions::ProgramOptions(int cmdlineArgc, const char* cmdlineArgv[], std::string configFile)
			: cmdlineArgc(cmdlineArgc), cmdlineArgv(cmdlineArgv), configFilePath(configFile)
			// foregroundImageFiles(), backgroundImageFiles()
		{
			_Initialize();
		}
		void ProgramOptions::_Initialize()
		{
			// Declare a group of options that will be
			// allowed only on command line
			po::options_description generic("Generic options");
			generic.add_options()
				("help,H", "Produce help message")
				("version,V", "Print version string")
				("options,O", "Print input options")
				;

			// Declare a group of options that will be
			// allowed both on command line and in
			// config file
			po::options_description config("Configuration");
			// string output_image_mode;
			// TargetImageMode output_image_mode = TargetImageMode::unknown;
			config.add_options()
				// Why is the value type vector<string>, not string?????
				// ("output-image-mode,M", po::value<string>(&output_image_mode)->default_value(TargetImageModes::ToString(TargetImageMode::bounding)), "Output image mode (default: bounding)")
				("output-image-mode,M", po::value<string>()->default_value(TargetImageModes::ToString(TargetImageMode::bounding)), "Output image mode (default: bounding)")
				("image-file,I", po::value<vector<string>>()->multitoken(), "Image file")
				("blending-weight,W", po::value<vector<float>>()->multitoken(), "Blending weight")
				;

			// Hidden options, will be allowed both on command line and
			// in config file, but will not be shown to the user.
			// bool resize_allowed;
			po::options_description hidden("Hidden options");
			hidden.add_options()
				("resize-allowed,R", po::value<bool>()->default_value(false), "Resize-allowed (default: false)")
				;

			cmdline_options.add(generic).add(config).add(hidden);
			config_file_options.add(config).add(hidden);
			// visible_options = "Allowed options";   // ???
			visible_options.add(generic).add(config);
		}
		void ProgramOptions::_Parse()
		{
			// ???
			// po::store(po::command_line_parser(cmdlineArgc, cmdlineArgv).options(cmdline_options).run(), vm);
			try {
				// po::store(po::parse_command_line(cmdlineArgc, cmdlineArgv, cmdline_options), vm);
				// Ignore unknown options???
				po::parsed_options cmdlineParsed = po::command_line_parser(cmdlineArgc, cmdlineArgv).options(cmdline_options).allow_unregistered().run();
				po::store(cmdlineParsed, vm);

				unrecognized = po::collect_unrecognized(cmdlineParsed.options, po::collect_unrecognized_mode::include_positional);
				//for (auto &i : unrecognized) {
				//	cout << "Unrecognised: " << i << endl;
				//}
			}
			catch (const exception& e) {   // ignore
				cerr << e.what() << endl;
				// isParsed = true;
				hasSyntacticError = true;
				// isValid = false;
				return;
			}
			//catch (...)
			//{
			//	// testing...
			//	cout << "catch all" << endl;
			//	cerr << "catch all" << endl;

			//}
			// ???
			if (configFilePath.size() > 0) {
				try {
					// temporary
					// cerr << "Parsing config file: " << configFilePath << "..." << endl;
					// temporary
					po::parsed_options configParsed = po::parse_config_file<char>(configFilePath.c_str(), config_file_options, true);  // allow_unregistered == true.
																																	   // po::store(configParsed, vm, true);
					po::store(configParsed, vm, false);   // ???
				}
				catch (const exception& e) {   // ignore
					cerr << e.what() << endl;
					// If configFile arg is specified, and it's not valid (e.g., the file does not exist or the file is invalid, etc.),
					//  then we consider it as "syntactic" error.
					hasSyntacticError = true;
					// isValid = false;
				}
			}
			// ???
			po::notify(vm);

			// temporary

			// int fileCount = vm.count("image-file");
			// int weightCount = vm.count("blending-weight");
			if (vm.count("image-file") > 0) {

				auto& files = vm["image-file"].as<vector<string>>();
				int fileCount = files.size();
				int weightCount = 0;
				vector<float> weights;
				if (vm.count("blending-weight") > 0) {
					weights = vm["blending-weight"].as<vector<float>>();
					weightCount = weights.size();
				}
				if (weightCount > fileCount) {
					weightCount = fileCount;
				}
				float remWeight = 0.0f;
				float weightSum = 0.0f;
				for (auto a = 0; a < weightCount;a++) {
					weightSum += weights[a];   // weights[a] >= 0.0f
				}
				// tbd: validate weightSum?
				// 0.0f <= weightSum <= 1.0f.
				if (weightCount < fileCount) {
					remWeight = (1.0f - weightSum) / (fileCount - weightCount);
				}

				// ???
				// cout << "File count: " << fileCount << "." << endl;
				for (auto i = 0; i < fileCount; i++) {
					auto name = files[i];
					auto weight = 0.0f;
					if (i < weightCount) {
						weight = weights[i];
					}
					else {
						weight = remWeight;
					}
					auto info = ImageFileInfo(name, weight);
					imageFileInfos.push_back(info);
				}
			}

			if (vm.count("help")) {
				// cout << visible_options << endl;
				// isParsed = true;
				isForUsageInfo = true;
				// return;   // continue parsing???
			}
			if (vm.count("version")) {
				// cout << "version..." << endl;
				// isParsed = true;
				isForVersionInfo = true;
				// return;   // continue parsing???
			}
			if (vm.count("options")) {
				// cout << "options..." << endl;
				// isParsed = true;
				isForOptionsDisplay = true;
				// return;   // continue parsing???
			}

			isParsed = true;
			// Required params.
			// if (vm.count("image-file")) {   // && vm.count("blending-weight")
		    if (imageFileInfos.size() > 0) {
					isValid = true;
			}
			else {
				isValid = false;
			}

		}

	}
}


text:
<?php
/**
 * Loads message management
 *
 * @package modx
 * @subpackage manager.controllers
 */
class SecurityMessageManagerController extends modManagerController {
    /**
     * Check for any permissions or requirements to load page
     * @return bool
     */
    public function checkPermissions() {
        return $this->modx->hasPermission('messages');
    }

    /**
     * Register custom CSS/JS for the page
     * @return void
     */
    public function loadCustomCssJs() {
        $mgrUrl = $this->modx->getOption('manager_url',null,MODX_MANAGER_URL);
        $this->addJavascript($mgrUrl.'assets/modext/widgets/security/modx.grid.message.js');
        $this->addJavascript($mgrUrl.'assets/modext/sections/security/message/list.js');
        $this->addHtml('<script>
            Ext.onReady(function() {
                MODx.perm.view_user = '.($this->modx->hasPermission('view_user') ? 1 : 0).';
                MODx.perm.view_role = '.($this->modx->hasPermission('view_role') ? 1 : 0).';
                MODx.perm.view_usergroup = '.($this->modx->hasPermission('usergroup_view') ? 1 : 0).';
                MODx.load({
                    xtype: "modx-page-messages"
                });
            });</script>');
    }

    /**
     * Custom logic code here for setting placeholders, etc
     * @param array $scriptProperties
     * @return mixed
     */
    public function process(array $scriptProperties = array()) {}

    /**
     * Return the pagetitle
     *
     * @return string
     */
    public function getPageTitle() {
        return $this->modx->lexicon('messages');
    }

    /**
     * Return the location of the template file
     * @return string
     */
    public function getTemplateFile() {
        return '';
    }

    /**
     * Specify the language topics to load
     * @return array
     */
    public function getLanguageTopics() {
        return array('user','messages');
    }
}


text:
player_variable (BCP command)
=============================

This is a generic "catch all" which sends player-specific variables to the media controller
any time they change. Since the pin controller will most likely track hundreds of variables
per player (with many being internal things that the media controller doesn't care about),
it's recommended that the pin controller has a way to filter which player variables are
sent to the media controller. Also note the parameter *player_num* indicates which player
this variable is for (starting with 1 for the first player). While it's usually the case
that the *player_variable* command will be sent for the player whose turn it is, that's not
always the case. (For example, when a second player is added during the first player's ball,
the second player's default variables will be initialized at 0 and a *player_variable* event
for player 2 will be sent even though player 1 is up.

Origin
------
Pin controller

Parameters
----------

name
~~~~
Type: ``string``

This is the name of the player variable.

player_num
~~~~~~~~~~
Type: ``int``

This is the player number the variable is for (starting with 1 for the first player).

value
~~~~~
Type: Varies depending upon the variable type.

This is the new value of the player variable.

prev_value
~~~~~~~~~~
Type: Varies depending upon the variable type.

This is the previous value of the player variable.

change
~~~~~~
Type: Varies depending upon the variable type.

If the player variable just changed, this will be the amount of the change. If it's not possible
to determine a numeric change (for example, if this player variable is a string), then this
*change* value will be set to the boolean *True*.

Response
--------
None


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.engine.test.bpmn.event.timer.compatibility;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.engine.test.Deployment;
import org.flowable.job.api.Job;
import org.flowable.job.service.impl.persistence.entity.TimerJobEntity;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
import org.junit.jupiter.api.Test;

public class BoundaryTimerEventRepeatCompatibilityTest extends TimerEventCompatibilityTest {

    @Test
    @Deployment
    public void testRepeatWithoutEnd() throws Throwable {

        Calendar calendar = Calendar.getInstance();
        Date baseTime = calendar.getTime();

        calendar.add(Calendar.MINUTE, 20);
        // expect to stop boundary jobs after 20 minutes
        DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
        DateTime dt = new DateTime(calendar.getTime());
        String dateStr = fmt.print(dt);

        // reset the timer
        Calendar nextTimeCal = Calendar.getInstance();
        nextTimeCal.setTime(baseTime);
        processEngineConfiguration.getClock().setCurrentTime(nextTimeCal.getTime());

        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("repeatWithEnd");

        runtimeService.setVariable(processInstance.getId(), "EndDateForBoundary", dateStr);

        List<org.flowable.task.api.Task> tasks = taskService.createTaskQuery().list();
        assertEquals(1, tasks.size());

        org.flowable.task.api.Task task = tasks.get(0);
        assertEquals("Task A", task.getName());

        // Test Boundary Events
        // complete will cause timer to be created
        taskService.complete(task.getId());

        List<Job> jobs = managementService.createTimerJobQuery().list();
        assertEquals(1, jobs.size());

        // change the job in old mode (the configuration should not be json in
        // "old mode" but a simple string).
        TimerJobEntity job = (TimerJobEntity) jobs.get(0);
        changeConfigurationToPlainText(job);

        // boundary events

        waitForJobExecutorToProcessAllJobs(2000, 100);

        // a new job must be prepared because there are 10 repeats 2 seconds interval
        jobs = managementService.createTimerJobQuery().list();
        assertEquals(1, jobs.size());

        for (int i = 0; i < 9; i++) {
            nextTimeCal.add(Calendar.SECOND, 2);
            processEngineConfiguration.getClock().setCurrentTime(nextTimeCal.getTime());
            waitForJobExecutorToProcessAllJobs(2000, 100);
            // a new job must be prepared because there are 10 repeats 2 seconds interval

            jobs = managementService.createTimerJobQuery().list();
            assertEquals(1, jobs.size());
        }

        nextTimeCal.add(Calendar.SECOND, 2);
        processEngineConfiguration.getClock().setCurrentTime(nextTimeCal.getTime());

        try {
            waitForJobExecutorToProcessAllJobs(2000, 100);
        } catch (Exception ex) {
            fail("Should not have any other jobs because the endDate is reached");
        }

        tasks = taskService.createTaskQuery().list();
        task = tasks.get(0);
        assertEquals("Task B", task.getName());
        assertEquals(1, tasks.size());
        taskService.complete(task.getId());

        try {
            waitForJobExecutorToProcessAllJobs(2000, 500);
        } catch (Exception e) {
            fail("No jobs should be active here.");
        }

        // now All the process instances should be completed
        List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().list();
        assertEquals(0, processInstances.size());

        // no jobs
        jobs = managementService.createJobQuery().list();
        assertEquals(0, jobs.size());
        jobs = managementService.createTimerJobQuery().list();
        assertEquals(0, jobs.size());

        // no tasks
        tasks = taskService.createTaskQuery().list();
        assertEquals(0, tasks.size());

    }

}


text:
require File.expand_path('../../../../spec_helper', __FILE__)

describe "Hash::Entry#next" do
  it "returns nil if there is no chained entry" do
    Hash::Entry.new(1, 3, 2).next.should be_nil
  end

  it "returns the next entry" do
    a = Hash::Entry.new 1, 2, 3
    b = Hash::Entry.new 4, 5, 6
    a.next = b
    a.next.should == b
  end
end


text:
var misc = require('rackspace-shared-utils/lib/misc');

['access_logger', 'transaction_id', 'validator', 'body_parser',
 'body_size_limiter', 'allow_javascript_xhr', 'timing',
 'attach_variables'].forEach(function(module) {
  var name = misc.toCamelCase(module);
  exports[name] = require('./' + module).attach;
});


text:
#include "third_party/blink/renderer/modules/notifications/notification.h"

#include <memory>
#include <utility>

#include "base/unguessable_token.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "third_party/blink/public/common/notifications/notification_constants.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-blink.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value_factory.h"
#include "third_party/blink/renderer/bindings/core/v8/to_v8_traits.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_notification_action.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_notification_options.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/dom/scoped_window_focus_allowed_indicator.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/performance_monitor.h"
#include "third_party/blink/renderer/core/probe/core_probes.h"
#include "third_party/blink/renderer/modules/notifications/notification_data.h"
#include "third_party/blink/renderer/modules/notifications/notification_manager.h"
#include "third_party/blink/renderer/modules/notifications/notification_resources_loader.h"
#include "third_party/blink/renderer/modules/notifications/timestamp_trigger.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/bindings/source_location.h"
#include "third_party/blink/renderer/platform/instrumentation/resource_coordinator/document_resource_coordinator.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"

namespace blink {

Notification* Notification::Create(ExecutionContext* context,
                                   const String& title,
                                   const NotificationOptions* options,
                                   ExceptionState& exception_state) {
  // The Notification constructor may be disabled through a runtime feature when
  // the platform does not support non-persistent notifications.
  if (!RuntimeEnabledFeatures::NotificationConstructorEnabled()) {
    exception_state.ThrowTypeError(
        "Illegal constructor. Use ServiceWorkerRegistration.showNotification() "
        "instead.");
    return nullptr;
  }

  // The Notification constructor may not be used in Service Worker contexts.
  if (context->IsServiceWorkerGlobalScope()) {
    exception_state.ThrowTypeError("Illegal constructor.");
    return nullptr;
  }

  if (!options->actions().IsEmpty()) {
    exception_state.ThrowTypeError(
        "Actions are only supported for persistent notifications shown using "
        "ServiceWorkerRegistration.showNotification().");
    return nullptr;
  }

  if (options->hasShowTrigger()) {
    exception_state.ThrowTypeError(
        "ShowTrigger is only supported for persistent notifications shown "
        "using ServiceWorkerRegistration.showNotification().");
    return nullptr;
  }

  auto* window = DynamicTo<LocalDOMWindow>(context);
  if (context->IsSecureContext()) {
    UseCounter::Count(context, WebFeature::kNotificationSecureOrigin);
    if (window) {
      window->CountUseOnlyInCrossOriginIframe(
          WebFeature::kNotificationAPISecureOriginIframe);
    }
  } else {
    Deprecation::CountDeprecation(context,
                                  WebFeature::kNotificationInsecureOrigin);
    if (window) {
      Deprecation::CountDeprecationCrossOriginIframe(
          window, WebFeature::kNotificationAPIInsecureOriginIframe);
    }
  }

  mojom::blink::NotificationDataPtr data =
      CreateNotificationData(context, title, options, exception_state);
  if (exception_state.HadException())
    return nullptr;

  if (context->IsContextDestroyed()) {
    exception_state.ThrowTypeError("Illegal invocation.");
    return nullptr;
  }

  Notification* notification = MakeGarbageCollected<Notification>(
      context, Type::kNonPersistent, std::move(data));

  // TODO(https://crbug.com/595685): Make |token| a constructor parameter
  // once persistent notifications have been mojofied too.
  if (notification->tag().IsNull() || notification->tag().IsEmpty()) {
    auto unguessable_token = base::UnguessableToken::Create();
    notification->SetToken(unguessable_token.ToString().c_str());
  } else {
    notification->SetToken(notification->tag());
  }

  notification->SchedulePrepareShow();

  if (window) {
    if (auto* document_resource_coordinator =
            window->document()->GetResourceCoordinator()) {
      document_resource_coordinator->OnNonPersistentNotificationCreated();
    }
  }

  return notification;
}

Notification* Notification::Create(ExecutionContext* context,
                                   const String& notification_id,
                                   mojom::blink::NotificationDataPtr data,
                                   bool showing) {
  Notification* notification = MakeGarbageCollected<Notification>(
      context, Type::kPersistent, std::move(data));
  notification->SetState(showing ? State::kShowing : State::kClosed);
  notification->SetNotificationId(notification_id);
  return notification;
}

Notification::Notification(ExecutionContext* context,
                           Type type,
                           mojom::blink::NotificationDataPtr data)
    : ExecutionContextLifecycleObserver(context),
      type_(type),
      state_(State::kLoading),
      data_(std::move(data)),
      prepare_show_timer_(context->GetTaskRunner(TaskType::kMiscPlatformAPI),
                          this,
                          &Notification::PrepareShow),
      listener_receiver_(this, context) {
  if (data_->show_trigger_timestamp.has_value()) {
    show_trigger_ = TimestampTrigger::Create(static_cast<DOMTimeStamp>(
        data_->show_trigger_timestamp.value().ToJsTime()));
  }
}

Notification::~Notification() = default;

void Notification::SchedulePrepareShow() {
  DCHECK_EQ(state_, State::kLoading);

  prepare_show_timer_.StartOneShot(base::TimeDelta(), FROM_HERE);
}

void Notification::PrepareShow(TimerBase*) {
  DCHECK_EQ(state_, State::kLoading);
  if (!GetExecutionContext()->IsSecureContext()) {
    DispatchErrorEvent();
    return;
  }

  if (NotificationManager::From(GetExecutionContext())->GetPermissionStatus() !=
      mojom::blink::PermissionStatus::GRANTED) {
    DispatchErrorEvent();
    return;
  }

  loader_ = MakeGarbageCollected<NotificationResourcesLoader>(
      WTF::Bind(&Notification::DidLoadResources, WrapWeakPersistent(this)));
  loader_->Start(GetExecutionContext(), *data_);
}

void Notification::DidLoadResources(NotificationResourcesLoader* loader) {
  DCHECK_EQ(loader, loader_.Get());

  mojo::PendingRemote<mojom::blink::NonPersistentNotificationListener>
      event_listener;

  scoped_refptr<base::SingleThreadTaskRunner> task_runner =
      GetExecutionContext()->GetTaskRunner(blink::TaskType::kInternalDefault);
  listener_receiver_.Bind(event_listener.InitWithNewPipeAndPassReceiver(),
                          task_runner);

  NotificationManager::From(GetExecutionContext())
      ->DisplayNonPersistentNotification(token_, data_->Clone(),
                                         loader->GetResources(),
                                         std::move(event_listener));

  loader_.Clear();

  state_ = State::kShowing;
}

void Notification::close() {
  if (state_ != State::kShowing)
    return;

  // Schedule the "close" event to be fired for non-persistent notifications.
  // Persistent notifications won't get such events for programmatic closes.
  if (type_ == Type::kNonPersistent) {
    state_ = State::kClosing;
    NotificationManager::From(GetExecutionContext())
        ->CloseNonPersistentNotification(token_);
    return;
  }

  state_ = State::kClosed;

  NotificationManager::From(GetExecutionContext())
      ->ClosePersistentNotification(notification_id_);
}

void Notification::OnShow() {
  DispatchEvent(*Event::Create(event_type_names::kShow));
}

void Notification::OnClick(OnClickCallback completed_closure) {
  ExecutionContext* context = GetExecutionContext();
  auto* window = DynamicTo<LocalDOMWindow>(context);
  if (window && window->GetFrame()) {
    LocalFrame::NotifyUserActivation(
        window->GetFrame(),
        mojom::blink::UserActivationNotificationType::kInteraction);
  }
  ScopedWindowFocusAllowedIndicator window_focus_allowed(GetExecutionContext());
  DispatchEvent(*Event::Create(event_type_names::kClick));

  std::move(completed_closure).Run();
}

void Notification::OnClose(OnCloseCallback completed_closure) {
  // The notification should be Showing if the user initiated the close, or it
  // should be Closing if the developer initiated the close.
  if (state_ == State::kShowing || state_ == State::kClosing) {
    state_ = State::kClosed;
    DispatchEvent(*Event::Create(event_type_names::kClose));
  }
  std::move(completed_closure).Run();
}

void Notification::DispatchErrorEvent() {
  DispatchEvent(*Event::Create(event_type_names::kError));
}

String Notification::title() const {
  return data_->title;
}

String Notification::dir() const {
  switch (data_->direction) {
    case mojom::blink::NotificationDirection::LEFT_TO_RIGHT:
      return "ltr";
    case mojom::blink::NotificationDirection::RIGHT_TO_LEFT:
      return "rtl";
    case mojom::blink::NotificationDirection::AUTO:
      return "auto";
  }

  NOTREACHED();
  return String();
}

String Notification::lang() const {
  return data_->lang;
}

String Notification::body() const {
  return data_->body;
}

String Notification::tag() const {
  return data_->tag;
}

String Notification::image() const {
  return data_->image.GetString();
}

String Notification::icon() const {
  return data_->icon.GetString();
}

String Notification::badge() const {
  return data_->badge.GetString();
}

VibrationController::VibrationPattern Notification::vibrate() const {
  VibrationController::VibrationPattern pattern;
  if (data_->vibration_pattern.has_value()) {
    pattern.AppendRange(data_->vibration_pattern->begin(),
                        data_->vibration_pattern->end());
  }

  return pattern;
}

DOMTimeStamp Notification::timestamp() const {
  return data_->timestamp;
}

bool Notification::renotify() const {
  return data_->renotify;
}

bool Notification::silent() const {
  return data_->silent;
}

bool Notification::requireInteraction() const {
  return data_->require_interaction;
}

ScriptValue Notification::data(ScriptState* script_state) {
  const char* data = nullptr;
  size_t length = 0;
  if (data_->data.has_value()) {
    // TODO(https://crbug.com/798466): Align data types to avoid this cast.
    data = reinterpret_cast<const char*>(data_->data->data());
    length = data_->data->size();
  }
  scoped_refptr<SerializedScriptValue> serialized_value =
      SerializedScriptValue::Create(data, length);

  return ScriptValue(script_state->GetIsolate(),
                     serialized_value->Deserialize(script_state->GetIsolate()));
}

Vector<v8::Local<v8::Value>> Notification::actions(
    ScriptState* script_state) const {
  Vector<v8::Local<v8::Value>> result;
  if (!data_->actions.has_value())
    return result;

  const Vector<mojom::blink::NotificationActionPtr>& actions =
      data_->actions.value();
  result.Grow(actions.size());
  for (wtf_size_t i = 0; i < actions.size(); ++i) {
    NotificationAction* action = NotificationAction::Create();

    switch (actions[i]->type) {
      case mojom::blink::NotificationActionType::BUTTON:
        action->setType("button");
        break;
      case mojom::blink::NotificationActionType::TEXT:
        action->setType("text");
        break;
      default:
        NOTREACHED() << "Unknown action type: " << actions[i]->type;
    }

    action->setAction(actions[i]->action);
    action->setTitle(actions[i]->title);
    action->setIcon(actions[i]->icon.GetString());
    action->setPlaceholder(actions[i]->placeholder);

    // Both the Action dictionaries themselves and the sequence they'll be
    // returned in are expected to the frozen. This cannot be done with
    // WebIDL.
    result[i] = FreezeV8Object(
        ToV8Traits<NotificationAction>::ToV8(script_state, action)
            .ToLocalChecked(),
        script_state->GetIsolate());
  }

  return result;
}

String Notification::PermissionString(
    mojom::blink::PermissionStatus permission) {
  switch (permission) {
    case mojom::blink::PermissionStatus::GRANTED:
      return "granted";
    case mojom::blink::PermissionStatus::DENIED:
      return "denied";
    case mojom::blink::PermissionStatus::ASK:
      return "default";
  }

  NOTREACHED();
  return "denied";
}

String Notification::permission(ExecutionContext* context) {
  // Permission is always denied for insecure contexts. Skip the sync IPC call.
  if (!context->IsSecureContext())
    return PermissionString(mojom::blink::PermissionStatus::DENIED);

  // If the current global object's browsing context is a prerendering browsing
  // context, then return "default".
  // https://wicg.github.io/nav-speculation/prerendering.html#patch-notifications
  if (auto* window = DynamicTo<LocalDOMWindow>(context)) {
    if (Document* document = window->document(); document->IsPrerendering()) {
      return PermissionString(mojom::blink::PermissionStatus::ASK);
    }
  }

  mojom::blink::PermissionStatus status =
      NotificationManager::From(context)->GetPermissionStatus();

  // Permission can only be requested from top-level frames and same-origin
  // iframes. This should be reflected in calls getting permission status.
  //
  // TODO(crbug.com/758603): Move this check to the browser process when the
  // NotificationService connection becomes frame-bound.
  if (status == mojom::blink::PermissionStatus::ASK) {
    auto* window = DynamicTo<LocalDOMWindow>(context);
    LocalFrame* frame = window ? window->GetFrame() : nullptr;
    if (!frame || frame->IsCrossOriginToOutermostMainFrame())
      status = mojom::blink::PermissionStatus::DENIED;
  }

  return PermissionString(status);
}

ScriptPromise Notification::requestPermission(
    ScriptState* script_state,
    V8NotificationPermissionCallback* deprecated_callback) {
  if (!script_state->ContextIsValid())
    return ScriptPromise();

  ExecutionContext* context = ExecutionContext::From(script_state);

  probe::BreakableLocation(context, "Notification.requestPermission");
  if (auto* window = DynamicTo<LocalDOMWindow>(context)) {
    if (!LocalFrame::HasTransientUserActivation(window->GetFrame())) {
      PerformanceMonitor::ReportGenericViolation(
          context, PerformanceMonitor::kDiscouragedAPIUse,
          "Only request notification permission in response to a user gesture.",
          base::TimeDelta(), nullptr);
    }

    // Sites cannot request notification permission from cross-origin iframes,
    // but they can use notifications if permission had already been granted.
    if (window->GetFrame()->IsCrossOriginToOutermostMainFrame()) {
      Deprecation::CountDeprecation(
          context, WebFeature::kNotificationPermissionRequestedIframe);
    }
  }

  // Sites cannot request notification permission from insecure contexts.
  if (!context->IsSecureContext()) {
    Deprecation::CountDeprecation(
        context, WebFeature::kNotificationPermissionRequestedInsecureOrigin);
  }

  return NotificationManager::From(context)->RequestPermission(
      script_state, deprecated_callback);
}

uint32_t Notification::maxActions() {
  return kNotificationMaxActions;
}

DispatchEventResult Notification::DispatchEventInternal(Event& event) {
  DCHECK(GetExecutionContext()->IsContextThread());
  return EventTarget::DispatchEventInternal(event);
}

const AtomicString& Notification::InterfaceName() const {
  return event_target_names::kNotification;
}

void Notification::ContextDestroyed() {
  state_ = State::kClosed;

  if (prepare_show_timer_.IsActive())
    prepare_show_timer_.Stop();

  if (loader_)
    loader_->Stop();
}

bool Notification::HasPendingActivity() const {
  // Non-persistent notification can receive events until they've been closed.
  // Persistent notifications should be subject to regular garbage collection.
  if (type_ == Type::kNonPersistent)
    return state_ != State::kClosed;

  return false;
}

void Notification::Trace(Visitor* visitor) const {
  visitor->Trace(show_trigger_);
  visitor->Trace(prepare_show_timer_);
  visitor->Trace(loader_);
  visitor->Trace(listener_receiver_);
  EventTargetWithInlineData::Trace(visitor);
  ExecutionContextLifecycleObserver::Trace(visitor);
}

}  // namespace blink


text:
@interface RKConferenceSession : NSObject

@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *sessionDescription;
@property (nonatomic, copy) NSString *start_time;
@property (nonatomic, copy) NSString *end_time;
@property (nonatomic, copy) NSString *type;

@end


text:
<?php

namespace Amb\TraceBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AmbTraceBundle extends Bundle
{
}


text:
import { isArray } from './_internals/isArray.js'
import { mapArray } from './map.js'

export function unwind(property, obj){
  if (arguments.length === 1){
    return _obj => unwind(property, _obj)
  }

  if (!isArray(obj[ property ])) return [ obj ]

  return mapArray(x => ({
    ...obj,
    [ property ] : x,
  }),
  obj[ property ])
}


text:
err_msg = """
Typical Usage:

   raw2subtractlines.py [-norm] < coordinate_file

   Coordinates read from one line of the file are subtracted from coordinates
   from the next line of the file (if it contains coordinates) and printed to
   the standard output.  Blank lines in the input file are copied to the
   standard out.  Each block of N lines of text containing M columns in the
   input file produces a block of N-1 lines of text (containing M columns)
   in the output file.

   The optional "-norm" argument allows you to normalize the resulting vectors
   after they have been subtracted.

Examples:

   raw2subtractlines.py       < coord_bead_chain.raw > coords_bond_vector.raw
   raw2subtractlines.py -norm < coord_bead_chain.raw > coords_bond_direction.raw

"""

import sys
from math import *
#import numpy as np

def ProcessStructure(x_id, normalize=False):
    D = len(x_id[0])
    N = len(x_id)
    for i in range(0, N-1):
        for d in range(0, D):
            x_diff = [x_id[i+1][d] - x_id[i][d] for d in range(0,D)]
        if (normalize):
            x_diff_len = 0.0
            for d in range(0, D):
                x_diff_len += x_diff[d] * x_diff[d]
            x_diff_len = sqrt(x_diff_len)
            for d in range(0, D):
                x_diff[d] /= x_diff_len

        sys.stdout.write(str(x_diff[0]))
        for d in range(1, D):
            sys.stdout.write(' ' + str(x_diff[d]))
        sys.stdout.write('\n')

# Parse the argument list:
if (len(sys.argv) > 2):
    sys.stderr.write("Error:\n\nTypical Usage:\n\n"+err_msg+"\n")
    exit(1)

if ((len(sys.argv) == 2) and
    ((sys.argv[1] == '-h') or
     (sys.argv[1] == '-?') or
     (sys.argv[1] == '--help'))):
    sys.stderr.write("Error:\n\nTypical Usage:\n\n"+err_msg+"\n")
    exit(1)

normalize = False

if (len(sys.argv) == 2):
    if ((sys.argv[1] == '-n') or
        (sys.argv[1] == '-norm') or
        (sys.argv[1] == '-normalize')):
        normalize = True
    else:
        sys.stderr.write("Error: Unrecognized command line argument:\n"
                         "       \""+sys.argv[1]+"\"\n")
        exit(1)

# Now read the input file:

x_id = []
count_structs = 0
is_new_structure = True
interpret_blank_lines_as_new_structures = True

in_file = sys.stdin
for line_orig in in_file:

    ic = line_orig.find('#')
    if ic != -1:
        line = line_orig[:ic]
    else:
        line = line_orig.rstrip('\n')

    tokens = line.strip().split()
    if len(tokens) == 0:
        if (interpret_blank_lines_as_new_structures and
            (len(x_id) > 0)):
            # blank (or comment) lines signal the next frame of animation
            ProcessStructure(x_id, normalize)
            sys.stdout.write('\n')

            x_id = []
            count_structs += 1
            #sys.stderr.write('done\n')
            is_new_structure = True
        continue  # skip blank lines or comments

    elif is_new_structure:
        is_new_structure = False

    # x_d contains the coordinates read from the
    # most recent line in the current frame
    x_d = list(map(float, tokens))
    x_id.append(x_d)

if len(x_id) > 0:
    ProcessStructure(x_id, normalize)