text:
//
//package com.impetus.client.query;
//
//import java.util.HashMap;
//import java.util.Map;
//
//import javax.persistence.Persistence;
//
//import org.elasticsearch.common.settings.Settings;
//import org.elasticsearch.common.settings.Settings.Builder;
//import org.elasticsearch.node.Node;
//import org.elasticsearch.node.NodeBuilder;
//import org.junit.AfterClass;
//import org.junit.BeforeClass;
//import org.junit.Test;
//
//import com.impetus.kundera.client.query.GroupByBaseTest;
//
///**
// * The Class HBaseGroupByTest.
// *
// * @author: karthikp.manchala
// */
//public class HBaseGroupByTest extends GroupByBaseTest
//{
//    /** The node. */
//    private static Node node = null;
//
//    /** The property map. */
//    private static Map<String, String> propertyMap = new HashMap<String, String>();
//
//    /**
//     * Sets the up before class.
//     *
//     * @throws Exception
//     *             the exception
//     */
//    @BeforeClass
//    public static void setUpBeforeClass() throws Exception
//    {
//        if (!checkIfServerRunning())
//        {
//            Builder builder = Settings.settingsBuilder();
//            builder.put("path.home", "target/data");
//            node = new NodeBuilder().settings(builder).node();
//        }
//        propertyMap.put("kundera.indexer.class", "com.impetus.client.es.index.ESIndexer");
//        emf = Persistence.createEntityManagerFactory("queryTest", propertyMap);
//        em = emf.createEntityManager();
//        init();
//    }
//
//    /**
//     * Test aggregation.
//     */
//    @Test
//    public void test()
//    {
//        testAggregation();
//    }
//
//    /**
//     * Tear down after class.
//     *
//     * @throws Exception
//     *             the exception
//     */
//    @AfterClass
//    public static void tearDownAfterClass() throws Exception
//    {
//        em.createQuery("Delete from Person p").executeUpdate();
//        waitThread();
//
//        em.close();
//        emf.close();
//
//        if (node != null)
//            node.close();
//    }
//
//}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package se.chalmers.dcs.bapic.concurrentKDTree.KDTrees;

//import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import se.chalmers.dcs.bapic.concurrentKDTree.utils.*;

/**
 *
 * @author bapic
 */
public class SimpleSingleLockBasedKDTree<T> implements KDTreeADT<T> {

    protected static class Node<T> {

        final double[] key;
        volatile Node<T> left, right, parent;
        final int dim;

        Node(final double[] key, final int d, final Node<T> l, final Node<T> r, final Node<T> p) {
            this.key = key;
            this.left = l;
            this.right = r;
            this.parent = p;
            this.dim = d;
        }

        Node(final double[] key, final int d) {
            this(key, d, null, null, null);
        }

        Node(final double[] key, final int d, final Node<T> r) {
            this(key, d, null, r, null);
        }
    }

    protected static class LeafNode<T> extends Node<T> {

        final T value;

        LeafNode(final double[] key, final int dim, final T val) {
            super(key, dim);
            this.value = val;
        }
    }

    final Node<T> root;
    private volatile ReentrantLock lock = new ReentrantLock();
    final int k;

    public SimpleSingleLockBasedKDTree(int k) {
        this.k = k;
        double[] m_keyMax1 = new double[k];
        double[] m_keyMax2 = new double[k];
        for (int i = 0; i < k; i ++) {
            m_keyMax1[i] = Double.MAX_VALUE;
            m_keyMax2[i] = 0.90 * Double.MAX_VALUE;
        }
        int rootDim = 0;
        root = new Node<T>(m_keyMax1, rootDim, new LeafNode<T>(m_keyMax2, (rootDim + 1) % k, null), new LeafNode<T>(m_keyMax1, (rootDim + 1) % k, null), null);
    }

    @Override
    public final boolean contains(final double[] key) {
        Node<T> current = root;
        while (current.getClass() == Node.class) {
            current = key[current.dim] < current.key[current.dim] ? (current.left) : (current.right);
        }
        boolean result = Tools.equals(k, key, current.key);
        return result;
    }

    @Override
    public final boolean add(final double[] key, T value) {
        Node<T> newInternal;
        boolean turn = true;//left:- true, right:- false.
        double[] curKey;
        boolean returnVlaue = false;
        LeafNode<T> newLeafNode;
        lock.lock();
        try {
            Node<T> parent = root;//parent needs to be taken as RLink as may
            Node<T> current = root.left;

            while (current.getClass() == Node.class) {//unless current becomes a clean or unclean leaf node
                parent = current;
                turn = key[parent.dim] < parent.key[parent.dim];
                current = turn ? (parent.left) : (parent.right);
            }

            curKey = ((LeafNode<T>) current).key;
            if (Tools.equals(k, key, curKey)) {
                return false;
            }
            int d, x;
            d = x = current.dim;
            double diff = 0, di;
            do {
                di = Math.abs(curKey[x] - key[x]);
                if (di > diff) {
                    diff = di;
                    d = x;
                }
                x = (x + 1) % k;
            }
            while (x != current.dim);
            while (key[d] == curKey[d]) {
                d = (d + 1) % k;
            }
            newLeafNode = new LeafNode<T>(key, (d + 1) % k, value);
            newInternal = key[d] < curKey[d]
                          ? new Node(curKey.clone(), d, newLeafNode, new LeafNode<T>(curKey, (d + 1) % k, ((LeafNode<T>) current).value), parent)
                          : new Node(key.clone(), d, new LeafNode<T>(curKey, (d + 1) % k, ((LeafNode<T>) current).value), newLeafNode, parent);
            newInternal.key[d] = curKey[d] * 0.5 + key[d] * 0.5;
            if (turn) {
                parent.left = newInternal;
            }
            else {
                parent.right = newInternal;
            }
            returnVlaue = true;
        }
        catch (Exception e) {
        }
        finally {
            lock.unlock();
        }
        return returnVlaue;
    }

    @Override
    public final boolean remove(final double[] key) {
        boolean returnVlaue = false;
        boolean turn = true;//left:- true, right:- false.
        lock.lock();
        try {
            Node<T> parent = root;//parent needs to be taken as RLink as may
            Node<T> current = root.left;

            while (current.getClass() == Node.class) {//unless current becomes a clean or unclean leaf node
                parent = current;
                turn = key[parent.dim] < parent.key[parent.dim];
                current = turn ? (parent.left) : (parent.right);
            }
            if ( ! Tools.equals(k, key, current.key)) {
                return false;
            }

            Node<T> grParent = parent.parent;
            boolean parentDir = parent.key[grParent.dim] < grParent.key[grParent.dim];
            Node<T> sibling = (turn) ? parent.right : parent.left;
            if (sibling.getClass() == Node.class) {
                sibling.parent = grParent;
            }
            if (parentDir) {
                grParent.left = sibling;
            }
            else {
                grParent.right = sibling;
            }

            returnVlaue = true;

        }
        catch (Exception e) {
        }
        finally {
            lock.unlock();

        }
        return returnVlaue;
    }

    @Override
    public T nearest(double[] key, boolean linearizable) throws KeySizeException {
        T returnVal;
        Node<T> parent = root, current = root.left;
        boolean turn = true;
        double[] nearestNeighbour, VisitedHRect = new double[2 * k];// The first k elements are for max of the rectangle and the next k elements are for min of the rectangle
        for (int i = 0; i < k; i ++) {
            VisitedHRect[i] = Double.POSITIVE_INFINITY;
            VisitedHRect[k + i] = Double.NEGATIVE_INFINITY;
        }
        VisitedHRect[0] = parent.key[parent.dim];
        while (current.getClass() == Node.class) {
            parent = current;
            turn = key[parent.dim] < parent.key[parent.dim];
            current = turn ? (parent.left) : (parent.right);
            if (turn) {
                VisitedHRect[parent.dim] = parent.key[parent.dim];
            }
            else {
                VisitedHRect[k + parent.dim] = parent.key[parent.dim];
            }
        }
        nearestNeighbour = current.key;
        double nearestDist = Tools.squaredDistance(key, nearestNeighbour), currentDist;
        returnVal = ((LeafNode<T>) current).value;
        if (nearestDist != 0) {
            while (parent != root) {
                double x = (parent.key[parent.dim] - key[parent.dim]);
                if (x * x < nearestDist && ((turn && parent.key[parent.dim] >= VisitedHRect[parent.dim]) || ( ! turn && parent.key[parent.dim] <= VisitedHRect[k + parent.dim]))) {
                    //Here the checks are in the opposite directions
                    turn =  ! turn;
                    current = turn ? (parent.left == parent ? parent.right.left : parent.left)
                              : (parent.left == parent ? parent.right.right : parent.right);
                    while (current.getClass() == Node.class) {
                        parent = current;
                        turn = key[parent.dim] < parent.key[parent.dim];
                        current = turn ? (parent.left) : (parent.right);
                        if (turn) {
                            VisitedHRect[parent.dim] = parent.key[parent.dim];
                        }
                        else {
                            VisitedHRect[k + parent.dim] = parent.key[parent.dim];
                        }
                    }
                    currentDist = Tools.squaredDistance(key, current.key);
                    if (currentDist < nearestDist) {
                        nearestNeighbour = current.key;
                        nearestDist = currentDist;
                        returnVal = ((LeafNode<T>) current).value;
                    }
                }
                else {
                    current = parent;
                    parent = parent.parent;
                    turn = current.key[parent.dim] < parent.key[parent.dim];
                    if (turn) {
                        VisitedHRect[parent.dim] = parent.key[parent.dim] > VisitedHRect[parent.dim] ? parent.key[parent.dim] : VisitedHRect[parent.dim];
                    }
                    else {
                        VisitedHRect[k + parent.dim] = parent.key[parent.dim] < VisitedHRect[k + parent.dim] ? parent.key[parent.dim] : VisitedHRect[k + parent.dim];
                    }
                }
            }
        }
        return returnVal;
    }
}

