text:
(function() {
    'use strict';

    angular.module('myApp').controller('UsuarioCtrl', UsuarioCtrl);

    UsuarioCtrl.$inject = ['config', 'usuarioService', '$rootScope', '$scope', '$state', '$mdDialog'];

    function UsuarioCtrl(config, usuarioService, $rootScope, $scope, $state, $mdDialog) {

        var vm = this;
        vm.init = init;
        vm.getData = getData;
        vm.create = create;
        vm.update = update;
        vm.remove = remove;
        vm.usuario = {
            limit: 5,
            page: 1,
            selected: [],
            order: '',
            data: [],
            pagination: pagination,
            total: 0
        };

        function init(event) {

            var filterLast = JSON.parse(localStorage.getItem('filter')) || {};

            if (filterLast[$state.current.url.split('/')[1]]) {
                vm.filter = filterLast;
            } else {
                vm.filter = {};
                vm.filter[$state.current.url.split('/')[1]] = true;
            }

            getData({ reset: true });
        }

        // $on
        // https://docs.angularjs.org/api/ng/type/$rootScope.Scope
        $scope.$on('broadcastTest', function() {
            console.info('broadcastTest!');
            //getData();
        });

        function pagination(page, limit) {
            vm.usuario.data = [];
            getData();
        }

        function getData(params) {
            params = params || {};

            vm.filter.page = vm.usuario.page;
            vm.filter.limit = vm.usuario.limit;

            if (params.reset) {
                vm.usuario.data = [];
            }

            localStorage.setItem('filter', JSON.stringify(vm.filter));

            vm.usuario.promise = usuarioService.get(vm.filter)
                .then(function success(response) {
                    //console.info('success', response);
                    vm.usuario.total = response.recordCount;

                    // Ajustar date
                    for (var i = 0; i <= response.query.length - 1; i++) {
                        if (response.query[i].USU_ULTIMOACESSO !== '') {
                            response.query[i].USU_ULTIMOACESSO = new Date(response.query[i].USU_ULTIMOACESSO);
                        }
                    }
                    vm.usuario.data = vm.usuario.data.concat(response.query);
                }, function error(response) {
                    console.error('error', response);
                });
        }

        function create() {
            $state.go('usuario-form');
        }

        function update(id) {
            $state.go('usuario-form', { id: id });
        }

        function remove(event) {
            var confirm = $mdDialog.confirm()
                .title('ATENÇÃO')
                .textContent('Deseja realmente remover o(s) item(ns) selecionado(s)?')
                .targetEvent(event)
                .ok('SIM')
                .cancel('NÃO');

            $mdDialog.show(confirm).then(function() {
                usuarioService.remove(vm.usuario.selected)
                    .then(function success(response) {
                        if (response.success) {
                            $('.md-selected').remove();
                            vm.usuario.selected = [];
                        }
                    }, function error(response) {
                        console.error('error', response);
                    });
            }, function() {
                // cancel
            });
        }
    }
})();


text:
layout: post
date:	2007-12-31 14:35:00
title:  The birds of Kanha and some of Pune
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
Here are some of the birds we saw; with the exception of a few, they are all birds that can be seen just outside Bangalore, too! But it was no less enjoyable to sight them in distant Madhya Pradesh.

The SIBERIAN STONECHAT (male)....

and the female...

<lj-cut text="birds, birds, birds, click here">

The EURASIAN THICKNEE, which used to be called the STORM CURLEW....

A couple of COLLARED SCOPS OWLS, peacefully sitting in the tree:

Later, we saw just one in the tree:

A LITTLE GREBE, making lovely patterns in the water:

The YELLOW-FOOTED GREEN PIGEON:

WHITE-RUMPED VULTURES feeding off a predator's kill:

and landing on a tree nearby:

A RUFOUS TREEPIE feeding:

This bird would NOT give us a good shot all the time we were at Kanha; but when we had packed our cameras, and took the taxi on the ghat road from Kanha down towards Nagpur, sat in the light  at at least seven places and I swear they were all smiling mockingly at us, I want to call it the Mockingbird!

The JUNGLE PRINIA:

The JUNGLE OWLET: (our uzliss guide insisted it was the Forest Owlet, thanks, <LJ user="sainath"> for confirming my first, and correct, id)

The GREY WAGTAIL:

The GREATER RACKET-TAILED DRONGO:

Let me digress a little here to show some lovely birds which we were able to see in the middle of Pune city, before we went to Kanha:

The INDIAN GREY HORNBILL:

The COPPERSMITH BARBET, which is becoming much more scarce in Bangalore than its cousin, the small green (white-cheeked) barbet:

These two views of the  PURPLE SUNBIRD (eclipse male, thank you Sainath!)

and

Let's get back to Kanha....

