text:
``` diff
 {
     namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets {
-        public sealed class SocketTransportFactory : ITransportFactory {
+        public sealed class SocketTransportFactory : IConnectionListenerFactory {
-            public SocketTransportFactory(IOptions<SocketTransportOptions> options, IApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory);

+            public SocketTransportFactory(IOptions<SocketTransportOptions> options, ILoggerFactory loggerFactory);
+            public ValueTask<IConnectionListener> BindAsync(EndPoint endpoint, CancellationToken cancellationToken = default(CancellationToken));
-            public ITransport Create(IEndPointInformation endPointInformation, IConnectionDispatcher dispatcher);

         }
         public class SocketTransportOptions {
+            public long? MaxReadBufferSize { get; set; }
+            public long? MaxWriteBufferSize { get; set; }
+            public bool NoDelay { get; set; }
         }
     }
-    namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal {
 {
-        public static class BufferExtensions {
 {
-            public static ArraySegment<byte> GetArray(this Memory<byte> memory);

-            public static ArraySegment<byte> GetArray(this ReadOnlyMemory<byte> memory);

-        }
-        public class IOQueue : PipeScheduler {
 {
-            public IOQueue();

-            public override void Schedule(Action<object> action, object state);

-        }
-        public interface ISocketsTrace : ILogger {
 {
-            void ConnectionError(string connectionId, Exception ex);

-            void ConnectionPause(string connectionId);

-            void ConnectionReadFin(string connectionId);

-            void ConnectionReset(string connectionId);

-            void ConnectionResume(string connectionId);

-            void ConnectionWriteFin(string connectionId, string reason);

-        }
-        public class SocketAwaitableEventArgs : SocketAsyncEventArgs, ICriticalNotifyCompletion, INotifyCompletion {
 {
-            public SocketAwaitableEventArgs(PipeScheduler ioScheduler);

-            public bool IsCompleted { get; }

-            public void Complete();

-            public SocketAwaitableEventArgs GetAwaiter();

-            public int GetResult();

-            public void OnCompleted(Action continuation);

-            protected override void OnCompleted(SocketAsyncEventArgs _);

-            public void UnsafeOnCompleted(Action continuation);

-        }
-        public sealed class SocketReceiver : SocketSenderReceiverBase {
 {
-            public SocketReceiver(Socket socket, PipeScheduler scheduler);

-            public SocketAwaitableEventArgs ReceiveAsync(Memory<byte> buffer);

-            public SocketAwaitableEventArgs WaitForDataAsync();

-        }
-        public sealed class SocketSender : SocketSenderReceiverBase {
 {
-            public SocketSender(Socket socket, PipeScheduler scheduler);

-            public SocketAwaitableEventArgs SendAsync(ReadOnlySequence<byte> buffers);

-        }
-        public abstract class SocketSenderReceiverBase : IDisposable {
 {
-            protected readonly SocketAwaitableEventArgs _awaitableEventArgs;

-            protected readonly Socket _socket;

-            protected SocketSenderReceiverBase(Socket socket, PipeScheduler scheduler);

-            public void Dispose();

-        }
-        public class SocketsTrace : ILogger, ISocketsTrace {
 {
-            public SocketsTrace(ILogger logger);

-            public IDisposable BeginScope<TState>(TState state);

-            public void ConnectionError(string connectionId, Exception ex);

-            public void ConnectionPause(string connectionId);

-            public void ConnectionRead(string connectionId, int count);

-            public void ConnectionReadFin(string connectionId);

-            public void ConnectionReset(string connectionId);

-            public void ConnectionResume(string connectionId);

-            public void ConnectionWrite(string connectionId, int count);

-            public void ConnectionWriteCallback(string connectionId, int status);

-            public void ConnectionWriteFin(string connectionId, string reason);

-            public bool IsEnabled(LogLevel logLevel);

-            public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter);

-        }
-    }
 }
```


text:
require 'doc_smoosher'

RSpec.configure do |c|
  c.color = true
end

redpajama_set_name: RedPajamaGithub