redpajama_set_name: RedPajamaGithub


text:
import mmap
import os
import struct
import array
import time
import sys
from optparse import OptionParser

class Cache:

    def __init__(self, filename, cache_slots, block_size=65536, sample_sleep=1):

        self.block_size = block_size
        self.cache_slots = cache_slots

        self.key_size = 2048
        self.item_size = 2 + 2 + 4 + 8 + 8 + 8 + 8 + 8 + self.key_size
        self.block_size_start = self.item_size * self.cache_slots

        fd = os.open(filename, os.O_RDONLY)
        self.cache_store = mmap.mmap(fd, 0, mmap.MAP_SHARED, mmap.PROT_READ)

        self.sample_sleep = sample_sleep
        self.samples = 0
        self.history = []
        self.cache_full = 0
        self.cache_empty = 0
        self.cache_items = 0
        self.block_sizes = 0

    def store_read_item_block(self, position):
        pos = self.cache_store.tell()
        # uwsgi cache stores cache entries first and then the blocks
        self.cache_store.seek(self.block_size_start + (position * self.block_size))
        buf = self.cache_store.read(self.block_size)
        self.cache_store.seek(pos)
        return buf

    def store_read_item(self, position):
        buf = self.cache_store.read(self.item_size)
        fields = struct.unpack_from('@HHIQQQQQ2048c', buf)
        key = array.array('c', fields[8:self.key_size+8]).tostring().rstrip('\x00')

        if [x for x in key if x!= '\x00']:
            buf = self.store_read_item_block(position)
            value = array.array('c', buf).tostring().rstrip('\x00')
        else:
            value = ''
        return (position, key, value, len(value))

    def read(self):
        data = [self.store_read_item(i) for i in range(self.cache_slots)]
        self.cache_store.seek(0)
        self.update_stats(data)
        if self.sample_sleep:
            time.sleep(self.sample_sleep)
        return data

    def update_stats(self, data):
        # data is a list of (position, key, value, len(value)) tuples
        items = len([1 for x in data if x[3] > 0])
        self.cache_items += items
        full, empty = items == self.cache_slots, items == 0
        if full:
            self.cache_full += 1
        if empty:
            self.cache_empty += 1
        self.samples += 1
        block_sizes = sum([x[3] for x in data])
        self.block_sizes += block_sizes
        self.history.append({'full': full, 'empty': empty, 'data': data, \
            'items': items, 'block_sizes': block_sizes})

    def dump(self):
        return {
            'samples': self.samples,
            'history': self.history,
            'cache_slots': self.cache_slots,
            'sample_sleep': self.sample_sleep,
            'cache_empty': self.cache_empty,
            'cache_full': self.cache_full,
            'cache_items': self.cache_items,
            'block_sizes': self.block_sizes,
         }

    def show_dump(self):
        d = self.dump()
        print()
        print("Recorded %d samples (%d second(s) sleep between samples)" % \
            (d['samples'], d['sample_sleep']))
        print("Cache empty %d times, full %d times, %.2f items on average" % \
            (d['cache_empty'], d['cache_full'], d['cache_items'] / d['samples']))
        print("Block size average size: %d bytes" % \
            (d['block_sizes'] / d['cache_items'] * 8))
        print("Data in cache average: %d bytes" % \
            (d['block_sizes'] / d['samples'] * 8))

def main(options):
    cache = Cache(options.cache_store, options.cache_slots, options.block_size,
        options.sleep_time)
    print("Recording...")
    while True:
        try:
            data = cache.read()
        except KeyboardInterrupt:
            cache.show_dump()
            sys.exit(0)

if __name__ == '__main__':
    parser = OptionParser()
    parser.add_option("-s", "--cache-slots", dest="cache_slots", type="int",
        help="Slots available in the cache, uwsgi cache option")
    parser.add_option("-c", "--cache-store", dest="cache_store", default="uwsgi.cache",
        help="The filename of the cache store, uwsgi cache-store option. Default: uwsgi.cache")
    parser.add_option("-b", "--block-size", dest="block_size", default=65536, type="int",
        help="The size of the cache block, uwsgi cache-blocksize option. Default: 65536")
    parser.add_option("-t", "--sleep-time", dest="sleep_time", default=1, type="int",
        help="The time to sleep between each sample. Default: 1")

    (options, args) = parser.parse_args()
    if not options.cache_slots:
        parser.error('Option -s / --cache-slots is mandatory')
    main(options)


text:
package see.functions.compare;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import org.junit.Test;

import java.math.BigDecimal;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class EqTest {

    Eq eq = new Eq();

    @Test
    public void testNumbers() throws Exception {
        assertTrue(eq.apply(ImmutableList.<Object>of(1.0, 1.0)));
        assertTrue(eq.apply(ImmutableList.<Object>of(1, 1)));
        assertTrue(eq.apply(ImmutableList.<Object>of(BigDecimal.valueOf(1), BigDecimal.valueOf(1))));
    }

    /**
     * Test that Eq can compare arbitrary Objects
     * @throws Exception
     */
    @Test
    public void testObjects() throws Exception {
        Object instance = new Object();
        assertTrue(eq.apply(ImmutableList.<Object>of(instance, instance)));
        assertFalse(eq.apply(ImmutableList.<Object>of(new Object(), new Object())));
    }

    /**
     * Test that Eq handles nulls
     * @throws Exception
     */
    @Test
    public void testNulls() throws Exception {
        assertTrue(eq.apply(Lists.newArrayList(null, null)));
        assertFalse(eq.apply(Lists.newArrayList(new Object(), null)));
        assertFalse(eq.apply(Lists.newArrayList(null, new Object())));
    }

    /**
     * Test that Eq compares BigDecimals via compareTo.
     * @throws Exception
     */
    @Test
    public void testBigDecimals() throws Exception {
        assertTrue(eq.apply(ImmutableList.<Object>of(new BigDecimal("1"), new BigDecimal("1.0"))));
    }
}


text:
package msa.arena.data.repository;

import android.content.Context;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;

import java.util.concurrent.TimeoutException;

import io.reactivex.observers.TestObserver;
import msa.arena.data.BuildConfig;
import msa.arena.data.common.RunnableSchedulerRule;
import msa.data.repository.DataStoreFactory;
import msa.data.repository.datasources.remote.RemoteDataSource;
import msa.domain.holder.carrier.ResourceCarrier;
import msa.domain.holder.carrier.Status;

import static java.util.concurrent.TimeUnit.SECONDS;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;

/**
 * Created by Abhimuktheeswarar on 31-08-2017.
 */
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class)
public class DataStoreFactoryTest {

    @Rule
    public final RunnableSchedulerRule runnableSchedulerRule = new RunnableSchedulerRule();
    private DataStoreFactory dataStoreFactory;

    //@BeforeClass
    public static void setupClass() {
        //RxJavaPlugins.setInitIoSchedulerHandler(__ -> Schedulers.trampoline());
    }

    @Before
    public void setup() {
        Context appContext = RuntimeEnvironment.application;
        dataStoreFactory = new DataStoreFactory(appContext);
    }

    @Test
    public void simpleCheck() {
        assertThat(dataStoreFactory, notNullValue());
        assertThat(dataStoreFactory.getRemoteDataSource(), notNullValue());
    }

    @Test
    public void networkConnectivity() {

        TestObserver<Boolean> testObserver = new TestObserver<>();

        dataStoreFactory.observeNetworkConnectivity().subscribe(testObserver);

        testObserver.assertNoErrors();
        testObserver.assertNotComplete();

        assertFalse(dataStoreFactory.isInternetAvailable());
    }

    @Test
    public void networkAvailableCaseZero() throws TimeoutException {

        dataStoreFactory.setInternetAvailable(true);

        TestObserver<ResourceCarrier<RemoteDataSource>> testObserver = new TestObserver<>();

        dataStoreFactory.getRemoteDataSourceObservable().subscribe(testObserver);

        testObserver.assertNoErrors();
        testObserver.assertValueCount(1);
        testObserver.assertComplete();

        ResourceCarrier<RemoteDataSource> resourceCarrier = dataStoreFactory.getRemoteDataSourceObservable().timeout(20, SECONDS).blockingFirst();

        assertThat(resourceCarrier.status, is(Status.SUCCESS));

    }

    @Test
    public void networkAvailableCaseOne() throws TimeoutException {

        //RxJavaPlugins.setIoSchedulerHandler(scheduler -> Schedulers.trampoline());

        dataStoreFactory.setInternetAvailable(true);

        TestObserver<ResourceCarrier<RemoteDataSource>> testObserver = new TestObserver<>();

        dataStoreFactory.getRemoteDataSourceObservable().subscribe(testObserver);

        testObserver.assertNoErrors();
        testObserver.assertValueCount(1);
        testObserver.assertComplete();

        ResourceCarrier<RemoteDataSource> resourceCarrier = dataStoreFactory.getRemoteDataSourceObservable().timeout(20, SECONDS).blockingFirst();

        assertThat(resourceCarrier.status, is(Status.SUCCESS));

    }

    @Test
    public void networkAvailableCaseAsynchronous() throws TimeoutException {

        dataStoreFactory.setInternetAvailable(true);

        TestObserver<ResourceCarrier<RemoteDataSource>> testObserver = new TestObserver<>();

        dataStoreFactory.getRemoteDataSourceObservable().subscribe(testObserver);

        await().timeout(10, SECONDS).until(testObserver::valueCount, equalTo(1));

        testObserver.assertNoErrors();
        for (ResourceCarrier<RemoteDataSource> resourceCarrier : testObserver.values())
            System.out.println("Resource carrier status = " + resourceCarrier.status);

        testObserver.assertValueCount(1);
        testObserver.assertComplete();

    }