The birds which I saw for the first time, and have not seen  in Karnataka (I don't know, they may be residents/visitors here too; it's just that *I* haven't seen them here!):

The LESSER ADUTANT STORK:

The ALEXANDRINE PARAKEET:

The BROWN-HEADED BARBET:

The SIRKEER MALKOHA, of which I could not get a better shot than this silhouette:

The BLACK-HOODED ORIOLE:

And the CHANGEABLE HAWK EAGLE (also called the crested hawk eagle), though I have seen it before in Karnataka, needs some time to be spent on it, it's such a handsome, majestic bird....once, on a birding trip with Sainath, we spotted it JUST after my camera battery died...and I have waited for another photo-op like this! We saw both the male and female in their nest, which they were busy building up, and one or the other would come out to perch on the branches of one or two trees nearby, and even when they were in the shade, it was delightful to photograph them:

</lj-cut>

Here's the final photo, of the Hawk Eagle calling to the mate....on INW, I titled this, "Hey! Why don't you come and help with the housework?"

Hope you enjoyed the avian tour of Kanha and Pune!

redpajama_set_name: RedPajamaGithub


text:
package fastdex.build.lib.snapshoot.sourceset;

import fastdex.build.lib.snapshoot.api.DiffResultSet;

/**
 * Created by tong on 17/3/29.
 */
public class JavaDirectoryDiffResultSet extends DiffResultSet<JavaFileDiffInfo> {
    public String projectPath;

    public JavaDirectoryDiffResultSet() {
    }

    public JavaDirectoryDiffResultSet(JavaDirectoryDiffResultSet resultSet) {
        super(resultSet);
    }
}


text:
package render

import (
	"context"

	"github.com/weaveworks/scope/report"
)

// TopologySelector selects a single topology from a report.
// NB it is also a Renderer!
type TopologySelector string

// Render implements Renderer
func (t TopologySelector) Render(ctx context.Context, r report.Report) Nodes {
	topology, _ := r.Topology(string(t))
	return Nodes{Nodes: topology.Nodes}
}

// The topology selectors implement a Renderer which fetch the nodes from the
// various report topologies.
var (
	SelectEndpoint              = TopologySelector(report.Endpoint)
	SelectProcess               = TopologySelector(report.Process)
	SelectContainer             = TopologySelector(report.Container)
	SelectContainerImage        = TopologySelector(report.ContainerImage)
	SelectHost                  = TopologySelector(report.Host)
	SelectPod                   = TopologySelector(report.Pod)
	SelectService               = TopologySelector(report.Service)
	SelectDeployment            = TopologySelector(report.Deployment)
	SelectDaemonSet             = TopologySelector(report.DaemonSet)
	SelectStatefulSet           = TopologySelector(report.StatefulSet)
	SelectCronJob               = TopologySelector(report.CronJob)
	SelectJob                   = TopologySelector(report.Job)
	SelectECSTask               = TopologySelector(report.ECSTask)
	SelectECSService            = TopologySelector(report.ECSService)
	SelectSwarmService          = TopologySelector(report.SwarmService)
	SelectOverlay               = TopologySelector(report.Overlay)
	SelectPersistentVolume      = TopologySelector(report.PersistentVolume)
	SelectPersistentVolumeClaim = TopologySelector(report.PersistentVolumeClaim)
	SelectStorageClass          = TopologySelector(report.StorageClass)
	SelectVolumeSnapshot        = TopologySelector(report.VolumeSnapshot)
	SelectVolumeSnapshotData    = TopologySelector(report.VolumeSnapshotData)
)


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using PcapngUtils.PcapNG;
using PcapngUtils.PcapNG.CommonTypes;
using PcapngUtils.PcapNG.BlockTypes;
using PcapngUtils.Extensions;
using PcapngUtils.PcapNG.OptionTypes;
using System.Diagnostics.Contracts;
using NUnit.Framework;
namespace PcapngUtils.PcapNG.BlockTypes
{
    [ToString]
    public sealed class InterfaceStatisticsBlock:AbstractBlock
    {
        #region nUnitTest
        [TestFixture]
        private static class InterfaceStatisticsBlock_Test
        {
            [TestCase(true)]
            [TestCase(false)]
            public static void InterfaceStatisticsBlock_ConvertToByte_Test(bool reorder)
            {
                InterfaceStatisticsBlock preStatisticBlock, postStatisticBlock;
                byte[] byteblock = { 5, 0, 0, 0, 108, 0, 0, 0, 1, 0, 0, 0, 34, 18, 5, 0, 87, 234, 56, 202, 1, 0, 28, 0, 67, 111, 117, 110, 116, 101, 114, 115, 32, 112, 114, 111, 118, 105, 100, 101, 100, 32, 98, 121, 32, 100, 117, 109, 112, 99, 97, 112, 2, 0, 8, 0, 34, 18, 5, 0, 36, 137, 18, 202, 3, 0, 8, 0, 34, 18, 5, 0, 87, 234, 56, 202, 4, 0, 8, 0, 56, 0, 0, 0, 0, 0, 0, 0, 5, 0, 8, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 0, 0, 0 };
                using (MemoryStream stream = new MemoryStream(byteblock))
                {
                    using (BinaryReader binaryReader = new BinaryReader(stream))
                    {
                        AbstractBlock block = AbstractBlockFactory.ReadNextBlock(binaryReader, false, null);
                        Assert.IsNotNull(block);
                        preStatisticBlock = block as InterfaceStatisticsBlock;
                        Assert.IsNotNull(preStatisticBlock);
                        byteblock = preStatisticBlock.ConvertToByte(reorder, null);
                    }
                }
                using (MemoryStream stream = new MemoryStream(byteblock))
                {
                    using (BinaryReader binaryReader = new BinaryReader(stream))
                    {
                        AbstractBlock block = AbstractBlockFactory.ReadNextBlock(binaryReader, reorder, null);
                        Assert.IsNotNull(block);
                        postStatisticBlock = block as InterfaceStatisticsBlock;
                        Assert.IsNotNull(postStatisticBlock);

                        Assert.AreEqual(preStatisticBlock.BlockType, postStatisticBlock.BlockType);
                        Assert.AreEqual(preStatisticBlock.InterfaceID, postStatisticBlock.InterfaceID);
                        Assert.AreEqual(preStatisticBlock.Timestamp, postStatisticBlock.Timestamp);
                        Assert.AreEqual(preStatisticBlock.Options.Comment, postStatisticBlock.Options.Comment);
                        Assert.AreEqual(preStatisticBlock.Options.DeliveredToUser, postStatisticBlock.Options.DeliveredToUser);
                        Assert.AreEqual(preStatisticBlock.Options.EndTime, postStatisticBlock.Options.EndTime);
                        Assert.AreEqual(preStatisticBlock.Options.StartTime, postStatisticBlock.Options.StartTime);
                        Assert.AreEqual(preStatisticBlock.Options.FilterAccept, postStatisticBlock.Options.FilterAccept);
                        Assert.AreEqual(preStatisticBlock.Options.InterfaceDrop, postStatisticBlock.Options.InterfaceDrop);
                        Assert.AreEqual(preStatisticBlock.Options.InterfaceReceived, postStatisticBlock.Options.InterfaceReceived);
                        Assert.AreEqual(preStatisticBlock.Options.SystemDrop, postStatisticBlock.Options.SystemDrop);
                    }
                }
            }
        }
        #endregion

        #region Properties
        /// <summary>
        /// The block type
        /// </summary>
        public override BaseBlock.Types BlockType
        {
            get { return BaseBlock.Types.InterfaceStatistics; }
        }

        /// <summary>
        /// Interface ID: it specifies the interface these statistics refers to; the correct interface will be the one whose Interface
        /// Description Block (within the current Section of the file) is identified by same number (see Section 3.2) of this field.
        /// Please note: in former versions of this document, this field was 16 bits only. As this differs from its usage in other places
        /// of this doc and as this block was not used "in the wild" before (as to the knowledge of the authors), it seems reasonable to
        /// change it to 32 bits!
        /// </summary>
        public int InterfaceID
        {
            get;
            set;
        }

        /// <summary>
        /// contains information about relations between packet and interface  on which it was captured
        /// </summary>
        public override int? AssociatedInterfaceID
        {
            get { return InterfaceID; }
        }

        /// <summary>
        /// Timestamp: time this statistics refers to. The format of the timestamp is the same already defined in the Enhanced Packet
        /// Timestamp (High) and Timestamp (Low): high and low 32-bits of a 64-bit quantity representing the timestamp. The timestamp is a
        /// single 64-bit unsigned integer representing the number of units since 1/1/1970. The way to interpret this field is specified by the
        /// 'if_tsresol' option (see Figure 9) of the Interface Description block referenced by this packet. Please note that differently
        /// from the libpcap file format, timestamps are not saved as two 32-bit values accounting for the seconds and microseconds since
        /// 1/1/1970. They are saved as a single 64-bit quantity saved as two 32-bit words.
        /// </summary>
        public TimestampHelper Timestamp
        {
            get;
            set;
        }

        private InterfaceStatisticsOption options;
        /// <summary>
        /// optional fields. Optional fields can be used to insert some information that may be useful when reading data, but that is not
        /// really needed for packet processing. Therefore, each tool can either read the content of the optional fields (if any),
        /// or skip some of them or even all at once.
        /// </summary>
        public InterfaceStatisticsOption Options
        {
            get
            {
                return options;
            }
            set
            {
                Contract.Requires<ArgumentNullException>(value != null, "Options cannot be null");
                options = value;
            }
        }
        #endregion

        #region ctor
        public static InterfaceStatisticsBlock Parse(BaseBlock baseBlock, Action<Exception> ActionOnException)
        {
            Contract.Requires<ArgumentNullException>(baseBlock != null, "BaseBlock cannot be null");
            Contract.Requires<ArgumentNullException>(baseBlock.Body != null, "BaseBlock.Body cannot be null");
            Contract.Requires<ArgumentException>(baseBlock.BlockType == BaseBlock.Types.InterfaceStatistics, "Invalid packet type");

            long positionInStream = baseBlock.PositionInStream;
            using (Stream stream = new MemoryStream(baseBlock.Body))
            {
                using (BinaryReader binaryReader = new BinaryReader(stream))
                {
                    int interfaceID = binaryReader.ReadInt32().ReverseByteOrder(baseBlock.ReverseByteOrder);
                    byte[] timestamp = binaryReader.ReadBytes(8);
                    if (timestamp.Length < 8)
                        throw new EndOfStreamException("Unable to read beyond the end of the stream");
                    TimestampHelper timestampHelper = new TimestampHelper(timestamp, baseBlock.ReverseByteOrder);
                    InterfaceStatisticsOption options = InterfaceStatisticsOption.Parse(binaryReader, baseBlock.ReverseByteOrder, ActionOnException);
                    InterfaceStatisticsBlock statisticBlock = new InterfaceStatisticsBlock(interfaceID, timestampHelper, options, positionInStream);
                    return statisticBlock;
                }
            }
        }

        /// <summary>
        /// The Interface Statistics Block contains the capture statistics for a given interface and it is optional. The statistics are referred
        /// to the interface defined in the current Section identified by the Interface ID field. An Interface Statistics Block is normally
        /// placed at the end of the file, but no assumptions can be taken about its position - it can even appear multiple times for the same
        /// interface.
        /// </summary>
        public InterfaceStatisticsBlock(int InterfaceID, TimestampHelper Timestamp, InterfaceStatisticsOption Options, long PositionInStream = 0)
        {
            Contract.Requires<ArgumentNullException>(Timestamp != null, "Timestamp cannot be null");
            Contract.Requires<ArgumentNullException>(Options != null, "Options cannot be null");

            this.InterfaceID = InterfaceID;
            this.Timestamp = Timestamp;
            this.options = Options;
            this.PositionInStream = PositionInStream;
        }
        #endregion;

        #region method
        protected override BaseBlock ConvertToBaseBlock(bool reverseByteOrder, Action<Exception> ActionOnException)
        {
            List<byte> body = new List<byte>();
            body.AddRange(BitConverter.GetBytes(InterfaceID.ReverseByteOrder(reverseByteOrder)));
            body.AddRange(Timestamp.ConvertToByte(reverseByteOrder));
            body.AddRange(Options.ConvertToByte(reverseByteOrder, ActionOnException));
            BaseBlock baseBlock = new BaseBlock(this.BlockType, body.ToArray(), reverseByteOrder, 0);
            return baseBlock;
        }
        #endregion
    }
}


text:
require "llt/logger/version"
require "colorize"

module LLT
  class Logger
    LEVELS = %w{ error info parser cf morph debug }
    # Numeric vals  0    1    2     3   4     5
    DEFAULT_LEVEL = 1

    @level = ENV["LLT_DEBUG"] ? normalized_level(ENV["LLT_DEBUG"]) : DEFAULT_LEVEL
    @loggers = []

    class << self
      attr_reader :loggers

      def level=(lev)
        return @level = nil if lev.nil?

        l = normalized_level(lev)
        unless valid_level?(l)
          l = @level || DEFAULT_LEVEL # DEFAULT_LEVEL catches invalid levels defined through the env var
          puts "LOG LEVEL ERROR".red + " #{lev} is unknown - falling back to #{l}"
        end

        @level = l
      end

      def level(n = nil)
        return nil if @level.nil?
        n ? n <= @level : @level
      end

      def new(*args)
        new_logger = super
        @loggers << new_logger
        new_logger
      end

      def clear
        @loggers.clear
      end

      def count(mapper = :count)
        @loggers.map(&mapper).inject(:+)
      end

      def errors
        messages.select { |message| message =~ /ERROR!/ }
      end

      def warnings
        messages.select { |message| message =~ /WARNING!/ }
      end

      def messages_that_match(regexp)
        messages.select { |message| message =~ regexp }
      end

      def count_errors
        count(:errors)
      end

      def count_warnings
        count(:warnings)
      end

      def normalized_level(lev)
        if lev.is_a? Fixnum
          lev
        else
          LEVELS.index(lev.to_s) || -1 # -1 to fail the valid_level? test
        end
      end

      private

      def messages
        @loggers.flat_map(&:logs)
      end

      def valid_level?(lev)
        lev.between?(0, 5)
      end
    end

    attr_reader :title, :logs, :errors, :warnings

    def initialize(title = "", indent = "", default: :info)
      @title  = title
      @indent = to_whitespace(indent)
      @default = default
      @logs   = []
      @errors   = 0
      @warnings = 0
    end

    def log(*args)
      send(@default, *args)
      # TODO Exception Handling
    end

    def error(message, indent = "")
      message = "ERROR! #{message}".light_red
      if level(0)
        log_message(message, indent)
        @errors += 1
      end
    end

    def warning(message, indent = "")
      message = "WARNING! #{message}".yellow
      if level(1)
        log_message(message, indent)
        @warnings += 1
      end
    end

    def info(message, indent = "")
      log_message(message, indent) if level(1)
    end

    def parser(message, indent = "")
      log_message(message, indent) if level(2)
    end

    def cf(message, indent = "")
      log_message(message, indent) if level(3)
    end

    def morph(message, indent = "")
      log_message(message, indent) if level(4)
    end

    def debug(message, indent = "")
      log_message(message, indent) if level(5)
    end

    def bare(message, indent = 0)
      lev = Logger.normalized_level(@default)
      puts "#{to_whitespace(indent)}#{message}" if level(lev)
    end

    def count
      @logs.count
    end

    private

    def log_message(message, indent)
      t = (! @title.empty? ? "#{@title}: " : "")
      indentation = @indent + to_whitespace(indent)
      str = "#{indentation}#{t}#{message}"

      @logs << str
      puts str
    end

    def level(lev = nil)
      Logger.level(lev)
    end

    def to_whitespace(indent)
      if indent.is_a?(Fixnum)
        str = ""
        indent.times { str << " "}
        str
      else
        indent
      end
    end
  end
end


text:
#ifndef LC_JPEGException_H
#define LC_JPEGException_H

// standard
#include <exception>

/**
 * An LC_JPEGException is-an exception that's used to break out of processing
 * a JPEG image.
 */
class LC_JPEGException : public std::exception {
public:
    char const* what() const throw() {
        return "LC_JPEGException";
    }
};

#endif  /* LC_JPEGException_H */
/* vim:set et sw=4 ts=4: */


text:
using Org.BouncyCastle.Asn1.Sec;
using Org.BouncyCastle.Asn1.X9;
using Org.BouncyCastle.Math;
using Org.BouncyCastle.Math.EC;

namespace BitcoinUtilities
{
    public static class Secp256K1Curve
    {
        private static readonly ECPoint g;
        private static readonly BigInteger n;
        private static readonly BigInteger fieldSize;
        private static readonly BigInteger groupSize;

        static Secp256K1Curve()
        {
            X9ECParameters parameters = SecNamedCurves.GetByName("secp256k1");
            g = parameters.G;
            n = parameters.N;
            fieldSize = ((FpCurve)parameters.Curve).Q;
            groupSize = parameters.N;
        }

        public static ECPoint G
        {
            get { return g; }
        }

        public static BigInteger N
        {
            get { return n; }
        }

        public static BigInteger FieldSize
        {
            get { return fieldSize; }
        }

        public static BigInteger GroupSize
        {
            get { return groupSize; }
        }
    }
}


text:
package org.apache.lucene.search;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.Term;
import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.Accountables;
import org.apache.lucene.util.RoaringDocIdSet;

/**
 * Wraps another {@link Query}'s result and caches it when scores are not
 * needed.  The purpose is to allow queries to simply care about matching and
 * scoring, and then wrap with this class to add caching.
 * @deprecated Use a {@link QueryCache} instead, such as {@link LRUQueryCache}.
 */
@Deprecated
public class CachingWrapperQuery extends Query implements Accountable, Cloneable {
  private Query query; // not final because of clone
  private final QueryCachingPolicy policy;
  private final Map<Object,DocIdSet> cache = Collections.synchronizedMap(new WeakHashMap<Object,DocIdSet>());

  /** Wraps another query's result and caches it according to the provided policy.
   * @param query Query to cache results of
   * @param policy policy defining which filters should be cached on which segments
   */
  public CachingWrapperQuery(Query query, QueryCachingPolicy policy) {
    this.query = Objects.requireNonNull(query, "Query must not be null");
    this.policy = Objects.requireNonNull(policy, "QueryCachingPolicy must not be null");
  }

  /** Same as {@link CachingWrapperQuery#CachingWrapperQuery(Query, QueryCachingPolicy)}
   *  but enforces the use of the
   *  {@link QueryCachingPolicy.CacheOnLargeSegments#DEFAULT} policy. */
  public CachingWrapperQuery(Query query) {
    this(query, QueryCachingPolicy.CacheOnLargeSegments.DEFAULT);
  }

  /**
   * Gets the contained query.
   * @return the contained query.
   */
  public Query getQuery() {
    return query;
  }

  /**
   * Default cache implementation: uses {@link RoaringDocIdSet}.
   */
  protected DocIdSet cacheImpl(DocIdSetIterator iterator, LeafReader reader) throws IOException {
    return new RoaringDocIdSet.Builder(reader.maxDoc()).add(iterator).build();
  }

  @Override
  public Query rewrite(IndexReader reader) throws IOException {
    if (getBoost() != 1f) {
      return super.rewrite(reader);
    }
    final Query rewritten = query.rewrite(reader);
    if (query == rewritten) {
      return super.rewrite(reader);
    } else {
      CachingWrapperQuery clone = (CachingWrapperQuery) clone();
      clone.query = rewritten;
      return clone;
    }
  }

  // for testing
  int hitCount, missCount;

  @Override
  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
    final Weight weight = query.createWeight(searcher, needsScores);
    if (needsScores) {
      // our cache is not sufficient, we need scores too
      return weight;
    }

    return new ConstantScoreWeight(weight.getQuery()) {

      final AtomicBoolean used = new AtomicBoolean(false);

      @Override
      public void extractTerms(Set<Term> terms) {
        weight.extractTerms(terms);
      }

      @Override
      public Scorer scorer(LeafReaderContext context) throws IOException {
        if (used.compareAndSet(false, true)) {
          policy.onUse(getQuery());
        }

        final LeafReader reader = context.reader();
        final Object key = reader.getCoreCacheKey();

        DocIdSet docIdSet = cache.get(key);
        if (docIdSet != null) {
          hitCount++;
        } else if (policy.shouldCache(query, context)) {
          missCount++;
          final Scorer scorer = weight.scorer(context);
          if (scorer == null) {
            docIdSet = DocIdSet.EMPTY;
          } else {
            docIdSet = cacheImpl(scorer, context.reader());
          }
          cache.put(key, docIdSet);
        } else {
          return weight.scorer(context);
        }

        assert docIdSet != null;
        if (docIdSet == DocIdSet.EMPTY) {
          return null;
        }
        final DocIdSetIterator disi = docIdSet.iterator();
        if (disi == null) {
          return null;
        }

        return new ConstantScoreScorer(this, 0f, disi);
      }
    };
  }

  @Override
  public String toString(String field) {
    return getClass().getSimpleName() + "("+query.toString(field)+")";
  }

  @Override
  public boolean equals(Object o) {
    if (super.equals(o) == false) return false;
    final CachingWrapperQuery other = (CachingWrapperQuery) o;
    return this.query.equals(other.query);
  }

  @Override
  public int hashCode() {
    return (query.hashCode() ^ super.hashCode());
  }

  @Override
  public long ramBytesUsed() {

    // Sync only to pull the current set of values:
    List<DocIdSet> docIdSets;
    synchronized(cache) {
      docIdSets = new ArrayList<>(cache.values());
    }

    long total = 0;
    for(DocIdSet dis : docIdSets) {
      total += dis.ramBytesUsed();
    }

    return total;
  }

  @Override
  public Collection<Accountable> getChildResources() {
    // Sync to pull the current set of values:
    synchronized (cache) {
      // no need to clone, Accountable#namedAccountables already copies the data
      return Accountables.namedAccountables("segment", cache);
    }
  }
}


