text:
/*
 * Licensed to the Sakai Foundation (SF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The SF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package org.sakaiproject.nakamura.docproxy.disk;

import static org.apache.sling.jcr.resource.JcrResourceConstants.SLING_RESOURCE_TYPE_PROPERTY;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.isA;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertEquals;
import static org.sakaiproject.nakamura.api.docproxy.DocProxyConstants.REPOSITORY_LOCATION;
import static org.sakaiproject.nakamura.api.docproxy.DocProxyConstants.RT_EXTERNAL_REPOSITORY_DOCUMENT;

import junit.framework.Assert;

import org.apache.sling.commons.testing.jcr.MockNode;
import org.apache.sling.commons.testing.jcr.MockValue;
import org.apache.sling.commons.testing.osgi.MockBundle;
import org.apache.sling.commons.testing.osgi.MockComponentContext;
import org.junit.Before;
import org.junit.Test;
import org.sakaiproject.nakamura.api.docproxy.DocProxyConstants;
import org.sakaiproject.nakamura.api.docproxy.DocProxyException;
import org.sakaiproject.nakamura.api.docproxy.ExternalDocumentResult;
import org.sakaiproject.nakamura.api.docproxy.ExternalDocumentResultMetadata;
import org.sakaiproject.nakamura.api.docproxy.ExternalSearchResultSet;
import org.sakaiproject.nakamura.util.IOUtils;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
import javax.jcr.Property;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.ValueFactory;
import javax.jcr.ValueFormatException;

/**
 *
 */
public class DiskProcessorTest {

  public static final String TEST_STRING = "Nakamura docProxy test resource";
  private DiskProcessor diskProcessor;
  private String currPath;
  private MockNode proxyNode;

  @Before
  public void setUp() throws Exception {
    // Start with a new processor.
    diskProcessor = new DiskProcessor();

    URI readmeUri = getClass().getClassLoader().getResource("README").toURI();
    File readmeFile = new File(readmeUri);
    String readmePath = readmeFile.getPath();
    currPath = readmePath.substring(0, readmePath.lastIndexOf(File.separator));

    proxyNode = new MockNode("/docproxy/disk");
    proxyNode.setProperty(REPOSITORY_LOCATION, currPath);
  }

  @Test
  public void testGet() throws RepositoryException, UnsupportedEncodingException,
      IOException, DocProxyException {
    // Create the proxy Node.
    Node proxyNode = createMock(Node.class);
    Property locationProp = createMock(Property.class);
    expect(locationProp.getString()).andReturn(currPath).anyTimes();
    expect(proxyNode.getProperty(DocProxyConstants.REPOSITORY_LOCATION)).andReturn(
        locationProp);
    replay(locationProp, proxyNode);
    ExternalDocumentResult result = diskProcessor.getDocument(proxyNode, "README");
    InputStream in = result.getDocumentInputStream("zach");
    String content = IOUtils.readFully(in, "UTF-8");
    Assert.assertEquals(TEST_STRING, content);

    // Properties from .json
    Map<String, Object> props = result.getProperties();
    Assert.assertEquals("bar", props.get("foo"));
    Assert.assertEquals(123, props.get("num"));
  }

  @Test
  public void testUpdateDocument() throws DocProxyException, PathNotFoundException,
      RepositoryException, IOException {

    // Create a new file.
    String path = "README-copy";
    Node newNode = createFile(diskProcessor, proxyNode, path, TEST_STRING);

    // Get the file
    ExternalDocumentResult result = diskProcessor.getDocument(newNode, path);
    InputStream in = result.getDocumentInputStream("zach");

    // Read content
    String content = IOUtils.readFully(in, "UTF-8");
    Assert.assertEquals(content, TEST_STRING);
  }

  @Test
  public void testSearch() throws PathNotFoundException, UnsupportedEncodingException,
      RepositoryException, DocProxyException {
    // Mock proxyNode
    Node proxyNode = createMock(Node.class);
    Property locationProp = createMock(Property.class);
    expect(locationProp.getString()).andReturn(currPath).anyTimes();
    expect(proxyNode.getProperty(DocProxyConstants.REPOSITORY_LOCATION)).andReturn(
        locationProp).anyTimes();
    replay(locationProp, proxyNode);

    // Create a couple of files.
    createFile(diskProcessor, proxyNode, "test-disk-search-1-foo", "alfa");
    createFile(diskProcessor, proxyNode, "test-disk-search-2-foo", "beta");
    createFile(diskProcessor, proxyNode, "test-disk-search-3-foo", "charlie");
    createFile(diskProcessor, proxyNode, ".FOOBAR-foo", "");

    // The disk search only matches filenames starting with a term..
    Map<String, Object> searchProperties = new HashMap<String, Object>();
    searchProperties.put("starts-with", "test-disk-search-");
    searchProperties.put("ends-with", "foo");

    // Perform actual search.
    ExternalSearchResultSet resultSet;
    resultSet = diskProcessor.search(proxyNode,
        searchProperties);

    Iterator<ExternalDocumentResult> results = resultSet.getResultIterator();

    // Quickly loop over the results to get a count
    int size = 0;
    while (results.hasNext()) {
      results.next();
      size++;
    }

    Assert.assertEquals(3, size);
  }

  @Test
  public void testContentType() throws PathNotFoundException,
      UnsupportedEncodingException, RepositoryException, DocProxyException {
    Node textNode = createFile(diskProcessor, proxyNode, "test-contentType.txt",
        TEST_STRING);
    ExternalDocumentResultMetadata meta = diskProcessor.getDocumentMetadata(textNode,
        "test-contentType.txt");
    Assert.assertEquals("text/plain", meta.getContentType());

    Node htmlNode = createFile(diskProcessor, proxyNode, "test-contentType.html",
        "<title>foo</title>");
    ExternalDocumentResultMetadata htmlMeta = diskProcessor.getDocumentMetadata(htmlNode,
        "test-contentType.html");
    Assert.assertEquals("text/html", htmlMeta.getContentType());

  }

  @Test
  public void testFaultyRepositoryLocation() throws ValueFormatException,
      RepositoryException, UnsupportedEncodingException, IOException {
    Node proxyNode = createMock(Node.class);
    Property locationProp = createMock(Property.class);
    expect(locationProp.getString()).andReturn(currPath).anyTimes();
    expect(proxyNode.getProperty(DocProxyConstants.REPOSITORY_LOCATION)).andThrow(
        new RepositoryException());
    replay(locationProp, proxyNode);
    try {
      diskProcessor.getDocument(proxyNode, "README");
    } catch (DocProxyException e) {
      assertEquals(500, e.getCode());
      assertEquals("Unable to read from node property.", e.getMessage());
    }
  }

  @Test
  public void testWritingtoJCR() throws PathNotFoundException,
      UnsupportedEncodingException, RepositoryException, DocProxyException {
    MockBundle bundle = new MockBundle(111);
    MockComponentContext context = new MockComponentContext(bundle);
    context.setProperty("createJCRNodes", true);
    diskProcessor.activate(context);

    String docPath = "path/to/document";

    MockNode documentNode = new MockNode(proxyNode.getPath() + "/" + docPath);
    Session session = createMock(Session.class);
    expect(session.itemExists(proxyNode.getPath() + "/" + docPath)).andReturn(true);
    expect(session.getItem(proxyNode.getPath() + "/" + docPath)).andReturn(documentNode);

    ValueFactory factory = createMock(ValueFactory.class);
    expect(factory.createValue(isA(String.class))).andReturn(new MockValue("someuuid"));

    expect(session.getValueFactory()).andReturn(factory);
    expect(session.hasPendingChanges()).andReturn(true);
    session.save();

    replay(factory);
    replay(session);
    proxyNode.setSession(session);

    createFile(diskProcessor, proxyNode, docPath, "random content");

    assertEquals(documentNode.getProperty(SLING_RESOURCE_TYPE_PROPERTY).getString(),
        RT_EXTERNAL_REPOSITORY_DOCUMENT);
  }

  public static Node createFile(DiskProcessor processor, Node proxyNode, String path,
      String content) throws PathNotFoundException, RepositoryException,
      UnsupportedEncodingException, DocProxyException {
    ByteArrayInputStream stream = new ByteArrayInputStream(content.getBytes("UTF-8"));
    return createFile(processor, proxyNode, path, stream);
  }

  public static Node createFile(DiskProcessor processor, Node proxyNode, String path,
      InputStream documentStream) throws PathNotFoundException, RepositoryException,
      DocProxyException {
    processor.updateDocument(proxyNode, path, null, documentStream, -1);

    return proxyNode;

  }

}


text:
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Bio.Algorithms.Assembly.Padena.Scaffold;
using Bio.Algorithms.Kmer;
using Bio.Util;

namespace Bio.Algorithms.Assembly.Padena.Utility
{
    /// <summary>
    /// Utility for aligning reads to contigs.
    /// </summary>
    public static class ReadAlignment
    {
        /// <summary>
        /// Aligns reads to contigs using kmer method of alignment.
        /// </summary>
        /// <param name="contigs">List of contig sequences.</param>
        /// <param name="reads">List of read sequences.</param>
        /// <param name="kmerLength">Kmer Length.</param>
        /// <returns>List of Contig.</returns>
        public static IList<Contig> ReadContigAlignment(IList<ISequence> contigs, IList<ISequence> reads, int kmerLength)
        {
            KmerIndexerDictionary map = SequenceToKmerBuilder.BuildKmerDictionary(reads, kmerLength);
            IList<ContigIndex> contigDatas;
            contigDatas = contigs.AsParallel().Select(contig =>
            {
                IEnumerable<ISequence> kmers = SequenceToKmerBuilder.GetKmerSequences(contig, kmerLength);
                ContigIndex index = new ContigIndex(contig);
                foreach (ISequence kmer in kmers)
                {
                    IList<KmerIndexer> positions;
                    if (map.TryGetValue(kmer, out positions) ||
                        map.TryGetValue(kmer.GetReverseComplementedSequence(), out positions))
                    {
                        index.ContigReadMatchIndexes.Add(positions);
                    }
                    else
                    {
                        index.ContigReadMatchIndexes.Add(new List<KmerIndexer>());
                    }
                }

                return index;
            }).ToList();

            return contigDatas.Select(contigData =>
            {
                IList<Task<IList<ReadMap>>> tasks =
                    new List<Task<IList<ReadMap>>>();

                // Stores information about contigs for which tasks has been generated.
                IList<long> visitedReads = new List<long>();

                // Creates Task for every read in nodes for a given contig.
                for (int index = 0; index < contigData.ContigReadMatchIndexes.Count; index++)
                {
                    int readPosition = index;
                    foreach (KmerIndexer kmer in contigData.ContigReadMatchIndexes[index])
                    {
                        long contigIndex = kmer.SequenceIndex;
                        if (!visitedReads.Contains(contigIndex))
                        {
                            visitedReads.Add(contigIndex);
                            tasks.Add(
                                Task<IList<ReadMap>>.Factory.StartNew(t => MapRead(readPosition, contigData.ContigReadMatchIndexes, contigIndex, kmerLength), TaskCreationOptions.AttachedToParent));
                        }
                    }
                }

                Contig contigOutputStructure = new Contig();
                contigOutputStructure.Consensus = contigData.ContigSequence;

                for (int index = 0; index < visitedReads.Count; index++)
                {
                    foreach (ReadMap maps in tasks[index].Result)
                    {
                        Contig.AssembledSequence assembledSeq = new Contig.AssembledSequence()
                        {
                            Length = maps.Length,
                            Position = maps.StartPositionOfContig,
                            ReadPosition = maps.StartPositionOfRead,
                            Sequence = reads.ElementAt(visitedReads[index])
                        };

                        if (new string(
                            contigOutputStructure.Consensus.GetSubSequence(
                            assembledSeq.Position, assembledSeq.Length).Select(a => (char)a).ToArray()).
                            Equals(new string(assembledSeq.Sequence.GetSubSequence(assembledSeq.ReadPosition, assembledSeq.Length)
                            .Select(a => (char)a).ToArray())))
                        {
                            assembledSeq.IsComplemented = false;
                            assembledSeq.IsReversed = false;
                        }
                        else
                        {
                            assembledSeq.IsComplemented = true;
                            assembledSeq.IsReversed = true;
                        }

                        contigOutputStructure.Sequences.Add(assembledSeq);
                    }
                }

                return contigOutputStructure;
            }).ToList();
        }