    @Test
    public void networkNotAvailableCaseSynchronous() throws TimeoutException {

        dataStoreFactory.setInternetAvailable(false);

        ResourceCarrier<RemoteDataSource> remoteDataSourceResourceCarrier = dataStoreFactory.getRemoteDataSourceObservable().doAfterNext(remoteDataSourceResourceCarrier1 -> {
            System.out.println("doAfterNext");
            dataStoreFactory.getNetworkConnectivityObservable().onNext(true);
        }).blockingLast();

        assertThat(remoteDataSourceResourceCarrier, notNullValue());
        assertThat(remoteDataSourceResourceCarrier.status, is(Status.SUCCESS));

    }

    @Test
    public void networkNotAvailableCaseZero() {

        dataStoreFactory.setInternetAvailable(false);

        TestObserver<ResourceCarrier<RemoteDataSource>> testObserver = new TestObserver<>();

        dataStoreFactory.getRemoteDataSourceObservable().doAfterNext(remoteDataSourceResourceCarrier -> {
            System.out.println("doAfterNext");
            dataStoreFactory.getNetworkConnectivityObservable().onNext(true);
        }).subscribe(testObserver);

        testObserver.awaitTerminalEvent(4, SECONDS);

        testObserver.assertNoErrors();
        for (ResourceCarrier<RemoteDataSource> resourceCarrier : testObserver.values())
            System.out.println("Resource carrier status = " + resourceCarrier.status);

        testObserver.assertValueCount(2);
        testObserver.assertComplete();

    }

    @Test
    public void networkNotAvailableCaseOne() throws TimeoutException {

        dataStoreFactory.setInternetAvailable(false);

        TestObserver<ResourceCarrier<RemoteDataSource>> testObserver = new TestObserver<>();

        dataStoreFactory.getRemoteDataSourceObservable().subscribe(testObserver);

        dataStoreFactory.getNetworkConnectivityObservable().onNext(true);

        await().timeout(10, SECONDS).until(testObserver::valueCount, equalTo(2));

        testObserver.assertNoErrors();
        for (ResourceCarrier<RemoteDataSource> resourceCarrier : testObserver.values())
            System.out.println("Resource carrier status = " + resourceCarrier.status);

        testObserver.assertValueCount(2);
        testObserver.assertComplete();

    }
}


text:
Artwork
=======

A repository for the MELD workshop staff to save and collaborate on artwork for logos, tshirts, and other products.


text:
namespace clang {

class ASTContext;
class NamedDecl;

namespace tooling {

/// \brief A refactoring operation that deals with occurrences of symbols.
class SymbolOperation {
  /// Contains the symbols that are required for this operation.
  SmallVector<rename::Symbol, 4> Symbols;

  /// Maps from a USR to an index in the \c Symbol array.
  /// Contains all of the USRs that correspond to the declarations which use
  /// the symbols in this operation.
  llvm::StringMap<unsigned> USRToSymbol;

  /// True if all the symbols in this operation occur only in the translation
  /// unit that defines them.
  bool IsLocal;

  /// The declaration whose implementation is needed for the correct initiation
  /// of a symbol operation.
  const NamedDecl *DeclThatRequiresImplementationTU;

public:
  SymbolOperation(const NamedDecl *FoundDecl, ASTContext &Context);

  SymbolOperation(SymbolOperation &&) = default;
  SymbolOperation &operator=(SymbolOperation &&) = default;

  /// Return the symbol that corresponds to the given USR, or null if this USR
  /// isn't interesting from the perspective of this operation.
  const rename::Symbol *getSymbolForUSR(StringRef USR) const {
    auto It = USRToSymbol.find(USR);
    if (It != USRToSymbol.end())
      return &Symbols[It->getValue()];
    return nullptr;
  }

  /// The symbols that this operation is working on.
  ///
  /// Symbol operations, like rename, usually just work on just one symbol.
  /// However, there are certain language constructs that require more than
  /// one symbol in order for them to be renamed correctly. Property
  /// declarations in Objective-C are the perfect example: in addition to the
  /// actual property, renaming has to rename the corresponding getters and
  /// setters, as well as the backing ivar.
  ArrayRef<rename::Symbol> symbols() const { return Symbols; }

  /// True if all the symbols in this operation occur only in the translation
  /// unit that defines them.
  bool isLocal() const { return IsLocal; }

  /// True if the declaration that was found in the initial TU needs to be
  /// examined in the TU that implemented it.
  bool requiresImplementationTU() const {
    return DeclThatRequiresImplementationTU;
  }

  /// Returns the declaration whose implementation is needed for the correct
  /// initiation of a symbol operation.
  const NamedDecl *declThatRequiresImplementationTU() const {
    return DeclThatRequiresImplementationTU;
  }
};

/// Return true if the given declaration corresponds to a local symbol.
bool isLocalSymbol(const NamedDecl *D, const LangOptions &LangOpts);

} // end namespace tooling
} // end namespace clang

#endif // LLVM_CLANG_TOOLING_REFACTOR_SYMBOL_OPERATION_H


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bull. Gov. Forest Exp. St. Tokyo 57: 104 (1952)

#### Original name
Polyporus mastoporus Lév., 1844

### Remarks
null


text:
import React, {useContext} from 'react';
import {
   EuiCallOut,
   EuiHeaderLink,
   EuiHeaderLinks,
   EuiPage,
   EuiPageBody,
   EuiPageContent,
   EuiPageContentBody,
   EuiPageSideBar,
   EuiPanel,
   EuiSpacer,
   EuiTab,
   EuiTabs,
} from "@elastic/eui";
import {useSelector} from "react-redux";
import {RecordPanel} from "./RecordPanel";
import {Breadcrumbs} from "../template/Breadcrumbs";
import {TreeView} from "./TreeView";
import {ThrottledResultTable} from "./ResultTable";
import {EditorToolbar} from "./EditorToolbar";
import {WorkbenchEditor} from "./editor";
import {QueryHistoryTable} from "./QueryHistoryTable";
import {setSelectedTab} from "./workbenchSlice";
import {useNavigate} from "react-router-dom";
import {ExecutionAnalysis} from "./ExecutionAnalysis";
import store from "../store";
import {LicenseTierContext, tiers} from "../license/License";
import {WorkbenchUpgradePanel} from "./WorkbenchUpgradePanel";

export const WorkbenchPage = () => {

   const history = useNavigate();
   const state = useSelector(state => state.console)
   const selectedTab = state.selectedTab;
   const error = useSelector(state => state.execution.error);

   const tier = useContext(LicenseTierContext)
   const allow = tier !== tiers.Free

   function changeTab(tab) {
      store.dispatch(setSelectedTab(tab));
   }

   let tabContent = 0;
   switch (selectedTab) {
      default:
      case 0:
         tabContent = <ThrottledResultTable/>
         break;
      case 1:
         tabContent = <ThrottledResultTable/>
         break;
      case 2:
         tabContent = <QueryHistoryTable/>
         break;
      case 3:
         tabContent = <ExecutionAnalysis/>
         break;
   }

   return (
      <>
         <Breadcrumbs
            breadcrumbs={[
               {
                  text: 'Workbench',
               },
            ]}
            right={
               <EuiHeaderLinks>
                  <EuiHeaderLink iconType="help"
                                 onClick={() => history("/workbench/sqlref")}>SQL Reference</EuiHeaderLink>
                  <EuiHeaderLink iconType="indexRuntime"
                                 onClick={() => history("/workbench/views")}>Manage Views</EuiHeaderLink>
               </EuiHeaderLinks>
            }/>
         <EuiPage paddingSize="s" grow={true}>
            <EuiPageSideBar className={"sidebar-width-xl"}>
               <EuiPanel paddingSize="m">
                  {allow && <TreeView/>}
               </EuiPanel>
               <EuiSpacer size="s"/>
               <RecordPanel/>
            </EuiPageSideBar>
            <EuiPageBody panelled grow={true} min-height={1000}>
               <EuiPageContent
                  paddingSize="none"
                  color="transparent"
                  borderRadius="none"
                  grow={true}>
                  <EuiPageContentBody grow={1}>
                     {!allow && <WorkbenchUpgradePanel/>}
                     {allow && <EditorToolbar/>}
                     {allow && <EuiSpacer/>}
                     {error && <>
                        <EuiCallOut size="s" title={error} color="danger" iconType="alert"/>
                        <EuiSpacer/>
                     </>
                     }
                     {allow && <WorkbenchEditor height={260}/>}
                     {allow && <EuiTabs size="m">
                        <EuiTab onClick={() => changeTab(0)} isSelected={selectedTab === 0}>Results Grid</EuiTab>
                        <EuiTab onClick={() => changeTab(2)} isSelected={selectedTab === 2}>Query History</EuiTab>
                        <EuiTab onClick={() => changeTab(3)} isSelected={selectedTab === 3}>Execution Analysis</EuiTab>
                     </EuiTabs>}
                     <EuiSpacer size="l"/>
                     {allow && tabContent}
                  </EuiPageContentBody>
               </EuiPageContent>
            </EuiPageBody>
         </EuiPage>
      </>
   );
}


text:
const express = require('express')
const path = require('path')
const webpack = require('webpack')
const logger = require('../build/lib/logger')
const webpackConfig = require('../build/webpack.config')
const project = require('../project.config')
const compress = require('compression')
const TwitterStreamChannels = require('twitter-stream-channels')
const credentials = require('../twitter-credentials.json')
const client = new TwitterStreamChannels(credentials)
const ObjectID = require('mongodb').ObjectID
const MongoClient = require('mongodb').MongoClient
let db;