text:
package example

import java.net.URL
import java.io.{IOException, FileNotFoundException, FileOutputStream}

object Main extends App {
  args match {
    case Array() => println("An argument is required")
    case arr => arr.foreach(download)
  }

  def download(urlStr: String) {
    val url = new URL(urlStr)
    val conn = url.openConnection()

    try {

      val inputStream = conn.getInputStream()

      val bytes =
        try {
          inputStream.readAllBytes
        } finally {
          inputStream.close()
        }

      val imageName = urlStr.split("/").last

      val fos = new FileOutputStream(imageName)
      try {
        fos.write(bytes)
      } finally {
        fos.close()
      }

    } catch {
      case e: FileNotFoundException =>
        println(s"${e.getMessage} is not found")
        throw e
      case e: IOException =>
        println(e.getMessage)
        throw e
    }

  }
}


text:
module Nominal
  module Operations
    module Create
      module ClassMethods
        def create(body)
          url = self.url
          response = Requestor.new.request(:post, url, nil, body)
          Util.convert_to_nominal_object(response, self.class_name)
        end
      end
      def self.included(base)
        base.extend(ClassMethods)
      end
    end
  end
end


text:
<?php

if ( ! defined( 'ABSPATH' ) ) {
	die();
}

/**
 * Class SearchWP_Admin_Ajax is responsible for implementing admin-only AJAX callbacks
 *
 * @since 2.8
 */
class SearchWP_Admin_Ajax {

	/**
	 * SearchWP_Admin_Ajax constructor.
	 */
	function __construct() {
		add_action( 'wp_ajax_searchwp_get_tax_terms', array( $this, 'get_tax_terms' ) );
		add_action( 'wp_ajax_searchwp_get_meta_keys', array( $this, 'get_meta_keys' ) );
	}

	/**
	 * Retrieve and return taxonomy terms encoded as JSON, formatted for select2
	 *
	 * @since 2.8
	 */
	function get_tax_terms() {
		if ( empty( $_REQUEST['tax'] ) || ! taxonomy_exists( $_REQUEST['tax'] ) ) {
			wp_send_json_error();
		}

		$tax = sanitize_text_field( $_REQUEST['tax'] );

		check_ajax_referer( 'swp_tax_terms_' . $tax );

		if ( empty( $_REQUEST['q'] ) ) {
			echo wp_json_encode( array() );
		}

		// search for terms
		$taxonomy_args = array(
			'hide_empty' => false,
			'name__like' => sanitize_text_field( $_REQUEST['q'] ),
			'fields'     => 'id=>name',
		);

		$terms = get_terms( $tax, $taxonomy_args );

		$response = array(
			'total_count'           => count( $terms ),
			'incomplete_results'    => false,
			'items'                 => array(),
		);

		foreach ( $terms as $term_id => $term ) {
			$response['items'][] = array(
				'id'    => $term_id,
				'text'  => $term,
			);
		}

		echo wp_json_encode( $response );

		die();
	}

	/**
	 * Retrieve and return unique meta_key values encoded as JSON, formatted for select2 autocomplete
	 *
	 * @since 2.8
	 */
	function get_meta_keys() {

		global $wpdb;

		check_ajax_referer( 'swp_search_meta_keys' );

		if ( empty( $_REQUEST['q'] ) ) {
			echo wp_json_encode( array() );
		}

		// search for keys
		/** @noinspection SqlDialectInspection */
		$meta_keys = $wpdb->get_col( $wpdb->prepare( "
			SELECT meta_key
			FROM $wpdb->postmeta
			WHERE meta_key != %s
			AND meta_key != %s
			AND meta_key != %s
			AND meta_key != %s
			AND meta_key NOT LIKE %s
			AND meta_key LIKE %s
			GROUP BY meta_key
		",
			'_' . SEARCHWP_PREFIX . 'indexed',
			'_' . SEARCHWP_PREFIX . 'content',
			'_' . SEARCHWP_PREFIX . 'needs_remote',
			'_' . SEARCHWP_PREFIX . 'skip',
			'_oembed_%',
			'%' . $wpdb->esc_like( sanitize_text_field( $_REQUEST['q'] ) ) . '%'
		) );

		// allow devs to filter this list
		$meta_keys = array_unique( apply_filters( 'searchwp_custom_field_keys', $meta_keys ) );

		// sort the keys alphabetically
		if ( $meta_keys ) {
			natcasesort( $meta_keys );
		} else {
			$meta_keys = array();
		}

		$response = array(
			'total_count'           => count( $meta_keys ),
			'incomplete_results'    => false,
			'items'                 => array(),
		);

		foreach ( $meta_keys as $meta_key ) {
			$response['items'][] = array(
				'id'    => $meta_key,
				'text'  => $meta_key,
			);
		}

		echo wp_json_encode( $response );

		die();
	}
}

// Kickoff
new SearchWP_Admin_Ajax();


text:
"use strict";

var assert = require("assert"),
  Pregister = require('../index.js');

describe('Namespace', function() {

  it('should mix namespace with file', function () {
    assert.equal(Pregister.file2namespace('service/db/index.js', 'service'), 'service.db');
    assert.equal(Pregister.file2namespace('service/db/index.js', 'service.db'), 'service.db');
    assert.equal(Pregister.file2namespace('root/service/db/index.js', 'service.db'), 'service.db');
    assert.equal(Pregister.file2namespace('root/service/db.js', 'service.db'), 'service.db');
    assert.equal(Pregister.file2namespace('/root/service/db.js', 'service.db'), 'service.db');
    assert.equal(Pregister.file2namespace('/root/service/db.js', 'service'), 'service.db');

    assert.equal(Pregister.file2namespace('service/dbservice/index.js', 'service'), 'service.dbservice');
    assert.equal(Pregister.file2namespace('root/dbservice/index.js', 'service'), 'service.root.dbservice');
    assert.equal(Pregister.file2namespace('/root/dbservice/db.js', 'service'), 'service.root.dbservice.db');
  });
});