text:
Escope ([escope](http://github.com/estools/escope)) is
[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
scope analyzer extracted from [esmangle project](http://github.com/estools/esmangle).

[![Build Status](https://travis-ci.org/estools/escope.png?branch=master)](https://travis-ci.org/estools/escope)

### Document

Generated JSDoc is [here](http://constellation.github.io/escope/).

### Demos and Tools

Demonstration is [here](http://mazurov.github.io/escope-demo/) by [Sasha Mazurov](https://github.com/mazurov) (twitter: [@mazurov](http://twitter.com/mazurov)). [issue](https://github.com/estools/escope/issues/14)

![Demo](https://f.cloud.github.com/assets/75759/462920/7aa6dd40-b4f5-11e2-9f07-9f4e8d0415f9.gif)

And there are tools constructed on Escope.

- [Esmangle](https://github.com/estools/esmangle) is a minifier / mangler / optimizer.
- [Eslevels](https://github.com/mazurov/eslevels) is a scope levels analyzer and [SublimeText plugin for scope context coloring](https://github.com/mazurov/sublime-levels) is constructed on it.
- [Esgoggles](https://github.com/keeyipchan/esgoggles) is JavaScript code browser.

### License

Copyright (C) 2012-2013 [Yusuke Suzuki](http://github.com/Constellation)
 (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


text:
package config

import (
	"bufio"
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"os/user"
	"path/filepath"
	"strings"

	"github.com/hobeone/tv2go/quality"
	"github.com/hobeone/tv2go/types"
)

//Config is the base struct for Tv2Go configuration information.
type Config struct {
	DB            dbConfig
	WebServer     webConfig
	Storage       storageConfig
	MediaDefaults mediaDefaults
	Providers     []ProviderConfig
}

type ProviderConfig struct {
	Name string
	API  string
}

type webConfig struct {
	ListenAddress string // eg localhost:7000 or 0.0.0.0:8000
	EnableAPI     bool
}

type dbConfig struct {
	Path          string
	Verbose       bool   // turn on verbose db logging
	UpdateDb      bool   // if we should update db items
	WatchInterval int64  // how often to check for shows to update
	Type          string // file or memory (for testing)
}

type mediaDefaults struct {
	ShowQuality   quality.Quality
	EpisodeStatus types.EpisodeStatus
}

type storageConfig struct {
	Directories      []string
	NZBBlackhole     string
	TorrentBlackhole string
}

// NewConfig returns a Config struct with reasonable defaults set.
func NewConfig() *Config {
	return &Config{
		WebServer: webConfig{
			ListenAddress: "localhost:7000",
			EnableAPI:     false,
		},
		DB: dbConfig{
			Verbose:       true,
			UpdateDb:      true,
			WatchInterval: 60,
			Type:          "file",
		},
		Storage: storageConfig{
			Directories: []string{
				replaceTildeInPath("~/tv2go/storage"),
			},
			NZBBlackhole:     replaceTildeInPath("~/tv2go/nzb_blackhole"),
			TorrentBlackhole: replaceTildeInPath("~/tv2go/torrent_blackhole"),
		},
		MediaDefaults: mediaDefaults{
			ShowQuality:   quality.HDTV,
			EpisodeStatus: types.SKIPPED,
		},
	}
}

//NewTestConfig returns a Config instance suitable for use in testing.
func NewTestConfig() *Config {
	c := NewConfig()
	c.DB.Type = "memory"
	c.DB.Verbose = false
	return c
}

func replaceTildeInPath(path string) string {
	usr, _ := user.Current()
	dir := usr.HomeDir
	return strings.Replace(path, "~", dir, 1)
}

// ReadConfig Decodes and evaluates a json config file, watching for include cycles.
func (c *Config) ReadConfig(configPath string) error {
	absConfigPath, err := filepath.Abs(replaceTildeInPath(configPath))
	if err != nil {
		return fmt.Errorf("failed to expand absolute path for %s", configPath)
	}

	var f *os.File
	if f, err = os.Open(absConfigPath); err != nil {
		return fmt.Errorf("failed to open config: %v", err)
	}
	defer f.Close()

	filecont, err := ioutil.ReadAll(f)

	if err = json.Unmarshal(filecont, c); err != nil {
		extra := ""
		if serr, ok := err.(*json.SyntaxError); ok {
			if _, serr := f.Seek(0, os.SEEK_SET); serr != nil {
				fmt.Printf("seek error: %v\n", serr)
			}
			line, col, highlight := highlightBytePosition(f, serr.Offset)
			extra = fmt.Sprintf(":\nError at line %d, column %d (file offset %d):\n%s",
				line, col, serr.Offset, highlight)
		}
		return fmt.Errorf("error parsing JSON object in config file %s%s\n%v",
			f.Name(), extra, err)
	}

	c.DB.Path = replaceTildeInPath(c.DB.Path)
	for i, p := range c.Storage.Directories {
		c.Storage.Directories[i] = replaceTildeInPath(p)
	}
	c.Storage.NZBBlackhole = replaceTildeInPath(c.Storage.NZBBlackhole)

	return nil
}

// HighlightBytePosition takes a reader and the location in bytes of a parse
// error (for instance, from json.SyntaxError.Offset) and returns the line, column,
// and pretty-printed context around the error with an arrow indicating the exact
// position of the syntax error.
//
// Lifted from camlistore
func highlightBytePosition(f io.Reader, pos int64) (line, col int, highlight string) {
	line = 1
	br := bufio.NewReader(f)
	lastLine := ""
	thisLine := new(bytes.Buffer)
	for n := int64(0); n < pos; n++ {
		b, err := br.ReadByte()
		if err != nil {
			break
		}
		if b == '\n' {
			lastLine = thisLine.String()
			thisLine.Reset()
			line++
			col = 1
		} else {
			col++
			thisLine.WriteByte(b)
		}
	}
	if line > 1 {
		highlight += fmt.Sprintf("%5d: %s\n", line-1, lastLine)
	}
	highlight += fmt.Sprintf("%5d: %s\n", line, thisLine.String())
	highlight += fmt.Sprintf("%s^\n", strings.Repeat(" ", col+5))
	return
}


text:
<?php

namespace Skvn\Crud\Exceptions;

class ConfigException extends Exception
{
}


text:
using Newtonsoft.Json;
using NUnit.Framework;
using System;
using System.Collections.ObjectModel;

namespace RiotNet.Tests.Converters
{
    [TestFixture]
    public class KeyedCollectionConverterTests
    {
        private static JsonSerializerSettings jsonSettings = RiotClient.JsonSettings;

        private class TestKeyedCollection : KeyedCollection<string, int>
        {
            protected override string GetKeyForItem(int item)
            {
                return item.ToString();
            }
        }

        [Test]
        public void ShouldDeserialize()
        {
            var value = JsonConvert.DeserializeObject<TestKeyedCollection>("{\"2\":2,\"5\":5}", jsonSettings);

            Assert.That(value.Count, Is.EqualTo(2), "Wrong count");
            Assert.That(value["2"], Is.EqualTo(2));
            Assert.That(value["5"], Is.EqualTo(5));
        }

        [Test]
        public void ShouldDeserializeNull()
        {
            var value = JsonConvert.DeserializeObject<TestKeyedCollection>("null", jsonSettings);

            Assert.That(value, Is.Null);
        }

        [Test]
        public void ShouldSerialize()
        {
            var collection = new TestKeyedCollection() { 11, 12, 13 };
            var value = JsonConvert.SerializeObject(collection, jsonSettings);

            Assert.That(value, Is.EqualTo("{\"11\":11,\"12\":12,\"13\":13}"));
        }
    }
}


text:
package org.fcrepo.server.types.gen;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for RepositoryInfo complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="RepositoryInfo">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="repositoryName" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="repositoryVersion" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="repositoryBaseURL" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="repositoryPIDNamespace" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="defaultExportFormat" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="OAINamespace" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="adminEmailList" type="{http://www.fedora.info/definitions/1/0/types/}ArrayOfString"/>
 *         <element name="samplePID" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="sampleOAIIdentifier" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="sampleSearchURL" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="sampleAccessURL" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="sampleOAIURL" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="retainPIDs" type="{http://www.fedora.info/definitions/1/0/types/}ArrayOfString"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RepositoryInfo", propOrder = {
    "repositoryName",
    "repositoryVersion",
    "repositoryBaseURL",
    "repositoryPIDNamespace",
    "defaultExportFormat",
    "oaiNamespace",
    "adminEmailList",
    "samplePID",
    "sampleOAIIdentifier",
    "sampleSearchURL",
    "sampleAccessURL",
    "sampleOAIURL",
    "retainPIDs"
})
public class RepositoryInfo {

    @XmlElement(required = true, nillable = true)
    protected String repositoryName;
    @XmlElement(required = true, nillable = true)
    protected String repositoryVersion;
    @XmlElement(required = true, nillable = true)
    protected String repositoryBaseURL;
    @XmlElement(required = true, nillable = true)
    protected String repositoryPIDNamespace;
    @XmlElement(required = true, nillable = true)
    protected String defaultExportFormat;
    @XmlElement(name = "OAINamespace", required = true, nillable = true)
    protected String oaiNamespace;
    @XmlElement(required = true, nillable = true)
    protected ArrayOfString adminEmailList;
    @XmlElement(required = true, nillable = true)
    protected String samplePID;
    @XmlElement(required = true, nillable = true)
    protected String sampleOAIIdentifier;
    @XmlElement(required = true, nillable = true)
    protected String sampleSearchURL;
    @XmlElement(required = true, nillable = true)
    protected String sampleAccessURL;
    @XmlElement(required = true, nillable = true)
    protected String sampleOAIURL;
    @XmlElement(required = true, nillable = true)
    protected ArrayOfString retainPIDs;

    /**
     * Gets the value of the repositoryName property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getRepositoryName() {
        return repositoryName;
    }

    /**
     * Sets the value of the repositoryName property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setRepositoryName(String value) {
        this.repositoryName = value;
    }

    /**
     * Gets the value of the repositoryVersion property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getRepositoryVersion() {
        return repositoryVersion;
    }

    /**
     * Sets the value of the repositoryVersion property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setRepositoryVersion(String value) {
        this.repositoryVersion = value;
    }

    /**
     * Gets the value of the repositoryBaseURL property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getRepositoryBaseURL() {
        return repositoryBaseURL;
    }

    /**
     * Sets the value of the repositoryBaseURL property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setRepositoryBaseURL(String value) {
        this.repositoryBaseURL = value;
    }

    /**
     * Gets the value of the repositoryPIDNamespace property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getRepositoryPIDNamespace() {
        return repositoryPIDNamespace;
    }

    /**
     * Sets the value of the repositoryPIDNamespace property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setRepositoryPIDNamespace(String value) {
        this.repositoryPIDNamespace = value;
    }

    /**
     * Gets the value of the defaultExportFormat property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDefaultExportFormat() {
        return defaultExportFormat;
    }

    /**
     * Sets the value of the defaultExportFormat property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDefaultExportFormat(String value) {
        this.defaultExportFormat = value;
    }

    /**
     * Gets the value of the oaiNamespace property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOAINamespace() {
        return oaiNamespace;
    }

    /**
     * Sets the value of the oaiNamespace property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOAINamespace(String value) {
        this.oaiNamespace = value;
    }

    /**
     * Gets the value of the adminEmailList property.
     *
     * @return
     *     possible object is
     *     {@link ArrayOfString }
     *
     */
    public ArrayOfString getAdminEmailList() {
        return adminEmailList;
    }

    /**
     * Sets the value of the adminEmailList property.
     *
     * @param value
     *     allowed object is
     *     {@link ArrayOfString }
     *
     */
    public void setAdminEmailList(ArrayOfString value) {
        this.adminEmailList = value;
    }

    /**
     * Gets the value of the samplePID property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSamplePID() {
        return samplePID;
    }

    /**
     * Sets the value of the samplePID property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSamplePID(String value) {
        this.samplePID = value;
    }

    /**
     * Gets the value of the sampleOAIIdentifier property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSampleOAIIdentifier() {
        return sampleOAIIdentifier;
    }

    /**
     * Sets the value of the sampleOAIIdentifier property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSampleOAIIdentifier(String value) {
        this.sampleOAIIdentifier = value;
    }

    /**
     * Gets the value of the sampleSearchURL property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSampleSearchURL() {
        return sampleSearchURL;
    }

    /**
     * Sets the value of the sampleSearchURL property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSampleSearchURL(String value) {
        this.sampleSearchURL = value;
    }

    /**
     * Gets the value of the sampleAccessURL property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSampleAccessURL() {
        return sampleAccessURL;
    }

    /**
     * Sets the value of the sampleAccessURL property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSampleAccessURL(String value) {
        this.sampleAccessURL = value;
    }

    /**
     * Gets the value of the sampleOAIURL property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSampleOAIURL() {
        return sampleOAIURL;
    }

    /**
     * Sets the value of the sampleOAIURL property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSampleOAIURL(String value) {
        this.sampleOAIURL = value;
    }

    /**
     * Gets the value of the retainPIDs property.
     *
     * @return
     *     possible object is
     *     {@link ArrayOfString }
     *
     */
    public ArrayOfString getRetainPIDs() {
        return retainPIDs;
    }

    /**
     * Sets the value of the retainPIDs property.
     *
     * @param value
     *     allowed object is
     *     {@link ArrayOfString }
     *
     */
    public void setRetainPIDs(ArrayOfString value) {
        this.retainPIDs = value;
    }

}


text:
use super::Graph;
use super::iterate::reverse_post_order;
use super::node_vec::NodeVec;

use std::fmt;

#[cfg(test)]
mod test;

pub fn dominators<G: Graph>(graph: &G)
                            -> Dominators<G>
{
    let start_node = graph.start_node();
    let rpo = reverse_post_order(graph, start_node);
    dominators_given_rpo(graph, &rpo)
}

pub fn dominators_given_rpo<G: Graph>(graph: &G,
                                      rpo: &[G::Node])
                                      -> Dominators<G>
{
    let start_node = graph.start_node();
    assert_eq!(rpo[0], start_node);

    // compute the post order index (rank) for each node
    let mut post_order_rank: NodeVec<G, usize> = NodeVec::from_default(graph);
    for (index, node) in rpo.iter().rev().cloned().enumerate() {
        post_order_rank[node] = index;
    }

    let mut immediate_dominators: NodeVec<G, Option<G::Node>> =
        NodeVec::from_default(graph);
    immediate_dominators[start_node] = Some(start_node);

    let mut changed = true;
    while changed {
        changed = false;

        for &node in &rpo[1..] {
            let mut new_idom = None;
            for pred in graph.predecessors(node) {
                if immediate_dominators[pred].is_some() { // (*)
                    // (*) dominators for `pred` have been calculated
                    new_idom = intersect_opt(&post_order_rank,
                                             &immediate_dominators,
                                             new_idom,
                                             Some(pred));
                }
            }

            if new_idom != immediate_dominators[node] {
                immediate_dominators[node] = new_idom;
                changed = true;
            }
        }
    }

    Dominators {
        post_order_rank: post_order_rank,
        immediate_dominators: immediate_dominators,
    }
}

fn intersect_opt<G: Graph>(post_order_rank: &NodeVec<G, usize>,
                           immediate_dominators: &NodeVec<G, Option<G::Node>>,
                           node1: Option<G::Node>,
                           node2: Option<G::Node>)
                           -> Option<G::Node>
{
    match (node1, node2) {
        (None, None) => None,
        (Some(n), None) | (None, Some(n)) => Some(n),
        (Some(n1), Some(n2)) => Some(intersect(post_order_rank,
                                               immediate_dominators,
                                               n1,
                                               n2)),
    }
}

fn intersect<G: Graph>(post_order_rank: &NodeVec<G, usize>,
                       immediate_dominators: &NodeVec<G, Option<G::Node>>,
                       mut node1: G::Node,
                       mut node2: G::Node)
                       -> G::Node
{
    while node1 != node2 {
        while post_order_rank[node1] < post_order_rank[node2] {
            node1 = immediate_dominators[node1].unwrap();
        }

        while post_order_rank[node2] < post_order_rank[node1] {
            node2 = immediate_dominators[node2].unwrap();
        }
    }
    return node1;
}

pub struct Dominators<G: Graph> {
    post_order_rank: NodeVec<G, usize>,
    immediate_dominators: NodeVec<G, Option<G::Node>>,
}

impl<G: Graph> Dominators<G> {
    pub fn is_reachable(&self, node: G::Node) -> bool {
        self.immediate_dominators[node].is_some()
    }

    pub fn immediate_dominator(&self, node: G::Node) -> G::Node {
        assert!(self.is_reachable(node), "node {:?} is not reachable", node);
        self.immediate_dominators[node].unwrap()
    }

    pub fn dominators(&self, node: G::Node) -> Iter<G> {
        assert!(self.is_reachable(node), "node {:?} is not reachable", node);
        Iter { dominators: self, node: Some(node) }
    }

    pub fn is_dominated_by(&self, node: G::Node, dom: G::Node) -> bool {
        // FIXME -- could be optimized by using post-order-rank
        self.dominators(node).any(|n| n == dom)
    }

    pub fn mutual_dominator_node(&self, node1: G::Node, node2: G::Node) -> G::Node {
        assert!(self.is_reachable(node1), "node {:?} is not reachable", node1);
        assert!(self.is_reachable(node2), "node {:?} is not reachable", node2);
        intersect(&self.post_order_rank, &self.immediate_dominators, node1, node2)
    }

    pub fn mutual_dominator<I>(&self, iter: I) -> Option<G::Node>
        where I: IntoIterator<Item=G::Node>
    {
        let mut iter = iter.into_iter();
        iter.next()
            .map(|dom| {
                iter.fold(dom, |dom, node| self.mutual_dominator_node(dom, node))
            })
    }

    pub fn all_immediate_dominators(&self) -> &NodeVec<G, Option<G::Node>> {
        &self.immediate_dominators
    }

    pub fn dominator_tree(&self) -> DominatorTree<G> {
        let mut children: NodeVec<G, Vec<G::Node>> =
            NodeVec::from_default_with_len(self.immediate_dominators.len());
        let mut root = None;
        for (index, immed_dom) in self.immediate_dominators.iter().enumerate() {
            let node = G::Node::from(index);
            match *immed_dom {
                None => { /* node not reachable */ }
                Some(immed_dom) => {
                    if node == immed_dom {
                        root = Some(node);
                    } else {
                        children[immed_dom].push(node);
                    }
                }
            }
        }
        DominatorTree { root: root.unwrap(), children: children }
    }
}

pub struct Iter<'dom, G: Graph + 'dom> {
    dominators: &'dom Dominators<G>,
    node: Option<G::Node>
}

impl<'dom, G: Graph> Iterator for Iter<'dom, G> {
    type Item = G::Node;

    fn next(&mut self) -> Option<Self::Item> {
        if let Some(node) = self.node {
            let dom = self.dominators.immediate_dominator(node);
            if dom == node {
                self.node = None; // reached the root
            } else {
                self.node = Some(dom);
            }
            return Some(node);
        } else {
            return None;
        }
    }
}

pub struct DominatorTree<G: Graph> {
    root: G::Node,
    children: NodeVec<G, Vec<G::Node>>,
}

impl<G: Graph> DominatorTree<G> {
    pub fn root(&self) -> G::Node {
        self.root
    }

    pub fn children(&self, node: G::Node) -> &[G::Node] {
        &self.children[node]
    }

    pub fn iter_children_of(&self, node: G::Node) -> IterChildrenOf<G> {
        IterChildrenOf { tree: self, stack: vec![node] }
    }
}

pub struct IterChildrenOf<'iter, G: Graph + 'iter> {
    tree: &'iter DominatorTree<G>,
    stack: Vec<G::Node>
}

impl<'iter, G: Graph> Iterator for IterChildrenOf<'iter, G> {
    type Item = G::Node;

    fn next(&mut self) -> Option<G::Node> {
        if let Some(node) = self.stack.pop() {
            self.stack.extend(self.tree.children(node));
            Some(node)
        } else {
            None
        }
    }
}

impl<G: Graph> fmt::Debug for DominatorTree<G> {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
        fmt::Debug::fmt(&DominatorTreeNode { tree: self, node: self.root }, fmt)
    }
}

struct DominatorTreeNode<'tree, G: Graph + 'tree> {
    tree: &'tree DominatorTree<G>,
    node: G::Node,
}

impl<'tree, G: Graph> fmt::Debug for DominatorTreeNode<'tree, G> {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
        let subtrees: Vec<_> =
            self.tree.children(self.node)
                     .iter()
                     .map(|&child| DominatorTreeNode { tree: self.tree, node: child })
                     .collect();
        fmt.debug_tuple("")
           .field(&self.node)
           .field(&subtrees)
           .finish()
    }
}


text:
package tests.interfaces.conflict;

import main.interfaces.conflict.Named;

public class Conflict1 extends Base implements Named {

    public static void main(String[] args) {
        System.out.println(new Conflict1().getName());
    }

}


text: zgrep "$1" /ResearchData/pfam/download/Pfam-A.clans.tsv.gz


text:
namespace fst {

template <class Arc, class Queue>
class RmEpsilonOptions
    : public ShortestDistanceOptions<Arc, Queue, EpsilonArcFilter<Arc>> {
 public:
  using StateId = typename Arc::StateId;
  using Weight = typename Arc::Weight;

  bool connect;             // Connect output
  Weight weight_threshold;  // Pruning weight threshold.
  StateId state_threshold;  // Pruning state threshold.

  explicit RmEpsilonOptions(Queue *queue, float delta = kShortestDelta,
                            bool connect = true,
                            Weight weight_threshold = Weight::Zero(),
                            StateId state_threshold = kNoStateId)
      : ShortestDistanceOptions<Arc, Queue, EpsilonArcFilter<Arc>>(
            queue, EpsilonArcFilter<Arc>(), kNoStateId, delta),
        connect(connect),
        weight_threshold(std::move(weight_threshold)),
        state_threshold(state_threshold) {}
};

namespace internal {

// Computation state of the epsilon-removal algorithm.
template <class Arc, class Queue>
class RmEpsilonState {
 public:
  using Label = typename Arc::Label;
  using StateId = typename Arc::StateId;
  using Weight = typename Arc::Weight;

  RmEpsilonState(const Fst<Arc> &fst, std::vector<Weight> *distance,
                 const RmEpsilonOptions<Arc, Queue> &opts)
      : fst_(fst),
        distance_(distance),
        sd_state_(fst_, distance, opts, true),
        expand_id_(0) {}

  void Expand(StateId s);

  std::vector<Arc> &Arcs() { return arcs_; }

  const Weight &Final() const { return final_; }

  bool Error() const { return sd_state_.Error(); }

 private:
  struct Element {
    Label ilabel;
    Label olabel;
    StateId nextstate;

    Element() {}

    Element(Label ilabel, Label olabel, StateId nexstate)
        : ilabel(ilabel), olabel(olabel), nextstate(nexstate) {}
  };

  struct ElementHash {
   public:
    size_t operator()(const Element &element) const {
      static FST_CONSTEXPR const size_t prime0 = 7853;
      static FST_CONSTEXPR const size_t prime1 = 7867;
      return static_cast<size_t>(element.nextstate) +
             static_cast<size_t>(element.ilabel) * prime0 +
             static_cast<size_t>(element.olabel) * prime1;
    }
  };

  class ElementEqual {
   public:
    bool operator()(const Element &e1, const Element &e2) const {
      return (e1.ilabel == e2.ilabel) && (e1.olabel == e2.olabel) &&
             (e1.nextstate == e2.nextstate);
    }
  };

  using ElementMap = std::unordered_map<Element, std::pair<StateId, size_t>,
                                        ElementHash, ElementEqual>;

  const Fst<Arc> &fst_;
  // Distance from state being expanded in epsilon-closure.
  std::vector<Weight> *distance_;
  // Shortest distance algorithm computation state.
  internal::ShortestDistanceState<Arc, Queue, EpsilonArcFilter<Arc>> sd_state_;
  // Maps an element to a pair corresponding to a position in the arcs vector
  // of the state being expanded. The element corresopnds to the position in
  // the arcs_ vector if p.first is equal to the state being expanded.
  ElementMap element_map_;
  EpsilonArcFilter<Arc> eps_filter_;
  std::stack<StateId> eps_queue_;  // Queue used to visit the epsilon-closure.
  std::vector<bool> visited_;      // True if the state has been visited.
  std::forward_list<StateId> visited_states_;  // List of visited states.
  std::vector<Arc> arcs_;                      // Arcs of state being expanded.
  Weight final_;       // Final weight of state being expanded.
  StateId expand_id_;  // Unique ID for each call to Expand

  RmEpsilonState(const RmEpsilonState &) = delete;
  RmEpsilonState &operator=(const RmEpsilonState &) = delete;
};

template <class Arc, class Queue>
void RmEpsilonState<Arc, Queue>::Expand(typename Arc::StateId source) {
  final_ = Weight::Zero();
  arcs_.clear();
  sd_state_.ShortestDistance(source);
  if (sd_state_.Error()) return;
  eps_queue_.push(source);
  while (!eps_queue_.empty()) {
    const auto state = eps_queue_.top();
    eps_queue_.pop();
    while (visited_.size() <= state) visited_.push_back(false);
    if (visited_[state]) continue;
    visited_[state] = true;
    visited_states_.push_front(state);
    for (ArcIterator<Fst<Arc>> aiter(fst_, state); !aiter.Done();
         aiter.Next()) {
      auto arc = aiter.Value();
      arc.weight = Times((*distance_)[state], arc.weight);
      if (eps_filter_(arc)) {
        while (visited_.size() <= arc.nextstate) visited_.push_back(false);
        if (!visited_[arc.nextstate]) eps_queue_.push(arc.nextstate);
      } else {
        const Element element(arc.ilabel, arc.olabel, arc.nextstate);
        auto insert_result = element_map_.insert(
            std::make_pair(element, std::make_pair(expand_id_, arcs_.size())));
        if (insert_result.second) {
          arcs_.push_back(arc);
        } else {
          if (insert_result.first->second.first == expand_id_) {
            auto &weight = arcs_[insert_result.first->second.second].weight;
            weight = Plus(weight, arc.weight);
          } else {
            insert_result.first->second.first = expand_id_;
            insert_result.first->second.second = arcs_.size();
            arcs_.push_back(arc);
          }
        }
      }
    }
    final_ = Plus(final_, Times((*distance_)[state], fst_.Final(state)));
  }
  while (!visited_states_.empty()) {
    visited_[visited_states_.front()] = false;
    visited_states_.pop_front();
  }
  ++expand_id_;
}

}  // namespace internal

// Removes epsilon-transitions (when both the input and output label are an
// epsilon) from a transducer. The result will be an equivalent FST that has no
// such epsilon transitions. This version modifies its input. It allows fine
// control via the options argument; see below for a simpler interface.
//
// The distance vector will be used to hold the shortest distances during the
// epsilon-closure computation. The state queue discipline and convergence delta
// are taken in the options argument.
template <class Arc, class Queue>
void RmEpsilon(MutableFst<Arc> *fst,
               std::vector<typename Arc::Weight> *distance,
               const RmEpsilonOptions<Arc, Queue> &opts) {
  using Label = typename Arc::Label;
  using StateId = typename Arc::StateId;
  using Weight = typename Arc::Weight;
  if (fst->Start() == kNoStateId) return;
  // noneps_in[s] will be set to true iff s admits a non-epsilon incoming
  // transition or is the start state.
  std::vector<bool> noneps_in(fst->NumStates(), false);
  noneps_in[fst->Start()] = true;
  for (size_t i = 0; i < fst->NumStates(); ++i) {
    for (ArcIterator<Fst<Arc>> aiter(*fst, i); !aiter.Done(); aiter.Next()) {
      const auto &arc = aiter.Value();
      if (arc.ilabel != 0 || arc.olabel != 0) {
        noneps_in[arc.nextstate] = true;
      }
    }
  }
  // States sorted in topological order when (acyclic) or generic topological
  // order (cyclic).
  std::vector<StateId> states;
  states.reserve(fst->NumStates());
  if (fst->Properties(kTopSorted, false) & kTopSorted) {
    for (size_t i = 0; i < fst->NumStates(); i++) states.push_back(i);
  } else if (fst->Properties(kAcyclic, false) & kAcyclic) {
    std::vector<StateId> order;
    bool acyclic;
    TopOrderVisitor<Arc> top_order_visitor(&order, &acyclic);
    DfsVisit(*fst, &top_order_visitor, EpsilonArcFilter<Arc>());
    // Sanity check: should be acyclic if property bit is set.
    if (!acyclic) {
      FSTERROR() << "RmEpsilon: Inconsistent acyclic property bit";
      fst->SetProperties(kError, kError);
      return;
    }
    states.resize(order.size());
    for (StateId i = 0; i < order.size(); i++) states[order[i]] = i;
  } else {
    uint64 props;
    std::vector<StateId> scc;
    SccVisitor<Arc> scc_visitor(&scc, nullptr, nullptr, &props);
    DfsVisit(*fst, &scc_visitor, EpsilonArcFilter<Arc>());
    std::vector<StateId> first(scc.size(), kNoStateId);
    std::vector<StateId> next(scc.size(), kNoStateId);
    for (StateId i = 0; i < scc.size(); i++) {
      if (first[scc[i]] != kNoStateId) next[i] = first[scc[i]];
      first[scc[i]] = i;
    }
    for (StateId i = 0; i < first.size(); i++) {
      for (auto j = first[i]; j != kNoStateId; j = next[j]) {
        states.push_back(j);
      }
    }
  }
  internal::RmEpsilonState<Arc, Queue> rmeps_state(*fst, distance, opts);
  while (!states.empty()) {
    const auto state = states.back();
    states.pop_back();
    if (!noneps_in[state] &&
        (opts.connect || opts.weight_threshold != Weight::Zero() ||
         opts.state_threshold != kNoStateId)) {
      continue;
    }
    rmeps_state.Expand(state);
    fst->SetFinal(state, rmeps_state.Final());
    fst->DeleteArcs(state);
    auto &arcs = rmeps_state.Arcs();
    fst->ReserveArcs(state, arcs.size());
    while (!arcs.empty()) {
      fst->AddArc(state, arcs.back());
      arcs.pop_back();
    }
  }
  if (opts.connect || opts.weight_threshold != Weight::Zero() ||
      opts.state_threshold != kNoStateId) {
    for (size_t s = 0; s < fst->NumStates(); ++s) {
      if (!noneps_in[s]) fst->DeleteArcs(s);
    }
  }
  if (rmeps_state.Error()) fst->SetProperties(kError, kError);
  fst->SetProperties(
      RmEpsilonProperties(fst->Properties(kFstProperties, false)),
      kFstProperties);
  if (opts.weight_threshold != Weight::Zero() ||
      opts.state_threshold != kNoStateId) {
    Prune(fst, opts.weight_threshold, opts.state_threshold);
  }
  if (opts.connect && opts.weight_threshold == Weight::Zero() &&
      opts.state_threshold == kNoStateId) {
    Connect(fst);
  }
}

// Removes epsilon-transitions (when both the input and output label
// are an epsilon) from a transducer. The result will be an equivalent
// FST that has no such epsilon transitions. This version modifies its
// input. It has a simplified interface; see above for a version that
// allows finer control.
//
// Complexity:
//
// - Time:
//
//   Unweighted: O(v^2 + ve).
//   Acyclic: O(v^2 + V e).
//   Tropical semiring: O(v^2 log V + ve).
//   General: exponential.
//
// - Space: O(vE)
//
// where v is the number of states visited and e is the number of arcs visited.
//
// For more information, see:
//
// Mohri, M. 2002. Generic epsilon-removal and input epsilon-normalization
// algorithms for weighted transducers. International Journal of Computer
// Science 13(1): 129-143.
template <class Arc>
void RmEpsilon(MutableFst<Arc> *fst, bool connect = true,
               typename Arc::Weight weight_threshold = Arc::Weight::Zero(),
               typename Arc::StateId state_threshold = kNoStateId,
               float delta = kShortestDelta) {
  using StateId = typename Arc::StateId;
  using Weight = typename Arc::Weight;
  std::vector<Weight> distance;
  AutoQueue<StateId> state_queue(*fst, &distance, EpsilonArcFilter<Arc>());
  RmEpsilonOptions<Arc, AutoQueue<StateId>> opts(
      &state_queue, delta, connect, weight_threshold, state_threshold);
  RmEpsilon(fst, &distance, opts);
}

struct RmEpsilonFstOptions : CacheOptions {
  float delta;

  explicit RmEpsilonFstOptions(const CacheOptions &opts,
                               float delta = kShortestDelta)
      : CacheOptions(opts), delta(delta) {}

  explicit RmEpsilonFstOptions(float delta = kShortestDelta) : delta(delta) {}
};

namespace internal {

// Implementation of delayed RmEpsilonFst.
template <class Arc>
class RmEpsilonFstImpl : public CacheImpl<Arc> {
 public:
  using StateId = typename Arc::StateId;
  using Weight = typename Arc::Weight;

  using Store = DefaultCacheStore<Arc>;
  using State = typename Store::State;

  using FstImpl<Arc>::Properties;
  using FstImpl<Arc>::SetType;
  using FstImpl<Arc>::SetProperties;
  using FstImpl<Arc>::SetInputSymbols;
  using FstImpl<Arc>::SetOutputSymbols;

  using CacheBaseImpl<CacheState<Arc>>::HasArcs;
  using CacheBaseImpl<CacheState<Arc>>::HasFinal;
  using CacheBaseImpl<CacheState<Arc>>::HasStart;
  using CacheBaseImpl<CacheState<Arc>>::PushArc;
  using CacheBaseImpl<CacheState<Arc>>::SetArcs;
  using CacheBaseImpl<CacheState<Arc>>::SetFinal;
  using CacheBaseImpl<CacheState<Arc>>::SetStart;

  RmEpsilonFstImpl(const Fst<Arc> &fst, const RmEpsilonFstOptions &opts)
      : CacheImpl<Arc>(opts),
        fst_(fst.Copy()),
        delta_(opts.delta),
        rmeps_state_(
            *fst_, &distance_,
            RmEpsilonOptions<Arc, FifoQueue<StateId>>(&queue_, delta_, false)) {
    SetType("rmepsilon");
    SetProperties(
        RmEpsilonProperties(fst.Properties(kFstProperties, false), true),
        kCopyProperties);
    SetInputSymbols(fst.InputSymbols());
    SetOutputSymbols(fst.OutputSymbols());
  }

  RmEpsilonFstImpl(const RmEpsilonFstImpl &impl)
      : CacheImpl<Arc>(impl),
        fst_(impl.fst_->Copy(true)),
        delta_(impl.delta_),
        rmeps_state_(
            *fst_, &distance_,
            RmEpsilonOptions<Arc, FifoQueue<StateId>>(&queue_, delta_, false)) {
    SetType("rmepsilon");
    SetProperties(impl.Properties(), kCopyProperties);
    SetInputSymbols(impl.InputSymbols());
    SetOutputSymbols(impl.OutputSymbols());
  }

  StateId Start() {
    if (!HasStart()) SetStart(fst_->Start());
    return CacheImpl<Arc>::Start();
  }

  Weight Final(StateId s) {
    if (!HasFinal(s)) Expand(s);
    return CacheImpl<Arc>::Final(s);
  }

  size_t NumArcs(StateId s) {
    if (!HasArcs(s)) Expand(s);
    return CacheImpl<Arc>::NumArcs(s);
  }

  size_t NumInputEpsilons(StateId s) {
    if (!HasArcs(s)) Expand(s);
    return CacheImpl<Arc>::NumInputEpsilons(s);
  }

  size_t NumOutputEpsilons(StateId s) {
    if (!HasArcs(s)) Expand(s);
    return CacheImpl<Arc>::NumOutputEpsilons(s);
  }

  uint64 Properties() const override { return Properties(kFstProperties); }

  // Sets error if found and returns other FST impl properties.
  uint64 Properties(uint64 mask) const override {
    if ((mask & kError) &&
        (fst_->Properties(kError, false) || rmeps_state_.Error())) {
      SetProperties(kError, kError);
    }
    return FstImpl<Arc>::Properties(mask);
  }

  void InitArcIterator(StateId s, ArcIteratorData<Arc> *data) {
    if (!HasArcs(s)) Expand(s);
    CacheImpl<Arc>::InitArcIterator(s, data);
  }

  void Expand(StateId s) {
    rmeps_state_.Expand(s);
    SetFinal(s, rmeps_state_.Final());
    auto &arcs = rmeps_state_.Arcs();
    while (!arcs.empty()) {
      PushArc(s, arcs.back());
      arcs.pop_back();
    }
    SetArcs(s);
  }

 private:
  std::unique_ptr<const Fst<Arc>> fst_;
  float delta_;
  std::vector<Weight> distance_;
  FifoQueue<StateId> queue_;
  internal::RmEpsilonState<Arc, FifoQueue<StateId>> rmeps_state_;
};

}  // namespace internal

// Removes epsilon-transitions (when both the input and output label are an
// epsilon) from a transducer. The result will be an equivalent FST that has no
// such epsilon transitions. This version is a
// delayed FST.
//
// Complexity:
//
// - Time:
//   Unweighted: O(v^2 + ve).
//   General: exponential.
//
// - Space: O(vE)
//
// where v is the number of states visited and e is the number of arcs visited.
// Constant time to visit an input state or arc is assumed and exclusive of
// caching.
//
// For more information, see:
//
// Mohri, M. 2002. Generic epsilon-removal and input epsilon-normalization
// algorithms for weighted transducers. International Journal of Computer
// Science 13(1): 129-143.
//
// This class attaches interface to implementation and handles
// reference counting, delegating most methods to ImplToFst.
template <class A>
class RmEpsilonFst : public ImplToFst<internal::RmEpsilonFstImpl<A>> {
 public:
  using Arc = A;
  using StateId = typename Arc::StateId;

  using Store = DefaultCacheStore<Arc>;
  using State = typename Store::State;
  using Impl = internal::RmEpsilonFstImpl<Arc>;

  friend class ArcIterator<RmEpsilonFst<Arc>>;
  friend class StateIterator<RmEpsilonFst<Arc>>;

  explicit RmEpsilonFst(const Fst<Arc> &fst)
      : ImplToFst<Impl>(std::make_shared<Impl>(fst, RmEpsilonFstOptions())) {}

  RmEpsilonFst(const Fst<A> &fst, const RmEpsilonFstOptions &opts)
      : ImplToFst<Impl>(std::make_shared<Impl>(fst, opts)) {}

  // See Fst<>::Copy() for doc.
  RmEpsilonFst(const RmEpsilonFst<Arc> &fst, bool safe = false)
      : ImplToFst<Impl>(fst, safe) {}

  // Get a copy of this RmEpsilonFst. See Fst<>::Copy() for further doc.
  RmEpsilonFst<Arc> *Copy(bool safe = false) const override {
    return new RmEpsilonFst<Arc>(*this, safe);
  }

  inline void InitStateIterator(StateIteratorData<Arc> *data) const override;

  void InitArcIterator(StateId s, ArcIteratorData<Arc> *data) const override {
    GetMutableImpl()->InitArcIterator(s, data);
  }

 private:
  using ImplToFst<Impl>::GetImpl;
  using ImplToFst<Impl>::GetMutableImpl;

  RmEpsilonFst &operator=(const RmEpsilonFst &) = delete;
};

// Specialization for RmEpsilonFst.
template <class Arc>
class StateIterator<RmEpsilonFst<Arc>>
    : public CacheStateIterator<RmEpsilonFst<Arc>> {
 public:
  explicit StateIterator(const RmEpsilonFst<Arc> &fst)
      : CacheStateIterator<RmEpsilonFst<Arc>>(fst, fst.GetMutableImpl()) {}
};

// Specialization for RmEpsilonFst.
template <class Arc>
class ArcIterator<RmEpsilonFst<Arc>>
    : public CacheArcIterator<RmEpsilonFst<Arc>> {
 public:
  using StateId = typename Arc::StateId;

  ArcIterator(const RmEpsilonFst<Arc> &fst, StateId s)
      : CacheArcIterator<RmEpsilonFst<Arc>>(fst.GetMutableImpl(), s) {
    if (!fst.GetImpl()->HasArcs(s)) fst.GetMutableImpl()->Expand(s);
  }
};

template <class Arc>
inline void RmEpsilonFst<Arc>::InitStateIterator(
    StateIteratorData<Arc> *data) const {
  data->base = new StateIterator<RmEpsilonFst<Arc>>(*this);
}

// Useful alias when using StdArc.
using StdRmEpsilonFst = RmEpsilonFst<StdArc>;

}  // namespace fst

#endif  // FST_RMEPSILON_H_


text:
const fs = require('fs');
const xlsx = require('node-xlsx');
const mongoose = require('mongoose');

var Student = require('./models/student.ts');

// TODO: allow for uploading file to be parsed
var filepath = '';

var obj = xlsx.parse(filepath);

obj[0].data.forEach((d) => {
  var student = new Student();
  student._id = d[2];
  student.name = d[4] + " " + d[3];
  student.mail = d[27];
  student.mobile = d[26];
  student.save((err) => {
    if (err) {
      console.log(err);
    } else {
      console.log(student._id + " added to database");
    }
  });
})


text:
from django.contrib.admin import helpers
from django.template.response import TemplateResponse
from django.utils.encoding import force_unicode
from django.utils.translation import ugettext_lazy as _
from django.contrib.admin.util import quote, model_ngettext
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.core.urlresolvers import reverse
from django.core.exceptions import PermissionDenied
from django.core.management import call_command
from django.core.management.base import CommandError

from publication_backbone.admin.forms import (
    PublicationSelectRubricsAdminForm,
    PublicationSetDescriptionAdminForm,
    PublicationSelectGroupsAdminForm,
    PublicationSetEstimatedDeliveryAdminForm,
    MergeRubricsAdminForm,
    MakeRubricsByPublicationsAttributesAdminForm,
)

def set_selected_rubrics(modeladmin, request, queryset):
    """
    """
    opts = modeladmin.model._meta
    app_label = opts.app_label

    def format_callback(obj):
        opts = obj._meta
        admin_url = reverse('%s:%s_%s_change'
                            % (modeladmin.admin_site.name,
                               opts.app_label,
                               opts.object_name.lower()),
                            None, (quote(obj._get_pk_val()),))
        # Display a link to the admin page.
        return mark_safe(u'%s: %s' %
                         (escape(capfirst(opts.verbose_name)),
                          admin_url,
                          escape(obj)))

    def rubric_proceed(publication, rubrics_set, rubrics_unset):
        publication_rubrics = publication.rubrics.all()
        if rubrics_set and len(rubrics_set) != 0:
            for rubric in rubrics_set:
                if not rubric in publication_rubrics:
                    publication.rubrics.add(rubric)
        if rubrics_unset and len(rubrics_unset) != 0:
            for rubric in rubrics_unset:
                if rubric in publication_rubrics:
                    publication.rubrics.remove(rubric)
        publication.save()

    to_proceed = []
    for obj in queryset:
        to_proceed.append(format_callback(obj))

    if request.POST.get('post'):
        form = PublicationSelectRubricsAdminForm(request.POST)
        if form.is_valid():
            rubrics_set = form.cleaned_data['rubrics_set']
            rubrics_unset = form.cleaned_data['rubrics_unset']
            n = queryset.count()
            if n:
                for publication in queryset:
                    obj_display = force_unicode(obj)
                    modeladmin.log_change(request, obj, obj_display)
                    rubric_proceed(publication, rubrics_set, rubrics_unset)

                modeladmin.message_user(request, _("Successfully proceed %(count)d %(items)s.") % {
                    "count": n, "items": model_ngettext(modeladmin.opts, n)
                })
            # Return None to display the change list page again.
            return None

    if len(queryset) == 1:
        objects_name = force_unicode(opts.verbose_name)
    else:
        objects_name = force_unicode(opts.verbose_name_plural)

    form = PublicationSelectRubricsAdminForm()

    title = _("Are you sure?")
    context = {
        "title": title,
        'form': form,
        "objects_name": objects_name,
        "to_proceed": [to_proceed],
        'queryset': queryset,
        "opts": opts,
        "app_label": app_label,
        'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME,
    }
    # Display the confirmation page
    return TemplateResponse(request, "publication_backbone/admin/actions/set_selected_rubrics.html",
                            context, current_app=modeladmin.admin_site.name)

set_selected_rubrics.short_description = _("Set or unset rubrics for selected %(verbose_name_plural)s")

def set_description(modeladmin, request, queryset):
    """
    """
    opts = modeladmin.model._meta
    app_label = opts.app_label
    error_message = None
    def format_callback(obj):
        opts = obj._meta
        admin_url = reverse('%s:%s_%s_change'
                            % (modeladmin.admin_site.name,
                               opts.app_label,
                               opts.object_name.lower()),
                            None, (quote(obj._get_pk_val()),))
        # Display a link to the admin page.
        return mark_safe(u'%s: %s' %
                         (escape(capfirst(opts.verbose_name)),
                          admin_url,
                          escape(obj)))

    to_proceed = []
    for obj in queryset:
        to_proceed.append(format_callback(obj))

    if request.POST.get('post'):
        form = PublicationSetDescriptionAdminForm(request.POST)
        if form.is_valid():
            description = form.cleaned_data['description'].strip()
            if description=='':
                description = None
            n = queryset.count()
            if n:
                for publication in queryset:
                    obj_display = force_unicode(obj)
                    modeladmin.log_change(request, obj, obj_display)
                    publication.description = description
                    publication.save()
                modeladmin.message_user(request, _("Successfully proceed %(count)d %(items)s.") % {
                    "count": n, "items": model_ngettext(modeladmin.opts, n)
                })
            # Return None to display the change list page again.
            return None

    if len(queryset) == 1:
        objects_name = force_unicode(opts.verbose_name)
    else:
        objects_name = force_unicode(opts.verbose_name_plural)

    form = PublicationSetDescriptionAdminForm()

    title = _("Are you sure?")
    context = {
        "title": title,
        'form': form,
        "objects_name": objects_name,
        "to_proceed": [to_proceed],
        'queryset': queryset,
        "opts": opts,
        "app_label": app_label,
        'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME,
        'error_message': error_message,
    }
    # Display the confirmation page
    return TemplateResponse(request, "publication_backbone/admin/actions/set_description.html",
                            context, current_app=modeladmin.admin_site.name)

set_description.short_description = _("Set description for selected %(verbose_name_plural)s")

def set_publicationgroup(modeladmin, request, queryset):
    """
    """
    opts = modeladmin.model._meta
    app_label = opts.app_label
    error_message = None

    def format_callback(obj):
        opts = obj._meta
        admin_url = reverse('%s:%s_%s_change'
                            % (modeladmin.admin_site.name,
                               opts.app_label,
                               opts.object_name.lower()),
                            None, (quote(obj._get_pk_val()),))
        # Display a link to the admin page.
        return mark_safe(u'%s: %s' %
                         (escape(capfirst(opts.verbose_name)),
                          admin_url,
                          escape(obj)))

    to_proceed = []
    for obj in queryset:
        to_proceed.append(format_callback(obj))

    if request.POST.get('post'):

        form = PublicationSelectGroupsAdminForm(request.POST)
        if form.is_valid():
            group = form.cleaned_data['group']
            n = queryset.count()
            if n:
                for publication in queryset:
                    obj_display = force_unicode(obj)
                    modeladmin.log_change(request, obj, obj_display)
                    publication.group = group
                    publication.save()
                modeladmin.message_user(request, _("Successfully proceed %(count)d %(items)s.") % {
                    "count": n, "items": model_ngettext(modeladmin.opts, n)
                })
            # Return None to display the change list page again.
            return None

    if len(queryset) == 1:
        objects_name = force_unicode(opts.verbose_name)
    else:
        objects_name = force_unicode(opts.verbose_name_plural)

    form = PublicationSelectGroupsAdminForm()

    title = _("Are you sure?")
    context = {
        "title": title,
        'form': form,
        "objects_name": objects_name,
        "to_proceed": [to_proceed],
        'queryset': queryset,
        "opts": opts,
        "app_label": app_label,
        'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME,
        'error_message': error_message,
    }
    return TemplateResponse(request, "publication_backbone/admin/actions/set_group.html",
                            context, current_app=modeladmin.admin_site.name)

set_publicationgroup.short_description = _("Set group for selected %(verbose_name_plural)s")

def set_estimated_delivery(modeladmin, request, queryset):
    """
    Set estimated delivery
    """
    opts = modeladmin.model._meta
    app_label = opts.app_label
    error_message = None

    def format_callback(obj):
        opts = obj._meta
        admin_url = reverse('%s:%s_%s_change'
                            % (modeladmin.admin_site.name,
                               opts.app_label,
                               opts.object_name.lower()),
                            None, (quote(obj._get_pk_val()),))
        # Display a link to the admin page.
        return mark_safe(u'%s: %s' %
                         (escape(capfirst(opts.verbose_name)),
                          admin_url,
                          escape(obj)))

    to_proceed = []
    for obj in queryset:
        to_proceed.append(format_callback(obj))

    if request.POST.get('post'):
        form = PublicationSetEstimatedDeliveryAdminForm(request.POST)
        if form.is_valid():
            estimated_delivery = form.cleaned_data['estimated_delivery'].strip()
            if estimated_delivery == '':
                estimated_delivery = None
            n = queryset.count()
            if n:
                for publication in queryset:
                    obj_display = force_unicode(obj)
                    modeladmin.log_change(request, obj, obj_display)
                    publication.estimated_delivery = estimated_delivery
                    publication.save()
                modeladmin.message_user(request, _("Successfully proceed %(count)d %(items)s.") % {
                    "count": n, "items": model_ngettext(modeladmin.opts, n)
                })
            # Return None to display the change list page again.
            return None

    if len(queryset) == 1:
        objects_name = force_unicode(opts.verbose_name)
    else:
        objects_name = force_unicode(opts.verbose_name_plural)

    form = PublicationSetEstimatedDeliveryAdminForm()

    title = _("Are you sure?")
    context = {
        "title": title,
        'form': form,
        "objects_name": objects_name,
        "to_proceed": [to_proceed],
        'queryset': queryset,
        "opts": opts,
        "app_label": app_label,
        'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME,
        'error_message': error_message,
    }
    return TemplateResponse(request, "publication_backbone/admin/actions/set_estimated_delivery.html",
                            context, current_app=modeladmin.admin_site.name)

set_estimated_delivery.short_description = _("Set estimated delivery for selected %(verbose_name_plural)s")

def merge_rubrics(modeladmin, request, queryset):
    """
    Merge rubrics
    """
    opts = modeladmin.model._meta
    app_label = opts.app_label
    error_message = None

    # Check that the user has delete and change permission for the actual model
    if not (modeladmin.has_delete_permission(request) and modeladmin.has_change_permission(request)):
        raise PermissionDenied

    def format_callback(obj):
        opts = obj._meta
        admin_url = reverse('%s:%s_%s_change'
                            % (modeladmin.admin_site.name,
                               opts.app_label,
                               opts.object_name.lower()),
                            None, (quote(obj._get_pk_val()),))
        # Display a link to the admin page.
        return mark_safe(u'%s: %s' %
                         (escape(capfirst(opts.verbose_name)),
                          admin_url,
                          escape(obj)))
    to_proceed = []
    for obj in queryset:
        to_proceed.append(format_callback(obj))

    if request.POST.get('post'):
        form = MergeRubricsAdminForm(request.POST)
        if form.is_valid():
            to_rubric = form.cleaned_data['to_rubric']
            n = queryset.count()
            if n:
                try:
                    for from_rubric in queryset:
                        call_command('merge_rubrics', to_id=to_rubric.id, from_id=from_rubric.id)

                    to_rubric_display = force_unicode(to_rubric)
                    modeladmin.log_change(request, to_rubric, to_rubric_display)

                    modeladmin.message_user(request, _("Successfully proceed %(count)d %(items)s.") % {
                        "count": n, "items": model_ngettext(modeladmin.opts, n)
                    })
                    return None
                except CommandError as e:
                    error_message = force_unicode(e)
    else:
        form = MergeRubricsAdminForm()

    context = {
        "title": _("Merging rubrics"),
        'form': form,
        "objects_name": force_unicode(opts.verbose_name) if len(queryset) else force_unicode(opts.verbose_name_plural),
        "to_proceed": [to_proceed],
        'queryset': queryset,
        "opts": opts,
        "app_label": app_label,
        'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME,
        'error_message': error_message,
    }
    return TemplateResponse(request, "publication_backbone/admin/actions/merge_rubrics.html",
                            context, current_app=modeladmin.admin_site.name)

merge_rubrics.short_description = _("Merge selected %(verbose_name_plural)s with %(verbose_name)s")

def make_rubrics_by_publications_attributes(modeladmin, request, queryset):
    """
    Make sub rubrics structure by additional publications attributes.
    """
    opts = modeladmin.model._meta
    app_label = opts.app_label
    error_message = None

    # Check that the user has delete and change permission for the actual model
    if not (modeladmin.has_delete_permission(request) and modeladmin.has_change_permission(request)):
        raise PermissionDenied

    def format_callback(obj):
        opts = obj._meta
        admin_url = reverse('%s:%s_%s_change'
                            % (modeladmin.admin_site.name,
                               opts.app_label,
                               opts.object_name.lower()),
                            None, (quote(obj._get_pk_val()),))
        # Display a link to the admin page.
        return mark_safe(u'%s: %s' %
                         (escape(capfirst(opts.verbose_name)),
                          admin_url,
                          escape(obj)))
    to_proceed = []
    for obj in queryset:
        to_proceed.append(format_callback(obj))

    if request.POST.get('post'):
        form = MakeRubricsByPublicationsAttributesAdminForm(request.POST)
        if form.is_valid():
            n = queryset.count()
            if n:
                try:
                    for target_rubric in queryset:
                        call_command('make_rubrics_by_publications_attributes', target_id=target_rubric.id)
                        #target_rubric_display = force_unicode(target_rubric)
                        #modeladmin.log_change(request, target_rubric, target_rubric_display)
                    modeladmin.message_user(request, _("Successfully proceed %(count)d %(items)s.") % {
                        "count": n, "items": model_ngettext(modeladmin.opts, n)
                    })
                    return None
                except CommandError as e:
                    error_message = force_unicode(e)
    else:
        form = MakeRubricsByPublicationsAttributesAdminForm()

    context = {
        "title": _("Making sub rubrics structure by additional publications attributes"),
        'form': form,
        "objects_name": force_unicode(opts.verbose_name) if len(queryset) else force_unicode(opts.verbose_name_plural),
        "to_proceed": [to_proceed],
        'queryset': queryset,
        "opts": opts,
        "app_label": app_label,
        'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME,
        'error_message': error_message,
    }
    return TemplateResponse(request, "publication_backbone/admin/actions/make_rubrics_by_publications_attibutes.html",
                            context, current_app=modeladmin.admin_site.name)

make_rubrics_by_publications_attributes.short_description = _("Make sub rubrics structure by additional publications attributes")

def set_rubrics_by_attributes(modeladmin, request, queryset):
    """
    Set rubrics to publication by additional attributes
    """
    try:
        for publication in queryset:
            call_command('set_publication_rubrics_by_attributes', publication_id=publication.pk)

        modeladmin.message_user(request, _("Set rubrics from attributes for %s publications") % queryset.count())

    except CommandError as e:
        from django.contrib import messages
        modeladmin.message_user(request, force_unicode(e), level=messages.ERROR)

set_rubrics_by_attributes.short_description = _("Set rubrics to publication by additional attributes")


text:
using System.Drawing;
using System.Windows.Forms;
using TGC.Core.Direct3D;
using TGC.Core.Geometry;
using TGC.Core.Mathematica;
using TGC.Core.Textures;
using TGC.Examples.Camara;
using TGC.Examples.Example;
using TGC.Examples.UserControls;
using TGC.Examples.UserControls.Modifier;

namespace TGC.Examples.GeometryBasics
{
    /// <summary>
    ///     Muestra como crear un cilindro 3D con la herramienta TgcCylinder, cuyos parametros pueden ser modificados.
    ///     Movimiento con mouse.
    ///     Esta es una vieja version, es recomendado utilizar trasnformaciones en vez de regenerar los triangulos en render.
    /// </summary>
    public class EjemploCilindro : TGCExampleViewer
    {
        private TGCBooleanModifier boundingCylinderModifier;
        private TGCColorModifier colorModifier;
        private TGCIntModifier alphaModifier;
        private TGCTextureModifier textureModifier;
        private TGCBooleanModifier useTextureModifier;
        private TGCVertex3fModifier sizeModifier;
        private TGCVertex3fModifier positionModifier;
        private TGCVertex3fModifier rotationModifier;

        private string currentTexture;
        private TgcCylinder cylinder;

        public EjemploCilindro(string mediaDir, string shadersDir, TgcUserVars userVars, Panel modifiersPanel)
            : base(mediaDir, shadersDir, userVars, modifiersPanel)
        {
            Category = "Geometry Basics";
            Name = "Cilindro";
            Description = "Muestra como crear un cilindro 3D con la herramienta TgcCylinder, cuyos parametros pueden ser modificados. Movimiento con mouse.";
        }

        public override void Init()
        {
            cylinder = new TgcCylinder(TGCVector3.Empty, 2, 4);

            cylinder.AlphaBlendEnable = true;

            boundingCylinderModifier = AddBoolean("boundingCylinder", "boundingCylinder", false);
            colorModifier = AddColor("color", Color.White);
            alphaModifier = AddInt("alpha", 0, 255, 255);
            textureModifier = AddTexture("texture", MediaDir + "\\Texturas\\madera.jpg");
            useTextureModifier = AddBoolean("useTexture", "useTexture", true);

            sizeModifier = AddVertex3f("size", new TGCVector3(-3, -3, 1), new TGCVector3(7, 7, 10), new TGCVector3(2, 2, 5));
            positionModifier = AddVertex3f("position", new TGCVector3(-20, -20, -20), new TGCVector3(20, 20, 20), TGCVector3.Empty);
            var angle = FastMath.TWO_PI;
            rotationModifier = AddVertex3f("rotation", new TGCVector3(-angle, -angle, -angle), new TGCVector3(angle, angle, angle), TGCVector3.Empty);

            Camera = new TgcRotationalCamera(Input);
        }

        public override void Update()
        {
            //  Se debe escribir toda la lógica de computo del modelo, así como también verificar entradas del usuario y reacciones ante ellas.
        }

        public override void Render()
        {
            PreRender();

            var size = sizeModifier.Value;
            var position = positionModifier.Value;
            var rotation = rotationModifier.Value;

            var texturePath = textureModifier.Value;
            if (texturePath != currentTexture)
            {
                currentTexture = texturePath;
                cylinder.setTexture(TgcTexture.createTexture(D3DDevice.Instance.Device, currentTexture));
            }

            cylinder.UseTexture = useTextureModifier.Value;

            cylinder.Position = position;
            cylinder.Rotation = rotation;
            cylinder.TopRadius = size.X;
            cylinder.BottomRadius = size.Y;
            cylinder.Length = size.Z;

            var alpha = alphaModifier.Value;
            var color = colorModifier.Value;
            cylinder.Color = Color.FromArgb(alpha, color);

            cylinder.updateValues();

            cylinder.Transform = TGCMatrix.Scaling(cylinder.Scale) * TGCMatrix.RotationYawPitchRoll(cylinder.Rotation.Y, cylinder.Rotation.X, cylinder.Rotation.Z) * TGCMatrix.Translation(cylinder.Position);

            if (boundingCylinderModifier.Value)
                cylinder.BoundingCylinder.Render();
            else
                cylinder.Render();

            PostRender();
        }

        public override void Dispose()
        {
            cylinder.Dispose();
        }
    }
}


text:
<component name="libraryTable">
  <library name="support-core-utils-25.0.0">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/adapter-lib/build/intermediates/exploded-aar/com.android.support/support-core-utils/25.0.0/annotations.zip!/" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/25.0.0/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/adapter-lib/build/intermediates/exploded-aar/com.android.support/support-core-utils/25.0.0/jars/classes.jar!/" />
      <root url="jar://$PROJECT_DIR$/adapter-lib/build/intermediates/exploded-aar/com.android.support/support-core-utils/25.0.0/jars/libs/internal_impl-25.0.0.jar!/" />
      <root url="file://$PROJECT_DIR$/adapter-lib/build/intermediates/exploded-aar/com.android.support/support-core-utils/25.0.0/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://E:/Androidtools/Android/sdk/extras/android/m2repository/com/android/support/support-core-utils/25.0.0/support-core-utils-25.0.0-sources.jar!/" />
      <root url="jar://E:/Androidtools/Android/sdk/extras/android/m2repository/com/android/support/support-core-utils/25.0.0/support-core-utils-25.0.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34014
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Glyma.Powershell.Update.v1_5_0_r2.MappingTool
{
	using System.Data.Linq;
	using System.Data.Linq.Mapping;
	using System.Data;
	using System.Collections.Generic;
	using System.Reflection;
	using System.Linq;
	using System.Linq.Expressions;
	using System.ComponentModel;
	using System;

	[global::System.Data.Linq.Mapping.DatabaseAttribute(Name="SP2013_Map_GlymaDB")]
	public partial class MappingToolDatabaseDataContext : System.Data.Linq.DataContext
	{

		private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();

    #region Extensibility Method Definitions
    partial void OnCreated();
    #endregion

		public MappingToolDatabaseDataContext() :
				base(global::Glyma.Powershell.Update.Properties.Settings.Default.SP2013_Map_GlymaDBConnectionString, mappingSource)
		{
			OnCreated();
		}

		public MappingToolDatabaseDataContext(string connection) :
				base(connection, mappingSource)
		{
			OnCreated();
		}

		public MappingToolDatabaseDataContext(System.Data.IDbConnection connection) :
				base(connection, mappingSource)
		{
			OnCreated();
		}

		public MappingToolDatabaseDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
				base(connection, mappingSource)
		{
			OnCreated();
		}

		public MappingToolDatabaseDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
				base(connection, mappingSource)
		{
			OnCreated();
		}

		[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.GetGlymaDbVersion")]
		public ISingleResult<GetGlymaDbVersionResult> GetGlymaDbVersion()
		{
			IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
			return ((ISingleResult<GetGlymaDbVersionResult>)(result.ReturnValue));
		}
	}

	public partial class GetGlymaDbVersionResult
	{

		private string _Column1;

		public GetGlymaDbVersionResult()
		{
		}

		[global::System.Data.Linq.Mapping.ColumnAttribute(Name="", Storage="_Column1", DbType="VarChar(8) NOT NULL", CanBeNull=false)]
		public string Column1
		{
			get
			{
				return this._Column1;
			}
			set
			{
				if ((this._Column1 != value))
				{
					this._Column1 = value;
				}
			}
		}
	}
}
#pragma warning restore 1591


text:
<!DOCTYPE html>
<html lang="en" dir="ltr" itemscope itemtype="http://schema.org/Article">
<head>
    <meta charset="utf-8">

	<title>MochaUI - A Web Applications User Interface Library</title>
	<meta name="description"
		  content="A web applications user interface library built on the Mootools JavaScript framework"/>

	<link rel="stylesheet" type="text/css" href="../Source/Themes/default/css/window.css"/>
	<link rel="stylesheet" type="text/css" href="../Source/Themes/default/css/desktop.css"/>
	<link rel="stylesheet" type="text/css" href="Themes/default/css/demo.css"/>

	<script type="text/javascript" src="scripts/mootools-core-1.5.0-full-nocompat.js"></script>
	<script type="text/javascript" src="scripts/mootools-more-1.5.0.js"></script>

	<!--MOCHAUI-->
	<script type="text/javascript" src="../Source/Core/core.js"></script>
	<script type="text/javascript" src="../Source/Core/create.js"></script>
	<script type="text/javascript" src="../Source/Core/require.js"></script>
	<script type="text/javascript" src="../Source/Core/canvas.js"></script>
	<script type="text/javascript" src="../Source/Core/content.js"></script>
	<script type="text/javascript" src="../Source/Core/persist.js"></script>
	<script type="text/javascript" src="../Source/Core/themes.js"></script>

	<script type="text/javascript" src="../Source/Controls/window/window.js"></script>
	<script type="text/javascript" src="../Source/Controls/desktop/desktop.js"></script>
	<!--MOCHAUI-->

	<script type="text/javascript">
		MUI.files.extend({
			'{controls}window/window.js':'loaded',
			'{controls}desktop/desktop.js':'loaded',
			'{theme}css/window.css':'loaded',
			'{theme}css/desktop.css':'loaded'
		});
	</script>

	<script type="text/javascript" src="scripts/demo-application.js"></script>
</head>
<body>

<div id="desktop">
</div>
</body>
</html>


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest
    package="in.joind"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="11"
    android:versionName="2.0.10">

    <!-- Target SDK version is handled in the build.gradle configuration -->
    <uses-sdk android:minSdkVersion="9"/>

    <!-- Since we make requests over the Internet, we need the users permission for it. -->
    <uses-permission android:name="android.permission.INTERNET"/>

    <!-- Account management. Used to store access tokens -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    <uses-permission android:name="android.permission.USE_CREDENTIALS"/>
    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/JoindInActionBarTheme">

        <!-- Just a bunch of activities here. Needed otherwise android cannot launch them. -->
        <activity
            android:name="in.joind.Main"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable"/>
        </activity>
        <activity
            android:name=".EventDetail"
            android:label="@string/app_name"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="in.joind.Main"/>
        </activity>
        <activity
            android:name=".EventTalks"
            android:label="@string/app_name"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="in.joind.EventDetail"/>
        </activity>
        <activity
            android:name=".EventComments"
            android:label="@string/app_name"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="in.joind.EventDetail"/>
        </activity>
        <activity
            android:name=".EventTracks"
            android:label="@string/app_name"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="in.joind.EventDetail"/>
        </activity>
        <activity
            android:name=".TalkDetail"
            android:label="@string/app_name"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="in.joind.EventTalks"/>
        </activity>
        <activity
            android:name=".TalkComments"
            android:label="@string/app_name"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="in.joind.TalkDetail"/>
        </activity>
        <activity
            android:name=".AddComment"
            android:label="@string/app_name"
            android:launchMode="singleTop">
        </activity>
        <activity
            android:name=".activity.SettingsActivity"
            android:label="@string/app_name"
            android:launchMode="singleTop">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="in.joind.Main"/>
        </activity>

        <!-- Authentication service. Used to store details of a user's joind.in account -->
        <service
            android:name="in.joind.authenticator.AuthenticationService"
            android:exported="false">
            <intent-filter>
                <action
                    android:name="android.accounts.AccountAuthenticator"/>
            </intent-filter>
            <meta-data
                android:name="android.accounts.AccountAuthenticator"
                android:resource="@xml/authenticator"/>
        </service>

        <meta-data
            android:name="com.crashlytics.ApiKey"
            android:value="2d4ca2fb1f0233b099fd8045815bbbe56496ef5a"/>

    </application>
</manifest>