MongoClient.connect("mongodb://dqianthebest:password@ds131900.mlab.com:31900/heroku_n36xdb93", function(err, database) {
  if(err) throw err;

  db = database;

  // Start the application after the database connection is ready
});

const yahooFinance = require('yahoo-finance');
const app = express()
app.use(compress())
// Create our stocks and their associated keywords to filter
const channels = {
  "google" : ['googl', 'google'],
  "facebook" : ['facebook', 'mark zuckerberg', 'oculus'],
  "apple" : ['apple inc', 'apple', 'tim cook'],
  "test" : ['giuseppe'],
}

const stream = client.streamChannels({track:channels, timeout:50000})

// Handle web sockets
const http = require('http').Server(app)
let io = require('socket.io')(http)

io = io.on('connection', function (socket) {
  console.log('user connected');
  socket.on('disconnect', function () {
    console.log('user disconnected');
  });

  // Stream out information related to google
  stream.on('channels/google',function(tweet){
		//socket.emit('googleTweet', tweet.text);
        socket.emit('googleTweet', tweet);
  });

  // Stream out information related to facebook
  stream.on('channels/facebook',function(tweet){
    //socket.emit('facebookTweet', tweet.text);
    socket.emit('facebookTweet', tweet);
	});

    // Stream out information related to apple
    stream.on('channels/apple',function(tweet){
      //socket.emit('facebookTweet', tweet.text);
      socket.emit('appleTweet', tweet);
  	});

    // Stream out information related to test
    stream.on('channels/test',function(tweet){
      //socket.emit('facebookTweet', tweet.text);
      socket.emit('testTweet', tweet);
    });

    socket.on('getStockInfo', function(stockname) {
//        console.log('getting stock info about ' + stockname);

        yahooFinance.quote({
          symbol: stockname,
          modules: [ 'price' ]
      }, function (err, data) {
              console.log('getting stock info about ' + stockname);
              if (err){
                  return;
              }
              var priceInfo =
                  {
                      company: data.price.longName,
                      regularMarketPrice: data.price.regularMarketPrice,
                      regularMarketTime: data.price.regularMarketTime,
                      exchange: data.price.exchange,
                      currency: data.price.currency,
                      marketChange: data.price.regularMarketChange,
                  }
              socket.emit('stockPriceInfo', priceInfo);
        });
    });

});

// Socket listens on port 3002
http.listen(3002, function (err) {
  if (err) {
    return logger.error(err.message);
  }
});
// ------------------------------------
// Apply Webpack HMR Middleware
// ------------------------------------
if (project.env === 'development') {
  const compiler = webpack(webpackConfig)

  logger.info('Enabling webpack development and HMR middleware')
  app.use(require('webpack-dev-middleware')(compiler, {
    publicPath  : webpackConfig.output.publicPath,
    contentBase : path.resolve(project.basePath, project.srcDir),
    hot         : true,
    quiet       : false,
    noInfo      : false,
    lazy        : false,
    stats       : 'normal',
  }))
  app.use(require('webpack-hot-middleware')(compiler, {
    path: '/__webpack_hmr'
  }))

  // get ratings
  app.get('/api/rate', function (req, res ) {
    let stockId = req.query.stockId;

    // retrieve from db
    db
      .collection("stock")
      .findOne({_id: stockId}, function (err,doc) {
        if ( err ) { return res.end() }

        return res.json(doc)
      })
  })

  app.get('/api/articles/:stockId', function(req, res) {
    const stockId = req.params.stockId;
    let objects = [];
    //console.log(stockId);
    db.collection("stock").findOne({ _id: stockId }, { articles: 1 }, function(err, doc) {
      if (err || !doc || !doc.articles) {
        res.end();
        return;
      }
      for (let i = 0; i < doc.articles.length; i++) {
        objects[i] = new ObjectID(doc.articles[i]);
      }
      db.collection("article").find({"_id" : {"$in" : objects}}).toArray(function(err, docs) {
        res.json(docs);
      });
    });

  });

  // Serve static assets from ~/public since Webpack is unaware of
  // these files. This middleware doesn't need to be enabled outside
  // of development since this directory will be copied into ~/dist
  // when the application is compiled.
  app.use(express.static(path.resolve(project.basePath, 'public')))

  // This rewrites all routes requests to the root /index.html file
  // (ignoring file requests). If you want to implement universal
  // rendering, you'll want to remove this middleware.
  app.use('*', function (req, res, next) {
    const filename = path.join(compiler.outputPath, 'index.html')
    compiler.outputFileSystem.readFile(filename, (err, result) => {
      if (err) {
        return next(err)
      }
      res.set('content-type', 'text/html')
      res.send(result)
      res.end()
    })
  })
} else {
  logger.warn(
    'Server is being run outside of live development mode, meaning it will ' +
    'only serve the compiled application bundle in ~/dist. Generally you ' +
    'do not need an application server for this and can instead use a web ' +
    'server such as nginx to serve your static files. See the "deployment" ' +
    'section in the README for more information on deployment strategies.'
  )

  // Serving ~/dist by default. Ideally these files should be served by
  // the web server and not the app server, but this helps to demo the
  // server in production.
  app.use(express.static(path.resolve(project.basePath, project.outDir)))
}

module.exports = app


text:
using System.Xml;
using System.Collections;

namespace System.Runtime.Serialization
{
    // NOTE: XmlReader methods that are not needed have been left un-implemented

    internal class ExtensionDataReader : XmlReader
    {
        private enum ExtensionDataNodeType
        {
            None,
            Element,
            EndElement,
            Text,
            Xml,
            ReferencedElement,
            NullElement,
        }

        private ElementData[] _elements;
        private ElementData _element;
        private ElementData _nextElement;

        private ReadState _readState = ReadState.Initial;
        private readonly ExtensionDataNodeType _internalNodeType;
        private XmlNodeType _nodeType;
        private int _depth;
        private string _localName;
        private string _ns;
        private string _prefix;
        private string _value;
        private int _attributeCount;
        private int _attributeIndex;

        private static readonly object s_prefixLock = new object();

#pragma warning disable 0649
        private readonly XmlNodeReader _xmlNodeReader;
#pragma warning restore 0649

        private readonly XmlObjectSerializerReadContext _context;

        private static readonly Hashtable s_nsToPrefixTable = new Hashtable();

        private static readonly Hashtable s_prefixToNsTable = new Hashtable();

        static ExtensionDataReader()
        {
            AddPrefix(Globals.XsiPrefix, Globals.SchemaInstanceNamespace);
            AddPrefix(Globals.SerPrefix, Globals.SerializationNamespace);
            AddPrefix(string.Empty, string.Empty);
        }

        internal ExtensionDataReader(XmlObjectSerializerReadContext context)
        {
            _attributeIndex = -1;
            _context = context;
        }

        internal IDataNode GetCurrentNode()
        {
            IDataNode retVal = _element.dataNode;
            Skip();
            return retVal;
        }

        internal void Reset()
        {
            _localName = null;
            _ns = null;
            _prefix = null;
            _value = null;
            _attributeCount = 0;
            _attributeIndex = -1;
            _depth = 0;
            _element = null;
            _nextElement = null;
            _elements = null;
        }

        private bool IsXmlDataNode { get { return (_internalNodeType == ExtensionDataNodeType.Xml); } }

        public override XmlNodeType NodeType { get { return IsXmlDataNode ? _xmlNodeReader.NodeType : _nodeType; } }
        public override string LocalName { get { return IsXmlDataNode ? _xmlNodeReader.LocalName : _localName; } }
        public override string NamespaceURI { get { return IsXmlDataNode ? _xmlNodeReader.NamespaceURI : _ns; } }
        public override string Prefix { get { return IsXmlDataNode ? _xmlNodeReader.Prefix : _prefix; } }
        public override string Value { get { return IsXmlDataNode ? _xmlNodeReader.Value : _value; } }
        public override int Depth { get { return IsXmlDataNode ? _xmlNodeReader.Depth : _depth; } }
        public override int AttributeCount { get { return IsXmlDataNode ? _xmlNodeReader.AttributeCount : _attributeCount; } }
        public override bool EOF { get { return IsXmlDataNode ? _xmlNodeReader.EOF : (_readState == ReadState.EndOfFile); } }
        public override ReadState ReadState { get { return IsXmlDataNode ? _xmlNodeReader.ReadState : _readState; } }
        public override bool IsEmptyElement { get { return IsXmlDataNode ? _xmlNodeReader.IsEmptyElement : false; } }
        public override bool IsDefault { get { return IsXmlDataNode ? _xmlNodeReader.IsDefault : base.IsDefault; } }
        //public override char QuoteChar { get { return IsXmlDataNode ? xmlNodeReader.QuoteChar : base.QuoteChar; } }
        public override XmlSpace XmlSpace { get { return IsXmlDataNode ? _xmlNodeReader.XmlSpace : base.XmlSpace; } }
        public override string XmlLang { get { return IsXmlDataNode ? _xmlNodeReader.XmlLang : base.XmlLang; } }
        public override string this[int i] { get { return IsXmlDataNode ? _xmlNodeReader[i] : GetAttribute(i); } }
        public override string this[string name] { get { return IsXmlDataNode ? _xmlNodeReader[name] : GetAttribute(name); } }
        public override string this[string name, string namespaceURI] { get { return IsXmlDataNode ? _xmlNodeReader[name, namespaceURI] : GetAttribute(name, namespaceURI); } }

        public override bool MoveToFirstAttribute()
        {
            if (IsXmlDataNode)
                return _xmlNodeReader.MoveToFirstAttribute();

            if (_attributeCount == 0)
                return false;
            MoveToAttribute(0);
            return true;
        }