text:
Crear Ticket

      <form role="form" id="ticketform" name="ticketform">

            Número de Ticket
            <input type="text" class="form-control" id="numeroticket" placeholder="Número de Ticket" ng-model="vm.ticket.num_ticket" ng-disabled="vm.loading" required>

            Modelos
            <select ng-model="vm.ticket.id_modelo"
                    ng-options="obj2.id_modelo as obj2.nombre for obj2  in vm.modelos"
                    class="form-control"
                    ng-required="true"
                    ng-change="vm.getTallas()"
                    id="modelos">
              <option value="">-- Escoge Modelo --</option>
            </select>

            Tallas
            <select ng-model="vm.ticket.id_talla"
                    ng-options="obj3.id_talla as obj3.talla for obj3 in vm.tallas"
                    class="form-control"
                    ng-required="true"
                    ng-change="vm.getmaqPric()"
                    id="tallas">
              <option value="">-- Escoge Talla --</option>
            </select>

            Cantidad
            <input type="number" class="form-control" id="cantidad" placeholder="Cantidad" ng-model="vm.ticket.cantidad" required>

Requerido

            Fecha Corte

              <input type="text" class="form-control" uib-datepicker-popup="dd-MMMM-yyyy" ng-model="vm.fecha_corte" is-open="vm.popup1.opened" ng-focus="vm.open1()" datepicker-options="vm.dateOptions" ng-required="true" close-text="Salir" current-text="Hoy" clear-text="Resetear" />

                <button type="button" class="btn btn-default" ng-click="vm.open1()"></button>

            Maquilero

			<select ng-model="vm.ticket.id_textileros"
                    ng-options="obj.id_textileros as obj.nombre for obj in vm.maquileros"
                    class="form-control"
                    id="id_textileros">
              <option value="">-- Escoge maquilero --</option>
            </select>

            Costo
            <input type="number" class="form-control" ng-model="vm.costos_maquila.costo" ng-show="vm.costos_maquila" /> <input class="form-control" ng-hide="vm.costos_maquila"  ng-model="vm.ticket.costo">

            Penalización
			<input type="number" class="form-control" ng-model="vm.costos_maquila.penalizacion" ng-show="vm.costos_maquila" /> <input class="form-control" ng-hide="vm.costos_maquila"  ng-model="vm.ticket.penalizacion">

            Total

			   {{vm.costos_maquila.costo * vm.ticket.cantidad|currency}}

            <button class="btn btn-primary" ng-click="vm.save(ticketform.$valid)">Guardar</button>

            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

 Alerta!

      </form>


text:
require.ensure(['splash-screen/dist/splash.min.css', 'splash-screen'], function(require) {

    require('splash-screen/dist/splash.min.css').use();
    require('splash-screen').Splash.enable('spinner-section-far');
});