        #region Private methods

        /// <summary>
        /// Traverse through list of contig-read match indexes for given read.
        /// </summary>
        /// <param name="position">Position from where list of
        ///  indexes should be traversed.</param>
        /// <param name="contigReadMatch">List for contig-read match indexes.</param>
        /// <param name="contigIndex">Index of contig sequence.</param>
        /// <param name="kmerLength">Length of kmer.</param>
        /// <returns>List of read maps.</returns>
        private static IList<ReadMap> MapRead(
            int position,
            IList<IList<KmerIndexer>> contigReadMatch,
            long contigIndex,
            int kmerLength)
        {
            IList<ReadMap> readMaps = new List<ReadMap>();
            for (int index = position; index < contigReadMatch.Count; index++)
            {
                foreach (KmerIndexer kmer in contigReadMatch[index])
                {
                    if (kmer.SequenceIndex == contigIndex)
                    {
                        FindContinuous(kmer, readMaps, index, kmerLength);
                    }
                }
            }

            return readMaps;
        }

        /// <summary>
        /// Merge continuous positions of a read in kmer indexes.
        /// </summary>
        /// <param name="kmer">Position of contig kmer.</param>
        /// <param name="readMaps">Alignment between read and contig.</param>
        /// <param name="position">Position of kmer in read.</param>
        /// <param name="kmerLength">Length of kmer.</param>
        private static void FindContinuous(
            KmerIndexer kmer,
            IList<ReadMap> readMaps,
            int position,
            int kmerLength)
        {
            // Create new object ReadInformation as read is encountered first time.
            if (readMaps.Count == 0)
            {
                foreach (int pos in kmer.Positions)
                {
                    ReadMap readMap = new ReadMap();
                    readMap.StartPositionOfContig = position;
                    readMap.StartPositionOfRead = pos;
                    readMap.Length = kmerLength;
                    readMaps.Add(readMap);
                }
            }
            else
            {
                // Merge current kmer node with previous kmer node of DeBruijn Graph,
                // if they are continuous in either right or left traversal of graph.
                bool isMerged = false;
                foreach (int pos in kmer.Positions)
                {
                    foreach (ReadMap read in readMaps)
                    {
                        if (IsContinousRight(read, pos, position, kmerLength) ||
                            IsContinousLeft(read, pos, position, kmerLength))
                        {
                            read.Length++;
                            if (read.StartPositionOfRead > pos)
                            {
                                read.StartPositionOfRead = pos;
                            }

                            isMerged = true;
                            break;
                        }
                    }

                    // If not continuous a new object ReadMap is created to store new overlap.
                    if (isMerged == false)
                    {
                        ReadMap readmap = new ReadMap();
                        readmap.StartPositionOfContig = position;
                        readmap.StartPositionOfRead = pos;
                        readmap.Length = kmerLength;
                        readMaps.Add(readmap);
                    }
                }
            }
        }

        /// <summary>
        ///  Find if positions occur simultaneously of read in contig,
        ///  if contig is traced from right direction.
        /// </summary>
        /// <param name="map">Map from previous position of read.</param>
        /// <param name="readPosition">Position of read.</param>
        /// <param name="contigPosition">Position of contig.</param>
        /// <param name="length">Length of kmer.</param>
        /// <returns>True if continuous position of reads in contig.</returns>
        private static bool IsContinousRight(
            ReadMap map,
            int readPosition,
            int contigPosition,
            int length)
        {
            return (map.Length - length + map.StartPositionOfContig + 1) == contigPosition &&
                    (map.StartPositionOfRead + map.Length - length + 1) == readPosition;
        }

        /// <summary>
        ///  Find if positions occur simultaneously of read in contig,
        ///  if contig is traced from left direction.
        /// </summary>
        /// <param name="map">Map from previous position of read.</param>
        /// <param name="readPosition">Position of read.</param>
        /// <param name="contigPosition">Position of contig.</param>
        /// <param name="length">Length of kmer.</param>
        /// <returns>True if continuous position of reads in contig.</returns>
        private static bool IsContinousLeft(
            ReadMap map,
            int readPosition,
            int contigPosition,
            int length)
        {
            return (map.Length - length + map.StartPositionOfContig + 1) == contigPosition &&
                (map.StartPositionOfRead - 1) == readPosition;
        }

        #endregion

        #region Private Class

        /// <summary>
        /// Stores information of kmer reads map with contigs.
        /// </summary>
        private class ContigIndex
        {
            #region Field Variables

            /// <summary>
            /// Contig stored in form of kmer maps of reads
            /// ------------------------------  Contig
            /// --------                        read1
            /// --------                        read5
            ///         --------                read2
            ///                 --------        read3
            ///                         ------  read4.
            /// </summary>
            private IList<IList<KmerIndexer>> contigReadMatchIndexes = new List<IList<KmerIndexer>>();

            #endregion

            /// <summary>
            /// Initializes a new instance of the ContigIndex class.
            /// </summary>
            /// <param name="contig">Contig sequence.</param>
            public ContigIndex(ISequence contig)
            {
                this.ContigSequence = contig;
            }

            /// <summary>
            /// Gets the value of Read as indexes of contig overlap.
            /// </summary>
            public IList<IList<KmerIndexer>> ContigReadMatchIndexes
            {
                get { return this.contigReadMatchIndexes; }
            }

            /// <summary>
            /// Gets the value of Contig sequence.
            /// </summary>
            public ISequence ContigSequence
            {
                get;
                private set;
            }
        }

        #endregion
    }
}

redpajama_set_name: RedPajamaGithub


text:
using IdentityModel;
using IdentityServer4.Events;
using IdentityServer4.Extensions;
using IdentityServer4.Services;
using IdentityServer4.Validation;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace IdentityServer4.ResponseHandling
{
    /// <summary>
    /// The introspection response generator
    /// </summary>
    /// <seealso cref="IdentityServer4.ResponseHandling.IIntrospectionResponseGenerator" />
    public class IntrospectionResponseGenerator : IIntrospectionResponseGenerator
    {
        /// <summary>
        /// Gets the events.
        /// </summary>
        /// <value>
        /// The events.
        /// </value>
        protected readonly IEventService Events;

        /// <summary>
        /// The logger
        /// </summary>
        protected readonly ILogger Logger;

        /// <summary>
        /// Initializes a new instance of the <see cref="IntrospectionResponseGenerator" /> class.
        /// </summary>
        /// <param name="events">The events.</param>
        /// <param name="logger">The logger.</param>
        public IntrospectionResponseGenerator(IEventService events, ILogger<IntrospectionResponseGenerator> logger)
        {
            Events = events;
            Logger = logger;
        }

        /// <summary>
        /// Processes the response.
        /// </summary>
        /// <param name="validationResult">The validation result.</param>
        /// <returns></returns>
        public virtual async Task<Dictionary<string, object>> ProcessAsync(IntrospectionRequestValidationResult validationResult)
        {
            Logger.LogTrace("Creating introspection response");

            // standard response
            var response = new Dictionary<string, object>
            {
                { "active", false }
            };

            // token is invalid
            if (validationResult.IsActive == false)
            {
                Logger.LogDebug("Creating introspection response for inactive token.");
                await Events.RaiseAsync(new TokenIntrospectionSuccessEvent(validationResult));

                return response;
            }

            // expected scope not present
            if (await AreExpectedScopesPresentAsync(validationResult) == false)
            {
                return response;
            }

            Logger.LogDebug("Creating introspection response for active token.");

            // get all claims (without scopes)
            response = validationResult.Claims.Where(c => c.Type != JwtClaimTypes.Scope).ToClaimsDictionary();

            // add active flag
            response.Add("active", true);

            // calculate scopes the caller is allowed to see
            var allowedScopes = validationResult.Api.Scopes;
            var scopes = validationResult.Claims.Where(c => c.Type == JwtClaimTypes.Scope).Select(x => x.Value);
            scopes = scopes.Where(x => allowedScopes.Contains(x));
            response.Add("scope", scopes.ToSpaceSeparatedString());

            await Events.RaiseAsync(new TokenIntrospectionSuccessEvent(validationResult));
            return response;
        }

        /// <summary>
        /// Checks if the API resource is allowed to introspect the scopes.
        /// </summary>
        /// <param name="validationResult">The validation result.</param>
        /// <returns></returns>
        protected virtual async Task<bool> AreExpectedScopesPresentAsync(IntrospectionRequestValidationResult validationResult)
        {
            var apiScopes = validationResult.Api.Scopes;
            var tokenScopes = validationResult.Claims.Where(c => c.Type == JwtClaimTypes.Scope);

            var tokenScopesThatMatchApi = tokenScopes.Where(c => apiScopes.Contains(c.Value));

            var result = false;

            if (tokenScopesThatMatchApi.Any())
            {
                // at least one of the scopes the API supports is in the token
                result = true;
            }
            else
            {
                // no scopes for this API are found in the token
                Logger.LogError("Expected scope {scopes} is missing in token", apiScopes);
                await Events.RaiseAsync(new TokenIntrospectionFailureEvent(validationResult.Api.Name, "Expected scopes are missing", validationResult.Token, apiScopes, tokenScopes.Select(s => s.Value)));
            }

            return result;
        }
    }
}


text:
var killed_containers = [],
  structure = {
    stories : {
      containerClasses : ["_5jmm"],
      imageLinkClasses : [ "_5v9u"]
    },
    comments : {
      containerClasses : ["UFIComment"],
      imageLinkClasses : ["UFIImageBlockImage"]
    }
  };