        public override bool MoveToNextAttribute()
        {
            if (IsXmlDataNode)
                return _xmlNodeReader.MoveToNextAttribute();

            if (_attributeIndex + 1 >= _attributeCount)
                return false;
            MoveToAttribute(_attributeIndex + 1);
            return true;
        }

        public override void MoveToAttribute(int index)
        {
            if (IsXmlDataNode)
                _xmlNodeReader.MoveToAttribute(index);
            else
            {
                if (index < 0 || index >= _attributeCount)
                    throw new XmlException(SR.InvalidXmlDeserializingExtensionData);

                _nodeType = XmlNodeType.Attribute;
                AttributeData attribute = _element.attributes[index];
                _localName = attribute.localName;
                _ns = attribute.ns;
                _prefix = attribute.prefix;
                _value = attribute.value;
                _attributeIndex = index;
            }
        }

        public override string GetAttribute(string name, string namespaceURI)
        {
            if (IsXmlDataNode)
                return _xmlNodeReader.GetAttribute(name, namespaceURI);

            for (int i = 0; i < _element.attributeCount; i++)
            {
                AttributeData attribute = _element.attributes[i];
                if (attribute.localName == name && attribute.ns == namespaceURI)
                    return attribute.value;
            }

            return null;
        }

        public override bool MoveToAttribute(string name, string namespaceURI)
        {
            if (IsXmlDataNode)
                return _xmlNodeReader.MoveToAttribute(name, _ns);

            for (int i = 0; i < _element.attributeCount; i++)
            {
                AttributeData attribute = _element.attributes[i];
                if (attribute.localName == name && attribute.ns == namespaceURI)
                {
                    MoveToAttribute(i);
                    return true;
                }
            }

            return false;
        }

        public override bool MoveToElement()
        {
            if (IsXmlDataNode)
                return _xmlNodeReader.MoveToElement();

            if (_nodeType != XmlNodeType.Attribute)
                return false;

            SetElement();
            return true;
        }

        private void SetElement()
        {
            _nodeType = XmlNodeType.Element;
            _localName = _element.localName;
            _ns = _element.ns;
            _prefix = _element.prefix;
            _value = string.Empty;
            _attributeCount = _element.attributeCount;
            _attributeIndex = -1;
        }

        public override string LookupNamespace(string prefix)
        {
            if (IsXmlDataNode)
                return _xmlNodeReader.LookupNamespace(prefix);

            return (string)s_prefixToNsTable[prefix];
        }

        public override void Skip()
        {
            if (IsXmlDataNode)
                _xmlNodeReader.Skip();
            else
            {
                if (ReadState != ReadState.Interactive)
                    return;
                MoveToElement();
                if (IsElementNode(_internalNodeType))
                {
                    int depth = 1;
                    while (depth != 0)
                    {
                        if (!Read())
                            throw new XmlException(SR.InvalidXmlDeserializingExtensionData);

                        if (IsElementNode(_internalNodeType))
                            depth++;
                        else if (_internalNodeType == ExtensionDataNodeType.EndElement)
                        {
                            ReadEndElement();
                            depth--;
                        }
                    }
                }
                else
                    Read();
            }
        }

        private bool IsElementNode(ExtensionDataNodeType nodeType)
        {
            return (nodeType == ExtensionDataNodeType.Element ||
                nodeType == ExtensionDataNodeType.ReferencedElement ||
                nodeType == ExtensionDataNodeType.NullElement);
        }

        protected override void Dispose(bool disposing)
        {
            if (IsXmlDataNode)
                _xmlNodeReader.Dispose();
            else
            {
                Reset();
                _readState = ReadState.Closed;
            }

            base.Dispose(disposing);
        }

        public override bool Read()
        {
            if (_nodeType == XmlNodeType.Attribute && MoveToNextAttribute())
                return true;

            MoveNext(_element.dataNode);

            switch (_internalNodeType)
            {
                case ExtensionDataNodeType.Element:
                case ExtensionDataNodeType.ReferencedElement:
                case ExtensionDataNodeType.NullElement:
                    PushElement();
                    SetElement();
                    break;

                case ExtensionDataNodeType.Text:
                    _nodeType = XmlNodeType.Text;
                    _prefix = string.Empty;
                    _ns = string.Empty;
                    _localName = string.Empty;
                    _attributeCount = 0;
                    _attributeIndex = -1;
                    break;

                case ExtensionDataNodeType.EndElement:
                    _nodeType = XmlNodeType.EndElement;
                    _prefix = string.Empty;
                    _ns = string.Empty;
                    _localName = string.Empty;
                    _value = string.Empty;
                    _attributeCount = 0;
                    _attributeIndex = -1;
                    PopElement();
                    break;

                case ExtensionDataNodeType.None:
                    if (_depth != 0)
                        throw new XmlException(SR.InvalidXmlDeserializingExtensionData);
                    _nodeType = XmlNodeType.None;
                    _prefix = string.Empty;
                    _ns = string.Empty;
                    _localName = string.Empty;
                    _value = string.Empty;
                    _attributeCount = 0;
                    _readState = ReadState.EndOfFile;
                    return false;

                case ExtensionDataNodeType.Xml:
                    // do nothing
                    break;

                default:
                    Fx.Assert("ExtensionDataReader in invalid state");
                    throw new SerializationException(SR.InvalidStateInExtensionDataReader);
            }
            _readState = ReadState.Interactive;
            return true;
        }

        public override string Name
        {
            get
            {
                if (IsXmlDataNode)
                {
                    return _xmlNodeReader.Name;
                }
                Fx.Assert("ExtensionDataReader Name property should only be called for IXmlSerializable");
                return string.Empty;
            }
        }

        public override bool HasValue
        {
            get
            {
                if (IsXmlDataNode)
                {
                    return _xmlNodeReader.HasValue;
                }
                Fx.Assert("ExtensionDataReader HasValue property should only be called for IXmlSerializable");
                return false;
            }
        }

        public override string BaseURI
        {
            get
            {
                if (IsXmlDataNode)
                {
                    return _xmlNodeReader.BaseURI;
                }
                Fx.Assert("ExtensionDataReader BaseURI property should only be called for IXmlSerializable");
                return string.Empty;
            }
        }

        public override XmlNameTable NameTable
        {
            get
            {
                if (IsXmlDataNode)
                {
                    return _xmlNodeReader.NameTable;
                }
                Fx.Assert("ExtensionDataReader NameTable property should only be called for IXmlSerializable");
                return null;
            }
        }

        public override string GetAttribute(string name)
        {
            if (IsXmlDataNode)
            {
                return _xmlNodeReader.GetAttribute(name);
            }
            Fx.Assert("ExtensionDataReader GetAttribute method should only be called for IXmlSerializable");
            return null;
        }

        public override string GetAttribute(int i)
        {
            if (IsXmlDataNode)
            {
                return _xmlNodeReader.GetAttribute(i);
            }
            Fx.Assert("ExtensionDataReader GetAttribute method should only be called for IXmlSerializable");
            return null;
        }

        public override bool MoveToAttribute(string name)
        {
            if (IsXmlDataNode)
            {
                return _xmlNodeReader.MoveToAttribute(name);
            }
            Fx.Assert("ExtensionDataReader MoveToAttribute method should only be called for IXmlSerializable");
            return false;
        }

        public override void ResolveEntity()
        {
            if (IsXmlDataNode)
            {
                _xmlNodeReader.ResolveEntity();
            }
            else
            {
                Fx.Assert("ExtensionDataReader ResolveEntity method should only be called for IXmlSerializable");
            }
        }

        public override bool ReadAttributeValue()
        {
            if (IsXmlDataNode)
            {
                return _xmlNodeReader.ReadAttributeValue();
            }
            Fx.Assert("ExtensionDataReader ReadAttributeValue method should only be called for IXmlSerializable");
            return false;
        }

        private void MoveNext(IDataNode dataNode)
        {
            throw NotImplemented.ByDesign;
        }

        private void PushElement()
        {
            GrowElementsIfNeeded();
            _elements[_depth++] = _element;
            if (_nextElement == null)
                _element = GetNextElement();
            else
            {
                _element = _nextElement;
                _nextElement = null;
            }
        }

        private void PopElement()
        {
            _prefix = _element.prefix;
            _localName = _element.localName;
            _ns = _element.ns;

            if (_depth == 0)
                return;

            _depth--;

            if (_elements != null)
            {
                _element = _elements[_depth];
            }
        }

        private void GrowElementsIfNeeded()
        {
            if (_elements == null)
                _elements = new ElementData[8];
            else if (_elements.Length == _depth)
            {
                ElementData[] newElements = new ElementData[_elements.Length * 2];
                Array.Copy(_elements, 0, newElements, 0, _elements.Length);
                _elements = newElements;
            }
        }

        private ElementData GetNextElement()
        {
            int nextDepth = _depth + 1;
            return (_elements == null || _elements.Length <= nextDepth || _elements[nextDepth] == null)
                ? new ElementData() : _elements[nextDepth];
        }

        internal static string GetPrefix(string ns)
        {
            ns = ns ?? string.Empty;
            string prefix = (string)s_nsToPrefixTable[ns];
            if (prefix == null)
            {
                lock (s_prefixLock)
                {
                    prefix = (string)s_nsToPrefixTable[ns];
                    if (prefix == null)
                    {
                        prefix = (ns == null || ns.Length == 0) ? string.Empty : "p" + s_nsToPrefixTable.Count;
                        AddPrefix(prefix, ns);
                    }
                }
            }
            return prefix;
        }