require.ensure(['splash-screen', './main'], function(require) {

    var App = require('./main').default;
    (new App()).run();
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
	<!-- persistence-unit name="tpce-persistence" transaction-type="RESOURCE_LOCAL" -->
	<!-- transaction-type default to  RESOURCE_LOCAL in SE and JTA in JEE-->
	<persistence-unit name="tpce-persistence" transaction-type="JTA" >
		<provider>org.hibernate.ejb.HibernatePersistence</provider>
		<jta-data-source>java:jboss/datasources/tpcegfxdds</jta-data-source>
		<!--jta-data-source>java:jboss/datasources/tpcederbyds</jta-data-source-->
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.AccountPermission</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.AccountPermissionPK</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Address</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Broker</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.CashTransaction</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Charge</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.ChargePK</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.CommissionRate</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.CommissionRatePK</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Company</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.CompanyCompetitor</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.CompanyCompetitorPK</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Customer</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.CustomerAccount</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.DailyMarket</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.DailyMarketPK</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Exchange</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Financial</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.FinancialPK</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Holding</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.HoldingHistory</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.HoldingHistoryPK</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Industry</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.LastTrade</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.NewsItem</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Sector</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Security</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Settlement</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.StatusType</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Taxrate</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.Trade</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.TradeHistory</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.TradeHistoryPK</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.TradeRequest</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.TradeType</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.WatchList</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.ZipCode</class>
		<class>com.pivotal.gemfirexd.app.tpce.jpa.entity.HoldingSummary</class>
		<properties>
			<property name="hibernate.dialect" value="com.pivotal.gemfirexd.hibernate.v4.v0.GemFireXDDialect"/>
			<!-- property name="hibernate.dialect" value="org.hibernate.dialect.DerbyTenFiveDialect"/ -->
			<property name="hibernate.show_sql" value="true"/>
			<property name="hibernate.connection.isolation" value="1"/>
		</properties>
	</persistence-unit>
</persistence>


text:
package com.bleutech.bleu.lib;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

public class Assets {

	public static Texture tile;
	public static Texture tileActivated;
	public static Texture tileError;

	public static void load () {

		tile = new Texture(Gdx.files.internal("tile.png"));
		tileActivated = new Texture(Gdx.files.internal("tile-activated.png"));
		tileError = new Texture(Gdx.files.internal("tile-error.png"));
	}
}


text:
package com.plugin.core.manager;

import com.plugin.content.PluginDescriptor;
import java.util.Collection;

public interface PluginManager {
	////管理接口
	void loadInstalledPlugins();
	boolean addOrReplace(PluginDescriptor pluginDescriptor);
	boolean remove(String packageName);
	boolean removeAll();
	void enablePlugin(String pluginId, boolean enable);
	String genInstallPath(String pluginId, String pluginVersoin);

	////查询接口
	Collection<PluginDescriptor> getPlugins();
	PluginDescriptor getPluginDescriptorByFragmenetId(String clazzId);
	PluginDescriptor getPluginDescriptorByPluginId(String pluginId);
	PluginDescriptor getPluginDescriptorByClassName(String clazzName);

}


text:
package resourceManager;

import es.bsc.compss.types.annotations.Constraints;
import es.bsc.compss.types.annotations.Parameter;
import es.bsc.compss.types.annotations.parameter.Direction;
import es.bsc.compss.types.annotations.task.Method;
import es.bsc.compss.types.annotations.task.Service;

public interface TestCompatibleItf {

    /*
     * ******************************************** EMPTY CORE-ELEMENTS
     *******************************************/
    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints()
    void emptyCoreElement0();

    @Method(declaringClass = "constraintManager.Implementation1")
    void emptyCoreElement1();

    /*
     * ******************************************** SIMPLE CONSTRAINTS CORE-ELEMENTS
     *******************************************/
    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(computingUnits = "1")
    void simpleCoreElement0();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(processorName = "Main")
    void simpleCoreElement1();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(processorSpeed = "2.4")
    void simpleCoreElement2();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(processorArchitecture = "amd64")
    void simpleCoreElement3();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(processorPropertyName = "ThreadAffinity", processorPropertyValue = "Big")
    void simpleCoreElement4();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(memorySize = "8.0")
    void simpleCoreElement5();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(memoryType = "Volatile")
    void simpleCoreElement6();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(storageSize = "240.0")
    void simpleCoreElement7();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(storageType = "SSD")
    void simpleCoreElement8();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(storageBW = "100")
    void simpleCoreElement9();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(operatingSystemType = "Linux")
    void simpleCoreElement10();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(operatingSystemDistribution = "OpenSUSE")
    void simpleCoreElement11();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(operatingSystemVersion = "13.2")
    void simpleCoreElement12();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(appSoftware = "JAVA")
    void simpleCoreElement13();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(appSoftware = "JAVA, PYTHON, COMPSS")
    void simpleCoreElement14();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(hostQueues = "sequential")
    void simpleCoreElement15();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(hostQueues = "sequential, debug, bsc")
    void simpleCoreElement16();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(wallClockLimit = "10")
    void simpleCoreElement117();

    /*
     * ******************************************** COMPLEX CONSTRAINTS CORE-ELEMENTS
     *******************************************/

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(computingUnits = "2", processorArchitecture = "amd64", memorySize = "8.0", storageSize = "120.0", operatingSystemType = "Windows")
    void complexCoreElement0();

    @Method(declaringClass = "constraintManager.Implementation1")
    @Constraints(computingUnits = "2", processorName = "Main", processorArchitecture = "amd64", processorSpeed = "2.4", processorPropertyName = "ThreadAffinity", processorPropertyValue = "Big", memorySize = "8.0", memoryType = "Volatile", storageSize = "120.0", storageType = "SSD", storageBW = "50", operatingSystemType = "Windows", operatingSystemDistribution = "XP", operatingSystemVersion = "SP2", appSoftware = "JAVA, PYTHON", hostQueues = "sequential, debug", wallClockLimit = "10")
    void complexCoreElement1();

    /*
     * ******************************************** MULTI-CONSTRAINTS CORE-ELEMENTS
     *******************************************/

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(computingUnits = "4"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(computingUnits = "2")
    void multiCoreElement0();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints())
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints(processorName = "Slave"))
    @Constraints(processorName = "Main")
    void multiCoreElement1();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(processorSpeed = "3.0"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(processorSpeed = "2.4")
    void multiCoreElement2();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(processorArchitecture = "x86"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(processorArchitecture = "amd64")
    void multiCoreElement3();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(processorPropertyName = "ThreadAffinity", processorPropertyValue = "Little"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(processorPropertyName = "ThreadAffinity", processorPropertyValue = "Big")
    void multiCoreElement4();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints())
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints(memorySize = "4.0"))
    @Constraints(memorySize = "8.0")
    void multiCoreElement5();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(memoryType = "Non-Volatile"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(memoryType = "Volatile")
    void multiCoreElement6();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(storageSize = "300.0"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(storageSize = "240.0")
    void multiCoreElement7();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(storageSize = "200"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(storageBW = "100")
    void multiCoreElement8();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(storageType = "HDD"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(storageType = "SSD")
    void multiCoreElement9();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints())
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints(operatingSystemType = "Windows"))
    @Constraints(operatingSystemType = "Linux")
    void multiCoreElement10();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(operatingSystemDistribution = "XP"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(operatingSystemDistribution = "OpenSUSE")
    void multiCoreElement11();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(operatingSystemVersion = "SP2"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(operatingSystemVersion = "13.2")
    void multiCoreElement12();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints())
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints(appSoftware = "PYTHON"))
    @Constraints(appSoftware = "JAVA")
    void multiCoreElement13();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(appSoftware = "PYTHON, COMPSS"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints(appSoftware = "COMPSS"))
    @Constraints(appSoftware = "JAVA, PYTHON")
    void multiCoreElement14();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(hostQueues = "debug"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(hostQueues = "sequential")
    void multiCoreElement15();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(hostQueues = "debug, bsc"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints(hostQueues = "bsc"))
    @Constraints(hostQueues = "sequential, debug")
    void multiCoreElement16();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(wallClockLimit = "5"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints())
    @Constraints(wallClockLimit = "10")
    void multiCoreElement17();

    @Method(declaringClass = "constraintManager.Implementation1", constraints = @Constraints(computingUnits = "4", memorySize = "4.0"))
    @Method(declaringClass = "constraintManager.Implementation2", constraints = @Constraints(computingUnits = "8", storageSize = "300.0", operatingSystemType = "Windows"))
    // modified both not modified modified 1 modified 2
    @Constraints(computingUnits = "2", processorArchitecture = "amd64", memorySize = "8.0", storageSize = "240.0")
    void multiCoreElement18();

    /*
     * ******************************************** SERVICE CORE-ELEMENTS
     *******************************************/
    @Service(name = "DummyService", namespace = "http://localhost:9999/", port = "DummyServicePort")
    public void getDummyService(@Parameter(direction = Direction.IN) int index);

}


text:
Returns the value of input **In** converted from radians to degrees. One radian is equivalent to approximately 57.2958 degrees and a full rotation of 2 Pi radians is equal to 360 degrees.

## Ports

| Name        | Direction           | Type  | Description |
|:------------ |:-------------|:-----|:---|
| In      | Input | Dynamic Vector | Input value |
| Out | Output      |    Dynamic Vector | Output value |

## Generated Code Example

The following example code represents one possible outcome of this node.

```
void Unity_RadiansToDegrees_float4(float4 In, out float4 Out)
{
    Out = degrees(In);
}
```


text:
package org.apache.pluto.container.util;

import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Locale;

public final class DummyPrintWriter extends PrintWriter
{
    private static final DummyPrintWriter instance = new DummyPrintWriter(DummyServletOutputStream.getInstance());

    public static PrintWriter getInstance()
    {
        return instance;
    }

	private DummyPrintWriter(OutputStream out)
	{
		super(out);
	}

	@Override
	public PrintWriter append(char c) {
		return this;
	}

	@Override
	public PrintWriter append(CharSequence csq, int start, int end) {
		return this;
	}

	@Override
	public PrintWriter append(CharSequence csq) {
		return this;
	}

	@Override
	public boolean checkError() {
		return false;
	}

	@Override
	public void close() {
	}

	@Override
	public void flush() {
	}

	@Override
	public PrintWriter format(Locale l, String format, Object... args) {
		return this;
	}

	@Override
	public PrintWriter format(String format, Object... args) {
		return this;
	}

	@Override
	public void print(boolean b) {
	}

	@Override
	public void print(char c) {
	}

	@Override
	public void print(char[] s) {
	}

	@Override
	public void print(double d) {
	}

	@Override
	public void print(float f) {
	}

	@Override
	public void print(int i) {
	}

	@Override
	public void print(long l) {
	}

	@Override
	public void print(Object obj) {
	}

	@Override
	public void print(String s) {
	}

	@Override
	public PrintWriter printf(Locale l, String format, Object... args) {
		return this;
	}

	@Override
	public PrintWriter printf(String format, Object... args) {
        return this;
	}

	@Override
	public void println() {
	}

	@Override
	public void println(boolean x) {
	}

	@Override
	public void println(char x) {
	}

	@Override
	public void println(char[] x) {
	}

	@Override
	public void println(double x) {
	}

	@Override
	public void println(float x) {
	}

	@Override
	public void println(int x) {
	}

	@Override
	public void println(long x) {
	}

	@Override
	public void println(Object x) {
	}

	@Override
	public void println(String x) {
	}

	@Override
	protected void setError() {
	}

	@Override
	public void write(char[] buf, int off, int len) {
	}

	@Override
	public void write(char[] buf) {
	}

	@Override
	public void write(int c) {
	}

	@Override
	public void write(String s, int off, int len) {
	}

	@Override
	public void write(String s) {
	}
}


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.rowTransformDependencies = void 0;

var _dependenciesIndexClass = require("./dependenciesIndexClass.generated");

var _dependenciesMatrix = require("./dependenciesMatrix.generated");

var _dependenciesRange = require("./dependenciesRange.generated");

var _dependenciesTyped = require("./dependenciesTyped.generated");

var _factoriesAny = require("../../factoriesAny.js");

/**
 * THIS FILE IS AUTO-GENERATED
 * DON'T MAKE CHANGES HERE
 */
var rowTransformDependencies = {
  IndexDependencies: _dependenciesIndexClass.IndexDependencies,
  matrixDependencies: _dependenciesMatrix.matrixDependencies,
  rangeDependencies: _dependenciesRange.rangeDependencies,
  typedDependencies: _dependenciesTyped.typedDependencies,
  createRowTransform: _factoriesAny.createRowTransform
};
exports.rowTransformDependencies = rowTransformDependencies;


text:
layout: default
title: Charlton Callender's Portfolio / classes / junior
categories:
 - classes
---

{% include navpills.html param='year' %}

{% include year_navpills.html param='junior' %}

		Junior Year Classes

		What happened this year

	{% include year_class.html param='junior'%}


text:
Event 3

Event 3 description


text:
require 'yaml'

module Rubikon

  module Config

    # A configuration provider loading configuration data from YAML files
    #
    # @author Sebastian Staudt
    # @since 0.5.0
    class YamlProvider

      # Loads a configuration Hash from a YAML formatted file
      #
      # @param [String] file The path of the file to load
      # @return [Hash] The configuration data loaded from the file
      def self.load_config(file)
        YAML.load_file file
      end

      # Saves a configuration Hash into a YAML formatted file
      #
      # @param [Hash] config The configuration to write
      # @param [String] file The path of the file to write
      # @since 0.6.0
      def self.save_config(config, file)
        unless config.is_a? Hash
          raise ArgumentError.new('Configuration has to be a Hash')
        end

        file = File.new file, 'w'
        YAML.dump config, file
        file.close
      end

    end

  end

end


text:
package org.elasticsearch.search.facet.terms.comparator.icu;

import com.ibm.icu.text.Collator;
import com.ibm.icu.util.ULocale;

/**
 * A localized terms facet entry comparator.
 * For convenience usage from API.
 *
 * @author joerg
 */
public class LocalizedTermsFacetComparator extends TermsFacetCollationComparator {

    public LocalizedTermsFacetComparator(ULocale locale, boolean reverse) {
        super(reverse ? "reverse_term" : "term", reverse);
        setLocale(locale);
        setCollator(Collator.getInstance(locale));
    }

}


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1"/>

  <title>Minions</title>
  <meta name="author" content="" />
  <meta name="description"
        content="Minions é tudo de errado que existe nos filmes de Meu Malvado Favorito sem o certo que torna a equação balanceada. Dessa forma, não temos as adoráveis meninas (Margo, Edith e, claro, Agnes), nem o..."/>

  <meta name="yandex-verification" content="48a8210fc043c5e8" />

  <meta name="generator" content="Hugo 0.54.0" />

  <meta itemprop="name" content="Minions"/>
  <meta itemprop="description"
        content="Minions é tudo de errado que existe nos filmes de Meu Malvado Favorito sem o certo que torna a equação balanceada. Dessa forma, não temos as adoráveis meninas (Margo, Edith e, claro, Agnes), nem o..."/>
  <meta itemprop="image"
        content="/img/logo.svg"/>

  <meta property="og:title" content="Minions"/>
  <meta property="og:type"
        content="article"/>
  <meta property="og:url" content="http://www.cinetenisverde.com.br/minions/"/>
  <meta property="og:image"
        content="/img/logo.svg"/>
  <meta property="og:description"
        content="Minions é tudo de errado que existe nos filmes de Meu Malvado Favorito sem o certo que torna a equação balanceada. Dessa forma, não temos as adoráveis meninas (Margo, Edith e, claro, Agnes), nem o..."/>
  <meta property="og:site_name" content="Cine Tênis Verde"/>
  <meta property="article:published_time"
        content="2015-06-27T00:00:00+00:00"/>
  <meta property="article:section" content="post"/>

  <meta name="twitter:card" content="summary"/>
  <meta name="twitter:site"
        content=""/>
  <meta name="twitter:title" content="Minions"/>
  <meta name="twitter:description"
        content="Minions é tudo de errado que existe nos filmes de Meu Malvado Favorito sem o certo que torna a equação balanceada. Dessa forma, não temos as adoráveis meninas (Margo, Edith e, claro, Agnes), nem o..."/>
  <meta name="twitter:creator"
        content=""/>
  <meta name="twitter:image:src"
        content="/img/logo.svg"/>

  <link rel="stylesheet" type="text/css" href="/css/capsule.min.css"/>
  <link rel="stylesheet" type="text/css" href="/css/custom.css"/>

  <link rel="apple-touch-icon" href="/img/apple-touch-icon.png"/>
  <link rel="icon" href="/img/favicon.ico"/>

 Cine Tênis Verde

    <input type="checkbox" id="navbar-burger-state"/>

      search

      twitter

      rss

Minions

    ★★☆☆☆

 Wanderley Caloni, June 27, 2015

Minions é tudo de errado que existe nos filmes de Meu Malvado Favorito sem o certo que torna a equação balanceada. Dessa forma, não temos as adoráveis meninas (Margo, Edith e, claro, Agnes), nem o controverso, mas engraçado, Gru. Porém, você diria, os Minions fazem parte do lado da equação com as coisas certas. Certo? Sim, é verdade. Desde que eles fiquem limitados aos seus dois segundos de fama, mais ou menos o tempo necessário para que uma piadinha paralela envolvendo um ou mais deles ocorra. Como protagonistas de um filme inteiro, eles com certeza estão pendendo para o lado negro da força.

A história gira em torno do óbvio: os bonequinhos amarelos têm por “instinto” procurar o chefão o mal de sua época. Como eles surgiram, digamos, algumas dezenas (centenas?) de milhões de anos atrás, um dos primeiros chefões parece ter sido o T-Rex, passando daí a ser um representante dos humanos, e daí para algo mais específico até chegar a Napoleão, quando ficam perdidos no gelo e decidem regressar na década de 60, indo parar três desses amarelinhos em uma convenção de criminosos e serem contratados pela vilã mais malvada do mundo: Scarlett Overkill.

Sem conseguir unir as piadas (ruins) do filme em uma linha de narrativa que consiga definir quem é o protagonista nesta história, Minions sofre com um roteiro preguiçoso e uma direção idem. Sem Gru para salvá-los, eles passam a ser coadjuvantes de um filme sem (anti-)herói. Um triste spin-off para a série.

           Imagens e créditos no IMDB.

    ★★☆☆☆

 Minions ● Minions. Minions (USA, 2015). Dirigido por Kyle Balda, Pierre Coffin. Escrito por Brian Lynch. Com Sandra Bullock, Jon Hamm, Michael Keaton, Allison Janney, Steve Coogan, Jennifer Saunders, Geoffrey Rush, Steve Carell, Pierre Coffin. ● Nota: 2/5. Categoria: movies.  Publicado em 2015-06-27.  Texto escrito por Wanderley Caloni.

Quer comentar?

      Share


text:
{-# LANGUAGE ExistentialQuantification #-}
module Ext.Test.Tasty.Monad.QuickCheck
  ( testProperty
  , module Test.Tasty.QuickCheck
  , module Ext.Test.Tasty.Monad
  , module Test.QuickCheck.Poly
  , monadic
  , monadicRun
  , monadicAssert
  , monadicParam

  , Identity
  , monadicIdentity
  , monadicIO
  , ArbitraryMonad
  , MonadicProperty
  , monadicArbitrary
  , runArbitraryMonad
  , testMonadicProperty
  ) where
import Ext.Test.Tasty.Monad
import Test.Tasty.QuickCheck hiding ( testProperty )
import qualified Test.Tasty.QuickCheck as QuickCheck
import Test.Tasty ( TestName )
import Test.QuickCheck.Poly
import Test.QuickCheck.Monadic ( PropertyM, monadic, monadic', monadicIO )
import Test.QuickCheck.Property ( morallyDubiousIOProperty )
import Test.QuickCheck ( Gen )
import qualified Test.QuickCheck.Gen as Gen
import qualified Test.QuickCheck.Monadic as Monadic
import Data.Functor.Identity

testProperty :: (Testable p) => TestName -> p -> Test
testProperty name = fromTestTree . QuickCheck.testProperty name

testMonadicProperty :: TestName -> PropertyM ArbitraryMonad a -> Test
testMonadicProperty name = testProperty name . monadicArbitrary

monadicRun :: (Monad m) => m a -> PropertyM m a
monadicRun = Monadic.run

monadicAssert :: (Monad m) => Bool -> PropertyM m ()
monadicAssert = Monadic.assert

monadicParam :: (Show a, Arbitrary a, Monad m) => PropertyM m a
monadicParam = Monadic.pick arbitrary

type MonadicProperty = PropertyM ArbitraryMonad

monadicIdentity :: PropertyM Identity a -> Property
monadicIdentity = monadic runIdentity

data ArbitraryMonad a
  = forall b. ArbitraryMonadComposeF (ArbitraryMonad b) (b -> ArbitraryMonad a)
  | forall b. ArbitraryMonadCompose (ArbitraryMonad b) (ArbitraryMonad a)

  | forall b. (Arbitrary b) => ArbitraryMonadComposeF' (ArbitraryMonad b) (b -> ArbitraryMonad a)
  | forall b. (Arbitrary b) => ArbitraryMonadCompose' (ArbitraryMonad b) (ArbitraryMonad a)

  | ArbitraryMonadReturn a
  | ArbitraryMonadFail String

instance Functor ArbitraryMonad where
  fmap f = (>>= (return . f))

instance Monad ArbitraryMonad where
  (>>=) = ArbitraryMonadComposeF
  (>>) = ArbitraryMonadCompose
  return = ArbitraryMonadReturn
  fail = ArbitraryMonadFail

instance (Arbitrary a) => Arbitrary (ArbitraryMonad a) where
  arbitrary = do
    seed <- Gen.choose (0, 1) :: Gen Float
    -- weighted so we don't get stack overflows
    if seed < 0.10 -- 10%
      then do
        l <- arbitrary :: Gen (ArbitraryMonad A)
        f <- arbitrary
        return (ArbitraryMonadComposeF' l f)
    else if seed < 0.20 -- 10%
      then do
        lhs <- arbitrary :: Gen (ArbitraryMonad A)
        rhs <- arbitrary
        return (ArbitraryMonadCompose' lhs rhs)
      else do -- 80%
        a <- arbitrary
        return (return a)
    -- don't generate fail because it tends to throw actual exceptions

  shrink _ = []
  {- TODO: WIP
  case m of
    ArbitraryMonadComposeF l f -> l : ((shrink f >>= (return.(l>>=))) ++ shrinkValues m)
    ArbitraryMonadCompose l r -> l : r : shrinkValues m
    ArbitraryMonadComposeF' l f -> l : ((shrink f >>= (return.(l>>=))) ++ shrinkValues m)
    ArbitraryMonadCompose' l r -> l : r : shrinkValues m
    _ -> shrinkValues m
    where
    shrinkValues n = case n of
      ArbitraryMonadComposeF l f -> []
      ArbitraryMonadCompose l r -> do
        r' <- shrinkValues r
        return (l >> r')
      ArbitraryMonadComposeF' l f -> do
        l' <- shrinkValues l
        return (ArbitraryMonadComposeF' l' f)
      ArbitraryMonadCompose' l r -> (do
          l' <- shrinkValues l
          return (ArbitraryMonadCompose' l' r)
        ) ++ (do
          r' <- shrinkValues r
          return (ArbitraryMonadCompose' l r')
        )
      ArbitraryMonadReturn a -> do
        a' <- shrink a
        [return a']
      ArbitraryMonadFail s -> do
        s' <- shrink s
        [fail s]
  -}

-- TODO: implement CoArbitrary for ArbitraryMonad

runArbitraryMonad :: (Monad m) => ArbitraryMonad a -> m a
runArbitraryMonad m = case m of
  ArbitraryMonadComposeF l f -> runArbitraryMonad l >>= (runArbitraryMonad . f)
  ArbitraryMonadCompose l r -> runArbitraryMonad l >> runArbitraryMonad r
  ArbitraryMonadComposeF' l f -> runArbitraryMonad l >>= (runArbitraryMonad . f)
  ArbitraryMonadCompose' l r -> runArbitraryMonad l >> runArbitraryMonad r
  ArbitraryMonadReturn a -> return a
  ArbitraryMonadFail s -> fail s

monadicArbitrary :: PropertyM ArbitraryMonad a -> Property
monadicArbitrary arb = property . oneof $ (
  [ convert runIdentity
  , convert morallyDubiousIOProperty
  ] :: [Gen Property])
  where
  convert :: (Monad m) => (m Property -> Property) -> Gen Property
  convert runMonad = fmap runMonad . fmap runArbitraryMonad . monadic' $ arb


text:
<html>
<head>
<script>
function log(message) {
	var node = document.createElement('p');
	node.textContent = message;
	document.body.appendChild(node);
}

function createWorker() {
	var worker = new SharedWorker('shared-worker.js', 'SharedWorker');
	worker.port.onmessage = function(event) {
		log(event.data);
		window.parent.postMessage(event.data, '*');
	}
	worker.port.start();
	worker.port.postMessage('Connection test');
}

window.onload = function() {
	try {
		createWorker(false);
	} catch (exception) {
		log(exception.name);
		window.parent.postMessage(exception.name, '*');
	}
}

window.onmessage = function(e) {
	try {
		createWorker(true);
	} catch (exception) {
		log(exception.name);
		window.parent.postMessage(exception.name, '*');
	}
}
</script>
</head>
<body>
</body>
</html>


text:
//=============================================================================
// KMS_ScrollOffset.js
//   Last update: 2017/05/03
//=============================================================================

/*:
 * @plugindesc
 * [v0.1.1] Set the number of lines which are displayed above and below the cursor.
 *
 * @author TOMY (Kamesoft)
 *
 * @param Line number
 * @default 1
 * @desc The number of lines which are displayed above and below the cursor.
 *
 * @help This plugin does not provide plugin commands.
 */

/*:ja
 * @plugindesc
 * [v0.1.1] リストのスクロール時に、カーソル位置の上下に表示する行数を指定する機能を追加します。
 *
 * @author TOMY (Kamesoft)
 *
 * @param Line number
 * @default 1
 * @desc カーソルの上下に表示する行数を指定します。
 *
 * @help このプラグインには、プラグインコマンドはありません。
 */

var KMS = KMS || {};

(function() {

'use strict';

var PluginName = 'KMS_ScrollOffset';

KMS.imported = KMS.imported || {};
KMS.imported['ScrollOffset'] = true;

var pluginParams = PluginManager.parameters(PluginName);
var Params = {};
Params.offset = Number(pluginParams['Line number'] || 1);

//-----------------------------------------------------------------------------
// Window_Selectable

var _Window_Selectable_ensureCursorVisible = Window_Selectable.prototype.ensureCursorVisible;
Window_Selectable.prototype.ensureCursorVisible = function()
{
    // タッチ操作の場合はデフォルトの処理
    if (this._scrollOffByTouch)
    {
        _Window_Selectable_ensureCursorVisible.call(this);
        return;
    }

    // 上下に表示する行数が足りない場合はデフォルトの表示方式
    if (this.maxPageRows() <= Params.offset * 2)
    {
        _Window_Selectable_ensureCursorVisible.call(this);
        return;
    }

    var row = this.row();
    if (row < this.topRow() + Params.offset)
    {
        this.setTopRow(Math.max(row - Params.offset, 0));
    }
    else if (row > this.bottomRow() - Params.offset)
    {
        this.setBottomRow(Math.min(row + Params.offset, this.maxRows()));
    }
};

var _Window_Selectable_processTouch = Window_Selectable.prototype.processTouch;
Window_Selectable.prototype.processTouch = function()
{
    this._scrollOffByTouch = true;

    _Window_Selectable_processTouch.call(this);

    delete this._scrollOffByTouch;
};

})();


text:
package ve.ucv.ciens.ccg.nxtar.systems;

import ve.ucv.ciens.ccg.nxtar.components.AutomaticMovementComponent;
import ve.ucv.ciens.ccg.nxtar.components.CollisionDetectionComponent;
import ve.ucv.ciens.ccg.nxtar.components.GeometryComponent;
import ve.ucv.ciens.ccg.nxtar.components.MarkerCodeComponent;
import ve.ucv.ciens.ccg.nxtar.input.GamepadUserInput;
import ve.ucv.ciens.ccg.nxtar.input.KeyboardUserInput;
import ve.ucv.ciens.ccg.nxtar.input.TouchUserInput;
import ve.ucv.ciens.ccg.nxtar.input.UserInput;
import ve.ucv.ciens.ccg.nxtar.utils.Utils;

import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Mapper;
import com.artemis.systems.EntityProcessingSystem;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.controllers.mappings.Ouya;
import com.badlogic.gdx.math.Vector3;

public class RobotArmPositioningSystem extends EntityProcessingSystem {
	private static final String  TAG                 = "ROBOT_ARM_POSITIONING_SYSTEM";
	private static final String  CLASS_NAME          = RobotArmPositioningSystem.class.getSimpleName();
	private static final float   INTERPOLATION_STEP  = 0.05f;
	private static final float   STEP_SIZE           = 0.05f;
	public  static final float   MAX_Z               = -4.5f;
	public  static final float   MIN_Z               = -1.0f;

	@Mapper ComponentMapper<GeometryComponent>           geometryMapper;
	@Mapper ComponentMapper<AutomaticMovementComponent>  autoMapper;
	@Mapper ComponentMapper<CollisionDetectionComponent> collisionMapper;

	private UserInput input;

	@SuppressWarnings("unchecked")
	public RobotArmPositioningSystem(){
		super(Aspect.getAspectForAll(GeometryComponent.class, AutomaticMovementComponent.class, CollisionDetectionComponent.class).exclude(MarkerCodeComponent.class));
	}

	public void setUserInput(UserInput input){
		this.input = input;
	}

	@Override
	protected void process(Entity e) throws ClassCastException{
		Vector3                     endPoint;
		GamepadUserInput            tempGP;
		KeyboardUserInput           tempKey;
		GeometryComponent           geometry  = geometryMapper.get(e);
		AutomaticMovementComponent  auto      = autoMapper.get(e);
		CollisionDetectionComponent collision = collisionMapper.get(e);

		if(input == null){
			if(auto.moving) autoMove(geometry, auto, collision);
			else return;

		}else{
			if(input instanceof TouchUserInput){
				if(!auto.moving){
					endPoint = ((TouchUserInput) input).userTouchEndPoint;
					endPoint.set(geometry.position.x, geometry.position.y, MAX_Z);
					auto.startPoint.set(geometry.position);
					auto.endPoint.set(endPoint);
					auto.moving = true;
					auto.forward = true;

					Gdx.app.log(TAG, CLASS_NAME + ".process(): Started moving from " + Utils.vector2String(auto.startPoint) + " to " + Utils.vector2String(auto.endPoint));
				}else autoMove(geometry, auto, collision);
				input = null;
			}else if(input instanceof GamepadUserInput){
				tempGP = (GamepadUserInput) input;

				if(!auto.moving){
					if(!tempGP.oButton){
						geometry.position.x += -tempGP.axisLeftY * STEP_SIZE;
						geometry.position.y += tempGP.axisLeftX * STEP_SIZE;
						if(Math.abs(tempGP.axisLeftX) < Ouya.STICK_DEADZONE && Math.abs(tempGP.axisLeftY) < Ouya.STICK_DEADZONE)
							input = null;
						else
							input = (UserInput)tempGP;
					}else{
						endPoint = new Vector3(geometry.position.x, geometry.position.y, MAX_Z);
						auto.startPoint.set(geometry.position);
						auto.endPoint.set(endPoint);
						auto.moving = true;
						auto.forward = true;
						input = null;
					}
				}else{
					autoMove(geometry, auto, collision);
					input = null;
				}

			}else if(input instanceof KeyboardUserInput){
				tempKey = (KeyboardUserInput) input;

				if(!auto.moving){
					if(!tempKey.keySpace){
						geometry.position.x += tempKey.keyUp ? STEP_SIZE : 0.0f;
						geometry.position.x -= tempKey.keyDown ? STEP_SIZE : 0.0f;
						geometry.position.y -= tempKey.keyLeft ? STEP_SIZE : 0.0f;
						geometry.position.y += tempKey.keyRight ? STEP_SIZE : 0.0f;
						if(!tempKey.keyUp && !tempKey.keyUp && !tempKey.keyUp && !tempKey.keyUp)
							input = null;
						else
							input = (UserInput)tempKey;
					}else{
						endPoint = new Vector3(geometry.position.x, geometry.position.y, MAX_Z);
						auto.startPoint.set(geometry.position);
						auto.endPoint.set(endPoint);
						auto.moving = true;
						auto.forward = true;
						input = null;
					}
				}else{
					autoMove(geometry, auto, collision);
					input = null;
				}
			}else
				throw new ClassCastException("Input is not a valid UserInput instance.");
		}

	}

	private void autoMove(GeometryComponent geometry, AutomaticMovementComponent auto, CollisionDetectionComponent collision){
		float step;

		if(auto.moving){
			if(auto.forward)
				step = INTERPOLATION_STEP;
			else
				step = -INTERPOLATION_STEP;

			Gdx.app.log(TAG, CLASS_NAME + ".autoMove(): Step = " + Float.toString(step));

			auto.distance += step;

			Gdx.app.log(TAG, CLASS_NAME + ".autoMove(): Step = " + Float.toString(auto.distance));

			geometry.position.x = (auto.startPoint.x * (1.0f - auto.distance)) + (auto.endPoint.x * auto.distance);
			geometry.position.y = (auto.startPoint.y * (1.0f - auto.distance)) + (auto.endPoint.y * auto.distance);
			geometry.position.z = (auto.startPoint.z * (1.0f - auto.distance)) + (auto.endPoint.z * auto.distance);

			Gdx.app.log(TAG, CLASS_NAME + ".autoMove(): Current position: " + Utils.vector2String(geometry.position));

			if(auto.distance <= 0.0f || geometry.position.z >= MIN_Z){
				geometry.position.x = auto.startPoint.x;
				geometry.position.y = auto.startPoint.y;
				geometry.position.z = MIN_Z;

				auto.forward = true;
				auto.moving = false;

				Gdx.app.log(TAG, CLASS_NAME + ".autoMove(): Going forward now.");

			}else if(auto.distance >= 1.0f || collision.colliding){
				auto.forward = false;
				Gdx.app.log(TAG, CLASS_NAME + ".autoMove(): Going backwards now.");
			}

		}else return;
	}
}


text:
package org.drools.eclipse.action;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringReader;
import java.util.List;

import org.drools.eclipse.DroolsEclipsePlugin;
import org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl;
import org.drools.core.xml.SemanticModules;
import org.eclipse.core.internal.resources.File;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.jbpm.bpmn2.xml.XmlBPMNProcessDumper;
import org.jbpm.compiler.xml.ProcessSemanticModule;
import org.jbpm.compiler.xml.XmlProcessReader;
import org.jbpm.compiler.xml.processes.RuleFlowMigrator;
import org.jbpm.workflow.core.WorkflowProcess;
import org.kie.api.definition.process.Process;

public class ConvertToBPMN2ProcessAction implements IObjectActionDelegate {

    private IFile file;
    private IWorkbenchPart targetPart;

    public void setActivePart(IAction action, IWorkbenchPart targetPart) {
        this.targetPart = targetPart;
    }

    public void run(IAction action) {
        if (file != null && file.exists()) {
            try {
                convertToBPMN2();
            } catch (Throwable t) {
                DroolsEclipsePlugin.log(t);
            }
        }

    }

    public void selectionChanged(IAction action, ISelection selection) {
        if (selection instanceof IStructuredSelection) {
            IStructuredSelection structured = (IStructuredSelection) selection;
            if (structured.size() == 1) {
                Object element = structured.getFirstElement();
                if (element instanceof IFile) {
                    file = (IFile) element;
                }
            }
        }
    }

    public void convertToBPMN2() {
        try {
            InputStreamReader isr = new InputStreamReader(((File) file).getContents());
            KnowledgeBuilderConfigurationImpl configuration = new KnowledgeBuilderConfigurationImpl();
            SemanticModules modules = configuration.getSemanticModules();
            modules.addSemanticModule(new ProcessSemanticModule());
            XmlProcessReader xmlReader = new XmlProcessReader( modules, Thread.currentThread().getContextClassLoader() );
            String xml = RuleFlowMigrator.convertReaderToString(isr);
            Reader reader = new StringReader(xml);
            List<Process> processes = xmlReader.read(reader);
            if (processes != null && processes.size() == 1) {
                final String output = XmlBPMNProcessDumper.INSTANCE.dump((WorkflowProcess) processes.get(0), true);

                ConvertToBPMN2ProcessDialog dialog = new ConvertToBPMN2ProcessDialog(targetPart.getSite().getShell());
                dialog.setOriginalFile(file);
                dialog.open();
                IPath path = dialog.getResult();

                if (path == null) {
                    return;
                }

                IWorkspace workspace = ResourcesPlugin.getWorkspace();
                final IFile newFile = workspace.getRoot().getFile(path);

                WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
                    public void execute(final IProgressMonitor monitor)
                            throws CoreException {
                        try {
                            ByteArrayOutputStream out = new ByteArrayOutputStream();
                            newFile.create(new ByteArrayInputStream(output.getBytes()), true, monitor);
                            out.close();
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                };

                try {
                    new ProgressMonitorDialog(targetPart.getSite().getShell()).run(false, true, op);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebApplication1.Repo;
using WebApplication1.Taskes.Single;

namespace WebApplication1.Taskes
{
    public partial class STaskPageImage : System.Web.UI.Page
    {
        private static bool next = true;
        private static KeyValuePair<int, int> index;
        private static Random randTag;
        private static Random randWord;
        public static Repository repo = new Repository();
        private  static ITask task = null;

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void MainPanel_Load(object sender, EventArgs e)
        {

                randTag = new Random((int) DateTime.Now.Ticks);
                randWord = new Random((int) DateTime.Now.Ticks);
                int t = randTag.Next(repo.topics.Count);
                int w = randWord.Next(repo.topics[t].words.Count);
                index = new KeyValuePair<int, int>(t, w);
            if (next)
                task = new SingleImage
                {
                    CorrectWord = repo.topics[index.Key].words[index.Value].word,
                    Content = repo.topics[index.Key].words[index.Value].translates[0].image
                };

                Label header = new Label();
                header.Font.Name = "Helvetica";
                header.Font.Size = 26;
                Label sense = new Label();
                sense.Font.Name = "Helvetica";
                sense.Font.Size = 26;
                //----пофіксити багатозначність

                Image content = new Image();

                header.Text = task.Header + "
";
                sense.Text = "
" + task.Sence + "
";
                content.BorderColor = System.Drawing.Color.Black;
                content.ImageUrl = (((SingleImage) task).Content as Image).ImageUrl;

                content.ImageAlign = ImageAlign.Middle;
                content.CssClass = "PicWordAuto1";
            content.Width = 512;
            content.Height = 512;
                MainPanel.Width = 512;
                MainPanel.Height = (256 + 512);

                MainPanel.Controls.Add(header);
                MainPanel.Controls.Add(sense);
                MainPanel.Controls.Add(new TableCell {Controls= {content}});

                next = false;

        }

        protected void Unnamed_Click(object sender, EventArgs e)
        {
            if (((SingleTask) task).CorrectWord.Replace('\"','\'') == InputWord.Text.Trim(' '))
            {
                next = true;
                ClientScript.RegisterClientScriptBlock(this.GetType(), "calling",
                    $"");
            }

        }
    }
}


text:
package org.apache.kafka.streams.processor.internals;

import java.util.Collection;
import org.apache.kafka.common.TopicPartition;

/**
 * See {@link StoreChangelogReader}.
 */
public interface ChangelogRegister {
    /**
     * Register a state store for restoration.
     *
     * @param partition the state store's changelog partition for restoring
     * @param stateManager the state manager used for restoring (one per task)
     */
    void register(final TopicPartition partition, final ProcessorStateManager stateManager);

    /**
     * Unregisters and removes the passed in partitions from the set of changelogs
     * @param removedPartitions the set of partitions to remove
     */
    void unregister(final Collection<TopicPartition> removedPartitions);
}


text:
class AddIndicesToLangauges < ActiveRecord::Migration
  def self.database_model
    return "SpeciesSchemaModel"
  end

  def self.up
    execute("create index iso_639_1 on languages(iso_639_1)")
    execute("create index iso_639_2 on languages(iso_639_2)")
    execute("create index iso_639_3 on languages(iso_639_3)")
  end

  def self.down
    remove_index :languages, :name => 'iso_639_1'
    remove_index :languages, :name => 'iso_639_2'
    remove_index :languages, :name => 'iso_639_3'
  end
end


text:
/* eslint-disable no-undef,no-unused-expressions */
import { setupConfig } from '../config'
import { QueryParams, setupPlatform } from '../../platform/platform'
const MOCK_CONFIG = {
  urlString: 'http://www.xx.com/api/dashboard',
  urlFunction: function (platform) {
    let type = platform.platforms()[0]
    return `http://www.xx.com/api/${type}/dashboard`
  },
  booleanValueTrue: true,
  stringValueTrue: 'true',
  booleanValueFalse: false,
  'nullValue': null,
  numberValue: 10
}
describe('config.js', function () {
  var configInstance
  var platformInstance
  beforeAll(() => {
    platformInstance = setupPlatform()
    platformInstance.setQueryParams(new QueryParams('https://xxx.github.io/xxx?vmPageTransition=fade-right-transition&vmRecordPosition=false&vmTabsHighlight=true#/action-sheet'))
    configInstance = setupConfig(MOCK_CONFIG, platformInstance)
  })
  afterAll(() => {
    platformInstance = null
    configInstance = null
  })
  it('get():string', function () {
    expect(configInstance.get('urlString')).toEqual('http://www.xx.com/api/dashboard')
  })
  it('get():function', function () {
    expect(configInstance.get('urlFunction')).toEqual('http://www.xx.com/api/core/dashboard')
  })
  it('get():default', function () {
    expect(configInstance.get('whatever', 'here')).toEqual('here')
  })
  it('get():undefined', function () {
    expect(() => { configInstance.get(undefined) }).toThrow('config key is not defined')
  })
  it('get():withQueryParam:string', function () {
    expect(configInstance.get('pageTransition')).toEqual('fade-right-transition')
  })
  it('get():withQueryParamL:true', function () {
    expect(configInstance.get('tabsHighlight')).toBeTruthy()
  })
  it('get():withQueryParamL:false', function () {
    expect(configInstance.get('recordPosition')).toBeFalsy()
  })
  it('get():platform-mode', function () {
    expect(configInstance.get('mode')).toEqual('ios')
  })
  it('getBoolean():true<boolean>', function () {
    expect(configInstance.getBoolean('booleanValueTrue')).toBeTruthy()
  })
  it('getBoolean():true<string>', function () {
    expect(configInstance.getBoolean('stringValueTrue')).toBeTruthy()
  })
  it('getBoolean():false<boolean>', function () {
    expect(configInstance.getBoolean('booleanValueFalse')).toBeFalsy()
  })
  it('getBoolean():nullValue', function () {
    expect(configInstance.getBoolean('nullValue', '123')).toEqual('123')
  })
  it('getBoolean():object', function () {
    expect(configInstance.getBoolean({a: 123})).toBeFalsy()
  })
  it('getNumber()', function () {
    expect(configInstance.getNumber('numberValue')).toEqual(10)
  })
  it('getNumber():fallback', function () {
    expect(configInstance.getNumber('numberValueNull', 100)).toEqual(100)
  })
  it('set(mode, key, value)', function () {
    configInstance.set('core', 'name', 'Hsiang')
    expect(configInstance.get('name')).toEqual('Hsiang')
  })
  it('set(key, value)', function () {
    configInstance.set('name', 'Hsiang')
    expect(configInstance.get('name')).toEqual('Hsiang')
  })
  it('settings()', function () {
    expect(configInstance.settings()).toEqual(MOCK_CONFIG)
  })
  it('settings(mode:{key:value})', function () {
    configInstance.settings('core', {
      age: '10'
    })
    expect(configInstance.get('age')).toEqual('10')
  })
  it('settings({key:value})', function () {
    configInstance.settings({
      age: '10'
    })
    expect(configInstance.get('age')).toEqual('10')
  })
  it('cache()', function () {
    configInstance.settings({
      age: '10'
    })
    expect(configInstance.get('age')).toEqual('10')
    expect(JSON.stringify(configInstance.cache())).toEqual('{"age":"10"}')
  })
})


text:
package org.vertx.mods;

import org.vertx.java.busmods.BusModBase;
import org.vertx.java.core.Handler;
import org.vertx.java.core.eventbus.Message;
import org.vertx.java.core.json.JsonObject;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * Basic Authentication Manager Bus Module

 * Please see the busmods manual for a full description

 *
 * @author Tim Fox
 */
public class AuthManager extends BusModBase {

  private Handler<Message<JsonObject>> loginHandler;
  private Handler<Message<JsonObject>> logoutHandler;
  private Handler<Message<JsonObject>> authoriseHandler;

  protected final Map<String, String> sessions = new HashMap<>();
  protected final Map<String, LoginInfo> logins = new HashMap<>();

  private static final long DEFAULT_SESSION_TIMEOUT = 30 * 60 * 1000;

  private String address;
  private String userCollection;
  private String persistorAddress;
  private long sessionTimeout;

  private static final class LoginInfo {
    final long timerID;
    final String sessionID;

    private LoginInfo(long timerID, String sessionID) {
      this.timerID = timerID;
      this.sessionID = sessionID;
    }
  }

  /**
   * Start the busmod
   */
  public void start() {
    super.start();

    this.address = getOptionalStringConfig("address", "vertx.basicauthmanager");
    this.userCollection = getOptionalStringConfig("user_collection", "users");
    this.persistorAddress = getOptionalStringConfig("persistor_address", "vertx.mongopersistor");
    Number timeout = config.getNumber("session_timeout");
    if (timeout != null) {
      if (timeout instanceof Long) {
        this.sessionTimeout = (Long)timeout;
      } else if (timeout instanceof Integer) {
        this.sessionTimeout = (Integer)timeout;
      }
    } else {
      this.sessionTimeout = DEFAULT_SESSION_TIMEOUT;
    }

    loginHandler = new Handler<Message<JsonObject>>() {
      public void handle(Message<JsonObject> message) {
        doLogin(message);
      }
    };
    eb.registerHandler(address + ".login", loginHandler);
    logoutHandler = new Handler<Message<JsonObject>>() {
      public void handle(Message<JsonObject> message) {
        doLogout(message);
      }
    };
    eb.registerHandler(address + ".logout", logoutHandler);
    authoriseHandler = new Handler<Message<JsonObject>>() {
      public void handle(Message<JsonObject> message) {
        doAuthorise(message);
      }
    };
    eb.registerHandler(address + ".authorise", authoriseHandler);
  }

  private void doLogin(final Message<JsonObject> message) {

    final String username = getMandatoryString("username", message);
    if (username == null) {
      return;
    }
    String password = getMandatoryString("password", message);
    if (password == null) {
      return;
    }

    JsonObject findMsg = new JsonObject().putString("action", "findone").putString("collection", userCollection);
    JsonObject matcher = new JsonObject().putString("username", username).putString("password", password);
    findMsg.putObject("matcher", matcher);

    eb.send(persistorAddress, findMsg, new Handler<Message<JsonObject>>() {
      public void handle(Message<JsonObject> reply) {

        if (reply.body.getString("status").equals("ok")) {
          if (reply.body.getObject("result") != null) {

            // Check if already logged in, if so logout of the old session
            LoginInfo info = logins.get(username);
            if (info != null) {
              logout(info.sessionID);
            }

            // Found
            final String sessionID = UUID.randomUUID().toString();
            long timerID = vertx.setTimer(sessionTimeout, new Handler<Long>() {
              public void handle(Long timerID) {
                sessions.remove(sessionID);
                logins.remove(username);
              }
            });
            sessions.put(sessionID, username);
            logins.put(username, new LoginInfo(timerID, sessionID));
            JsonObject jsonReply = new JsonObject().putString("sessionID", sessionID);
            sendOK(message, jsonReply);
          } else {
            // Not found
            sendStatus("denied", message);
          }
        } else {
          logger.error("Failed to execute login query: " + reply.body.getString("message"));
          sendError(message, "Failed to excecute login");
        }
      }
    });
  }

  protected void doLogout(final Message<JsonObject> message) {
    final String sessionID = getMandatoryString("sessionID", message);
    if (sessionID != null) {
      if (logout(sessionID)) {
        sendOK(message);
      } else {
        super.sendError(message, "Not logged in");
      }
    }
  }

  protected boolean logout(String sessionID) {
    String username = sessions.remove(sessionID);
    if (username != null) {
      LoginInfo info = logins.remove(username);
      vertx.cancelTimer(info.timerID);
      return true;
    } else {
      return false;
    }
  }

  protected void doAuthorise(Message<JsonObject> message) {
    String sessionID = getMandatoryString("sessionID", message);
    if (sessionID == null) {
      return;
    }
    String username = sessions.get(sessionID);

    // In this basic auth manager we don't do any resource specific authorisation
    // The user is always authorised if they are logged in

    if (username != null) {
      JsonObject reply = new JsonObject().putString("username", username);
      sendOK(message, reply);
    } else {
      sendStatus("denied", message);
    }
  }

}


text:
package org.red5.server.api.statistics;

import java.util.Set;

import org.red5.server.api.scope.IScope;
import org.red5.server.api.so.ISharedObject;
import org.red5.server.exception.ScopeNotFoundException;
import org.red5.server.exception.SharedObjectException;

/**
 * Statistics methods for Red5. They can be used to poll for updates of given elements inside the server. Statistics data will be stored as properties of different shared objects.
 *
 * Use
 *
 *

 * getScopeStatisticsSO
 *

 *
 * and
 *
 *

 * getSharedObjectStatisticsSO
 *

 *
 * to get these shared objects. The property names are
 *
 *

 * scopeName
 *

 *
 * for scope attributes and
 *
 *

 * scopeName | sharedObjectName
 *

 *
 * for shared object attributes. Each property holds a Map containing key/value mappings of the corresponding attributes.
 *
 * Sometime in the future, the updates on the shared objects will be done automatically so a client doesn't need to poll for them.
 *
 * @author The Red5 Project
 * @author Joachim Bauch (jojo@struktur.de)
 */
public interface IStatisticsService {

    /**
     * Return the shared object that will be used to keep scope statistics.
     *
     * @param scope
     *            A scope to return the shared object for.
     * @return the shared object containing scope statistics
     */
    public ISharedObject getScopeStatisticsSO(IScope scope);

    /**
     * Return the shared object that will be used to keep SO statistics.
     *
     * @param scope
     *            A scope to return the shared object for.
     * @return the shared object containing SO statistics
     */
    public ISharedObject getSharedObjectStatisticsSO(IScope scope);

    /**
     * Return a list of all scopes that currently exist on the server.
     *
     * @return list of scope names
     */
    public Set<String> getScopes();

    /**
     * Return a list of all scopes that currently exist on the server below a current path.
     *
     * @param path
     *            Path to start looking for scopes.
     * @return list of scope names
     * @throws ScopeNotFoundException
     *             if the path on the server doesn't exist
     */
    public Set<String> getScopes(String path) throws ScopeNotFoundException;

    /**
     * Update statistics for a given scope.
     *
     * @param path
     *            Path to scope to update.
     * @throws ScopeNotFoundException
     *             if the given scope doesn't exist
     */
    public void updateScopeStatistics(String path) throws ScopeNotFoundException;

    /**
     * Return informations about shared objects for a given scope.
     *
     * @param path
     *            Path to scope to return shared object names for.
     * @return list of informations about shared objects
     */
    public Set<ISharedObjectStatistics> getSharedObjects(String path);

    /**
     * Update informations about a shared object in a given scope.
     *
     * @param path
     *            Path to scope that contains the shared object.
     * @param name
     *            Name of shared object to update.
     * @throws ScopeNotFoundException
     *             if the given scope doesn't exist
     * @throws SharedObjectException
     *             if no shared object with the given name exists
     */
    public void updateSharedObjectStatistics(String path, String name) throws ScopeNotFoundException, SharedObjectException;

}