function getMutedList(value) {
  chrome.storage.sync.get("muted_list", function (data) {
    var bannedPersons = null;
    if (data["muted_list"]) {
      bannedPersons = data["muted_list"];
      value(bannedPersons);
    }
  });
}

function getTransparency(value) {
  chrome.storage.sync.get("transparency", function (data) {
    var level = null;
    if (data["transparency"]) {
      level = data["transparency"];
      value(level);
    }
  });
}
// Pattern for fetching async values
/* getMutedList( function(idk) {
  console.log(idk);
}); */

function ghost() {
  chrome.storage.sync.get("status_pref", function(data){
    if (data["status_pref"]){
      _.each(structure, function(contentType) {
        // find all potential posts
        var containerClasses = contentType.containerClasses,
            imageLinkClasses = contentType.imageLinkClasses;
        _.each(containerClasses, function(containerClass){
          posts = document.getElementsByClassName(containerClass);
          _.each(posts, function(post){
            ghostkillLinks(post, imageLinkClasses);
          });
        });
      });

    }
  });
}

function removeUrlParams(profileUrl) {
  var pretrimmedUrl, trimmedUrl;
  if (profileUrl.indexOf('profile.php') > -1 ) {
    // this is a non-vanity URL
    pretrimmedUrl = profileUrl.split('?id=')[1];
    trimmedUrl = pretrimmedUrl.split('&')[0];
  } else {
    // this is a vanity URL
    pretrimmedUrl = profileUrl.split('?')[0];
    trimmedUrl = pretrimmedUrl.split('facebook.com/')[1];

  }
  return trimmedUrl;
}

function ghostkillLinks(item, imageLinkClasses){
  _.each(imageLinkClasses, function(imageLinkClass) {
    var imageLinks = item.getElementsByClassName(imageLinkClass);
    // console.log(imageLinks);
    _.each(imageLinks, function(link){

      if (link.href) {
        var href = link.href.toLowerCase();
        href = removeUrlParams(href);
        //console.log(href);
        getMutedList( function(bannedPerson) {
          _.each(bannedPerson, function(profileUrl){
            //console.log(profileUrl[0]);
              // can't use indexOf in case a shorter name is contained in a longer name
              // ie Kim John --> Kim Johnson
              if (href == profileUrl[0]) {
                ghostkillItem(item);
              }
          });
        });
      }
    });
  });
}

function ghostkillItem(item){
  getTransparency( function(level) {
    //console.log(level)
    var opacityLevel;
    if (level === "low") {
      opacityLevel = "0.5";
    } else if (level === "medium") {
      opacityLevel = "0.25";
    } else if (level === "high") {
      opacityLevel = "0.1";
    } else if (level === "full") {
      opacityLevel = "0";
    }

    // set the comment to be invisible
    item.style.opacity = opacityLevel;
  });

  // add this story to the list of killed stories
  if (killed_containers.indexOf(item) == -1){
    killed_containers.push(item);
  }
}

ghost();

// debounce the function so it's not running constantly
var scrollGhost = _.debounce(ghost, 100);
document.addEventListener("scroll", scrollGhost);

chrome.storage.onChanged.addListener(function(changes, namespace) {
  // When new profiles are added to list, or transparency level is changed, re-run ghost function
  for (key in changes) {
    if ((key === "transparency") || (key === "muted_list")) {
      ghost();
    }
  }

  //Debug helper
  /*
  for (key in changes) {
    var storageChange = changes[key];
    console.log('Storage key "%s" in namespace "%s" changed. ' +
                'Old value was "%s", new value is "%s".',
                key,
                namespace,
                storageChange.oldValue,
                storageChange.newValue);
  } */
});


text:
package com.monsterlin.blives.adapter.changeadapter;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * 引导页adapter
 * Created by monsterLin on 2016/4/27.
 */
public class WelWpadapter extends PagerAdapter {
    private List<View> mViewList;

    public WelWpadapter(List<View> viewList) {
        mViewList = viewList;
    }
    /**
     * 获取Viewpager页卡的数量
     */
    @Override
    public int getCount() {
        return mViewList.size();
    }

    /**
     * 判断类型是否符合
     */
    @Override
    public boolean isViewFromObject(View arg0, Object arg1) {
        return arg0 == arg1;
    }

    /**
     * 实例化一个页卡
     */
    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        container.addView(mViewList.get(position));
        return mViewList.get(position);
    }

    /**
     * 销毁一个页卡
     */
    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView(mViewList.get(position));
    }
}


text:
function display(F)
%DISPLAY   Display a chebfun2
%
% DISPLAY(F) outputs important information about the chebfun2 F to the
% command window, including its domain of definition, length (number of
% pivots used to represent it), and a summary of its structure.
%
% It is called automatically when the semicolon is not used at the
% end of a statement that results in a chebfun2.

% Copyright 2013 by The University of Oxford and The Chebfun Developers.
% See http://www.maths.ox.ac.uk/chebfun/ for Chebfun information.

%%
% Get display style and remove trivial empty chebfun2 case.

loose = strcmp(get(0,'FormatSpacing'),'loose');
if ( loose )
    fprintf('\n%s = \n\n',inputname(1))
else
    fprintf('%s = \n',inputname(1))
end

% compact version
if ( isempty(F) )
    fprintf('      empty chebfun2\n\n')
    return
end

%%
% Get information that we want to display
rect = F.corners;
len = length(F);
xx = F.corners; [xx yy]=meshgrid(xx(1:2),xx(3:4));
vals = feval(F,xx,yy).'; vals = vals(:);   % values at the corners.

%%
% Display information

disp('chebfun2 object: (1 smooth surface)')
fprintf('       domain                 rank       corner values\n');

if(isreal(vals))
    fprintf('[%4.2g,%4.2g] x [%4.2g,%4.2g]   %6i     [%4.2g %4.2g %4.2g %4.2g]\n', rect(1), rect(2), rect(3) , rect(4) , len,vals);
else
    fprintf('[%4.2g,%4.2g] x [%4.2g,%4.2g]   %6i     [  complex values  ]\n', rect(1), rect(2), rect(3) , rect(4) , len);
end
fprintf('vertical scale = %3.2g \n', F.scl)

end


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>B</logradouro><bairro>Campina do Barreto</bairro><cidade>Recife</cidade><uf>PE</uf><cep>52121033</cep></feed>


text:
TARGET = main

MCU=mk20dx128
CPU=cortex-m4
# configurable options
OPTIONS = -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH

# options needed by many Arduino libraries to configure for Teensy 3.0
#OPTIONS += -D__MK20DX128__ -DARDUIO=105 -DTEENSYDUINO=118

CPPFLAGS = -Wall -g -Os -mcpu=$(CPU) -mthumb -nostdlib -MMD $(OPTIONS) -I.
CXXFLAGS = -std=gnu++0x -felide-constructors -fno-exceptions -fno-rtti
CFLAGS =
LDFLAGS = -Os -Wl,--gc-sections -mcpu=$(CPU) -mthumb -Tmk20dx256.ld
LIBS = -lm

CC = arm-none-eabi-gcc
CXX = arm-none-eabi-g++
OBJCOPY = arm-none-eabi-objcopy
SIZE = arm-none-eabi-size
TEENSY_LOADER_CLI = ~/Development/teensy_loader_cli/teensy_loader_cli
FORMAT = ihex

# Other Makefiles and project templates for Teensy 3.x:
#
# https://github.com/apmorton/teensy-template
# https://github.com/xxxajk/Arduino_Makefile_master
# https://github.com/JonHylands/uCee

# automatically create lists of the sources and objects
C_FILES := $(wildcard *.c)
CPP_FILES := $(wildcard *.cpp)
OBJS := $(C_FILES:.c=.o) $(CPP_FILES:.cpp=.o)

all: $(TARGET).hex

$(TARGET).elf: $(OBJS) mk20dx256.ld
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

# from teensyduino
#TOOLSPATH = $(ARDUINOPATH)/hardware/tools   # on Linux
#%.hex: %.elf
#	$(SIZE) $<
#	$(OBJCOPY) -O ihex -R .eeprom $< $@
#	$(abspath $(TOOLSPATH))/teensy_post_compile -file=$(basename $@) -path=$(shell pwd) -tools=$(abspath $(TOOLSPATH))
#	-$(abspath $(TOOLSPATH))/teensy_reboot