        private static void AddPrefix(string prefix, string ns)
        {
            s_nsToPrefixTable.Add(ns, prefix);
            s_prefixToNsTable.Add(prefix, ns);
        }
    }

#if USE_REFEMIT
    public class AttributeData
#else
    internal class AttributeData
#endif
    {
        public string prefix;
        public string ns;
        public string localName;
        public string value;
    }

#if USE_REFEMIT
    public class ElementData
#else
    internal class ElementData
#endif
    {
        public string localName;
        public string ns;
        public string prefix;
        public int attributeCount;
        public AttributeData[] attributes;
        public IDataNode dataNode;
        public int childElementIndex;

        public void AddAttribute(string prefix, string ns, string name, string value)
        {
            GrowAttributesIfNeeded();
            AttributeData attribute = attributes[attributeCount];
            if (attribute == null)
                attributes[attributeCount] = attribute = new AttributeData();
            attribute.prefix = prefix;
            attribute.ns = ns;
            attribute.localName = name;
            attribute.value = value;
            attributeCount++;
        }

        private void GrowAttributesIfNeeded()
        {
            if (attributes == null)
                attributes = new AttributeData[4];
            else if (attributes.Length == attributeCount)
            {
                AttributeData[] newAttributes = new AttributeData[attributes.Length * 2];
                Array.Copy(attributes, 0, newAttributes, 0, attributes.Length);
                attributes = newAttributes;
            }
        }
    }
}


text:
'use strict';

angular.module('app.players', ['ui.router'])

.config(['$urlRouterProvider','$stateProvider', function($urlRouterProvider,$stateProvider) {

  $stateProvider
        .state('dashboard.players', {
          url: '/players',
          views: {
            '' : {templateUrl: 'components/dashboard/dashboard.html'},
            'nav@dashboard': {templateUrl: 'components/nav/nav.html'},
            'body@dashboard': {
              templateUrl: 'components/partials/players/players.html',
              controller: 'PlayersController',
              controllerAs: 'players'
            }
          }
        })
}])