# from teensy website
# Create final output files (.hex, .eep) from ELF output file.
%.hex: %.elf
	@echo
	@echo $(MSG_FLASH) $@
	$(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature $< $@
	$(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $@

# compiler generated dependency info
-include $(OBJS:.o=.d)

clean:
	rm -f *.o *.d $(TARGET).elf $(TARGET).hex


text:
A Selector in enzyme is similar to a CSS selector, but can be a number of other things as well in
order to easily specify a criteria by which you want to find nodes in a enzyme wrapper. See the
Selector page for more information.

# wrapper

A wrapper refers to the enzyme wrapper class that provides the API.

# predicate

A function that returns true or false


text:
describe('Splash page', function() {

  beforeEach(function() {
      browser.get('http://localhost:8088/');
  });

  // it('should redirect to the worklist.', function() {
      // expect(browser.getCurrentUrl()).toMatch(".*?/work-item-list");
  // });
});


text:
SapientNitro React Demo

Steps to run the App
1. npm install
2. node server.js

In browser use fallowing address.

http://localhost:3000


text:
<?php
/**
 * @package DevOps_and_Platforms
 * @version 1.0
 */
/*
Plugin Name: lp-date-widget
Plugin URI: http://wordpress.org/extend/plugins/devops_and_platforms/
Description: Create a date shortcode for use in the top sidebar element.  DevOps and Platforms is a modern web hosting platform that allows you to easily launch websites into the cloud.  Your pages will automatically be served from 2 datacenters.  For more information about doap.com or help with setting up your free site, drop a line to info@doap.com

Author: David Menache
Version: 1.1
Author URI: http://doap.com/
*/

// This echoes the formatted date
function formatted_date() {
        date_default_timezone_set("America/Managua");
        ini_set('default_charset', 'utf-8');
        header('Content-Type: text/html; charset=utf-8' );
        $x = time();
        $oldLocale = setlocale(LC_TIME, 'es_ES.UTF-8');
        echo ucwords(strftime("%A %d %B %Y", $x));
        //echo ucwords(strftime("%A %d %B %Y", $x));
        setlocale(LC_TIME, $oldLocale);
        add_filter('widget_text', 'do_shortcode');
}

add_shortcode('date-tag', 'formatted_date');

?>


text:
NSString * const kPPToolkitBundleName       = @"PPToolkitResources.bundle";
NSString * const kPPToolkitErrorDomain      = @"com.PPToolkit.ErrorDomain";
const NSUInteger kPPToolkitFetchBatchSize   = 10;

#pragma mark - Utilities

NSString * PPStringFromBool(BOOL yesOrNo) {
    return yesOrNo ? @"YES" : @"NO";
}

NSString * PPStringFromInterfaceOrientation(UIInterfaceOrientation interfaceOrientation) {
    switch (interfaceOrientation) {
        case UIInterfaceOrientationPortrait: {
            return @"UIInterfaceOrientationPortrait";
        }

        case UIInterfaceOrientationPortraitUpsideDown: {
            return @"UIInterfaceOrientationPortraitUpsideDown";
        }

        case UIInterfaceOrientationLandscapeLeft: {
            return @"UIInterfaceOrientationLandscapeLeft";
        }

        case UIInterfaceOrientationLandscapeRight: {
            return @"UIInterfaceOrientationLandscapeRight";
        }

        default: {
            return @"Unknown interface orientation";
        }
    }
}

NSString * PPStringFromDeviceOrientation(UIDeviceOrientation deviceOrientation) {
    switch (deviceOrientation) {
        case UIDeviceOrientationPortrait: {
            return @"UIDeviceOrientationPortrait";
        }

        case UIDeviceOrientationPortraitUpsideDown: {
            return @"UIDeviceOrientationPortraitUpsideDown";
        }

        case UIDeviceOrientationLandscapeLeft: {
            return @"UIDeviceOrientationLandscapeLeft";
        }

        case UIDeviceOrientationLandscapeRight: {
            return @"UIDeviceOrientationLandscapeRight";
        }

        default: {
            return @"Unknown device orientation";
        }
    }
}

NSString * PPStringFromManagedObjectContextConcurrencyType(NSManagedObjectContextConcurrencyType ct) {
    switch (ct) {
        case NSConfinementConcurrencyType: {
            return @"NSConfinementConcurrencyType";
        }
        case NSPrivateQueueConcurrencyType: {
            return @"NSPrivateQueueConcurrencyType";
        }
        case NSMainQueueConcurrencyType: {
            return @"NSMainQueueConcurrencyType";
        }
        default: {
            return @"Unknown concurency type";
        }
    }
}

NSString * PPStringFromLoadingState(PPLoadingState state) {
    switch (state) {
        case PPLoadingStateIdle: {
            return @"PPLoadingStateIdle";
        }
        case PPLoadingStateEmpty: {
            return @"PPLoadingStateEmpty";
        }
        case PPLoadingStateError: {
            return @"PPLoadingStateError";
        }
        case PPLoadingStateInitial: {
            return @"PPLoadingStateInitial";
        }
        case PPLoadingStateRefresh: {
            return @"PPLoadingStateRefresh";
        }
        case PPLoadingStateLoading: {
            return @"PPLoadingStateLoading";
        }
        default: {
            return @"Undefined";
        }
    }
}


text:
Welcome to Apache Jackrabbit FileVault Package Maven Plugin
===========================================================

The Apache Jackrabbit FileVault package maven plugin is an Apache maven plugin
that simplifies the creation of content package maven artifacts. The content
packages can later be used to install content into a JCR repository using the
Apache Jackrabbit FileVault packaging runtime.

Apache Jackrabbit FileVault is a project of the Apache Software Foundation.

Documentation
=============
Please refer to the plugin documentation at
http://jackrabbit.apache.org/filevault-package-maven-plugin/index.html

Building the FileVault Package Maven Plugin
===========================================

You can build the plugin like this:

    mvn clean install

You need Maven 3.2.5 (or higher) with Java 7 (or higher) for the build.
For more instructions, please see the documentation at:

   http://jackrabbit.apache.org/building-jackrabbit.html

License (see also LICENSE)
==============================

```
Collective work: Copyright 2013 The Apache Software Foundation.

Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

Mailing Lists
=============

To get involved with the Apache Jackrabbit project, start by having a
look at our website and joining our mailing lists. For more details about
Jackrabbit mailing lists as well as links to list archives, please see:

   http://jackrabbit.apache.org/mailing-lists.html

Latest development
==================

The latest FileVault package plugin source code is available via Subversion at

   https://svn.apache.org/repos/asf/jackrabbit/commons/filevault-package-maven-plugin/trunk/

or with ViewVC at

   https://svn.apache.org/viewvc/jackrabbit/commons/filevault-package-maven-plugin/trunk/

To checkout the main source tree, run

   svn checkout https://svn.apache.org/repos/asf/commons/filevault-package-maven-plugin/trunk filevault-package-maven-plugin

Credits
=======

See http://jackrabbit.apache.org/jackrabbit-team.html for the list of
Jackrabbit committers and main contributors.


text:
QUnit.test("Padding option", function (assert) {

    document.getElementById('qunit-fixture').innerHTML = '

';

    var settings = {
        start: [0, 10],
        padding: 1,
        range: {
            'min': 0,
            'max': 10
        }
    };

    var slider = document.getElementById('qunit-fixture').querySelector('.slider');

    noUiSlider.create(slider, settings);

    assert.deepEqual(slider.noUiSlider.get(), ['1.00', '9.00'], 'Padding applied on init.');

    slider.noUiSlider.set([2, 10]);
    assert.deepEqual(slider.noUiSlider.get(), ['2.00', '9.00'], 'Handle can\'t pass padding.');

    slider.noUiSlider.set([0, 10]);
    assert.deepEqual(slider.noUiSlider.get(), ['1.00', '9.00'], 'Multiple set outside of padding');

    // Rebuild with new settings;
    settings.direction = 'rtl';
    slider.noUiSlider.destroy();

    noUiSlider.create(slider, settings);

    assert.deepEqual(slider.noUiSlider.get(), ['1.00', '9.00'], 'RTL on init.');

    slider.noUiSlider.set([3, 10]);
    assert.deepEqual(slider.noUiSlider.get(), ['3.00', '9.00'], 'RTL set.');
});

QUnit.test("Padding option (non-linear)", function (assert) {

    document.getElementById('qunit-fixture').innerHTML = '

';

    var settings = {
        start: [0, 310],
        padding: 20,
        range: {
            'min': [0],
            '20%': [160],
            '40%': [240],
            '60%': [280],
            '80%': [300],
            'max': [310]
        }
    };

    var slider = document.getElementById('qunit-fixture').querySelector('.slider');

    noUiSlider.create(slider, settings);

    assert.deepEqual(slider.noUiSlider.get(), ['20.00', '290.00'], 'Padding applied on init.');

    slider.noUiSlider.set([40, 310]);
    assert.deepEqual(slider.noUiSlider.get(), ['40.00', '290.00'], 'Handle can\'t pass padding.');

    slider.noUiSlider.set([0, 270]);
    assert.deepEqual(slider.noUiSlider.get(), ['20.00', '270.00'], 'Multiple set outside of padding');

    // Rebuild with new settings;
    settings.direction = 'rtl';
    slider.noUiSlider.destroy();

    noUiSlider.create(slider, settings);

    assert.deepEqual(slider.noUiSlider.get(), ['20.00', '290.00'], 'RTL on init.');

    slider.noUiSlider.set([20, 285]);
    assert.deepEqual(slider.noUiSlider.get(), ['20.00', '285.00'], 'RTL set.');
});

QUnit.test("Padding option", function (assert) {

    document.getElementById('qunit-fixture').innerHTML = '

';

    var settings = {
        start: [0, 100],
        padding: [10, 5],
        range: {
            'min': 0,
            'max': 100
        }
    };

    var slider = document.getElementById('qunit-fixture').querySelector('.slider');

    noUiSlider.create(slider, settings);

    assert.deepEqual(slider.noUiSlider.get(), ['10.00', '95.00'], 'Different paddings applied');

    // =============

    slider.noUiSlider.destroy();

    settings.padding = [0, 10];

    noUiSlider.create(slider, settings);
    assert.deepEqual(slider.noUiSlider.get(), ['0.00', '90.00'], 'One of the padding values is 0');

});

QUnit.test("Padding option (non-linear)", function (assert) {

    document.getElementById('qunit-fixture').innerHTML = '

';

    var settings = {
        start: [0, 310],
        padding: [20, 5],
        range: {
            'min': [0],
            '20%': [160],
            '40%': [240],
            '60%': [280],
            '80%': [300],
            'max': [310]
        }
    };

    var slider = document.getElementById('qunit-fixture').querySelector('.slider');

    noUiSlider.create(slider, settings);

    assert.deepEqual(slider.noUiSlider.get(), ['20.00', '305.00'], 'Different paddings applied');

    // =============

    slider.noUiSlider.destroy();

    settings.padding = [0, 10];

    noUiSlider.create(slider, settings);
    assert.deepEqual(slider.noUiSlider.get(), ['0.00', '300.00'], 'One of the padding values is 0');

});

QUnit.test("Padding values <= 100%", function (assert) {

    document.getElementById('qunit-fixture').innerHTML = '

';

    var settings = {
        start: [0, 100],
        padding: [30, 70],
        range: {
            'min': 0,
            'max': 100
        }
    };

    var slider = document.getElementById('qunit-fixture').querySelector('.slider');

    noUiSlider.create(slider, settings);

    assert.deepEqual(slider.noUiSlider.get(), ['30.00', '30.00'], 'Slider values can only be 30');

});

QUnit.test("Padding values <= 100% (non-linear)", function (assert) {

    document.getElementById('qunit-fixture').innerHTML = '

';

    var settings = {
        start: [0, 310],
        padding: [155, 155],
        range: {
            'min': [0],
            '20%': [160],
            '40%': [240],
            '60%': [280],
            '80%': [300],
            'max': [310]
        }
    };

    var slider = document.getElementById('qunit-fixture').querySelector('.slider');

    noUiSlider.create(slider, settings);

    assert.deepEqual(slider.noUiSlider.get(), ['155.00', '155.00'], 'Slider values can only be 155');

});


text:
class cBlockMobSpawnerHandler :
	public cBlockHandler
{
public:
	cBlockMobSpawnerHandler(BLOCKTYPE a_BlockType)
		: cBlockHandler(a_BlockType)
	{
	}

	virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override
	{
		a_ChunkInterface.UseBlockEntity(a_Player, a_BlockX, a_BlockY, a_BlockZ);
	}

	virtual bool IsUseable() override
	{
		return true;
	}

	virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
	{
		// No pickups
	}

	virtual void OnDestroyedByPlayer(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) override
	{
		cItemHandler * Handler = a_Player->GetEquippedItem().GetHandler();
		if (a_Player->IsGameModeCreative() || !Handler->CanHarvestBlock(E_BLOCK_MOB_SPAWNER))
		{
			return;
		}

		cFastRandom Random;
		int Reward = 15 + Random.NextInt(15) + Random.NextInt(15);
		a_WorldInterface.SpawnExperienceOrb(static_cast<double>(a_BlockX), static_cast<double>(a_BlockY + 1), static_cast<double>(a_BlockZ), Reward);
	}
} ;


text:
package org.apache.rya.indexing.pcj.fluo.app.query;

import static com.google.common.base.Preconditions.checkNotNull;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.rya.indexing.pcj.fluo.app.util.FilterSerializer;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;

import com.google.common.base.Objects;

import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import net.jcip.annotations.Immutable;

/**
 * Metadata that is specific to Filter nodes.
 */
@Immutable
@DefaultAnnotation(NonNull.class)
public class FilterMetadata extends CommonNodeMetadata {

    private final String filterSparql;
    private final String parentNodeId;
    private final String childNodeId;

    /**
     * Constructs an instance of {@link FilterMetadata}.
     *
     * @param nodeId - The ID the Fluo app uses to reference this node. (not null)
     * @param varOrder - The variable order of binding sets that are emitted by this node. (not null)
     * @param filterSparql - SPARQL query representing the filter as generated by {@link FilterSerializer#serialize}. (not null)
     * @param filterIndexWithinSparql - The index of the filter within the original SPARQL query
     *   that this node processes. (not null)
     * @param parentNodeId - The node id of this node's parent. (not null)
     * @param childNodeId - The node id of this node's child. (not null)
     */
    public FilterMetadata(
            final String nodeId,
            final VariableOrder varOrder,
            final String filterSparql,
            final String parentNodeId,
            final String childNodeId) {
        super(nodeId, varOrder);
        this.filterSparql = checkNotNull(filterSparql);
        this.parentNodeId = checkNotNull(parentNodeId);
        this.childNodeId = checkNotNull(childNodeId);
    }

    /**
     * @return The original SPARQL query the filter is derived from.
     */
    public String getFilterSparql() {
        return filterSparql;
    }

    /**
     * @return The node id of this node's parent.
     */
    public String getParentNodeId() {
        return parentNodeId;
    }

    /**
     * @return The node whose results are being filtered.
     */
    public String getChildNodeId() {
        return childNodeId;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(
                super.getNodeId(),
                super.getVariableOrder(),
                filterSparql,
                parentNodeId,
                childNodeId);
    }

    @Override
    public boolean equals(final Object o) {
        if(this == o) {
            return true;
        }

        if(o instanceof FilterMetadata) {
            if(super.equals(o)) {
                final FilterMetadata filterMetadata = (FilterMetadata)o;
                return new EqualsBuilder()
                        .append(filterSparql, filterMetadata.filterSparql)
                        .append(parentNodeId, filterMetadata.parentNodeId)
                        .append(childNodeId, filterMetadata.childNodeId)
                        .isEquals();
            }
            return false;

        }

        return false;
    }

    @Override
    public String toString() {
        return new StringBuilder()
                .append("Filter Metadata {\n")
                .append("    Node ID: " + super.getNodeId() + "\n")
                .append("    Variable Order: " + super.getVariableOrder() + "\n")
                .append("    Parent Node ID: " + parentNodeId + "\n")
                .append("    Child Node ID: " + childNodeId + "\n")
                .append("    Original SPARQL: " + filterSparql + "\n")
                .append("}")
                .toString();
    }

    /**
     * Creates a new {@link Builder} for this class.
     *
     * @param nodeId - The ID the Fluo app uses to reference this node. (not null)
     * @return A new {@link Builder} for this class.
     */
    public static Builder builder(final String nodeId) {
        return new Builder(nodeId);
    }

    /**
     * Builds instances of {@link FilterMetadata}.
     */
    @DefaultAnnotation(NonNull.class)
    public static final class Builder implements CommonNodeMetadata.Builder{

        private final String nodeId;
        private VariableOrder varOrder;
        private String filterSparql;
        private String parentNodeId;
        private String childNodeId;

        /**
         * Constructs an instance of {@link Builder}.
         *
         * @param nodeId - the ID the Fluo app uses to reference this node.
         */
        public Builder(final String nodeId) {
            this.nodeId = checkNotNull(nodeId);
        }

        /**
         * @return the ID the Fluo app uses to reference this node.
         */
        public String getNodeId() {
            return nodeId;
        }

        /**
         * Set the variable order of binding sets that are emitted by this node.
         *
         * @param varOrder - The variable order of binding sets that are emitted by this node.
         * @return This builder so that method invocations may be chained.
         */
        public Builder setVarOrder(@Nullable final VariableOrder varOrder) {
            this.varOrder = varOrder;
            return this;
        }

        @Override
        public VariableOrder getVariableOrder() {
            return varOrder;
        }

        /**
         * Set the original SPARQL query the filter is derived from.
         *
         * @param originalSparql - The original SPARQL query the filter is derived from.
         * @return This builder so that method invocations may be chained.
         */
        public Builder setFilterSparql(final String originalSparql) {
            this.filterSparql = originalSparql;
            return this;
        }

        /**
         * Set the node ID of this node's parent.
         *
         * @param parentNodeId - The node ID of this node's parent.
         * @return This builder so that method invocations may be chained.
         */
        public Builder setParentNodeId(@Nullable final String parentNodeId) {
            this.parentNodeId = parentNodeId;
            return this;
        }

        /**
         * Set the node ID of this node's child.
         *
         * @param childNodeId - The node id of this node's child.
         * @return This builder so that method invocations may be chained.
         */
        public Builder setChildNodeId(@Nullable final String childNodeId) {
            this.childNodeId = childNodeId;
            return this;
        }

        public String getChildNodeId() {
            return childNodeId;
        }

        /**
         * @return Returns an instance of {@link FilterMetadata} using this builder's values.
         */
        public FilterMetadata build() {
            return new FilterMetadata(
                    nodeId,
                    varOrder,
                    filterSparql,
                    parentNodeId,
                    childNodeId);
        }
    }
}


text:
'use strict';
module.exports = require('os-homedir')();


text:
'use strict';

/**
 * @file Routen für Bewertungen
 */

var express = require('express');
var router = express.Router();
var config = require('../../config/config');
var helper = require('./helper/middleware');
var auth = require('./auth/auth');
var async = require('async');

var Rating = require('../../models/rating');

var API_VERSION = config.HOST_URL + '/api/v1';

/**************************************************
            DEGREE RESTRICTED ROUTES
**************************************************/

// Eine bestimmte Bewertung
router.get('/ratings/:ratingUUID', helper.prefetchRating, auth.restricted, function(req, res, next) {

  var rating = req._rating;
  rating.addMetadata(API_VERSION);
  res.json(rating);

});

// Gibt eigene Bewertung für die Bewertung zurück, falls eine existiert
router.get('/ratings/:ratingUUID/rating', helper.prefetchRating, auth.restricted, function(req, res, next) {

  var _rating = req._rating;
  var user = req.user;

  user.getMyRatingFor(_rating.uuid, function(err, myrating) {
    if(err) return next(err);
    myrating.addMetadata(API_VERSION);
    res.json(myrating);
  });

});

// Bewertung erstellen
router.post('/ratings/:ratingUUID/ratings', helper.prefetchRating, auth.restricted, helper.prefetchConfig, helper.prefetchPackage, function(req, res, next) {

  var user = req.user;
  var config = req._config;
  var pack = req._package;
  var _rating = req._rating;

  // eigentliche Funktion die die Bewertung erstellt, Punkte verteilt, etc.
  function create() {
    Rating.create(req.body, user.uuid, _rating.uuid, function(err, rating) {
      if(err) return next(err);
      rating.addMetadata(API_VERSION);
      // Admins brauchen keine Punkte, etc
      if(user.isAdmin()) {
        return res.status(201).json(rating);
      }

      // Arbeitspaket aktualisieren
      // Punkte an den Ersteller der Bewertung verteilen
      // Punkte vom Ersteller der Bewertung abziehen
      // Punkte an den Ersteller des bewerteten Inhalts verteilen
      async.parallel([
        function(_cb) { pack.updatePackage({ratings: 1}, config, _cb); },
        function(_cb) { rating.givePointsTo(user.uuid, {points: config.ratePoints}, _cb); },
        function(_cb) { rating.takePointsFrom(user.uuid, {points: config.rateCost}, _cb); },
        function(_cb) { rating.givePrestigeTo(_rating.author, {points: rating.getRating().avg, prestige: user.prestige}, _cb); }
      ], function(errors, results) {
        if(errors) next(errors);
        return res.status(201).json({success: true});
      });
    });
  }

  // Admins dürfen sowieso
  if(user.isAdmin()) {
    create();
  } else {
    // der User sollte seine eigenen Inhalte nicht bewerten dürfen
    user.hasCreated(_rating.uuid, function(err, hasCreated) {
      if(err) return next(err);
      if(hasCreated) {
        err = new Error('Du darfst nicht deine eigenen Inhalte bewerten.');
        err.status = 409;
        return next(err);
      }

      // überprüfe ob der Nutzer noch Bewertungen erstellen darf
      // falls 0: Limit erreicht, Paket muss erst abgearbeitet werden
      if(user.ratingsToDo === 0) {
        // Nutzer muss erst Paket abarbeiten
        err = new Error('Du musst erst dein Arbeitspaket abarbeiten bevor du wieder Bewertungen erstellen darfst');
        err.status = 409;
        err.name = 'WorkPackageNotDone';
        return next(err);
      }
      // falls > 0: Einstellung möglich
      // überprüfe ob der Nutzer noch genug Punkte hat
      user.hasPoints(config.rateCost, function(err, heDoes) {
        if(err) return next(err);
        if(!heDoes) {
          err = new Error('Du hast nicht genug Punkte um eine Bewertung abzugeben');
          err.status = 409;
          err.name = 'MissingPoints';
          return next(err);
        }

        create();

      });
    });
  }

});

/**************************************************
            AUTHOR ONLY ROUTES
**************************************************/

// Gibt Bewertungen der Bewertung zurück
router.get('/ratings/:ratingUUID/ratings', helper.prefetchRating, auth.authorOnly, function(req, res, next) {

  var _rating = req._rating;
  var user = req.user;

  _rating.getRatings(function(err, ratings) {
    if(err) return next(err);
    ratings.forEach(function(r) {
      r.addMetadata(API_VERSION);
    });
    res.json(ratings);
  });

});

module.exports = router;


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

<!-- config.xml reference: https://build.phonegap.com/docs/config-xml -->
<widget xmlns     = "http://www.w3.org/ns/widgets"
        xmlns:gap = "http://phonegap.com/ns/1.0"
        id        = "nl.appdsgn.ctc2"
        version   = "2.0.3">

    <name>App-otheek</name>

    <description>
        Herhaalmedicatie bestel App.
    </description>

    <author href="http://phonegap.com" email="support@phonegap.com">
        Marcel Swarts
    </author>

<preference name='phonegap-version' value='cli-7.0.1' />

    <!--
        If you do not want any permissions to be added to your app, add the
        following tag to your config.xml; you will still have the INTERNET
        permission on your app, which PhoneGap requires.

    <preference name="permissions"                value="none"/>   -->

    <!-- Customize your app and platform with the preference element. -->
    <preference name="orientation"                value="default" />        <!-- all: default means both landscape and portrait are enabled -->
    <preference name="target-device"              value="universal" />      <!-- all: possible values handset, tablet, or universal -->
    <preference name="fullscreen"                 value="false" />           <!-- all: hides the status bar at the top of the screen -->
    <preference name="webviewbounce"              value="true" />           <!-- ios: control whether the screen 'bounces' when scrolled beyond the top -->
    <preference name="prerendered-icon"           value="true" />           <!-- ios: if icon is prerendered, iOS will not apply it's gloss to the app's icon on the user's home screen -->
    <preference name="stay-in-webview"            value="false" />          <!-- ios: external links should open in the default browser, 'true' would use the webview the app lives in -->
    <preference name="ios-statusbarstyle"         value="black-opaque" />   <!-- ios: black-translucent will appear black because the PhoneGap webview doesn't go beneath the status bar -->
    <preference name="detect-data-types"          value="true" />           <!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system -->
    <preference name="exit-on-suspend"            value="false" />          <!-- ios: if set to true, app will terminate when home button is pressed -->
    <preference name="show-splash-screen-spinner" value="true" />           <!-- ios: if set to false, the spinner won't appear on the splash screen during app loading -->
    <preference name="auto-hide-splash-screen"    value="true" />           <!-- ios: if set to false, the splash screen must be hidden using a JavaScript API -->
    <preference name="disable-cursor"             value="false" />          <!-- blackberry: prevents a mouse-icon/cursor from being displayed on the app -->
    <preference name="android-installLocation"    value="auto" />           <!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. -->
    <!--
        Define a specific version of PhoneGap to build into your app.
        <preference name="phonegap-version"       value="3.5.0" />
    -->

    <!-- Plugins -->

    <!-- Core plugins -->
    <plugin name="cordova-plugin-battery-status" />
    <plugin name="cordova-plugin-camera" />
    <plugin name="cordova-plugin-media-capture" />
    <plugin name="cordova-plugin-console" />
  <!--  <plugin name="cordova-plugin-contacts" spec="~2.2.1" /> -->
    <plugin name="cordova-plugin-device" />
    <plugin name="cordova-plugin-device-motion" />
    <plugin name="cordova-plugin-device-orientation" />
    <plugin name="cordova-plugin-dialogs" />
  <plugin name="cordova-plugin-file" />
  <plugin name="cordova-plugin-file-transfer" />
    <plugin name="cordova-plugin-geolocation" />
    <plugin name="cordova-plugin-globalization" />
    <plugin name="cordova-plugin-inappbrowser" />
 <!--   <plugin name="cordova-plugin-media" spec="~2.4.1" />. -->
    <plugin name="cordova-plugin-network-information" />
    <plugin name="cordova-plugin-splashscreen" />
<!--    <plugin name="cordova-plugin-vibration" spec="~2.1.3" />. -->

    <!-- Third party plugins -->
    <!-- A list of available plugins are available at https://build.phonegap.com/plugins -->
    <!--
        <plugin name="com.phonegap.plugins.barcodescanner" />
    -->

    <!-- Define app icon for each platform. -->

    <icon src="Icon-29@1x.png" platform="ios" width="29" height="29" />
    <icon src="Icon-29@2x.png" platform="ios" width="58" height="58" />
    <icon src="Icon-29@3x.png" platform="ios" width="87" height="87" />
    <icon src="Icon-40@1x.png" platform="ios" width="40" height="40" />
    <icon src="Icon-40@2x.png" platform="ios" width="80" height="80" />
    <icon src="Icon-40@3x.png" platform="ios" width="120" height="120" />

    <!-- iPhone 6 / 6+ -->
	<icon src="Icon-60@3x.png" platform="ios" width="180" height="180" />

	<!-- iPhone / iPod Touch  -->
	<icon src="Icon-60.png" platform="ios" width="60" height="60" />
	<icon src="Icon-60@2x.png" platform="ios" width="120" height="120" />

	<!-- iPad -->
	<icon src="Icon-76.png" platform="ios" width="76" height="76" />
	<icon src="Icon-76@2x.png" platform="ios" width="152" height="152" />
	<icon src="Icon-76@3x.png" platform="ios" width="228" height="228" />
	<icon src="Icon-83.5@2x.png" platform="ios" width="167" height="167" />

    <icon src="icon.png" />
    <icon src="icon-36-ldpi.png"   platform="android"    qualifier="ldpi" />
    <icon src="icon-48-mdpi.png"   platform="android"    qualifier="mdpi" />
    <icon src="icon-72-hdpi.png"   platform="android"    qualifier="hdpi" />
    <icon src="icon-96-xhdpi.png"  platform="android"    qualifier="xhdpi" />
    <icon src="icon-144-xxhdpi.png"  platform="android"    qualifier="xxhdpi" />

    <!--<icon src="res/icon/ios/icon-57.png"            gap:platform="ios"        width="57" height="57" />
    <icon src="res/icon/ios/icon-72.png"            gap:platform="ios"        width="72" height="72" />
    <icon src="res/icon/ios/icon-57-2x.png"         gap:platform="ios"        width="114" height="114" />
    <icon src="res/icon/ios/icon-72-2x.png"         gap:platform="ios"        width="144" height="144" />
    -->

    <!-- Define app splash screen for each platform. -->
    <!-- iPhone and iPod touch -->
	<splash src="Default.png" platform="ios" width="320" height="480" />
	<splash src="Default@2x.png" platform="ios" width="640" height="960" />

	<!-- iPhone 5 / iPod Touch (5th Generation) -->
	<splash src="Default-568h@2x.png" platform="ios" width="640" height="1136" />

	<!-- iPhone 6 -->
	<splash src="Default-667h@2x.png" platform="ios" width="750" height="1334" />
	<splash src="Default-Portrait-736h@3x.png" platform="ios" width="1242" height="2208" />

	<!-- iPad -->
	<splash src="Default-Portrait.png" platform="ios" width="768" height="1024" />

	<!-- Retina iPad -->
	<splash src="Default-Portrait@2x.png" platform="ios" width="1536" height="2048" />

	<!-- Android -->
	<splash src="ldpi.png" platform="android" qualifier="ldpi" />
	<splash src="mdpi.png" platform="android" qualifier="mdpi" />
	<splash src="hdpi.png" platform="android" qualifier="hdpi" />
	<splash src="xhdpi.png" platform="android" qualifier="xhdpi" />
	<splash src="portrait-xxhdpi.png" platform="android" qualifier="port-xxhdpi" />

 <!--   <gap:splash src="res/screen/android/screen-ldpi-portrait.png"       gap:platform="android" gap:qualifier="port-ldpi" />
    <gap:splash src="res/screen/android/screen-mdpi-portrait.png"       gap:platform="android" gap:qualifier="port-mdpi" />
    <gap:splash src="res/screen/android/screen-hdpi-portrait.png"       gap:platform="android" gap:qualifier="port-hdpi" />
    <gap:splash src="res/screen/android/screen-xhdpi-portrait.png"      gap:platform="android" gap:qualifier="port-xhdpi" />
    <gap:splash src="res/screen/blackberry/screen-225.png"              gap:platform="blackberry" />
    <gap:splash src="res/screen/ios/screen-iphone-portrait.png"         gap:platform="ios"     width="320" height="480" />
    <gap:splash src="res/screen/ios/screen-iphone-portrait-2x.png"      gap:platform="ios"     width="640" height="960" />
    <gap:splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" gap:platform="ios"     width="640" height="1136" />
    <gap:splash src="res/screen/ios/screen-ipad-portrait.png"           gap:platform="ios"     width="768" height="1024" />
    <gap:splash src="res/screen/ios/screen-ipad-landscape.png"          gap:platform="ios"     width="1024" height="768" />
    <gap:splash src="res/screen/windows-phone/screen-portrait.jpg"      gap:platform="winphone" />

 -->

 <edit-config file="*-Info.plist" mode="merge" platform="ios" target="NSCameraUsageDescription">
        <string>De app gebruikt de camera om foto's van uw recept(en) te maken</string>
    </edit-config>

    <edit-config file="*-Info.plist" mode="merge" platform="ios" target="NSPhotoLibraryUsageDescription">
        <string>De app gebruikt de foto bibliotheek om foto's van uw recept(en) te maken</string>
    </edit-config>

    <gap:config-file platform="ios" parent="CFBundleShortVersionString">
    <string>100</string>
    </gap:config-file>

    <!--
        Define access to external domains.

        <access />            - a blank access tag denies access to all external resources.
        <access origin="*" /> - a wildcard access tag allows access to all external resource.

        Otherwise, you can specify specific domains:

        <access origin="http://phonegap.com" />                    - allow any secure requests to http://phonegap.com/
        <access origin="http://phonegap.com" subdomains="true" />  - same as above, but including subdomains, such as http://build.phonegap.com/
        <access origin="http://phonegap.com" browserOnly="true" /> - only allows http://phonegap.com to be opened by the child browser.
    -->

    <access origin="http://ajax.googleapis.com" subdomains="true" />
    <access origin="http://code.jquery.com" subdomains="true" />
    <access origin="http://cdnjs.cloudflare.com" subdomains="true" />

    <access origin="*"/>
    <!-- Added the following intents to support the removal of whitelist code from base cordova to a plugin -->
    <!-- Whitelist configuration. Refer to https://cordova.apache.org/docs/en/edge/guide_appdev_whitelist_index.md.html -->
    <plugin name="cordova-plugin-whitelist" spec="~1.3.1" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>

</widget>


text:
use core::ops::Deref;
use fake_characteristic::FakeBluetoothGATTCharacteristic;
use std::error::Error;
use std::sync::{Arc, Mutex};

#[derive(Clone, Debug)]
pub struct FakeBluetoothGATTDescriptor {
    id: Arc<Mutex<String>>,
    uuid: Arc<Mutex<String>>,
    characteristic: Arc<FakeBluetoothGATTCharacteristic>,
    value: Arc<Mutex<Option<Vec<u8>>>>,
    flags: Arc<Mutex<Vec<String>>>,
}

impl FakeBluetoothGATTDescriptor {
    pub fn new(id: String,
               uuid: String,
               characteristic: Arc<FakeBluetoothGATTCharacteristic>,
               value: Option<Vec<u8>>,
               flags: Vec<String>)
               -> Arc<FakeBluetoothGATTDescriptor> {
        if let Ok(existing_descriptor) = characteristic.get_gatt_descriptor(id.clone()) {
            return existing_descriptor;
        }
        let descriptor = Arc::new(FakeBluetoothGATTDescriptor {
            id: Arc::new(Mutex::new(id)),
            uuid: Arc::new(Mutex::new(uuid)),
            characteristic: characteristic.clone(),
            value: Arc::new(Mutex::new(value)),
            flags: Arc::new(Mutex::new(flags)),
        });
        let _ = characteristic.add_descriptor(descriptor.clone());
        descriptor
    }

    pub fn new_empty(characteristic: Arc<FakeBluetoothGATTCharacteristic>,
                     descriptor_id: String)
                     -> Arc<FakeBluetoothGATTDescriptor> {
        FakeBluetoothGATTDescriptor::new(
            /*id*/ descriptor_id,
            /*uuid*/ String::new(),
            /*characteristic*/ characteristic,
            /*value*/ None,
            /*flags*/ vec!(),
        )
    }

    make_getter!(get_id, id);

    make_setter!(set_id, id);

    make_getter!(get_uuid, uuid, String);

    make_setter!(set_uuid, uuid, String);

    make_option_getter!(get_value, value, Vec<u8>);

    make_setter!(set_value, value, Option<Vec<u8>>);

    make_getter!(get_flags, flags, Vec<String>);

    make_setter!(set_flags, flags, Vec<String>);

    pub fn get_characteristic(&self) -> Result<Arc<FakeBluetoothGATTCharacteristic>, Box<Error>> {
        Ok(self.characteristic.clone())
    }

    pub fn read_value(&self) -> Result<Vec<u8>, Box<Error>> {
        self.get_value()
    }

    pub fn write_value(&self, value: Vec<u8>) -> Result<(), Box<Error>> {
        self.set_value(Some(value))
    }
}


text:
workers Integer(ENV['WEB_CONCURRENCY'] || 3)
threads Integer(ENV['MIN_THREADS'] || 8), Integer(ENV['MAX_THREADS'] || 12)

preload_app!

rackup      DefaultRackup
port        ENV['PORT']     || 3000
environment ENV['RACK_ENV'] || 'development'

on_worker_boot do
  # Valid on Rails 4.1+ using the `config/database.yml` method of setting `pool` size
  # https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
  ActiveRecord::Base.establish_connection
end


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

package org.apache.tapestry.junit.mock.c19;

import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.html.BasePage;
import org.apache.tapestry.request.IUploadFile;

/**
 *  Used in tests of upload and the {@link org.apache.tapestry.form.Upload}
 *  component.
 *
 *  @author Howard Lewis Ship
 *  @version $Id$
 *  @since 3.0
 *
 **/

public abstract class Home extends BasePage
{
    public abstract IUploadFile getUploadFile();
	public abstract void setUploadDisabled(boolean uploadDisabled);

    public void formSubmit(IRequestCycle cycle)
    {
    	IUploadFile file = getUploadFile();

    	if (file == null)
    	{
    		cycle.activate("Three");
    		return;
    	}

        Two page = (Two) cycle.getPage("Two");

        page.setFile(file);
        cycle.activate(page);
    }

    public void disableUpload(IRequestCycle cycle)
    {
    	setUploadDisabled(true);
    }
}


text:
from what_apps.utility.admin import autoregister
from models import ContentBlock
from models import Page
from django.contrib import admin

class ContentBlockAdmin(admin.ModelAdmin):
    model = ContentBlock

    list_display = ('headline', 'subhead')

admin.site.register(ContentBlock, ContentBlockAdmin)

class PageAdmin(admin.ModelAdmin):
    model = Page

    list_display = ('title',)

admin.site.register(Page, PageAdmin)

autoregister('cms')


text:
package com.heliosapm.streams.tracing;

import java.util.Collection;
import java.util.Properties;

import com.google.common.util.concurrent.Service;
import com.heliosapm.streams.metrics.StreamedMetric;

import io.netty.buffer.ByteBuf;

/**
 *
Title: IMetricWriter

 *
Description: Defines a class that accepts metrics from a tracer and writes it to an end-point

 * @author Whitehead (nwhitehead AT heliosdev DOT org)
 *
com.heliosapm.streams.tracing.IMetricWriter

 */

public interface IMetricWriter extends Service, MetricWriterMXBean {

	/**
	 * Indicates if this writer fully consumes written metrics before returning.
	 * @return true if metrics are fully consumed, false if they may be cached or linger
	 */
	public boolean areMetricsConsumed();

	/**
	 * Indicates if metric delivery is confirmed by callback or if metric writes are fire-n-forget
	 * @return true if metric delivery is confirmed by callback, false if metric writes are fire-n-forget
	 */
	public boolean areMetricsConfirmed();

	/**
	 * Handles the delivery of an array of {@link StreamedMetric} instances
	 * @param metrics The metrics to deliver
	 */
	public void onMetrics(final StreamedMetric...metrics);

	/**
	 * Handles the delivery of a collection of {@link StreamedMetric} instances
	 * @param metrics The metrics to deliver
	 */
	public void onMetrics(final Collection<StreamedMetric> metrics);

	/**
	 * Handles the delivery of a collection of {@link StreamedMetric} instances encoded in a {@link ByteBuf}
	 * @param metrics The buffer containing metrics to deliver
	 *
Encoding rules so far:

	 *
The first byte represents a 0 for no compression, or a 1 for gzipped.

	 *
The next 4 bytes represent an int that indicates how many metrics are contained in the buffer

	 *

	 *

	 */
	public void onMetrics(final ByteBuf metrics);

	/**
	 * Indicates the number of metrics sent, but not confirmed
	 * @return the number of metrics sent
	 */
	public long getMetricsSent();

	/**
	 * Indicates the number of metrics sent and confirmed
	 * @return the number of confirmed metrics sent
	 */
	public long getConfirmedMetricsSent();

	/**
	 * Returns the number of metrics sent but pending confirmation
	 * @return the number of metrics sent but pending confirmation
	 */
	public long getMetricsPending();

	/**
	 * Indicates the number of metric send errors
	 * @return the number of metric send errors
	 */
	public long getSendErrors();

	/**
	 * Passes the writer its configuration
	 * @param config the writer's configuration
	 */
	public void configure(Properties config);

	/**
	 * Performs any initialization required for this writer to deliver metrics
	 * @throws Exception thrown on any failure to initialize the writer
	 */
	public void start() throws Exception;

	/**
	 * Callback to shutdown and clean up any allocated resoures for this writer
	 */
	public void stop();

	/**
	 * Indicates if this writer is started
	 * @return true if this writer is started, false otherwise
	 */
	public boolean isStarted();

	/**
	 * Indicates if this writer is connected
	 * @return true if this writer is connected, false otherwise
	 */
	public boolean isConnected();

}


text:
/*
 * Written by Doug Lea with assistance from members of JCP JSR-166
 * Expert Group and released to the public domain, as explained at
 * http://creativecommons.org/publicdomain/zero/1.0/
 */

/**
 * Utility classes commonly useful in concurrent programming.  This
 * package includes a few small standardized extensible frameworks, as
 * well as some classes that provide useful functionality and are
 * otherwise tedious or difficult to implement.  Here are brief
 * descriptions of the main components.  See also the
 * {@link java.util.concurrent.locks} and
 * {@link java.util.concurrent.atomic} packages.
 *
 *
Executors

 *
 * Interfaces.
 *
 * {@link java.util.concurrent.Executor} is a simple standardized
 * interface for defining custom thread-like subsystems, including
 * thread pools, asynchronous I/O, and lightweight task frameworks.
 * Depending on which concrete Executor class is being used, tasks may
 * execute in a newly created thread, an existing task-execution thread,
 * or the thread calling {@link java.util.concurrent.Executor#execute
 * execute}, and may execute sequentially or concurrently.
 *
 * {@link java.util.concurrent.ExecutorService} provides a more
 * complete asynchronous task execution framework.  An
 * ExecutorService manages queuing and scheduling of tasks,
 * and allows controlled shutdown.
 *
 * The {@link java.util.concurrent.ScheduledExecutorService}
 * subinterface and associated interfaces add support for
 * delayed and periodic task execution.  ExecutorServices
 * provide methods arranging asynchronous execution of any
 * function expressed as {@link java.util.concurrent.Callable},
 * the result-bearing analog of {@link java.lang.Runnable}.
 *
 * A {@link java.util.concurrent.Future} returns the results of
 * a function, allows determination of whether execution has
 * completed, and provides a means to cancel execution.
 *
 * A {@link java.util.concurrent.RunnableFuture} is a {@code Future}
 * that possesses a {@code run} method that upon execution,
 * sets its results.
 *
 *

 *
 * Implementations.
 *
 * Classes {@link java.util.concurrent.ThreadPoolExecutor} and
 * {@link java.util.concurrent.ScheduledThreadPoolExecutor}
 * provide tunable, flexible thread pools.
 *
 * The {@link java.util.concurrent.Executors} class provides
 * factory methods for the most common kinds and configurations
 * of Executors, as well as a few utility methods for using
 * them.  Other utilities based on {@code Executors} include the
 * concrete class {@link java.util.concurrent.FutureTask}
 * providing a common extensible implementation of Futures, and
 * {@link java.util.concurrent.ExecutorCompletionService}, that
 * assists in coordinating the processing of groups of
 * asynchronous tasks.
 *
 *
Class {@link java.util.concurrent.ForkJoinPool} provides an
 * Executor primarily designed for processing instances of {@link
 * java.util.concurrent.ForkJoinTask} and its subclasses.  These
 * classes employ a work-stealing scheduler that attains high
 * throughput for tasks conforming to restrictions that often hold in
 * computation-intensive parallel processing.
 *
 *
Queues

 *
 * The {@link java.util.concurrent.ConcurrentLinkedQueue} class
 * supplies an efficient scalable thread-safe non-blocking FIFO queue.
 * The {@link java.util.concurrent.ConcurrentLinkedDeque} class is
 * similar, but additionally supports the {@link java.util.Deque}
 * interface.
 *
 *
Five implementations in {@code java.util.concurrent} support
 * the extended {@link java.util.concurrent.BlockingQueue}
 * interface, that defines blocking versions of put and take:
 * {@link java.util.concurrent.LinkedBlockingQueue},
 * {@link java.util.concurrent.ArrayBlockingQueue},
 * {@link java.util.concurrent.SynchronousQueue},
 * {@link java.util.concurrent.PriorityBlockingQueue}, and
 * {@link java.util.concurrent.DelayQueue}.
 * The different classes cover the most common usage contexts
 * for producer-consumer, messaging, parallel tasking, and
 * related concurrent designs.
 *
 *
Extended interface {@link java.util.concurrent.TransferQueue},
 * and implementation {@link java.util.concurrent.LinkedTransferQueue}
 * introduce a synchronous {@code transfer} method (along with related
 * features) in which a producer may optionally block awaiting its
 * consumer.
 *
 *
The {@link java.util.concurrent.BlockingDeque} interface
 * extends {@code BlockingQueue} to support both FIFO and LIFO
 * (stack-based) operations.
 * Class {@link java.util.concurrent.LinkedBlockingDeque}
 * provides an implementation.
 *
 *
Timing

 *
 * The {@link java.util.concurrent.TimeUnit} class provides
 * multiple granularities (including nanoseconds) for
 * specifying and controlling time-out based operations.  Most
 * classes in the package contain operations based on time-outs
 * in addition to indefinite waits.  In all cases that
 * time-outs are used, the time-out specifies the minimum time
 * that the method should wait before indicating that it
 * timed-out.  Implementations make a "best effort"
 * to detect time-outs as soon as possible after they occur.
 * However, an indefinite amount of time may elapse between a
 * time-out being detected and a thread actually executing
 * again after that time-out.  All methods that accept timeout
 * parameters treat values less than or equal to zero to mean
 * not to wait at all.  To wait "forever", you can use a value
 * of {@code Long.MAX_VALUE}.
 *
 *
Synchronizers

 *
 * Five classes aid common special-purpose synchronization idioms.
 *

 *
 *
{@link java.util.concurrent.Semaphore} is a classic concurrency tool.
 *
 *
{@link java.util.concurrent.CountDownLatch} is a very simple yet
 * very common utility for blocking until a given number of signals,
 * events, or conditions hold.
 *
 *
A {@link java.util.concurrent.CyclicBarrier} is a resettable
 * multiway synchronization point useful in some styles of parallel
 * programming.
 *
 *
A {@link java.util.concurrent.Phaser} provides
 * a more flexible form of barrier that may be used to control phased
 * computation among multiple threads.
 *
 *
An {@link java.util.concurrent.Exchanger} allows two threads to
 * exchange objects at a rendezvous point, and is useful in several
 * pipeline designs.
 *
 *

 *
 *
Concurrent Collections

 *
 * Besides Queues, this package supplies Collection implementations
 * designed for use in multithreaded contexts:
 * {@link java.util.concurrent.ConcurrentHashMap},
 * {@link java.util.concurrent.ConcurrentSkipListMap},
 * {@link java.util.concurrent.ConcurrentSkipListSet},
 * {@link java.util.concurrent.CopyOnWriteArrayList}, and
 * {@link java.util.concurrent.CopyOnWriteArraySet}.
 * When many threads are expected to access a given collection, a
 * {@code ConcurrentHashMap} is normally preferable to a synchronized
 * {@code HashMap}, and a {@code ConcurrentSkipListMap} is normally
 * preferable to a synchronized {@code TreeMap}.
 * A {@code CopyOnWriteArrayList} is preferable to a synchronized
 * {@code ArrayList} when the expected number of reads and traversals
 * greatly outnumber the number of updates to a list.
 *
 *
The "Concurrent" prefix used with some classes in this package
 * is a shorthand indicating several differences from similar
 * "synchronized" classes.  For example {@code java.util.Hashtable} and
 * {@code Collections.synchronizedMap(new HashMap())} are
 * synchronized.  But {@link
 * java.util.concurrent.ConcurrentHashMap} is "concurrent".  A
 * concurrent collection is thread-safe, but not governed by a
 * single exclusion lock.  In the particular case of
 * ConcurrentHashMap, it safely permits any number of
 * concurrent reads as well as a tunable number of concurrent
 * writes.  "Synchronized" classes can be useful when you need
 * to prevent all access to a collection via a single lock, at
 * the expense of poorer scalability.  In other cases in which
 * multiple threads are expected to access a common collection,
 * "concurrent" versions are normally preferable.  And
 * unsynchronized collections are preferable when either
 * collections are unshared, or are accessible only when
 * holding other locks.
 *
 *
Most concurrent Collection implementations
 * (including most Queues) also differ from the usual {@code java.util}
 * conventions in that their {@linkplain java.util.Iterator Iterators}
 * and {@linkplain java.util.Spliterator Spliterators} provide
 * weakly consistent rather than fast-fail traversal:
 *

 *
they may proceed concurrently with other operations
 *
they will never throw {@link java.util.ConcurrentModificationException
 * ConcurrentModificationException}
 *
they are guaranteed to traverse elements as they existed upon
 * construction exactly once, and may (but are not guaranteed to)
 * reflect any modifications subsequent to construction.
 *

 *
 *
Memory Consistency Properties

 *
 *
 * Chapter 17 of
 * The Java™ Language Specification defines the
 * happens-before relation on memory operations such as reads and
 * writes of shared variables.  The results of a write by one thread are
 * guaranteed to be visible to a read by another thread only if the write
 * operation happens-before the read operation.  The
 * {@code synchronized} and {@code volatile} constructs, as well as the
 * {@code Thread.start()} and {@code Thread.join()} methods, can form
 * happens-before relationships.  In particular:
 *
 *

 *
Each action in a thread happens-before every action in that
 *   thread that comes later in the program's order.
 *
 *
An unlock ({@code synchronized} block or method exit) of a
 *   monitor happens-before every subsequent lock ({@code synchronized}
 *   block or method entry) of that same monitor.  And because
 *   the happens-before relation is transitive, all actions
 *   of a thread prior to unlocking happen-before all actions
 *   subsequent to any thread locking that monitor.
 *
 *
A write to a {@code volatile} field happens-before every
 *   subsequent read of that same field.  Writes and reads of
 *   {@code volatile} fields have similar memory consistency effects
 *   as entering and exiting monitors, but do not entail
 *   mutual exclusion locking.
 *
 *
A call to {@code start} on a thread happens-before any
 *   action in the started thread.
 *
 *
All actions in a thread happen-before any other thread
 *   successfully returns from a {@code join} on that thread.
 *
 *

 *
 *
 * The methods of all classes in {@code java.util.concurrent} and its
 * subpackages extend these guarantees to higher-level
 * synchronization.  In particular:
 *
 *

 *
 *
Actions in a thread prior to placing an object into any concurrent
 *   collection happen-before actions subsequent to the access or
 *   removal of that element from the collection in another thread.
 *
 *
Actions in a thread prior to the submission of a {@code Runnable}
 *   to an {@code Executor} happen-before its execution begins.
 *   Similarly for {@code Callables} submitted to an {@code ExecutorService}.
 *
 *
Actions taken by the asynchronous computation represented by a
 *   {@code Future} happen-before actions subsequent to the
 *   retrieval of the result via {@code Future.get()} in another thread.
 *
 *
Actions prior to "releasing" synchronizer methods such as
 *   {@code Lock.unlock}, {@code Semaphore.release}, and
 *   {@code CountDownLatch.countDown} happen-before actions
 *   subsequent to a successful "acquiring" method such as
 *   {@code Lock.lock}, {@code Semaphore.acquire},
 *   {@code Condition.await}, and {@code CountDownLatch.await} on the
 *   same synchronizer object in another thread.
 *
 *
For each pair of threads that successfully exchange objects via
 *   an {@code Exchanger}, actions prior to the {@code exchange()}
 *   in each thread happen-before those subsequent to the
 *   corresponding {@code exchange()} in another thread.
 *
 *
Actions prior to calling {@code CyclicBarrier.await} and
 *   {@code Phaser.awaitAdvance} (as well as its variants)
 *   happen-before actions performed by the barrier action, and
 *   actions performed by the barrier action happen-before actions
 *   subsequent to a successful return from the corresponding {@code await}
 *   in other threads.
 *
 *

 *
 * @since 1.5
 */
package java.util.concurrent;


text:
存货:  现货

VAIO fit laptop - windows 8 SVF14322CXW

sony

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ornare turpis non risus semper dapibus. Quisque eu vehicula turpis. Donec sodales lacinia eros, sit amet auctor tellus volutpat non.

$1740.00

$2199.00

                            <form>

                                <input name="quantity" readonly="readonly" type="text" value="1" />

                            </form>

                        加入购物车

商品详情

商品属性

商品评价 (3)

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sit amet porttitor eros. Praesent quis diam placerat, accumsan velit interdum, accumsan orci. Nunc libero sem, elementum in semper in, sollicitudin vitae dolor. Etiam sed tempus nisl. Integer vel diam nulla. Suspendisse et aliquam est. Nulla molestie ante et tortor sollicitudin, at elementum odio lobortis. Pellentesque neque enim, feugiat in elit sed, pharetra tempus metus. Pellentesque non lorem nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.

Sed consequat orci vel rutrum blandit. Nam non leo vel risus cursus porta quis non nulla. Vestibulum vitae pellentesque nunc. In hac habitasse platea dictumst. Cras egestas, turpis a malesuada mollis, magna tortor scelerisque urna, in pellentesque diam tellus sit amet velit. Donec vel rhoncus nisi, eget placerat elit. Phasellus dignissim nisl vel lectus vehicula, eget vehicula nisl egestas. Duis pretium sed risus dapibus egestas. Nam lectus felis, sodales sit amet turpis se.

                                SKU:
                                54687621

                            /

                                categories:
                                -50% sale,
                                gaming,
                                desktop PC

                            /

                                tag:
                                fast,
                                gaming,
                                strong

                                weight

7.25 kg

                                dimensions

90x60x90 cm

                                size

one size fits all

                                color

white

                                guarantee

5 years

                                SKU:
                                54687621

                            /

                                categories:
                                -50% sale,
                                gaming,
                                desktop PC

                            /

                                tag:
                                fast,
                                gaming,
                                strong

                                                    John Smith

                                                    12.07.2013

                                                Integer id purus ultricies nunc tincidunt congue vitae nec felis. Vivamus sit amet nisl convallis, faucibus risus in, suscipit sapien. Vestibulum egestas interdum tellus id venenatis.

                                                    Jane Smith

                                                    12.07.2013

                                                Integer id purus ultricies nunc tincidunt congue vitae nec felis. Vivamus sit amet nisl convallis, faucibus risus in, suscipit sapien. Vestibulum egestas interdum tellus id venenatis.

                                                    John Doe

                                                    12.07.2013

                                                Integer id purus ultricies nunc tincidunt congue vitae nec felis. Vivamus sit amet nisl convallis, faucibus risus in, suscipit sapien. Vestibulum egestas interdum tellus id venenatis.

Add review

                                    <form id="contact-form" class="contact-form" method="post" >

                                                name*
                                                <input class="le-input" >

                                                email*
                                                <input class="le-input" >

                                            your rating

                                            your review
                                            <textarea rows="8" class="le-input"></textarea>

                                            <button type="submit" class="le-button huge">submit</button>

                                    </form>

最近浏览

sale

                                    LC-70UD1U 70" class aquos 4K ultra HD

Sharp

$1199.00

                                    加入购物车

new!

                                    cinemizer OLED 3D virtual reality TV Video

zeiss

$1199.00

                                    加入购物车

                                    s2340T23" full HD multi-Touch Monitor

dell

$1199.00

                                    加入购物车

new!

                                    kardon BDS 7772/120 integrated 3D

harman

$1199.00

                                    加入购物车

bestseller

                                    netbook acer travel B113-E-10072

acer

$1199.00

                                    加入购物车

                                    iPod touch 5th generation,64GB, blue

apple

$1199.00

                                    加入购物车

                                    s2340T23" full HD multi-Touch Monitor

dell

$1199.00

                                    加入购物车

new!

                                    kardon BDS 7772/120 integrated 3D

harman

$1199.00

                                    加入购物车


text:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * Message string can be used with plural forms format. Check i18n section
 * of the guide for details.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 */
return array (
  'Communication' => '通信',
  'Created at' => '创建时间',
  'Created by' => '创建人',
  'Description' => '描述',
  'General' => '一般',
  'ID' => '',
  'Module' => '模块',
  'Social bookmarks' => '社交标签',
  'Sort order' => '排序',
  'Title' => '标题',
  'Translation Category ID' => '',
  'Updated at' => '修改时间',
  'Updated by' => '修改人',
  'Visibility' => '可见性',
);