.controller('PlayersController', ['$http', '$filter', '$scope', function($http, $filter, $scope) {
  var players = this;

  $scope.playerFilter = false;

  players.all = [];
  players.today = [];

  //Get today's date in the same format
  var todaysDate = function(){
    var today = new Date();
    today = $filter('date')(today, 'fullDate');
    return (today);
  };

  //Toggle player filter between 'all' and 'today'
  $scope.playerToggle = function () {
    $scope.playerFilter = !$scope.playerFilter;
  };

  $http.get('api/players')
    .success(function(playerData){

      angular.copy(playerData, players.all);

      $http.get('api/visits?populate=player')
        .success(function(visits){

          angular.forEach(visits, function(visitData){
            var visit = $filter('date')(visitData.createdAt, 'fullDate');
            if (visit == todaysDate()){
              players.today.push(visitData.player);
              console.log(players.today);
            }

          });
        });
    });

}]);


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="test.IDao.RecieveMapper" >
  <resultMap id="BaseResultMap" type="test.domain.Recieve" >
    <result column="user_id" property="userId" jdbcType="INTEGER" />
    <result column="user_name" property="userName" jdbcType="VARCHAR" />
    <result column="is_view" property="isView" jdbcType="SMALLINT" />
    <result column="ad_id" property="adId" jdbcType="BIGINT" />
    <result column="ad_type" property="adType" jdbcType="TINYINT" />
    <result column="is_del" property="isDel" jdbcType="BIT" />
    <result column="crtime" property="crtime" jdbcType="TIMESTAMP" />
  </resultMap>
  <insert id="insert" parameterType="test.domain.Recieve" >
    insert into advertise_recieve_list_v (user_id, user_name, is_view,
      ad_id, ad_type, is_del, crtime
      )
    values (#{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{isView,jdbcType=SMALLINT},
      #{adId,jdbcType=BIGINT}, #{adType,jdbcType=TINYINT}, #{isDel,jdbcType=BIT}, #{crtime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="test.domain.Recieve" >
    insert into advertise_recieve_list_v
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="userId != null" >
        user_id,
      </if>
      <if test="userName != null" >
        user_name,
      </if>
      <if test="isView != null" >
        is_view,
      </if>
      <if test="adId != null" >
        ad_id,
      </if>
      <if test="adType != null" >
        ad_type,
      </if>
      <if test="isDel != null" >
        is_del,
      </if>
      <if test="crtime != null" >
        crtime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="userId != null" >
        #{userId,jdbcType=INTEGER},
      </if>
      <if test="userName != null" >
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="isView != null" >
        #{isView,jdbcType=SMALLINT},
      </if>
      <if test="adId != null" >
        #{adId,jdbcType=BIGINT},
      </if>
      <if test="adType != null" >
        #{adType,jdbcType=TINYINT},
      </if>
      <if test="isDel != null" >
        #{isDel,jdbcType=BIT},
      </if>
      <if test="crtime != null" >
        #{crtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
</mapper>


text:
Express middleware for redeploying Node.js app

## What's it do?
Redeploy a running Node.js app by just hitting
a URL exposed by the app.

## Requirements
The app must be running from a git repository,
and `git pull` must be sufficient to pull new code.

## Usage
```js
var express = require('express'),
    redeployer = require('@byondreal/redeployer');

var app = express();

app.use('/redeploy', redeployer('forever restartall'));

app.listen(5000);
```


text:
module DynamicImage
  module Model
    # = DynamicImage Model Variants
    #
    # Validates that all necessary attributes are valid. All of these are
    # managed by +DynamicImage::Model+, so this is mostly for enforcing
    # integrity.
    module Variants
      extend ActiveSupport::Concern

      included do
        has_many :variants,
                 as: :image,
                 class_name: "DynamicImage::Variant",
                 dependent: :destroy

        before_update :clear_variants, if: :data_changed?
      end

      private

      def clear_variants
        variants.destroy_all
      end
    end
  end
end


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.authorization.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentScheduleRequestInner;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Role assignment schedule request list operation result. */
@Fluent
public final class RoleAssignmentScheduleRequestListResult {
    /*
     * Role assignment schedule request list.
     */
    @JsonProperty(value = "value")
    private List<RoleAssignmentScheduleRequestInner> value;

    /*
     * The URL to use for getting the next set of results.
     */
    @JsonProperty(value = "nextLink")
    private String nextLink;

    /** Creates an instance of RoleAssignmentScheduleRequestListResult class. */
    public RoleAssignmentScheduleRequestListResult() {
    }

    /**
     * Get the value property: Role assignment schedule request list.
     *
     * @return the value value.
     */
    public List<RoleAssignmentScheduleRequestInner> value() {
        return this.value;
    }

    /**
     * Set the value property: Role assignment schedule request list.
     *
     * @param value the value value to set.
     * @return the RoleAssignmentScheduleRequestListResult object itself.
     */
    public RoleAssignmentScheduleRequestListResult withValue(List<RoleAssignmentScheduleRequestInner> value) {
        this.value = value;
        return this;
    }

    /**
     * Get the nextLink property: The URL to use for getting the next set of results.
     *
     * @return the nextLink value.
     */
    public String nextLink() {
        return this.nextLink;
    }

    /**
     * Set the nextLink property: The URL to use for getting the next set of results.
     *
     * @param nextLink the nextLink value to set.
     * @return the RoleAssignmentScheduleRequestListResult object itself.
     */
    public RoleAssignmentScheduleRequestListResult withNextLink(String nextLink) {
        this.nextLink = nextLink;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (value() != null) {
            value().forEach(e -> e.validate());
        }
    }
}


text:
<archimate:TechnologyService
    xmlns:archimate="http://www.archimatetool.com/archimate"
    name="AzureRepos"
    id="ce8ce327-c9cc-4509-87c9-88efef243bbe"
    documentation="Unlimited free private repos

Get flexible, powerful Git hosting with effective code reviews and unlimited free repositories for all your ideas—from a one-person project to the world's largest ">
  <properties
      key="icon"
      value="/DevOps/AzureRepos.png"/>
  <properties
      key="icon size"
      value="50x50"/>
</archimate:TechnologyService>


text:
package com.microfocus.application.automation.tools.results;

import com.microfocus.application.automation.tools.results.projectparser.performance.JobLrScenarioResult;
import com.microfocus.application.automation.tools.results.projectparser.performance.LrJobResults;
import com.microfocus.application.automation.tools.model.ResultsPublisherModel;
import hudson.FilePath;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

/**
* RunResultRecorder Tester.
*
* @author <Authors name>
* @since <pre>??? 17, 2016</pre>
* @version 1.0
 */
@SuppressWarnings("squid:S2699")
public class RunResultRecorderTest {

@Before
public void before() throws Exception {
}

@After
public void after() throws Exception {
}

/**
*
* Method: getDescriptor()
*
*/
@Test
public void testGetDescriptor() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)
*
*/
@Test
public void testPerform() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: getProjectAction(AbstractProject<?, ?> project)
*
*/
@Test
public void testGetProjectAction() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: getProjectActions(AbstractProject<?, ?> project)
*
*/
@Test
public void testGetProjectActions() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: createAggregator(MatrixBuild build, Launcher launcher, BuildListener listener)
*
*/
@Test
public void testCreateAggregator() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: getRequiredMonitorService()
*
*/
@Test
public void testGetRequiredMonitorService() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: getResultsPublisherModel()
*
*/
@Test
public void testGetResultsPublisherModel() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: getDisplayName()
*
*/
@Test
public void testGetDisplayName() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: isApplicable(@SuppressWarnings("rawtypes") Class<? extends AbstractProject> jobType)
*
*/
@Test
public void testIsApplicable() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: getReportArchiveModes()
*
*/
@Test
public void testGetReportArchiveModes() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: accept(File file)
*
*/
@Test
public void testAccept() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: sort(List<ExtensionComponent<Descriptor<Publisher>>> r)
*
*/
@Test
public void testSort() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: compare(ExtensionComponent<Descriptor<Publisher>> lhs, ExtensionComponent<Descriptor<Publisher>> rhs)
*
*/
@Test
public void testCompare() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: addNotifier(Descriptor<Publisher> d)
*
*/
@Test
public void testAddNotifier() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: addRecorder(Descriptor<Publisher> d)
*
*/
@Test
public void testAddRecorder() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: add(Descriptor<Publisher> d)
*
*/
@Test
public void testAddD() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: add(int index, Descriptor<Publisher> d)
*
*/
@Test
public void testAddForIndexD() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: get(int index)
*
*/
@Test
public void testGet() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: size()
*
*/
@Test
public void testSize() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: iterator()
*
*/
@Test
public void testIterator() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: remove(Object o)
*
*/
@Test
public void testRemove() throws Exception {
//TODO: Test goes here...
}

/**
*
* Method: writeReportMetaData2XML(List<ReportMetaData> htmlReportsInfo, String xmlFile)
*
*/
@Test
public void testWriteReportMetaData2XML() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("writeReportMetaData2XML", List<ReportMetaData>.class, String.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: collectAndPrepareHtmlReports(AbstractBuild build, BuildListener listener, List<ReportMetaData> htmlReportsInfo)
*
*/
@Test
public void testCollectAndPrepareHtmlReports() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("collectAndPrepareHtmlReports", AbstractBuild.class, BuildListener.class, List<ReportMetaData>.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: archiveTestsReport(AbstractBuild<?, ?> build, BuildListener listener, List<String> resultFiles, TestResult testResult)
*
*/
@Test
public void testArchiveTestsReport() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("archiveTestsReport", AbstractBuild<?,.class, BuildListener.class, List<String>.class, TestResult.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: copyRunReport(FilePath reportFolder, String testFolderPath, File buildDir, String scenerioName)
*
*/
@Test
public void testCopyRunReport() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("copyRunReport", FilePath.class, String.class, File.class, String.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: buildJobDataset(AbstractBuild<?, ?> build, BuildListener listener)
*
*/
@Test
public void testBuildJobDataset() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("buildJobDataset", AbstractBuild<?,.class, BuildListener.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

@Test
public void testCreatingJobDataSet()
{
    try {
    RunResultRecorder runResultRecorder = new RunResultRecorder(ResultsPublisherModel.CreateHtmlReportResults.getValue());
    Method parseScenarioResults = runResultRecorder.getClass().getDeclaredMethod("parseScenarioResults", FilePath.class);
    parseScenarioResults.setAccessible(true);

    ArrayList<FilePath> runReportList = new ArrayList<FilePath>(0);
    runReportList.add(new FilePath(new File(getClass().getResource("RunReport.xml").getPath())));
    runReportList.add(new FilePath(new File(getClass().getResource("RunReport_sc5.xml").getPath())));
        LrJobResults jobResults = new LrJobResults();

    // read each RunReport.xml
    for (FilePath reportFilePath : runReportList) {
        JobLrScenarioResult result = null;
        JobLrScenarioResult jobLrScenarioResult = (JobLrScenarioResult) parseScenarioResults.invoke(runResultRecorder,
                reportFilePath);
        jobResults.addScenario(jobLrScenarioResult);
    }
    System.out.println("");
    } catch(NoSuchMethodException e) {
        e.printStackTrace();
    } catch(IllegalAccessException e) {
        e.printStackTrace();

    } catch(InvocationTargetException e) {
        e.printStackTrace();
    }

}

/**
*
* Method: getJobLrScenarioResult(FilePath slaFilePath)
*
*/
@Test
public void testParseScenarioResults() throws Exception {

	RunResultRecorder runResultRecorder = new RunResultRecorder(ResultsPublisherModel.CreateHtmlReportResults.getValue());
	FilePath runReportPath = new FilePath(new File(getClass().getResource("RunReport.xml").getPath()));
    JobLrScenarioResult result = null;
    try {
	   	Method method = runResultRecorder.getClass().getDeclaredMethod("parseScenarioResults", FilePath.class);
		method.setAccessible(true);
        result = (JobLrScenarioResult) method.invoke(runResultRecorder, runReportPath);
    } catch(NoSuchMethodException e) {
		e.printStackTrace();
	} catch(IllegalAccessException e) {
		e.printStackTrace();

	} catch(InvocationTargetException e) {
		e.printStackTrace();

	}

    assertNotNull("RunResult parser result is empty", result);
    assertEquals(Integer.valueOf(344), result.vUserSum.get("Passed"));
    assertEquals(Integer.valueOf(364), result.vUserSum.get("Stopped"));
    assertEquals(Integer.valueOf(292), result.vUserSum.get("Failed"));
    assertEquals(Integer.valueOf(0), result.vUserSum.get("Error"));
    assertEquals(Integer.valueOf(1000), result.vUserSum.get("Count"));

}

/**
*
* Method: processScenarioStats(JobLrScenarioResult jobLrScenarioResult, Document doc)
*
*/
@Test
public void testProcessScenarioStats() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("processScenarioStats", JobLrScenarioResult.class, Document.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: processSLA(JobLrScenarioResult jobLrScenarioResult, Document doc)
*
*/
@Test
public void testProcessSLA() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("processSLA", JobLrScenarioResult.class, Document.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: processSlaRule(JobLrScenarioResult jobLrScenarioResult, Element slaRuleElement, LrTest.SLA_GOAL slaGoal)
*
*/
@Test
public void testProcessSlaRule() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("processSlaRule", JobLrScenarioResult.class, Element.class, LrTest.SLA_GOAL.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: addTimeRanges(TimeRangeResult transactionTimeRange, Element slaRuleElement)
*
*/
@Test
public void testAddTimeRanges() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("addTimeRanges", TimeRangeResult.class, Element.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: archiveFolder(FilePath reportFolder, String testStatus, FilePath archivedFile, BuildListener listener)
*
*/
@Test
public void testArchiveFolder() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("archiveFolder", FilePath.class, String.class, FilePath.class, BuildListener.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: createHtmlReport(FilePath reportFolder, String testFolderPath, File artifactsDir, List<String> reportNames, TestResult testResult)
*
*/
@Test
public void testCreateHtmlReport() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("createHtmlReport", FilePath.class, String.class, File.class, List<String>.class, TestResult.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: createTransactionSummary(FilePath reportFolder, String testFolderPath, File artifactsDir, List<String> reportNames, TestResult testResult)
*
*/
@Test
public void testCreateTransactionSummary() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("createTransactionSummary", FilePath.class, String.class, File.class, List<String>.class, TestResult.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: outputReportFiles(List<String> reportNames, File reportDirectory, TestResult testResult, boolean tranSummary)
*
*/
@Test
public void testOutputReportFiles() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("outputReportFiles", List<String>.class, File.class, TestResult.class, boolean.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: write2XML(Document document, String filename)
*
*/
@Test
public void testWrite2XML() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("write2XML", Document.class, String.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: getUniqueZipFileNameInFolder(ArrayList<String> names, String fileName)
*
*/
@Test
public void testGetUniqueZipFileNameInFolder() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("getUniqueZipFileNameInFolder", ArrayList<String>.class, String.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

/**
*
* Method: classify(Descriptor<Publisher> d)
*
*/
@Test
public void testClassify() throws Exception {
//TODO: Test goes here...
/*
try {
   Method method = RunResultRecorder.getClass().getMethod("classify", Descriptor<Publisher>.class);
   method.setAccessible(true);
   method.invoke(<Object>, <Parameters>);
} catch(NoSuchMethodException e) {
} catch(IllegalAccessException e) {
} catch(InvocationTargetException e) {
}
*/
}

}


text:
namespace arangodb { namespace fuerte { inline namespace v1 {
const std::string fu_accept_key("accept");
const std::string fu_authorization_key("authorization");
const std::string fu_content_length_key("content-length");
const std::string fu_content_type_key("content-type");
const std::string fu_keep_alive_key("keep-alive");

struct MessageHeader {
  /// arangodb message format version
  short version() const { return _version; }
  void setVersion(short v) { _version = v; }

 public:
  // Header metadata helpers#
  template<typename K, typename V>
  void addMeta(K&& key, V&& value) {
    if (fu_accept_key == key) {
      _acceptType = to_ContentType(value);
      if (_acceptType != ContentType::Custom) {
        return;
      }
    } else if (fu_content_type_key == key) {
      _contentType = to_ContentType(value);
      if (_contentType != ContentType::Custom) {
        return;
      }
    }
    this->_meta.emplace(std::forward<K>(key), std::forward<V>(value));
  }

  void setMeta(StringMap);
  StringMap const& meta() const { return _meta; }

  // Get value for header metadata key, returns empty string if not found.
  std::string const& metaByKey(std::string const& key) const {
    bool unused;
    return this->metaByKey(key, unused);
  }
  std::string const& metaByKey(std::string const& key, bool& found) const;

  // content type accessors
  ContentType contentType() const { return _contentType; }
  void contentType(ContentType type) {
    _contentType = type;
  }
  void contentType(std::string const& type) {
    addMeta(fu_content_type_key, type);
  }

 protected:
  StringMap _meta;  /// Header meta data (equivalent to HTTP headers)
  short _version;
  ContentType _contentType = ContentType::Unset;
  ContentType _acceptType = ContentType::Unset;
};

struct RequestHeader final : public MessageHeader {
  /// Database that is the target of the request
  std::string database;

  /// Local path of the request (without "/_db/" prefix)
  std::string path;

  /// Query parameters
  StringMap parameters;

  /// HTTP method
  RestVerb restVerb = RestVerb::Illegal;

 public:
  // accept header accessors
  ContentType acceptType() const { return _acceptType; }
  void acceptType(ContentType type) { _acceptType = type; }
  void acceptType(std::string const& type);

  // query parameter helpers
  void addParameter(std::string const& key, std::string const& value);

  /// @brief analyze path and split into components
  /// strips /_db/<name> prefix, sets db name and fills parameters
  void parseArangoPath(std::string const&);
};

struct ResponseHeader final : public MessageHeader {
  friend class Response;

  /// Response code
  StatusCode responseCode = StatusUndefined;

  MessageType responseType() const { return _responseType; }

 private:
  MessageType _responseType = MessageType::Response;
};

// Message is base class for message being send to (Request) or
// from (Response) a server.
class Message {
 protected:
  Message() = default;
  virtual ~Message() = default;

 public:
  /// Message type
  virtual MessageType type() const = 0;
  virtual MessageHeader const& messageHeader() const = 0;

  ///////////////////////////////////////////////
  // get payload
  ///////////////////////////////////////////////

  /// get slices if the content-type is velocypack
  virtual std::vector<velocypack::Slice> slices() const = 0;
  virtual asio_ns::const_buffer payload() const = 0;
  virtual std::size_t payloadSize() const = 0;
  std::string payloadAsString() const {
    auto p = payload();
    return std::string(asio_ns::buffer_cast<char const*>(p),
                       asio_ns::buffer_size(p));
  }

  /// get the content as a slice
  velocypack::Slice slice() const {
    auto slices = this->slices();
    if (!slices.empty()) {
      return slices[0];
    }
    return velocypack::Slice::noneSlice();
  }

  /// content-type header accessors
  ContentType contentType() const;

  bool isContentTypeJSON() const;
  bool isContentTypeVPack() const;
  bool isContentTypeHtml() const;
  bool isContentTypeText() const;
};

// Request contains the message send to a server in a request.
class Request final : public Message {
 public:
  static constexpr std::chrono::milliseconds defaultTimeout =
      std::chrono::milliseconds(300 * 1000);

  Request(RequestHeader messageHeader = RequestHeader())
      : header(std::move(messageHeader)), _timeout(defaultTimeout) {}

  /// @brief request header
  RequestHeader header;

  MessageType type() const override { return MessageType::Request; }
  MessageHeader const& messageHeader() const override { return header; }

  ///////////////////////////////////////////////
  // header accessors
  ///////////////////////////////////////////////

  // accept header accessors
  ContentType acceptType() const;

  ///////////////////////////////////////////////
  // add payload
  ///////////////////////////////////////////////
  void addVPack(velocypack::Slice const slice);
  void addVPack(velocypack::Buffer<uint8_t> const& buffer);
  void addVPack(velocypack::Buffer<uint8_t>&& buffer);
  void addBinary(uint8_t const* data, std::size_t length);

  ///////////////////////////////////////////////
  // get payload
  ///////////////////////////////////////////////

  /// @brief get velocypack slices contained in request
  /// only valid iff the data was added via addVPack
  std::vector<velocypack::Slice> slices() const override;
  asio_ns::const_buffer payload() const override;
  std::size_t payloadSize() const override;

  // get timeout, 0 means no timeout
  inline std::chrono::milliseconds timeout() const { return _timeout; }
  // set timeout
  void timeout(std::chrono::milliseconds timeout) { _timeout = timeout; }

 private:
  velocypack::Buffer<uint8_t> _payload;
  std::chrono::milliseconds _timeout;
};

// Response contains the message resulting from a request to a server.
class Response : public Message {
 public:
  Response(ResponseHeader reqHeader = ResponseHeader())
      : header(std::move(reqHeader)), _payloadOffset(0) {}

  Response(Response const&) = delete;
  Response& operator=(Response const&) = delete;

  /// @brief request header
  ResponseHeader header;

  MessageType type() const override { return header._responseType; }
  MessageHeader const& messageHeader() const override { return header; }
  ///////////////////////////////////////////////
  // get / check status
  ///////////////////////////////////////////////

  // statusCode returns the (HTTP) status code for the request (200==OK).
  StatusCode statusCode() const noexcept { return header.responseCode; }
  // checkStatus returns true if the statusCode equals one of the given valid
  // code, false otherwise.
  bool checkStatus(std::initializer_list<StatusCode> validStatusCodes) const {
    auto actual = statusCode();
    for (auto code : validStatusCodes) {
      if (code == actual) {
        return true;
      }
    }
    return false;
  }
  // assertStatus throw an exception if the statusCode does not equal one of the
  // given valid codes.
  void assertStatus(std::initializer_list<StatusCode> validStatusCodes) {
    if (!checkStatus(validStatusCodes)) {
      throw std::runtime_error("invalid status " +
                               std::to_string(statusCode()));
    }
  }

  ///////////////////////////////////////////////
  // get/set payload
  ///////////////////////////////////////////////

  /// @brief validates and returns VPack response. Only valid for velocypack
  std::vector<velocypack::Slice> slices() const override;
  asio_ns::const_buffer payload() const override;
  std::size_t payloadSize() const override;
  std::shared_ptr<velocypack::Buffer<uint8_t>> copyPayload() const;
  std::shared_ptr<velocypack::Buffer<uint8_t>> stealPayload();

  /// @brief move in the payload
  void setPayload(velocypack::Buffer<uint8_t>&& buffer, std::size_t offset) {
    _payloadOffset = offset;
    _payload = std::move(buffer);
  }

 private:
  velocypack::Buffer<uint8_t> _payload;
  std::size_t _payloadOffset;
};
}}}  // namespace arangodb::fuerte::v1
#endif


text:
package cn.kenshinn.tsdb.kafka.plugin;

import cn.kenshinn.tsdb.thrift.rpc.AbstractTSDBRpcPlugin;
import cn.kenshinn.tsdb.thrift.rpc.TSDBWrapper;
import com.stumbleupon.async.Deferred;
import net.opentsdb.core.TSDB;
import net.opentsdb.stats.StatsCollector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author stliu <stliu@apache.org>
 * @date 3/11/15
 */
@SuppressWarnings("UnusedDeclaration")
public class KafkaConsumerRPCPlugin extends AbstractTSDBRpcPlugin {
    private final static Logger logger = LoggerFactory.getLogger(KafkaConsumerRPCPlugin.class);

//    private static volatile KafkaConsumerGroups kafkaConsumerGroups;
//    private final ExecutorService executorService = Executors.newCachedThreadPool();

    private static volatile KafkaConsumerGroupsMultiTopic kafkaConsumerGroupsMultiTopic;

    @Override
    public void initialize(TSDB tsdb) {
        kafkaConsumerGroupsMultiTopic = new KafkaConsumerGroupsMultiTopic(new TSDBWrapper(tsdb));
        kafkaConsumerGroupsMultiTopic.start();

//        kafkaConsumerGroups = new KafkaConsumerGroups(new TSDBWrapper(tsdb));
//        executorService.submit(kafkaConsumerGroups);
    }

    @Override
    public Deferred<Object> shutdown() {
        Deferred<Object> deferred = new Deferred<>();
        try {
            kafkaConsumerGroupsMultiTopic.close();
//            kafkaConsumerGroups.close();
//            executorService.shutdown();
        } catch (Exception e) {
            logger.error("Failed to stop kafka consumer group", e);
        }
        return deferred;
    }

    @Override
    public void collectStats(StatsCollector statsCollector) {
    }
}


text:
module Monologue
  class Configuration
    include ConfigurationExtensions

    attr_accessor :disqus_shortname,
                    :site_name,
                    :site_subtitle,
                    :site_url,
                    :meta_description,
                    :meta_keyword,

                    :show_rss_icon,

                    :twitter_username,
                    :twitter_locale,

                    :facebook_like_locale,
                    :facebook_url,
                    :facebook_logo, #used in the open graph protocol to display an image when a post is liked

                    :google_plus_account_url,
                    :google_plusone_locale,

                    :linkedin_url,

                    :github_username,

                    :admin_force_ssl,
                    :posts_per_page,
                    :google_analytics_id,
                    :gauge_analytics_site_id,
                    :layout,
                    :sidebar

  end

  def self.config(&block)
    yield(Rails.application.config.monologue)
  end
end


text:
<META http-equiv="content-type" content="text/html;charset=iso-8859-9"/><meta name="viewport" content="width=device-width, initial-scale=1"><title>ac</title> <link rel="stylesheet"  href="css/jquery.mobile-1.2.0.css" />

MÜBAREK BUHARÝ

Geri

Evliyanýn meþhurlarýndan. Baba Þeyh Mübarek Buhari ismiyle tanýnmýþtýr. On beþinci asýrda
yaþamýþ bir alimdir. Doðum ve vefat tarihi kaynaklarda kaydedilmemiþtir. "Silsile-i aliyye"
denilen evliyanýn meþhurlarýndan olan Seyyid Emir Külal hazretlerinin oðlu Seyyid Emir
Hamza'nýn talebesidir. Seyyid Emir Külal'in talebesi olduðu da rivayet edilmiþtir. Evliyanýn
meþhurlarýndan olan Hace Muhammed Parisa, Mübarek Buhari'nin de sohbetinde bulunup
feyz almýþtýr.

Mübarek Buhari hazretleri, bir gün Muhammed Parisa hazretlerinin evine gitmiþti.
Muhammed Parisa, ondan, oðlu Ebü'n-Nasr için dua istedi. O da dua için Fatiha-i þerifeyi
okumaya baþladý. Fakat daha bitirmeden dýþarý çýkýp, kalan kýsmýný da dýþarýda okuyup
tamamladý. Bunun sebebini sorduklarýnda; "Ben Fatiha'yý okumaya baþlayýnca, eve o kadar
melek doldu ki, bana yer kalmadý zannedip dýþarý çýktým." dedi.

1) Reþehat Ayn-ül-Hayat; s.69

2) Ýslam Alimleri Ansiklopedisi; c.12, s.361