text:
    <form  id="edit-issue" name="edit-issue"  ng-hide="!isProjectLead">

Edit issue

        Issue title
        <input ng-model="issueData.Title" id="name" type="text" class="form-control" placeholder="Issue title..." required>

        Description
        <textarea ng-model="issueData.Description" name="" id="description" class="form-control"
                  placeholder="Edit issue description..." required>
        </textarea>

        Select assignee

            <select id="select-leader" ng-options="u.Username for u in users"
                    ng-model="issueData.Assignee" class="form-control" required>
            </select>

        Select project

            <select id="select-project" ng-options="p.Name for p in projects" ng-model="issueData.Project"
                    class="form-control" required>
            </select>

        Choose priority

            <select id="select-priority" ng-options="p.Name for p in issueData.Project.Priorities"
                    ng-model="issueData.Priority" class="form-control" required>
            </select>

        Due
        <input ng-model="issueData.DueDate" id="due" type="date" class="form-control" required />

        Labels (Comma separated)
        <input ng-model="issueData.Labels" id="proj-labels" type="text" class="form-control" placeholder="Give issue label..." required>

        <button class="btn btn-primary" ng-click="editIssue()">Save issue</button>
        <input class="btn btn-primary"  type="reset" value="Reset values">
    </form>

            Current status:
            {{issueData.Status.Name}}

        <button ng-if="issueData.Status.Id == 2" class="btn btn-primary" ng-click="changeStatus(3)">In Progress</button>
        <button ng-if="issueData.Status.Id == 3" class="btn btn-primary" ng-click="changeStatus(4)">Stop progress</button>
        <button ng-if="issueData.Status.Id != 1" class="btn btn-primary" ng-click="changeStatus(1)">Close</button>


text:
#include <srs_rtmp_msg_array.hpp>

#include <srs_rtmp_stack.hpp>

SrsMessageArray::SrsMessageArray(int max_msgs)
{
    srs_assert(max_msgs > 0);

    msgs = new SrsSharedPtrMessage*[max_msgs];
    max = max_msgs;

    zero(max_msgs);
}

SrsMessageArray::~SrsMessageArray()
{
    // we just free the msgs itself,
    // both delete and delete[] is ok,
    // for each msg in msgs is already freed by send_and_free_messages.
    srs_freepa(msgs);
}

void SrsMessageArray::free(int count)
{
    // initialize
    for (int i = 0; i < count; i++) {
        SrsSharedPtrMessage* msg = msgs[i];
        srs_freep(msg);

        msgs[i] = NULL;
    }
}

void SrsMessageArray::zero(int count)
{
    // initialize
    for (int i = 0; i < count; i++) {
        msgs[i] = NULL;
    }
}

redpajama_set_name: RedPajamaGithub


text:
const React = require('react');

class ErrorThrowingComponent extends React.Component{
  render() {
    throw Error('Error from inside ErrorThrowingComponent');
  }
}

module.exports = ErrorThrowingComponent;


text:
using InterflowFramework.Core.Message.Interface;
using InterflowFramework.Core.Message.Model.ExecutorRegistrator;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InterflowFramework.Core.Message.Model.Base
{
	public abstract class BaseRequestExecutorProvider : IRequestExecutorProvider
	{
		public virtual IRequestExecutor Create(string type)
		{
			return Executors.Where(x => x.Key == type).Select(x => x.Value).FirstOrDefault();
		}
		private Dictionary<string, IRequestExecutor> _executors;
		protected virtual Dictionary<string, IRequestExecutor> Executors {
			get {
				if(_executors == null) {
					_executors = typeof(BaseRequestExecutorProvider)
						.Assembly
						.GetTypes()
						.Where(x => x.GetCustomAttributes(GetExecutorAttributeType(), false).Any())
						.Select(x =>
						{
							var attribute = x.GetCustomAttributes(GetExecutorAttributeType(), false).FirstOrDefault();
							if (attribute != null)
							{
								var name = GetExecutorAttributeDataName(attribute);
								var executor = Activator.CreateInstance(x) as IRequestExecutor;
								if (executor != null)
								{
									return new
									{
										name = name,
										executor = executor
									};
								}
							}
							return null;
						})
						.Where(x => x != null)
						.ToDictionary(x => x.name, x => x.executor);
				}
				return _executors;
			}
		}
		protected virtual Type GetExecutorAttributeType() {
			return typeof(ExecutorAttribute);
		}
		protected virtual string GetExecutorAttributeDataName(object attribute) {
			return ((ExecutorAttribute)attribute).Name;
		}
	}
}


text:
/**
  *
  *
  */
exports.listen = function(server, options) {
  var router = new Router(server, options);

  return router.io;
};

/**
  * @class Router
  * The router class
  */
var Router = exports.Router = (function () {

  /*!****************************************$
  *       Dependencies and Constants        $
  */

  /** @requires */
  var http = require('http')
    , sio = require('socket.io')
    , url = require('url')
    , path = require('path')
    , fs = require('fs');

  /** @constant */
  var  _Events = [
        'newclient'
      , 'leaveclient'
      , 'listupdate'
    ]
    , _Handledfiles = [
        '/SimUDP.client.js'
      , '/SimUDP.client.min.js'
    ];

  /*!****************************************$
  *         Routing Messages                $
  */

  /** Send the `message` passed as parameter
    * @memberOf Router
    * @param {Message} message object
    * @example
    * message = {
    *             dst : "ip:port"
    *           , src : "ip:port"
    *           , msg : "content"
    *            };
    * Router.send(message);`
    */

  var send = function(message) {
    this._routeMessage(message);
  };

  var broadcast = function(message) {
    this._sockets.emit('packet', message);
  };

  var _routeMessage = function(message) {
    if (!message.dst) {
      console.error("No dst in message");
      return;
    }
    else {
      try {
        var socket = this.getClientSocket(message.dst);
        socket.emit('packet', message);
      }
      catch(e) {
        // DROP THE PACKET
      }
    }
  };

  /*!****************************************$
  *         Managing clients                $
  */

  var getClients = function() {
    return this._clients;
  };

  var getClientSocket = function(ip_port) {
    if (typeof this._clients[ip_port] != 'undefined') {
      id = this._clients[ip_port];
      return this._getClientSocketbyId(id);
    }
    else {
      console.error("Client " + ip_port + " is not in list.");
      return false;
    }
  };

  var _getClientSocketbyId = function(id) {
    return this._sockets.socket(id);
  };

  var _registerClient = function(client) {
    var ip_port = _extractip_port(client);

    this._addClient(ip_port, client.id);

    var self = this;

    client.on('whoami', function() {
      client.emit('whoami',ip_port);
    });

    client.on('disconnect', function() {
      self._removeClient(ip_port);
    });

    client.on('packet', function(message){
      message.src = ip_port;
      self._routeMessage(message);
    });
  };

  var _addClient = function(ip_port, id) {
    if (!this._clients[ip_port]) {
      this._clients[ip_port] = id;

      this.log(ip_port + ' connected');

      this._callCallbacks("newclient", ip_port);
      this._callCallbacks("listupdate", ip_port);
    }
  };

  var _removeClient = function(ip_port) {
    delete this._clients[ip_port] ;
    this.log(ip_port + ' disconnected');

    this._callCallbacks("leaveclient", ip_port);
    this._callCallbacks("listupdate", ip_port);
  };

  var _extractip_port = function(client) {
    return client.handshake.address.address + ':' + client.handshake.address.port;
  };

  /*!****************************************$
  *         Serving client-side code        $
  */

  var _redirectRequests = function(server) {
    old_listeners =  server.listeners('request');
    server.removeAllListeners('request');

    var self = this;
    server.on('request', function(req, res) {
      if (_isRequestHandled(req)){
        _serveRequest(req, res);
      } else {
        for (var i = 0, l = old_listeners.length; i < l; i++) {
          old_listeners[i].call(server, req, res);
        }
      }
    });
  };

  var _isRequestHandled = function(req) {
    var pathname = path.normalize(url.parse(req.url).pathname);
    return (_Handledfiles.indexOf(pathname) != -1) ? true : false;
  };

  var _serveRequest = function(req, res) {
    var pathname = path.normalize(url.parse(req.url).pathname);

    fs.readFile(__dirname + '/../dist' +  pathname,
    function(err, data) {
      if (err) {
        res.writeHead(500);
        return res.end('Error loading ' + path);
      }

      this.log(pathname + ' served');
      res.writeHead(200);
      return res.end(data);
    });
  };

  /*!****************************************$
  *          Callbacks handling             $
  */

  var on = function(eventname, fn) {
    //check if eventname is accepted
    if (_Events.indexOf(eventname) != -1) {
      this._callbacks[eventname].push(fn);
    } else {
      console.error('the event ' + eventname + ' does NOT exist');
    }
  };

  var _initCallbacks = function() {
    var cb = {};
     for(var i in _Events) {
       cb[_Events[i]] = [];
     }
     return cb;
  };

  var _callCallbacks =  function(eventname, passed_arg) {
    //check if event exists
    if (typeof this._callbacks[eventname] === 'undefined') {
      console.error('the event ' + eventname + ' does NOT exist');
    } else {
      //extract callbacks associated to the event
      var eventcallbacks = this._callbacks[eventname];

      if (eventcallbacks.length !== 0) {
        //execute each callbacks by passing the argument
        for(var i in eventcallbacks) {
          eventcallbacks[i](passed_arg);
        }
      }
    }
  };

  var log = function(string) {
    console.log('[Router] ' + string);
  }

  /*!****************************************$
  *         Constructor and prototype       $
  */

  var Router = function (server, options) {
    //if server is undefined or a number create one
    if (typeof server === 'undefined') {
      server = 8080;
    }

    if (typeof server === 'number') {
      var port = server;
      server = http.createServer();
      server.listen(port);
    }
    this._server = server;

    //then delegates requests concerning our client-side source files
//    var _old_listeners = {};
//    _redirectRequests(this._server);

    //start socket.io for our server
    this.io = sio.listen(this._server);
    this.io.set('log level', 1);

    //restricting to 'SimUDP' namespace
    this._io = this.io.of('/SimUDP');

    this._sockets = this._io;

    //start callbacks system
    this._callbacks = _initCallbacks();

    //start client management
    this._clients = {};
    var self = this;
    this._io.on('connection', function(client){
      self._registerClient(client);
    });
  };

  Router.prototype = {
    //Revealing public API
      version           :   "0.2"
    , constructor       :   Router
    , on                :   on
    , getClients        :   getClients
    , getClientSocket   :   getClientSocket
    , broadcast         :   broadcast
    , send              :   send
    , log               :   log
//    , listen            :   iolisten

    //Revealing private API
    , _routeMessage     :   _routeMessage

    , _getClientSocketbyId : _getClientSocketbyId
    , _registerClient   :   _registerClient
    , _addClient        :   _addClient
    , _removeClient     :   _removeClient

    , _callCallbacks    :   _callCallbacks
  };

  return Router;

}());


text:
class Forum::PageController < ParagraphController

  editor_header 'Forum Paragraphs'

  editor_for :categories, :name => 'List of Forum Categories', :feature => :forum_page_categories,
                          :inputs => [[:url, 'Category Url', :path]]

  editor_for :list, :name => "List of Forums", :feature => :forum_page_list,
                    :inputs => [[:url, 'Category Url', :path]],
                    :outputs => [[:category, 'Forum Category Target', :forum_category_target]]

  editor_for :forum, :name => "Forum Display", :feature => :forum_page_forum,
                     :inputs => { :forum => [[:url, 'Forum Url', :path]],
                                  :topic => [[:id, 'Topic Id', :path]] },
                     :outputs => [[:forum, 'Forum Target', :forum_forum_target]]

  editor_for :topic, :name => "Forum Topic Display", :feature => :forum_page_topic,
                     :inputs => { :forum => [[:url, 'Forum Url', :path]],
                                  :topic => [[:id, 'Topic Id', :path]] },
                     :outputs => [[:topic, 'Topic Target', :forum_topic_target]]

  editor_for :new_post, :name => "New Post Form", :feature => :forum_page_new_post,
                        :inputs => { :input => [[:forum, 'Forum', :forum_forum_target],
                                                [:topic, 'Topic', :forum_topic_target],
                                                [:forum_path, 'Forum Url', :path]],
                                     :topic => [[:id, 'Topic Id', :path]],
                                     :post => [[:id, 'Post Id', :path]],
                                     :content => [[:content, 'Content Identifier', :content]]
                                   },
                        :triggers => [['New Post','new_post'], ['New Topic','new_topic']]

  editor_for :edit_post, :name => "Edit Post Form", :feature => :forum_page_edit_post,
                        :inputs => { :forum => [[:url, 'Forum Url', :path]],
                                     :topic => [[:id, 'Topic Id', :path]],
                                     :post => [[:id, 'Post Id', :path]]
                                   }

  editor_for :recent, :name => "Recent Posts Display", :feature => :forum_page_recent,
                      :inputs => { :input => [[:category, 'Category', :forum_category_target],
                                              [:forum, 'Forum', :forum_forum_target],
                                              [:category_path, 'Forum Category Url', :path]],
                                   :forum => [[:url, 'Forum Url (only used with Forum Category Url)', :path]],
                                   :content => [[:content, 'Content Identifier', :content]]
                                 }

  class CategoriesOptions < HashModel
    attributes :categories_per_page => 20, :category_page_id => nil, :forum_page_id => nil

    integer_options :categories_per_page

    page_options :category_page_id
    page_options :forum_page_id

    options_form(
                 fld(:categories_per_page, :text_field),
                 fld(:category_page_id, :page_selector),
                 fld(:forum_page_id, :page_selector)
                 )
  end

  class ListOptions < HashModel
    attributes :forum_category_id => nil, :forums_per_page => 10, :category_page_id => nil, :forum_page_id => nil

    integer_options :forums_per_page

    page_options :category_page_id
    page_options :forum_page_id

    options_form(
                 fld(:forum_category_id, :select, :options => :forum_category_options),
                 fld(:forums_per_page, :text_field),
                 fld(:category_page_id, :page_selector),
                 fld(:forum_page_id, :page_selector)
                 )

    def self.forum_category_options
      [['Use page connection', nil]] + ForumCategory.select_options
    end
  end

  class ForumOptions < HashModel
    attributes :forum_forum_id => nil, :topics_per_page => 20, :category_page_id => nil, :forum_page_id => nil, :new_post_page_id => nil

    integer_options :topics_per_page

    page_options :category_page_id
    page_options :forum_page_id
    page_options :new_post_page_id

   options_form(
                 fld(:forum_forum_id, :select, :options => :forum_forum_options),
                 fld(:topics_per_page, :text_field),
                 fld(:category_page_id, :page_selector),
                 fld(:forum_page_id, :page_selector),
                 fld(:new_post_page_id, :page_selector)
                 )

    def self.forum_forum_options
      [['Use page connection', nil]] + ForumForum.select_options
    end
  end

  class TopicOptions < HashModel
    attributes :forum_forum_id => nil, :posts_per_page => 20, :category_page_id => nil, :forum_page_id => nil, :new_post_page_id => nil, :edit_post_page_id => nil

    integer_options :posts_per_page

    page_options :category_page_id
    page_options :forum_page_id
    page_options :new_post_page_id
    page_options :edit_post_page_id

    meta_canonical_paragraph "ForumForum", :list_page_id => :forum_page_id, :url_field => :url

   options_form(
                 fld(:forum_forum_id, :select, :options => :forum_forum_options),
                 fld(:posts_per_page, :text_field),
                 fld(:category_page_id, :page_selector),
                 fld(:forum_page_id, :page_selector),
                 fld(:new_post_page_id, :page_selector),
                 fld(:edit_post_page_id, :page_selector)
                 )

    def self.forum_forum_options
      [['Use page connection', nil]] + ForumForum.select_options
    end
  end

  class NewPostOptions < HashModel
    attributes :forum_forum_id => nil, :posts_per_page => 20, :category_page_id => nil, :forum_page_id => nil

    integer_options :posts_per_page

    page_options :category_page_id
    page_options :forum_page_id

    options_form(
                 fld(:forum_forum_id, :select, :options => :forum_forum_options),
                 fld(:posts_per_page, :text_field),
                 fld(:category_page_id, :page_selector),
                 fld(:forum_page_id, :page_selector)
                 )

    def self.forum_forum_options
      [['Use page connection', nil]] + ForumForum.select_options
    end

    def options_partial
      "/application/triggered_options_partial"
    end
  end

  class EditPostOptions < HashModel
    attributes :forum_page_id => nil

    page_options :forum_page_id

    validates_presence_of :forum_page_id

    options_form(
                 fld(:forum_page_id, :page_selector)
                 )
  end

  class RecentOptions < HashModel
    attributes :forum_category_id => -1, :forum_forum_id => nil, :topics_per_page => 20, :category_page_id => nil, :forum_page_id => nil

    integer_options :topics_per_page

    page_options :category_page_id
    page_options :forum_page_id

    options_form(
                 fld(:forum_category_id, :select, :options => :forum_category_options),
                 fld(:forum_forum_id, :select, :options => :forum_forum_options),
                 fld(:topics_per_page, :text_field),
                 fld(:category_page_id, :page_selector),
                 fld(:forum_page_id, :page_selector)
                 )

    def self.forum_category_options
      [['Use page connection', nil]] + ForumCategory.select_options
    end

    def self.forum_forum_options
      [['Use page connection', nil]] + ForumForum.select_options
    end
  end

end


text:
YUI.add('LayoutBinderIndex', function(Y, NAME) {

/**
 * The LayoutBinder module.
 *
 * @module LayoutBinder
 */

    Y.namespace('mojito.binders')[NAME] = {

        /**
         * Binder initialization method, invoked after all binders on the page
         * have been constructed.
         */
        init: function(mojitProxy) {
            this.mojitProxy = mojitProxy;
        },

        /**
         * The binder method, invoked to allow the mojit to attach DOM event
         * handlers.
         *
         * @param node {Node} The DOM node to which this mojit is attached.
         */
        bind: function(node) {
            this.node = node;
        }

    };

}, '0.0.1', {requires: ['mojito-client']});


text:
@implementation TrainerUpgradeLayer

-(id)initWithChoice:(int)choice
           withItem:(NSString*)item
{
	if((self=[super initWithColor:ccc4(0, 0, 0, 255)
                         fadingTo:ccc4(40, 40, 40, 255)])) {

		screenSize = [[CCDirector sharedDirector] winSize];

        choiceVal = choice;
        itemName = item;

        [self setupShopMenu];

        labelGold = [CCLabelTTF labelWithString:NSLocalizedString(@"UpgradeMsg01", nil)
                                       fontName:@"Shark Crash" fontSize:[Utility getFontSize:20]];
        labelShop = [CCLabelTTF labelWithString:NSLocalizedString(@"UpgradeMsg03", nil)
                                       fontName:@"Shark Crash" fontSize:[Utility getFontSize:32]];

        [CCMenuItemFont setFontSize:32];
        [CCMenuItemFont setFontName:@"Shark Crash"];

        [labelGold setColor:ccc3(255, 182, 18)];
        [labelShop setColor:ccc3(0, 255, 127)];
        [labelMsg2 setColor:ccc3(255, 204, 102)];
        [labelCostVal setColor:ccc3(255, 182, 18)];

        itemMsg1 = [CCMenuItemLabel itemWithLabel:labelMsg1];
        itemMsg2 = [CCMenuItemLabel itemWithLabel:labelMsg2];
        itemCost = [CCMenuItemLabel itemWithLabel:labelCost];
        itemCostVal = [CCMenuItemLabel itemWithLabel:labelCostVal];

        itemCancel = [CCMenuItemFont itemWithString:NSLocalizedString(@"Cancel", nil)
                                             target:self selector:@selector(cancel)];
        itemUpgrade = [CCMenuItemFont itemWithString:NSLocalizedString(@"Upgrade", nil)
                                              target:self selector:@selector(upgrade)];

        menuItem = [CCMenu menuWithItems:itemMsg1, itemMsg2, nil];
        menuCost = [CCMenu menuWithItems:itemCost, itemCostVal, nil];
		menuChoice = [CCMenu menuWithItems:itemCancel, itemUpgrade, nil];

        [labelGold setAnchorPoint:ccp(0, 0)];
        [labelGoldVal setAnchorPoint:ccp(1, 0)];

        [menuChoice setPosition:ccp(screenSize.width/2, screenSize.height/2)];

        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
            if (screenSize.height == 568.00) {
                [labelGold setPosition:ccp(screenSize.width/2 - 143, screenSize.height/2 + 244)];
                [labelGoldVal setPosition:ccp(screenSize.width/2 + 142, screenSize.height/2 + 244)];

                [labelShop setPosition:ccp(screenSize.width/2, screenSize.height/2 + 184)];
                [menuItem alignItemsHorizontallyWithPadding:10];
                [menuItem setPosition:ccp(screenSize.width/2, screenSize.height/2 + 90)];
                [labelMsg3 setPosition:ccp(screenSize.width/2, screenSize.height/2 + 10)];

                [menuCost alignItemsHorizontallyWithPadding:10];
                [menuCost setPosition:ccp(screenSize.width/2, screenSize.height/2 - 70)];
                [menuChoice alignItemsHorizontallyWithPadding:80];
                [menuChoice setPosition:ccp(screenSize.width/2, screenSize.height/2 - 164)];
            }
            else {
                [labelGold setPosition:ccp(screenSize.width/2 - 143, screenSize.height/2 + 200)];
                [labelGoldVal setPosition:ccp(screenSize.width/2 + 142, screenSize.height/2 + 200)];

                [labelShop setPosition:ccp(screenSize.width/2, screenSize.height/2 + 140)];
                [menuItem alignItemsHorizontallyWithPadding:10];
                [menuItem setPosition:ccp(screenSize.width/2, screenSize.height/2 + 70)];
                [labelMsg3 setPosition:ccp(screenSize.width/2, screenSize.height/2 + 10)];

                [menuCost alignItemsHorizontallyWithPadding:10];
                [menuCost setPosition:ccp(screenSize.width/2, screenSize.height/2 - 50)];
                [menuChoice alignItemsHorizontallyWithPadding:80];
                [menuChoice setPosition:ccp(screenSize.width/2, screenSize.height/2 - 120)];
            }
        }
        else {
            [labelGold setPosition:ccp(screenSize.width/2 - (143 * 2.4f), screenSize.height/2 + (200 * 2.133f))];
            [labelGoldVal setPosition:ccp(screenSize.width/2 + (142 * 2.4f), screenSize.height/2 + (200 * 2.133f))];

            [labelShop setPosition:ccp(screenSize.width/2, screenSize.height/2 + (140 * 2.133f))];
            [menuItem alignItemsHorizontallyWithPadding:(10 * 2.4f)];
            [menuItem setPosition:ccp(screenSize.width/2, screenSize.height/2 + (70 * 2.133f))];
            [labelMsg3 setPosition:ccp(screenSize.width/2, screenSize.height/2 + (10 * 2.133f))];

            [menuCost alignItemsHorizontallyWithPadding:(10 * 2.4f)];
            [menuCost setPosition:ccp(screenSize.width/2, screenSize.height/2 - (50 * 2.133f))];
            [menuChoice alignItemsHorizontallyWithPadding:(80 * 2.4f)];
            [menuChoice setPosition:ccp(screenSize.width/2, screenSize.height/2 - (120 * 2.133f))];
        }

        [self addChild:labelGold z:1 tag:0];
        [self addChild:labelGoldVal z:1 tag:1];
        [self addChild:labelShop z:1 tag:2];
        [self addChild:menuItem z:1 tag:3];
        [self addChild:labelMsg3 z:1 tag:4];
        [self addChild:menuCost z:1 tag:5];
		[self addChild:menuChoice z:1 tag:6];

        [self scheduleUpdate];

        menuItem.isTouchEnabled = NO;
        menuCost.isTouchEnabled = NO;

        if ([[Player sharedPlayer] currentGold] < requiredGold) {
            itemUpgrade.isEnabled = NO;
        }
	}

	return self;
}

#pragma mark - scene setup

// setups the shop menu
-(void)setupShopMenu
{
    [self setupTradeValues];
    [self setupMessages];

    currentGold = [NSString stringWithFormat:@"%lld", [[Player sharedPlayer] currentGold]];
    costVal = [NSString stringWithFormat:NSLocalizedString(@"UpgradeMsg05", nil), requiredGold];

    labelGoldVal = [CCLabelTTF labelWithString:currentGold
                                      fontName:@"Shark Crash" fontSize:[Utility getFontSize:20]];
    labelMsg1 = [CCLabelTTF labelWithString:msg1
                                   fontName:@"Shark Crash" fontSize:[Utility getFontSize:26]];
    labelMsg2 = [CCLabelTTF labelWithString:itemName
                                   fontName:@"Shark Crash" fontSize:[Utility getFontSize:26]];
    labelMsg3 = [CCLabelTTF labelWithString:msg3
                                   fontName:@"Shark Crash" fontSize:[Utility getFontSize:26]];
    labelCost = [CCLabelTTF labelWithString:NSLocalizedString(@"UpgradeMsg04", nil)
                                   fontName:@"Shark Crash" fontSize:[Utility getFontSize:22]];
    labelCostVal = [CCLabelTTF labelWithString:costVal
                                      fontName:@"Shark Crash" fontSize:[Utility getFontSize:22]];
}

// setups menu messages
-(void)setupMessages
{
    int gainedValue = 0;

    if (choiceVal == 1) {
        itemName = NSLocalizedString(@"TrainerSkillName01", nil);

        if ([[Player sharedPlayer] combatSkill1] == 0) {
            msg1 = NSLocalizedString(@"Learn", nil);
            gainedValue = 2;
        }
        else {
            msg1 = NSLocalizedString(@"Train", nil);

            if ([[Player sharedPlayer] combatSkill1] == 1) gainedValue = 4;
            else if ([[Player sharedPlayer] combatSkill1] == 2) gainedValue = 6;
            else if ([[Player sharedPlayer] combatSkill1] == 3) gainedValue = 8;
            else if ([[Player sharedPlayer] combatSkill1] == 4) gainedValue = 10;
            else if ([[Player sharedPlayer] combatSkill1] == 5) gainedValue = 12;
            else if ([[Player sharedPlayer] combatSkill1] == 6) gainedValue = 14;
            else if ([[Player sharedPlayer] combatSkill1] == 7) gainedValue = 16;
            else if ([[Player sharedPlayer] combatSkill1] == 8) gainedValue = 18;
            else if ([[Player sharedPlayer] combatSkill1] == 9) gainedValue = 20;
        }

        msg3 = [NSString stringWithFormat:NSLocalizedString(@"UpgradeItem21", nil), gainedValue];
    }
    else if (choiceVal == 2) {
        itemName = NSLocalizedString(@"TrainerSkillName02", nil);

        if ([[Player sharedPlayer] combatSkill2] == 0) {
            msg1 = NSLocalizedString(@"Learn", nil);
            gainedValue = 2;
        }
        else {
            msg1 = NSLocalizedString(@"Train", nil);

            if ([[Player sharedPlayer] combatSkill2] == 1) gainedValue = 4;
            else if ([[Player sharedPlayer] combatSkill2] == 2) gainedValue = 6;
            else if ([[Player sharedPlayer] combatSkill2] == 3) gainedValue = 8;
            else if ([[Player sharedPlayer] combatSkill2] == 4) gainedValue = 10;
            else if ([[Player sharedPlayer] combatSkill2] == 5) gainedValue = 12;
            else if ([[Player sharedPlayer] combatSkill2] == 6) gainedValue = 14;
            else if ([[Player sharedPlayer] combatSkill2] == 7) gainedValue = 16;
            else if ([[Player sharedPlayer] combatSkill2] == 8) gainedValue = 18;
            else if ([[Player sharedPlayer] combatSkill2] == 9) gainedValue = 20;
        }

        msg3 = [NSString stringWithFormat:NSLocalizedString(@"UpgradeItem22", nil), gainedValue];
    }
    else if (choiceVal == 3) {
        itemName = NSLocalizedString(@"TrainerSkillName03", nil);

        if ([[Player sharedPlayer] combatSkill3] == 0) {
            msg1 = NSLocalizedString(@"Learn", nil);
            gainedValue = 1;
        }
        else {
            msg1 = NSLocalizedString(@"Train", nil);

            if ([[Player sharedPlayer] combatSkill3] == 1) gainedValue = 2;
            else if ([[Player sharedPlayer] combatSkill3] == 2) gainedValue = 3;
            else if ([[Player sharedPlayer] combatSkill3] == 3) gainedValue = 4;
            else if ([[Player sharedPlayer] combatSkill3] == 4) gainedValue = 5;
            else if ([[Player sharedPlayer] combatSkill3] == 5) gainedValue = 6;
            else if ([[Player sharedPlayer] combatSkill3] == 6) gainedValue = 7;
            else if ([[Player sharedPlayer] combatSkill3] == 7) gainedValue = 8;
            else if ([[Player sharedPlayer] combatSkill3] == 8) gainedValue = 9;
            else if ([[Player sharedPlayer] combatSkill3] == 9) gainedValue = 10;
        }

        msg3 = [NSString stringWithFormat:NSLocalizedString(@"UpgradeItem23", nil), gainedValue];
    }
    else if (choiceVal == 4) {
        itemName = NSLocalizedString(@"TrainerSkillName04", nil);

        if ([[Player sharedPlayer] survivalSkill1] == 0) {
            msg1 = NSLocalizedString(@"Learn", nil);
            gainedValue = 10;
        }
        else {
            msg1 = NSLocalizedString(@"Train", nil);

            if ([[Player sharedPlayer] survivalSkill1] == 1) gainedValue = 30;
            else if ([[Player sharedPlayer] survivalSkill1] == 2) gainedValue = 60;
            else if ([[Player sharedPlayer] survivalSkill1] == 3) gainedValue = 100;
            else if ([[Player sharedPlayer] survivalSkill1] == 4) gainedValue = 150;
            else if ([[Player sharedPlayer] survivalSkill1] == 5) gainedValue = 210;
            else if ([[Player sharedPlayer] survivalSkill1] == 6) gainedValue = 280;
            else if ([[Player sharedPlayer] survivalSkill1] == 7) gainedValue = 360;
            else if ([[Player sharedPlayer] survivalSkill1] == 8) gainedValue = 450;
            else if ([[Player sharedPlayer] survivalSkill1] == 9) gainedValue = 550;
        }

        msg3 = [NSString stringWithFormat:NSLocalizedString(@"UpgradeItem24", nil), gainedValue];
    }
    else if (choiceVal == 5) {
        itemName = NSLocalizedString(@"TrainerSkillName05", nil);

        if ([[Player sharedPlayer] survivalSkill2] == 0) {
            msg1 = NSLocalizedString(@"Learn", nil);
            gainedValue = 2;
        }
        else {
            msg1 = NSLocalizedString(@"Train", nil);

            if ([[Player sharedPlayer] survivalSkill2] == 1) gainedValue = 4;
            else if ([[Player sharedPlayer] survivalSkill2] == 2) gainedValue = 6;
            else if ([[Player sharedPlayer] survivalSkill2] == 3) gainedValue = 8;
            else if ([[Player sharedPlayer] survivalSkill2] == 4) gainedValue = 10;
            else if ([[Player sharedPlayer] survivalSkill2] == 5) gainedValue = 12;
            else if ([[Player sharedPlayer] survivalSkill2] == 6) gainedValue = 14;
            else if ([[Player sharedPlayer] survivalSkill2] == 7) gainedValue = 16;
            else if ([[Player sharedPlayer] survivalSkill2] == 8) gainedValue = 18;
            else if ([[Player sharedPlayer] survivalSkill2] == 9) gainedValue = 20;
        }

        msg3 = [NSString stringWithFormat:NSLocalizedString(@"UpgradeItem25", nil), gainedValue];
    }
    else if (choiceVal == 6) {
        itemName = NSLocalizedString(@"TrainerSkillName06", nil);

        if ([[Player sharedPlayer] survivalSkill3] == 0) {
            msg1 = NSLocalizedString(@"Learn", nil);
            gainedValue = 1;
        }
        else {
            msg1 = NSLocalizedString(@"Train", nil);

            if ([[Player sharedPlayer] survivalSkill3] == 1) gainedValue = 2;
            else if ([[Player sharedPlayer] survivalSkill3] == 2) gainedValue = 3;
            else if ([[Player sharedPlayer] survivalSkill3] == 3) gainedValue = 4;
            else if ([[Player sharedPlayer] survivalSkill3] == 4) gainedValue = 5;
            else if ([[Player sharedPlayer] survivalSkill3] == 5) gainedValue = 6;
            else if ([[Player sharedPlayer] survivalSkill3] == 6) gainedValue = 7;
            else if ([[Player sharedPlayer] survivalSkill3] == 7) gainedValue = 8;
            else if ([[Player sharedPlayer] survivalSkill3] == 8) gainedValue = 9;
            else if ([[Player sharedPlayer] survivalSkill3] == 9) gainedValue = 10;
        }

        msg3 = [NSString stringWithFormat:NSLocalizedString(@"UpgradeItem26", nil), gainedValue];
    }
    else if (choiceVal == 7) {
        itemName = NSLocalizedString(@"TrainerSkillName07", nil);

        if ([[Player sharedPlayer] practicalSkill1] == 0) {
            msg1 = NSLocalizedString(@"Learn", nil);
            gainedValue = 2;
        }
        else {
            msg1 = NSLocalizedString(@"Train", nil);

            if ([[Player sharedPlayer] practicalSkill1] == 1) gainedValue = 4;
            else if ([[Player sharedPlayer] practicalSkill1] == 2) gainedValue = 6;
            else if ([[Player sharedPlayer] practicalSkill1] == 3) gainedValue = 8;
            else if ([[Player sharedPlayer] practicalSkill1] == 4) gainedValue = 10;
            else if ([[Player sharedPlayer] practicalSkill1] == 5) gainedValue = 12;
            else if ([[Player sharedPlayer] practicalSkill1] == 6) gainedValue = 14;
            else if ([[Player sharedPlayer] practicalSkill1] == 7) gainedValue = 16;
            else if ([[Player sharedPlayer] practicalSkill1] == 8) gainedValue = 18;
            else if ([[Player sharedPlayer] practicalSkill1] == 9) gainedValue = 20;
        }

        msg3 = [NSString stringWithFormat:NSLocalizedString(@"UpgradeItem27", nil), gainedValue];
    }
    else if (choiceVal == 8) {
        itemName = NSLocalizedString(@"TrainerSkillName08", nil);

        if ([[Player sharedPlayer] practicalSkill2] == 0) {
            msg1 = NSLocalizedString(@"Learn", nil);
            gainedValue = 2;
        }
        else {
            msg1 = NSLocalizedString(@"Train", nil);

            if ([[Player sharedPlayer] practicalSkill2] == 1) gainedValue = 4;
            else if ([[Player sharedPlayer] practicalSkill2] == 2) gainedValue = 6;
            else if ([[Player sharedPlayer] practicalSkill2] == 3) gainedValue = 8;
            else if ([[Player sharedPlayer] practicalSkill2] == 4) gainedValue = 10;
            else if ([[Player sharedPlayer] practicalSkill2] == 5) gainedValue = 12;
            else if ([[Player sharedPlayer] practicalSkill2] == 6) gainedValue = 14;
            else if ([[Player sharedPlayer] practicalSkill2] == 7) gainedValue = 16;
            else if ([[Player sharedPlayer] practicalSkill2] == 8) gainedValue = 18;
            else if ([[Player sharedPlayer] practicalSkill2] == 9) gainedValue = 20;
        }

        msg3 = [NSString stringWithFormat:NSLocalizedString(@"UpgradeItem28", nil), gainedValue];
    }
    else if (choiceVal == 9) {
        itemName = NSLocalizedString(@"TrainerSkillName09", nil);

        if ([[Player sharedPlayer] practicalSkill3] == 0) {
            msg1 = NSLocalizedString(@"Learn", nil);
            gainedValue = 4;
        }
        else {
            msg1 = NSLocalizedString(@"Train", nil);

            if ([[Player sharedPlayer] practicalSkill3] == 1) gainedValue = 12;
            else if ([[Player sharedPlayer] practicalSkill3] == 2) gainedValue = 24;
            else if ([[Player sharedPlayer] practicalSkill3] == 3) gainedValue = 40;
            else if ([[Player sharedPlayer] practicalSkill3] == 4) gainedValue = 60;
            else if ([[Player sharedPlayer] practicalSkill3] == 5) gainedValue = 84;
            else if ([[Player sharedPlayer] practicalSkill3] == 6) gainedValue = 112;
            else if ([[Player sharedPlayer] practicalSkill3] == 7) gainedValue = 144;
            else if ([[Player sharedPlayer] practicalSkill3] == 8) gainedValue = 180;
            else if ([[Player sharedPlayer] practicalSkill3] == 9) gainedValue = 220;
        }

        msg3 = [NSString stringWithFormat:NSLocalizedString(@"UpgradeItem29", nil), gainedValue];
    }
}

// setups item trade values
-(void)setupTradeValues
{
    int upgrade_rank;

    if (choiceVal == 1) {
        upgrade_rank = [[Player sharedPlayer] combatSkill1];
    }
    else if (choiceVal == 2) {
        upgrade_rank = [[Player sharedPlayer] combatSkill2];
    }
    else if (choiceVal == 3) {
        upgrade_rank = [[Player sharedPlayer] combatSkill3];
    }
    else if (choiceVal == 4) {
        upgrade_rank = [[Player sharedPlayer] survivalSkill1];
    }
    else if (choiceVal == 5) {
        upgrade_rank = [[Player sharedPlayer] survivalSkill2];
    }
    else if (choiceVal == 6) {
        upgrade_rank = [[Player sharedPlayer] survivalSkill3];
    }
    else if (choiceVal == 7) {
        upgrade_rank = [[Player sharedPlayer] practicalSkill1];
    }
    else if (choiceVal == 8) {
        upgrade_rank = [[Player sharedPlayer] practicalSkill2];
    }
    else if (choiceVal == 9) {
        upgrade_rank = [[Player sharedPlayer] practicalSkill3];
    }

    if (upgrade_rank == 9) {
        requiredGold = 250000;
    }
    else if (upgrade_rank == 8) {
        requiredGold = 100000;
    }
    else if (upgrade_rank == 7) {
        requiredGold = 50000;
    }
    else if (upgrade_rank == 6) {
        requiredGold = 10000;
    }
    else if (upgrade_rank == 5) {
        requiredGold = 3200;
    }
    else if (upgrade_rank == 4) {
        requiredGold = 1500;
    }
    else if (upgrade_rank == 3) {
        requiredGold = 800;
    }
    else if (upgrade_rank == 2) {
        requiredGold = 400;
    }
    else if (upgrade_rank == 1) {
        requiredGold = 200;
    }
    else if (upgrade_rank == 0) {
        requiredGold = 100;
    }
}

#pragma mark - update schedulers

// updates menu
-(void)update:(ccTime)dt
{
    if (itemCancel.isSelected || itemUpgrade.isSelected) {
        [[SoundManager sharedSoundManager] playButtonPressedEffect];
    }
    else if (!itemCancel.isSelected && !itemUpgrade.isSelected) {

        [[SoundManager sharedSoundManager] setSoundEffectStarted:NO];
    }
}

#pragma mark - menu choices

// upgrades the selected by the user item
-(void)upgrade
{
    if (choiceVal == 1) {
        [[GameManager sharedGameManager] writeCombatSkill1UpgradeData];
    }
    else if (choiceVal == 2) {
        [[GameManager sharedGameManager] writeCombatSkill2UpgradeData];
    }
    else if (choiceVal == 3) {
        [[GameManager sharedGameManager] writeCombatSkill3UpgradeData];
    }
    else if (choiceVal == 4) {
        [[GameManager sharedGameManager] writeSurvivalSkill1UpgradeData];
    }
    else if (choiceVal == 5) {
        [[GameManager sharedGameManager] writeSurvivalSkill2UpgradeData];
    }
    else if (choiceVal == 6) {
        [[GameManager sharedGameManager] writeSurvivalSkill3UpgradeData];
    }
    else if (choiceVal == 7) {
        [[GameManager sharedGameManager] writePracticalSkill1UpgradeData];
    }
    else if (choiceVal == 8) {
        [[GameManager sharedGameManager] writePracticalSkill2UpgradeData];
    }
    else if (choiceVal == 9) {
        [[GameManager sharedGameManager] writePracticalSkill3UpgradeData];
    }

    [[GameManager sharedGameManager] writeSpendingGold:requiredGold];

    [self confirm];
}

// accepts training and returns to the underlying menu
-(void)confirm
{
    TrainerLayer *layer = (TrainerLayer*)self.parent;
    [layer resumeGame];
    [self.parent removeChild:self cleanup:YES];
}

// cancels training and returns to the underlying menu
-(void)cancel
{
    TrainerLayer *layer = (TrainerLayer*)self.parent;
    [layer resumeGame];
    [self.parent removeChild:self cleanup:YES];
}

@end


text:
var Bloom = require("./index.js");
var bloom = new Bloom();
bloom.add("http://www.baidu.com");
bloom.add("http://omy2do.com");
console.log(bloom.exist("http://www.baidu.com")); // true
console.log(bloom.exist("http://github.com")); //false


text:
// ***********************************************************************
// Copyright (c) 2017 Charlie Poole, Rob Prouse
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ***********************************************************************

using System;
using System.Collections.Generic;

namespace NUnit.Framework.Constraints
{
    /// <summary>
    /// Summary description for ConstraintExpressionTests.
    /// </summary>
    [TestFixture]
    public class ConstraintExpressionTests
    {
        static readonly Func<int, int, bool> myIntComparer = (x, y) => x == y;

        [Test]
        public void ConstraintExpressionMemberAnd()
        {
            var constraintExpression = new ConstraintExpression();
            var constraint = constraintExpression.Member(3).And.Contains(7);
            var collection1 = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8 };
            Assert.That(collection1, constraint);
        }

        [Test]
        public void ConstraintExpressionMemberUsing()
        {
            var constraintExpression = new ConstraintExpression();
            var constraint = constraintExpression
                .Member("3")
                .Using<int, string>((i, s) => i.ToString() == s)
                .Using((IComparer<string>) Comparer<string>.Default);
            var collection1 = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8 };
            Assert.That(collection1, constraint);
        }

        [Test]
        public void ConstraintExpressionContainsAnd()
        {
            var constraintExpression = new ConstraintExpression();
            var constraint = constraintExpression.Contains(4).And.Member(2);
            var collection1 = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8 };
            Assert.That(collection1, constraint);
        }

        [Test]
        public void ConstraintExpressionContainsUsing()
        {
            var constraintExpression = new ConstraintExpression();
            var constraint = constraintExpression.Contains(4).Using(myIntComparer);
            var collection1 = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8 };
            Assert.That(collection1, constraint);
        }

        [Test]
        public void ConstraintExpressionContainAnd()
        {
            var constraintExpression = new ConstraintExpression();
            var constraint = constraintExpression.Contain(8).And.Contain(7);
            var collection1 = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8 };
            Assert.That(collection1, constraint);
        }

        [Test]
        public void ConstraintExpressionContainUsing()
        {
            var constraintExpression = new ConstraintExpression();
            var constraint = constraintExpression.Contain(8).Using(myIntComparer);
            var collection1 = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8 };
            Assert.That(collection1, constraint);
        }

        [Test]
        public void ContainsConstraintApplyTo()
        {
            var containsConstraint = new ContainsConstraint(6);
            var collection1 = new[] { 1, 2, 3, 4, 5, 6, 7, 8 };
            var result = containsConstraint.ApplyTo(collection1);
            Assert.That(result.IsSuccess, Is.True);
        }
    }
}


text:
from datetime import datetime
import json
import sys
from tornado import gen
from urllib.parse import urlencode

from dateutil.parser import parse as parse_date
import re
from tornado.httpclient import AsyncHTTPClient

from tornado.log import app_log

from targetprocess.filter import TargetprocessAssignablesFilter
from vizydrop.fields import NumberField, TextField, DateField, DecimalField, IDField
from vizydrop.sdk.source import StreamingDataSource, SourceSchema

class TargetprocessGeneral(StreamingDataSource):
    class Meta:
        tp_api_call = "Generals"

    class Schema(SourceSchema):
        Id = IDField(name="ID", description="Entity ID", force_int=True)
        Name = TextField(name="Name", description="Entity name or title")
        StartDate = DateField(name="Start Date",
                              description="Start date for time-boxed entities such as Iteration, Project, Release")
        EndDate = DateField(name="End Date",
                            description="End date for time-boxed entities such as Iteration, Project, Release")
        CreateDate = DateField(name="Create Date", description="Entity creation date")
        Tags = TextField(name="Tags", description="List of tags")

    @classmethod
    def get_api_includes(cls):
        """
        Gathers the TP API's include fields based on our source schema
        :return:
        """
        includes = []
        for name, field in cls.Schema.get_all_fields():
            if field.response_location is not None:
                # convert our response location pieces delimited by a hyphen
                # to TP's API x[y[z]] format for include
                pieces = field.response_location.split('-')
                include = '['.join(pieces) + ''.join([']' for n in range(pieces.__len__() - 1)])
                includes.append(include)
            else:
                # if we have no response location, our name is the location
                includes.append(name)
        return '[{}]'.format(','.join(includes))

    @classmethod
    def _get_value_from_location(cls, item, location):
        """
        Adds some extra spice to this function to deal with TargetProcess' collections
        :param item: dict to search through
        :param location: location to get the value from, nested dictionaries can be separated by a hyphen (-)
        :return: value
        """
        if location is None or item is None:
            return None
        if 'Items' in item.keys():
            # handle our inner collections
            return ','.join([cls._get_value_from_location(i, location) for i in item['Items']])
        return super(TargetprocessGeneral, cls)._get_value_from_location(item, location)

    @classmethod
    @gen.coroutine
    def get_data(cls, account, source_filter, limit=100, skip=0):
        try:
            # first try the filter specified in our Meta-class
            source_filter = cls.Meta.filter(source_filter)
        except AttributeError:
            # and fallback to our base assignables filter if that fails
            source_filter = TargetprocessAssignablesFilter(source_filter)

        where_clause = source_filter.get_where_clause()

        client = AsyncHTTPClient()

        app_log.info("Start retrieval of {} for {}".format(cls.Meta.tp_api_call, account._id))

        uri = "{}/api/v1/{}".format(account.tp_url, cls.Meta.tp_api_call)
        query_params = {}
        if where_clause != "":
            query_params['where'] = where_clause
        if skip > 0:
            query_params['skip'] = skip
        page_limit = limit if limit is not None else 1000  # TP API's maximum page size
        query_params['take'] = page_limit
        query_params['include'] = cls.get_api_includes()

        uri = '?'.join([uri, urlencode(query_params)])
        date_re = re.compile(r'\((\d+)([\+\-])(\d+)\)')
        # hold our counts and track the amount of data we've already streamed
        # (for maximum response sizes)
        item_count = 0
        response_size = 1

        # open our list
        cls.write('[')

        while uri is not None:
            req = account.get_request(uri)

            response = yield client.fetch(req)

            page_data = response.body.decode('utf-8')
            resp_obj = json.loads(page_data)

            app_log.info("Start retrieval; first page...")
            for item in resp_obj['Items']:
                # convert our dates to something understandable
                # TP dates come in as something like \/Date(1429890000000-0500)\/
                # we put them out in 8601
                for name, field in cls.Schema.get_all_fields():
                    if not isinstance(field, DateField):
                        continue
                    val = item[name]
                    if val is not None and isinstance(val, str):
                        search = date_re.search(val)
                        if search is None:
                            continue
                        pieces = search.groups()
                        timestamp = int(int(pieces[0]) / 1000)
                        val = parse_date(datetime.fromtimestamp(timestamp).isoformat()
                                         + ''.join(pieces[1:])).strftime('%Y-%m-%dT%H:%M:%S%z')
                    item[name] = val
                formatted = cls.format_data_to_schema(item)
                response_size += sys.getsizeof(formatted)
                if item_count > 0:
                    cls.write(',')
                cls.write(json.dumps(formatted))
                item_count += 1

            uri = resp_obj.get('Next', None)
            if uri is not None:
                app_log.info(
                    "Next page for {}, retrieved {} thus far".format(account._id, item_count))
                # This escapes the filter, otherwise every request past the first will
                # return a 400
                uri = uri.replace(' ', '+')
            else:
                app_log.info("At end of response for {}".format(account._id))
        # close our array
        cls.write(']')
        # finish
        app_log.info(
            "Finished retrieval of {} {} for {}".format(item_count, cls.Meta.tp_api_call, account._id))

class TargetprocessAssignable(TargetprocessGeneral):
    class Schema(TargetprocessGeneral.Schema):
        Project = TextField(name="Project", description="Project where entity is found", response_loc="Project-Name")
        Effort = DecimalField(name="Effort", description="Total efforts for assignable")
        EffortCompleted = DecimalField(name="Effort Completed", description="Effort spent on assignment")
        EffortToDo = DecimalField(name="Effort ToDo", description="Effort required to complete assignment")
        Progress = DecimalField(name="Progress", description="Percent done for assignable")
        TimeSpent = DecimalField(name="Time Spent", description="Total time spent on assignment")
        TimeRemain = DecimalField(name="Time Remain",
                                  description="Total time remaining to complete assignment for Role")
        PlannedStartDate = DateField(name="Planned Start Date",
                                     description="Planned Start date for time-boxed entities such as Iteration, Project, Release")
        PlannedEndDate = DateField(name="Planned End Date",
                                   description="Planned End date for time-boxed entities such as Iteration, Project, Release")
        Assignments = TextField(name="Assignment", description="User assigned to this item",
                                response_loc="Assignments-GeneralUser-LastName")
        LeadTime = NumberField(name="Lead Time",
                               description="Number of days between assignable create date and end date")
        CycleTime = NumberField(name="Cycle Time",
                                description="Number of days between assignable start date and end date")
        ForecastEndDate = DateField(name="Forecast End Date", description="End date predicted on current progress")
        Iteration = TextField(name="Iteration", description="Assignable entity can be assigned to Iteration",
                              response_loc="Iteration-Name")
        TeamIteration = TextField(name="Team Iteration",
                                  description="Assignable entity can be assigned to TeamIteration",
                                  response_loc="TeamIteration-Name")
        Release = TextField(name="Release",
                            description="Assignable entity can be assigned to Release or can be in project Backlog (Release is not defined in this case)",
                            response_loc="Release-Name")
        EntityState = TextField(name="Entity State", description="State of Assignable",
                                response_loc="EntityState-Name")
        Priority = TextField(name="Priority", description="Priority of Assignable", response_loc="Priority-Name")
        Teams = TextField(name="Teams", description="Assigned Team(s)", response_loc="AssignedTeams-Team-Name")


text:
package org.jetbrains.plugins.groovy.lang.completion.weighers;

import com.intellij.codeInsight.completion.CompletionLocation;
import com.intellij.codeInsight.completion.CompletionWeigher;
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.GroovyFileType;
import org.jetbrains.plugins.groovy.lang.psi.api.GroovyResolveResult;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrReferenceExpression;
import org.jetbrains.plugins.groovy.lang.psi.util.GdkMethodUtil;

/**
 * Prefers elements that were added by 'with' closure: foo.with{ caret }
 *
 * @author Max Medvedev
 */
public class GrWithWeigher extends CompletionWeigher {

  @Override
  public Comparable weigh(@NotNull LookupElement element, @NotNull CompletionLocation location) {
    final PsiElement position = location.getCompletionParameters().getPosition();
    if (!(position.getLanguage() != GroovyFileType.GROOVY_LANGUAGE)) return null;

    if (!(position.getParent() instanceof GrReferenceExpression)) return null;

    Object o = element.getObject();
    if (!(o instanceof GroovyResolveResult)) return 0;

    final PsiElement resolveContext = ((GroovyResolveResult)o).getCurrentFileResolveContext();

    if (resolveContext == null) return 0;

    if (GdkMethodUtil.isInWithContext(resolveContext)) {
      return 1;
    }

    return 0;
  }
}


text:
package io.ckl.crash.app.activities;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;

import io.ckl.crash.app.R;
import io.ckl.crash.app.fragments.MainFragment;

public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, new MainFragment())
                    .commit();
        }
    }
}


text:
#ifndef __UVISOR_API_HALT_EXPORTS_H__
#define __UVISOR_API_HALT_EXPORTS_H__

#include "uvisor_exports.h"

#define UVISOR_ERROR_INVALID_BOX_ID             (-2)
#define UVISOR_ERROR_BUFFER_TOO_SMALL           (-3)
#define UVISOR_ERROR_BOX_NAMESPACE_ANONYMOUS    (-4)
#define UVISOR_ERROR_BAD_MAGIC                  (-5)
#define UVISOR_ERROR_BAD_VERSION                (-6)
#define UVISOR_ERROR_OUT_OF_STRUCTURES          (-7)
#define UVISOR_ERROR_INVALID_PARAMETERS         (-8)
#define UVISOR_ERROR_NOT_IMPLEMENTED            (-9)
#define UVISOR_ERROR_TIMEOUT                    (-10)

#define UVISOR_ERROR_CLASS_MASK     (0xFFFF0000UL)
#define UVISOR_ERROR_MASK           (0x0000FFFFUL)

#define UVISOR_ERROR_CLASS_PAGE     (1UL << 16)

typedef enum {
    USER_NOT_ALLOWED = 1,
    DEBUG_BOX_HALT,
} THaltUserError;

typedef enum {
    HALT_NO_ERROR = 0,
    PERMISSION_DENIED = 1,
    SANITY_CHECK_FAILED,
    NOT_IMPLEMENTED,
    NOT_ALLOWED,
    FAULT_MEMMANAGE,
    FAULT_BUS,
    FAULT_USAGE,
    FAULT_HARD,
    FAULT_DEBUG,
    FAULT_SECURE,
    __THALTERROR_MAX /* always keep as the last element of the enum */
} THaltError;

/** A basic exception frame
 *
 * This struct contains the registers always saved during an exception in the
 * order they are placed in the memory.
 * If FPU state is also saved it's placed after this register block.
 * On ARMv8-M in certain cases an additional state context may be placed on
 * the stack before this block.
 */
typedef struct {
    uint32_t r0;
    uint32_t r1;
    uint32_t r2;
    uint32_t r3;
    uint32_t r12;
    uint32_t lr;
    uint32_t retaddr;
    uint32_t retpsr;
} UVISOR_PACKED exception_frame_t;

/* A pointer to this structure will be given to halt_error() handler
 * of the debug box driver. */
typedef struct {
    /* A basic exception stack frame that is always present with a valid stack. */
    exception_frame_t stack_frame;

    /* A few registers that may be useful for debug. */
    uint32_t lr;
    uint32_t control;
    uint32_t ipsr;

    /* Fault status registers. */
    uint32_t mmfar;
    uint32_t bfar;
    uint32_t cfsr;
    uint32_t hfsr;
    uint32_t dfsr;
    uint32_t afsr;

    /* Bitmask telling which of the above regions are valid. */
    uint32_t valid_data;
} UVISOR_PACKED THaltInfo;

/* Bitmask to specify which HaltInfo regions are valid. */
typedef enum {
    HALT_INFO_STACK_FRAME = 0x1,
    HALT_INFO_REGISTERS   = 0x2
} THaltInfoValidMask;

#endif /* __UVISOR_API_HALT_EXPORTS_H__ */


text:
from __future__ import absolute_import, division, print_function

from mock import MagicMock

# from glue.utils.qt import process_dialog

from ..mouse_mode import (MouseMode, RectangleMode, CircleMode, PolyMode,
                          ContrastMode, LassoMode)

class Event(object):

    def __init__(self, x, y, button=3, key='a'):
        self.x = x
        self.y = y
        self.xdata = x
        self.ydata = y
        self.button = button
        self.key = key
        self.inaxes = True

def viewer():
    result = MagicMock()
    result.axes.figure.canvas.get_width_height.return_value = (640, 480)
    return result

class TestMouseMode(object):

    def setup_method(self, method):
        self.mode = self.mode_factory()(viewer())
        self.axes = self.mode._axes
        self.attach_callbacks()

    def attach_callbacks(self):
        self.press = self.mode._press_callback = MagicMock()
        self.move = self.mode._move_callback = MagicMock()
        self.release = self.mode._release_callback = MagicMock()

    def mode_factory(self):
        return MouseMode

    def test_press_callback(self):
        e = Event(1, 2)
        self.mode.press(e)
        self.press.assert_called_once_with(self.mode)
        assert self.move.call_count == 0
        assert self.release.call_count == 0

    # def test_log_null_event(self):
    #    """ Should exit quietly if event is None """
    #    self.mode._log_position(None)

    def test_move_callback(self):
        e = Event(1, 2)
        self.mode.move(e)
        self.move.assert_called_once_with(self.mode)
        assert self.press.call_count == 0
        assert self.release.call_count == 0

    def test_release_callback(self):
        e = Event(1, 2)
        self.mode.release(e)
        self.release.assert_called_once_with(self.mode)
        assert self.press.call_count == 0
        assert self.move.call_count == 0

    def test_press_log(self):
        e = Event(1, 2)
        self.mode.press(e)
        assert self.mode._event_x == 1
        assert self.mode._event_y == 2

    def test_move_log(self):
        e = Event(1, 2)
        self.mode.move(e)
        assert self.mode._event_x == 1
        assert self.mode._event_y == 2

    def test_release_log(self):
        e = Event(1, 2)
        self.mode.release(e)
        assert self.mode._event_x == 1
        assert self.mode._event_y == 2

class TestRoiMode(TestMouseMode):

    def setup_method(self, method):
        TestMouseMode.setup_method(self, method)
        self.mode._roi_tool = MagicMock()

    def mode_factory(self):
        raise NotImplementedError()

    def test_roi_not_called_on_press(self):
        e = Event(1, 2)
        self.mode.press(e)
        assert self.mode._roi_tool.start_selection.call_count == 0

    def test_roi_called_on_drag(self):
        e = Event(1, 2)
        e2 = Event(10, 200)
        self.mode.press(e)
        self.mode.move(e2)
        self.mode._roi_tool.start_selection.assert_called_once_with(e)
        self.mode._roi_tool.update_selection.assert_called_once_with(e2)

    def test_roi_ignores_small_drags(self):
        e = Event(1, 2)
        e2 = Event(1, 3)
        self.mode.press(e)
        self.mode.move(e2)
        assert self.mode._roi_tool.start_selection.call_count == 0
        assert self.mode._roi_tool.update_selection.call_count == 0

    def test_roi_called_on_release(self):
        e = Event(1, 2)
        e2 = Event(10, 20)
        self.mode.press(e)
        self.mode.move(e2)
        self.mode.release(e2)
        self.mode._roi_tool.finalize_selection.assert_called_once_with(e2)

    def test_roi(self):
        self.mode.roi()
        self.mode._roi_tool.roi.assert_called_once_with()

    def test_roi_resets_on_escape(self):
        e = Event(1, 2)
        e2 = Event(1, 30, key='escape')
        self.mode.press(e)
        self.mode.key(e2)
        self.mode.press(e)
        assert self.mode._roi_tool.abort_selection.call_count == 1

class TestClickRoiMode(TestMouseMode):

    def setup_method(self, method):
        TestMouseMode.setup_method(self, method)
        self.mode._roi_tool = MagicMock()
        self.mode._roi_tool.active.return_value = False

    def mode_factory(self):
        raise NotImplementedError()

    def test_roi_started_on_press(self):
        e = Event(1, 2)
        self.mode.press(e)
        assert self.mode._roi_tool.start_selection.call_count == 1

    def test_roi_updates_on_subsequent_presses(self):
        e = Event(1, 2)
        e2 = Event(1, 30)
        self.mode.press(e)
        self.mode._roi_tool.active.return_value = True
        self.mode.press(e2)
        assert self.mode._roi_tool.start_selection.call_count == 1
        assert self.mode._roi_tool.update_selection.call_count == 1

    def test_roi_finalizes_on_enter(self):
        e = Event(1, 2)
        e2 = Event(1, 20)
        e3 = Event(1, 30, key='enter')
        self.mode.press(e)
        self.mode._roi_tool.active.return_value = True
        self.mode.press(e2)
        self.mode.key(e3)
        self.mode._roi_tool.start_selection.assert_called_once_with(e)
        self.mode._roi_tool.update_selection.assert_called_once_with(e2)
        self.mode._roi_tool.finalize_selection.assert_called_once_with(e2)

    def test_roi_resets_on_escape(self):
        e = Event(1, 2)
        e2 = Event(1, 30, key='escape')
        self.mode.press(e)
        self.mode.key(e2)
        self.mode.press(e)
        assert self.mode._roi_tool.abort_selection.call_count == 1
        assert self.mode._roi_tool.start_selection.call_count == 2

class TestRectangleMode(TestRoiMode):

    def mode_factory(self):
        return RectangleMode

class TestCircleMode(TestRoiMode):

    def mode_factory(self):
        return CircleMode

class TestLassoMode(TestRoiMode):

    def mode_factory(self):
        return LassoMode

class TestPolyMode(TestClickRoiMode):

    def mode_factory(self):
        return PolyMode

class TestContrastMode(TestMouseMode):

    def mode_factory(self):
        return ContrastMode

    def test_move_ignored_if_not_right_drag(self):
        e = Event(1, 2, button=1)
        self.mode.move(e)
        count = self.mode._axes.figure.canvas.get_width_height.call_count
        assert count == 0

    def test_clip_percentile(self):
        assert self.mode.get_clip_percentile() == (1, 99)
        self.mode.set_clip_percentile(2, 33)
        assert self.mode.get_clip_percentile() == (2, 33)

    def test_vmin_vmax(self):
        assert self.mode.get_vmin_vmax() == (None, None)
        self.mode.set_vmin_vmax(3, 4)
        assert self.mode.get_vmin_vmax() == (3, 4)
        assert self.mode.get_clip_percentile() == (None, None)

    # TODO: at the moment, this doesn't work because the dialog is non-modal
    # assert self.mode.get_vmin_vmax() == (5, 7)
    # def test_choose_vmin_vmax(self):
    #
    #     assert self.mode.get_vmin_vmax() == (None, None)
    #
    #     def fill_apply(dialog):
    #         dialog.vmin.setText('5')
    #         dialog.vmax.setText('7')
    #         dialog.accept()
    #
    #     with process_dialog(delay=500, function=fill_apply):
    #         self.mode.choose_vmin_vmax()

del TestRoiMode  # prevents test discovery from running abstract test
del TestClickRoiMode


text:
package org.apache.hadoop.hbase.regionserver;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
import java.util.OptionalLong;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellComparator;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HDFSBlocksDistribution;
import org.apache.hadoop.hbase.io.TimeRange;
import org.apache.hadoop.hbase.io.hfile.BlockType;
import org.apache.hadoop.hbase.io.hfile.BloomFilterMetrics;
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
import org.apache.hadoop.hbase.io.hfile.HFile;
import org.apache.hadoop.hbase.io.hfile.ReaderContext;
import org.apache.hadoop.hbase.io.hfile.ReaderContext.ReaderType;
import org.apache.hadoop.hbase.util.BloomFilterFactory;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.hbase.thirdparty.com.google.common.base.Preconditions;

import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;

/**
 * A Store data file. Stores usually have one or more of these files. They are produced by flushing
 * the memstore to disk. To create, instantiate a writer using {@link StoreFileWriter.Builder} and
 * append data. Be sure to add any metadata before calling close on the Writer (Use the
 * appendMetadata convenience methods). On close, a StoreFile is sitting in the Filesystem. To refer
 * to it, create a StoreFile instance passing filesystem and path. To read, call
 * {@link #initReader()}
 *

 * StoreFiles may also reference store files in another Store. The reason for this weird pattern
 * where you use a different instance for the writer and a reader is that we write once but read a
 * lot more.
 */
@InterfaceAudience.Private
public class HStoreFile implements StoreFile {

  private static final Logger LOG = LoggerFactory.getLogger(HStoreFile.class.getName());

  // Keys for fileinfo values in HFile

  /** Max Sequence ID in FileInfo */
  public static final byte[] MAX_SEQ_ID_KEY = Bytes.toBytes("MAX_SEQ_ID_KEY");

  /** Major compaction flag in FileInfo */
  public static final byte[] MAJOR_COMPACTION_KEY = Bytes.toBytes("MAJOR_COMPACTION_KEY");

  /** Minor compaction flag in FileInfo */
  public static final byte[] EXCLUDE_FROM_MINOR_COMPACTION_KEY =
    Bytes.toBytes("EXCLUDE_FROM_MINOR_COMPACTION");

  /**
   * Key for compaction event which contains the compacted storefiles in FileInfo
   */
  public static final byte[] COMPACTION_EVENT_KEY = Bytes.toBytes("COMPACTION_EVENT_KEY");

  /** Bloom filter Type in FileInfo */
  public static final byte[] BLOOM_FILTER_TYPE_KEY = Bytes.toBytes("BLOOM_FILTER_TYPE");

  /** Bloom filter param in FileInfo */
  public static final byte[] BLOOM_FILTER_PARAM_KEY = Bytes.toBytes("BLOOM_FILTER_PARAM");

  /** Delete Family Count in FileInfo */
  public static final byte[] DELETE_FAMILY_COUNT = Bytes.toBytes("DELETE_FAMILY_COUNT");

  /** Last Bloom filter key in FileInfo */
  public static final byte[] LAST_BLOOM_KEY = Bytes.toBytes("LAST_BLOOM_KEY");

  /** Key for Timerange information in metadata */
  public static final byte[] TIMERANGE_KEY = Bytes.toBytes("TIMERANGE");

  /** Key for timestamp of earliest-put in metadata */
  public static final byte[] EARLIEST_PUT_TS = Bytes.toBytes("EARLIEST_PUT_TS");

  /** Key for the number of mob cells in metadata */
  public static final byte[] MOB_CELLS_COUNT = Bytes.toBytes("MOB_CELLS_COUNT");

  /** Null data */
  public static final byte[] NULL_VALUE = new byte[] { 0 };

  /** Key for the list of MOB file references */
  public static final byte[] MOB_FILE_REFS = Bytes.toBytes("MOB_FILE_REFS");

  /** Meta key set when store file is a result of a bulk load */
  public static final byte[] BULKLOAD_TASK_KEY = Bytes.toBytes("BULKLOAD_SOURCE_TASK");
  public static final byte[] BULKLOAD_TIME_KEY = Bytes.toBytes("BULKLOAD_TIMESTAMP");

  /**
   * Key for skipping resetting sequence id in metadata. For bulk loaded hfiles, the scanner resets
   * the cell seqId with the latest one, if this metadata is set as true, the reset is skipped.
   */
  public static final byte[] SKIP_RESET_SEQ_ID = Bytes.toBytes("SKIP_RESET_SEQ_ID");

  private final StoreFileInfo fileInfo;

  // StoreFile.Reader
  private volatile StoreFileReader initialReader;
  private volatile InputStreamBlockDistribution initialReaderBlockDistribution = null;

  // Block cache configuration and reference.
  private final CacheConfig cacheConf;
  private final BloomFilterMetrics metrics;

  // Indicates if the file got compacted
  private volatile boolean compactedAway = false;

  // Keys for metadata stored in backing HFile.
  // Set when we obtain a Reader.
  private long sequenceid = -1;

  // max of the MemstoreTS in the KV's in this store
  // Set when we obtain a Reader.
  private long maxMemstoreTS = -1;

  // firstKey, lastkey and cellComparator will be set when openReader.
  private Optional<Cell> firstKey;

  private Optional<Cell> lastKey;

  private CellComparator comparator;

  public CacheConfig getCacheConf() {
    return this.cacheConf;
  }

  @Override
  public Optional<Cell> getFirstKey() {
    return firstKey;
  }

  @Override
  public Optional<Cell> getLastKey() {
    return lastKey;
  }

  @Override
  public CellComparator getComparator() {
    return comparator;
  }

  @Override
  public long getMaxMemStoreTS() {
    return maxMemstoreTS;
  }

  // If true, this file was product of a major compaction. Its then set
  // whenever you get a Reader.
  private AtomicBoolean majorCompaction = null;

  // If true, this file should not be included in minor compactions.
  // It's set whenever you get a Reader.
  private boolean excludeFromMinorCompaction = false;

  // This file was product of these compacted store files
  private final Set<String> compactedStoreFiles = new HashSet<>();

  /**
   * Map of the metadata entries in the corresponding HFile. Populated when Reader is opened after
   * which it is not modified again.
   */
  private Map<byte[], byte[]> metadataMap;

  /**
   * Bloom filter type specified in column family configuration. Does not necessarily correspond to
   * the Bloom filter type present in the HFile.
   */
  private final BloomType cfBloomType;

  /**
   * Constructor, loads a reader and it's indices, etc. May allocate a substantial amount of ram
   * depending on the underlying files (10-20MB?).
   * @param fs             The current file system to use.
   * @param p              The path of the file.
   * @param conf           The current configuration.
   * @param cacheConf      The cache configuration and block cache reference.
   * @param cfBloomType    The bloom type to use for this store file as specified by column family
   *                       configuration. This may or may not be the same as the Bloom filter type
   *                       actually present in the HFile, because column family configuration might
   *                       change. If this is {@link BloomType#NONE}, the existing Bloom filter is
   *                       ignored.
   * @param primaryReplica true if this is a store file for primary replica, otherwise false.
   */
  public HStoreFile(FileSystem fs, Path p, Configuration conf, CacheConfig cacheConf,
    BloomType cfBloomType, boolean primaryReplica) throws IOException {
    this(new StoreFileInfo(conf, fs, p, primaryReplica), cfBloomType, cacheConf);
  }

  /**
   * Constructor, loads a reader and it's indices, etc. May allocate a substantial amount of ram
   * depending on the underlying files (10-20MB?).
   * @param fileInfo    The store file information.
   * @param cfBloomType The bloom type to use for this store file as specified by column family
   *                    configuration. This may or may not be the same as the Bloom filter type
   *                    actually present in the HFile, because column family configuration might
   *                    change. If this is {@link BloomType#NONE}, the existing Bloom filter is
   *                    ignored.
   * @param cacheConf   The cache configuration and block cache reference.
   */
  public HStoreFile(StoreFileInfo fileInfo, BloomType cfBloomType, CacheConfig cacheConf) {
    this(fileInfo, cfBloomType, cacheConf, null);
  }

  /**
   * Constructor, loads a reader and it's indices, etc. May allocate a substantial amount of ram
   * depending on the underlying files (10-20MB?).
   * @param fileInfo    The store file information.
   * @param cfBloomType The bloom type to use for this store file as specified by column family
   *                    configuration. This may or may not be the same as the Bloom filter type
   *                    actually present in the HFile, because column family configuration might
   *                    change. If this is {@link BloomType#NONE}, the existing Bloom filter is
   *                    ignored.
   * @param cacheConf   The cache configuration and block cache reference.
   * @param metrics     Tracks bloom filter requests and results. May be null.
   */
  public HStoreFile(StoreFileInfo fileInfo, BloomType cfBloomType, CacheConfig cacheConf,
    BloomFilterMetrics metrics) {
    this.fileInfo = fileInfo;
    this.cacheConf = cacheConf;
    this.metrics = metrics;
    if (BloomFilterFactory.isGeneralBloomEnabled(fileInfo.getConf())) {
      this.cfBloomType = cfBloomType;
    } else {
      LOG.info("Ignoring bloom filter check for file " + this.getPath() + ": " + "cfBloomType="
        + cfBloomType + " (disabled in config)");
      this.cfBloomType = BloomType.NONE;
    }
  }

  /**
   * @return the StoreFile object associated to this StoreFile. null if the StoreFile is not a
   *         reference.
   */
  public StoreFileInfo getFileInfo() {
    return this.fileInfo;
  }

  @Override
  public Path getPath() {
    return this.fileInfo.getPath();
  }

  @Override
  public Path getEncodedPath() {
    try {
      return new Path(URLEncoder.encode(fileInfo.getPath().toString(), HConstants.UTF8_ENCODING));
    } catch (UnsupportedEncodingException ex) {
      throw new RuntimeException("URLEncoder doesn't support UTF-8", ex);
    }
  }

  @Override
  public Path getQualifiedPath() {
    FileSystem fs = fileInfo.getFileSystem();
    return this.fileInfo.getPath().makeQualified(fs.getUri(), fs.getWorkingDirectory());
  }

  @Override
  public boolean isReference() {
    return this.fileInfo.isReference();
  }

  @Override
  public boolean isHFile() {
    return StoreFileInfo.isHFile(this.fileInfo.getPath());
  }

  @Override
  public boolean isMajorCompactionResult() {
    Preconditions.checkState(this.majorCompaction != null, "Major compation has not been set yet");
    return this.majorCompaction.get();
  }

  @Override
  public boolean excludeFromMinorCompaction() {
    return this.excludeFromMinorCompaction;
  }

  @Override
  public long getMaxSequenceId() {
    return this.sequenceid;
  }

  @Override
  public long getModificationTimestamp() throws IOException {
    return fileInfo.getModificationTime();
  }

  /**
   * @param key to look up
   * @return value associated with the metadata key
   */
  public byte[] getMetadataValue(byte[] key) {
    return metadataMap.get(key);
  }

  @Override
  public boolean isBulkLoadResult() {
    boolean bulkLoadedHFile = false;
    String fileName = this.getPath().getName();
    int startPos = fileName.indexOf("SeqId_");
    if (startPos != -1) {
      bulkLoadedHFile = true;
    }
    return bulkLoadedHFile || (metadataMap != null && metadataMap.containsKey(BULKLOAD_TIME_KEY));
  }

  public boolean isCompactedAway() {
    return compactedAway;
  }

  public int getRefCount() {
    return fileInfo.refCount.get();
  }

  /** Returns true if the file is still used in reads */
  public boolean isReferencedInReads() {
    int rc = fileInfo.refCount.get();
    assert rc >= 0; // we should not go negative.
    return rc > 0;
  }

  @Override
  public OptionalLong getBulkLoadTimestamp() {
    byte[] bulkLoadTimestamp = metadataMap.get(BULKLOAD_TIME_KEY);
    return bulkLoadTimestamp == null
      ? OptionalLong.empty()
      : OptionalLong.of(Bytes.toLong(bulkLoadTimestamp));
  }

  /**
   * @return the cached value of HDFS blocks distribution. The cached value is calculated when store
   *         file is opened.
   */
  public HDFSBlocksDistribution getHDFSBlockDistribution() {
    if (initialReaderBlockDistribution != null) {
      return initialReaderBlockDistribution.getHDFSBlockDistribution();
    } else {
      return this.fileInfo.getHDFSBlockDistribution();
    }
  }

  /**
   * Opens reader on this store file. Called by Constructor.
   * @see #closeStoreFile(boolean)
   */
  private void open() throws IOException {
    fileInfo.initHDFSBlocksDistribution();
    long readahead = fileInfo.isNoReadahead() ? 0L : -1L;
    ReaderContext context = fileInfo.createReaderContext(false, readahead, ReaderType.PREAD);
    fileInfo.initHFileInfo(context);
    StoreFileReader reader = fileInfo.preStoreFileReaderOpen(context, cacheConf);
    if (reader == null) {
      reader = fileInfo.createReader(context, cacheConf);
      fileInfo.getHFileInfo().initMetaAndIndex(reader.getHFileReader());
    }
    this.initialReader = fileInfo.postStoreFileReaderOpen(context, cacheConf, reader);

    if (InputStreamBlockDistribution.isEnabled(fileInfo.getConf())) {
      boolean useHBaseChecksum = context.getInputStreamWrapper().shouldUseHBaseChecksum();
      FSDataInputStream stream = context.getInputStreamWrapper().getStream(useHBaseChecksum);
      this.initialReaderBlockDistribution = new InputStreamBlockDistribution(stream, fileInfo);
    }

    // Load up indices and fileinfo. This also loads Bloom filter type.
    metadataMap = Collections.unmodifiableMap(initialReader.loadFileInfo());

    // Read in our metadata.
    byte[] b = metadataMap.get(MAX_SEQ_ID_KEY);
    if (b != null) {
      // By convention, if halfhfile, top half has a sequence number > bottom
      // half. Thats why we add one in below. Its done for case the two halves
      // are ever merged back together --rare. Without it, on open of store,
      // since store files are distinguished by sequence id, the one half would
      // subsume the other.
      this.sequenceid = Bytes.toLong(b);
      if (fileInfo.isTopReference()) {
        this.sequenceid += 1;
      }
    }

    if (isBulkLoadResult()) {
      // generate the sequenceId from the fileName
      // fileName is of the form <randomName>_SeqId_<id-when-loaded>_
      String fileName = this.getPath().getName();
      // Use lastIndexOf() to get the last, most recent bulk load seqId.
      int startPos = fileName.lastIndexOf("SeqId_");
      if (startPos != -1) {
        this.sequenceid =
          Long.parseLong(fileName.substring(startPos + 6, fileName.indexOf('_', startPos + 6)));
        // Handle reference files as done above.
        if (fileInfo.isTopReference()) {
          this.sequenceid += 1;
        }
      }
      // SKIP_RESET_SEQ_ID only works in bulk loaded file.
      // In mob compaction, the hfile where the cells contain the path of a new mob file is bulk
      // loaded to hbase, these cells have the same seqIds with the old ones. We do not want
      // to reset new seqIds for them since this might make a mess of the visibility of cells that
      // have the same row key but different seqIds.
      boolean skipResetSeqId = isSkipResetSeqId(metadataMap.get(SKIP_RESET_SEQ_ID));
      if (skipResetSeqId) {
        // increase the seqId when it is a bulk loaded file from mob compaction.
        this.sequenceid += 1;
      }
      initialReader.setSkipResetSeqId(skipResetSeqId);
      initialReader.setBulkLoaded(true);
    }
    initialReader.setSequenceID(this.sequenceid);

    b = metadataMap.get(HFile.Writer.MAX_MEMSTORE_TS_KEY);
    if (b != null) {
      this.maxMemstoreTS = Bytes.toLong(b);
    }

    b = metadataMap.get(MAJOR_COMPACTION_KEY);
    if (b != null) {
      boolean mc = Bytes.toBoolean(b);
      if (this.majorCompaction == null) {
        this.majorCompaction = new AtomicBoolean(mc);
      } else {
        this.majorCompaction.set(mc);
      }
    } else {
      // Presume it is not major compacted if it doesn't explicity say so
      // HFileOutputFormat explicitly sets the major compacted key.
      this.majorCompaction = new AtomicBoolean(false);
    }

    b = metadataMap.get(EXCLUDE_FROM_MINOR_COMPACTION_KEY);
    this.excludeFromMinorCompaction = (b != null && Bytes.toBoolean(b));

    BloomType hfileBloomType = initialReader.getBloomFilterType();
    if (cfBloomType != BloomType.NONE) {
      initialReader.loadBloomfilter(BlockType.GENERAL_BLOOM_META, metrics);
      if (hfileBloomType != cfBloomType) {
        LOG.debug("HFile Bloom filter type for " + initialReader.getHFileReader().getName() + ": "
          + hfileBloomType + ", but " + cfBloomType + " specified in column family "
          + "configuration");
      }
    } else if (hfileBloomType != BloomType.NONE) {
      LOG.info(
        "Bloom filter turned off by CF config for " + initialReader.getHFileReader().getName());
    }

    // load delete family bloom filter
    initialReader.loadBloomfilter(BlockType.DELETE_FAMILY_BLOOM_META, metrics);

    try {
      byte[] data = metadataMap.get(TIMERANGE_KEY);
      initialReader.timeRange =
        data == null ? null : TimeRangeTracker.parseFrom(data).toTimeRange();
    } catch (IllegalArgumentException e) {
      LOG.error("Error reading timestamp range data from meta -- " + "proceeding without", e);
      this.initialReader.timeRange = null;
    }

    try {
      byte[] data = metadataMap.get(COMPACTION_EVENT_KEY);
      this.compactedStoreFiles.addAll(ProtobufUtil.toCompactedStoreFiles(data));
    } catch (IOException e) {
      LOG.error("Error reading compacted storefiles from meta data", e);
    }

    // initialize so we can reuse them after reader closed.
    firstKey = initialReader.getFirstKey();
    lastKey = initialReader.getLastKey();
    comparator = initialReader.getComparator();
  }

  /**
   * Initialize the reader used for pread.
   */
  public void initReader() throws IOException {
    if (initialReader == null) {
      synchronized (this) {
        if (initialReader == null) {
          try {
            open();
          } catch (Exception e) {
            try {
              boolean evictOnClose = cacheConf != null ? cacheConf.shouldEvictOnClose() : true;
              this.closeStoreFile(evictOnClose);
            } catch (IOException ee) {
              LOG.warn("failed to close reader", ee);
            }
            throw e;
          }
        }
      }
    }
  }

  private StoreFileReader createStreamReader(boolean canUseDropBehind) throws IOException {
    initReader();
    final boolean doDropBehind = canUseDropBehind && cacheConf.shouldDropBehindCompaction();
    ReaderContext context = fileInfo.createReaderContext(doDropBehind, -1, ReaderType.STREAM);
    StoreFileReader reader = fileInfo.preStoreFileReaderOpen(context, cacheConf);
    if (reader == null) {
      reader = fileInfo.createReader(context, cacheConf);
      // steam reader need copy stuffs from pread reader
      reader.copyFields(initialReader);
    }
    return fileInfo.postStoreFileReaderOpen(context, cacheConf, reader);
  }

  /**
   * Get a scanner which uses pread.
   *

   * Must be called after initReader.
   */
  public StoreFileScanner getPreadScanner(boolean cacheBlocks, long readPt, long scannerOrder,
    boolean canOptimizeForNonNullColumn) {
    return getReader().getStoreFileScanner(cacheBlocks, true, false, readPt, scannerOrder,
      canOptimizeForNonNullColumn);
  }

  /**
   * Get a scanner which uses streaming read.
   *

   * Must be called after initReader.
   */
  public StoreFileScanner getStreamScanner(boolean canUseDropBehind, boolean cacheBlocks,
    boolean isCompaction, long readPt, long scannerOrder, boolean canOptimizeForNonNullColumn)
    throws IOException {
    return createStreamReader(canUseDropBehind).getStoreFileScanner(cacheBlocks, false,
      isCompaction, readPt, scannerOrder, canOptimizeForNonNullColumn);
  }

  /**
   * @return Current reader. Must call initReader first else returns null.
   * @see #initReader()
   */
  public StoreFileReader getReader() {
    return this.initialReader;
  }

  /**
   * @param evictOnClose whether to evict blocks belonging to this file
   */
  public synchronized void closeStoreFile(boolean evictOnClose) throws IOException {
    if (this.initialReader != null) {
      this.initialReader.close(evictOnClose);
      this.initialReader = null;
    }
  }

  /**
   * Delete this file
   */
  public void deleteStoreFile() throws IOException {
    boolean evictOnClose = cacheConf != null ? cacheConf.shouldEvictOnClose() : true;
    closeStoreFile(evictOnClose);
    this.fileInfo.getFileSystem().delete(getPath(), true);
  }

  public void markCompactedAway() {
    this.compactedAway = true;
  }

  @Override
  public String toString() {
    return this.fileInfo.toString();
  }

  @Override
  public String toStringDetailed() {
    StringBuilder sb = new StringBuilder();
    sb.append(this.getPath().toString());
    sb.append(", isReference=").append(isReference());
    sb.append(", isBulkLoadResult=").append(isBulkLoadResult());
    if (isBulkLoadResult()) {
      sb.append(", bulkLoadTS=");
      OptionalLong bulkLoadTS = getBulkLoadTimestamp();
      if (bulkLoadTS.isPresent()) {
        sb.append(bulkLoadTS.getAsLong());
      } else {
        sb.append("NotPresent");
      }
    } else {
      sb.append(", seqid=").append(getMaxSequenceId());
    }
    sb.append(", majorCompaction=").append(isMajorCompactionResult());

    return sb.toString();
  }

  /**
   * Gets whether to skip resetting the sequence id for cells.
   * @param skipResetSeqId The byte array of boolean.
   * @return Whether to skip resetting the sequence id.
   */
  private boolean isSkipResetSeqId(byte[] skipResetSeqId) {
    if (skipResetSeqId != null && skipResetSeqId.length == 1) {
      return Bytes.toBoolean(skipResetSeqId);
    }
    return false;
  }

  @Override
  public OptionalLong getMinimumTimestamp() {
    TimeRange tr = getReader().timeRange;
    return tr != null ? OptionalLong.of(tr.getMin()) : OptionalLong.empty();
  }

  @Override
  public OptionalLong getMaximumTimestamp() {
    TimeRange tr = getReader().timeRange;
    return tr != null ? OptionalLong.of(tr.getMax()) : OptionalLong.empty();
  }

  Set<String> getCompactedStoreFiles() {
    return Collections.unmodifiableSet(this.compactedStoreFiles);
  }
}


text:
/*
 * sf-Touchscreen v1.3b - Provides touchscreen compatibility for the jQuery Superfish plugin.
 *
 * Developer's note:
 * Built as a part of the Superfish project for Drupal (http://drupal.org/project/superfish)
 * Found any bug? have any cool ideas? contact me right away! http://drupal.org/user/619294/contact
 *
 * jQuery version: 1.3.x or higher.
 *
 * Dual licensed under the MIT and GPL licenses:
 *  http://www.opensource.org/licenses/mit-license.php
 *  http://www.gnu.org/licenses/gpl.html
 */

(function($){
  $.fn.sftouchscreen = function(options){
    options = $.extend({
      mode: 'inactive',
      breakpoint: 768,
      breakpointUnit: 'px',
      useragent: '',
      behaviour: 2,
      disableHover: false
    }, options);

    function activate(menu){
      var eventHandler = (('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch)) ? ['click touchstart','mouseup touchend'] : ['click','mouseup'];
      // Select hyperlinks from parent menu items.
      menu.find('li:has(ul)').children('a,span.nolink').each(function(){
        var item = $(this),
        parent = item.closest('li');
        if (options.disableHover){
          parent.unbind('mouseenter mouseleave');
        }
        if (options.behaviour == 2){
          if (parent.children('a.menuparent,span.nolink.menuparent').length > 0 && parent.children('ul').children('.sf-clone-parent').length == 0){
            var
            // Cloning the hyperlink of the parent menu item.
            cloneLink = parent.children('a.menuparent,span.nolink.menuparent').clone(),
            // Wrapping the hyerplinks in <li>.
            cloneLink = $('<li class="sf-clone-parent" />').html(cloneLink);
            // Removing unnecessary stuff.
            cloneLink.find('.sf-sub-indicator').remove(),
            // Adding a helper class and attaching them to the sub-menus.
            parent.children('ul').addClass('sf-has-clone-parent').prepend(cloneLink);
          }
        }
        // No .toggle() here as it's not possible to reset it.
        item.bind(eventHandler[0], function(event){
          // Already clicked?
          if (item.hasClass('sf-clicked')){
            // Depending on the preferred behaviour, either proceed to the URL.
            if (options.behaviour == 0){
              url = item.attr('href');
              if (typeof(url) != 'undefined'){
                window.location = url;
              }
            }
            // or collapse the sub-menu.
            else if (options.behaviour == 1 || options.behaviour == 2){
              event.preventDefault();
              item.removeClass('sf-clicked');
              parent.hideSuperfishUl().find('a,span.nolink').removeClass('sf-clicked');
            }
          }
          // Prevent the default action otherwise.
          else {
            event.preventDefault();
            item.addClass('sf-clicked');
            parent.showSuperfishUl().siblings('li:has(ul)').hideSuperfishUl().find('.sf-clicked').removeClass('sf-clicked');
          }
        });
      });

      $(document).bind(eventHandler[1], function(event){
        if (menu.not(event.target) && menu.has(event.target).length === 0){
          menu.find('.sf-clicked').removeClass('sf-clicked');
          menu.find('li:has(ul)').hideSuperfishUl();
        }
      });
    }
    // Return original object to support chaining.
    // This is not necessary actually because of the way the module uses these plugins.
    for (var b = 0; b < this.length; b++) {
      var menu = $(this).eq(b),
      mode = options.mode;
      // The rest is crystal clear, isn't it? :)
      if (mode == 'always_active'){
        activate(menu);
      }
      else if (mode == 'window_width'){
        var breakpoint = (options.breakpointUnit == 'em') ? (options.breakpoint * parseFloat($('body').css('font-size'))) : options.breakpoint,
        windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
        timer;
        if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){
          activate(menu);
        }
        else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) {
          activate(menu);
        }
        $(window).resize(function(){
          clearTimeout(timer);
          timer = setTimeout(function(){
            var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
            if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){
              activate(menu);
            }
            else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) {
              activate(menu);
            }
          }, 50);
        });
      }
      else if (mode == 'useragent_custom'){
        if (options.useragent != ''){
          var ua = RegExp(options.useragent, 'i');
          if (navigator.userAgent.match(ua)){
            activate(menu);
          }
        }
      }
      else if (mode == 'useragent_predefined' && navigator.userAgent.match(/(android|bb\d+|meego)|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i)){
        activate(menu);
      }
    }
    return this;
  }
})(jQuery);


text:
package com.evolveum.midpoint.certification.impl;

import com.evolveum.midpoint.schema.constants.SchemaConstants;

/**
 * @author mederly
 */
public class AccessCertificationConstants {

    public static final String NS_CERTIFICATION_TASK_PREFIX = SchemaConstants.NS_CERTIFICATION + "/task";
    public static final String NS_CERTIFICATION_TRIGGER_PREFIX = SchemaConstants.NS_CERTIFICATION + "/trigger";

}


text:
[![Build Status](https://travis-ci.org/hexojs/hexo-renderer-stylus.svg?branch=master)](https://travis-ci.org/hexojs/hexo-renderer-stylus)  [![NPM version](https://badge.fury.io/js/hexo-renderer-stylus.svg)](http://badge.fury.io/js/hexo-renderer-stylus) [![Coverage Status](https://img.shields.io/coveralls/hexojs/hexo-renderer-stylus.svg)](https://coveralls.io/r/hexojs/hexo-renderer-stylus?branch=master)

Add support for [Stylus] with [nib].

## Install

``` bash
$ npm install hexo-renderer-stylus --save
```

## Options

You can configure this plugin in `_config.yml`.

``` yaml
stylus:
  compress: false
```

- **compress** - Compress generated CSS

[Stylus]: http://learnboost.github.io/stylus/
[nib]: http://visionmedia.github.io/nib/


text:
<?php

namespace WindowsAzure\Blob\Models;

/**
 * Holds result of getContainerProperties and getContainerMetadata
 *
 * @category  Microsoft
 * @package   WindowsAzure\Blob\Models
 * @author    Azure PHP SDK <azurephpsdk@microsoft.com>
 * @copyright 2012 Microsoft Corporation
 * @license   http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
 * @version   Release: 0.4.2_2016-04
 * @link      https://github.com/windowsazure/azure-sdk-for-php
 */
class GetContainerPropertiesResult
{
    /**
     * @var \DateTime
     */
    private $_lastModified;

    /**
     * @var string
     */
    private $_etag;

    /**
     * @var array
     */
    private $_metadata;

    /**
     * Any operation that modifies the container or its properties or metadata
     * updates the last modified time. Operations on blobs do not affect the last
     * modified time of the container.
     *
     * @return \DateTime.
     */
    public function getLastModified()
    {
        return $this->_lastModified;
    }

    /**
     * Sets container lastModified.
     *
     * @param \DateTime $lastModified value.
     *
     * @return none.
     */
    public function setLastModified($lastModified)
    {
        $this->_lastModified = $lastModified;
    }

    /**
     * The entity tag for the container. If the request version is 2011-08-18 or
     * newer, the ETag value will be in quotes.
     *
     * @return string.
     */
    public function getETag()
    {
        return $this->_etag;
    }

    /**
     * Sets container etag.
     *
     * @param string $etag value.
     *
     * @return none.
     */
    public function setETag($etag)
    {
        $this->_etag = $etag;
    }

    /**
     * Gets user defined metadata.
     *
     * @return array.
     */
    public function getMetadata()
    {
        return $this->_metadata;
    }

    /**
     * Sets user defined metadata. This metadata should be added without the header
     * prefix (x-ms-meta-*).
     *
     * @param array $metadata user defined metadata object in array form.
     *
     * @return none.
     */
    public function setMetadata($metadata)
    {
        $this->_metadata = $metadata;
    }
}


text:
module Jekyll
  class RenderFullWidthTag < Liquid::Tag

    require "shellwords"
    require "kramdown"

    def initialize(tag_name, text, tokens)
      super
      @text = text.shellsplit
    end

    def render(context)

      # Gather settings
      site = context.registers[:site]
      converter = site.find_converter_instance(::Jekyll::Converters::Markdown)

      baseurl = context.registers[:site].config['baseurl']
      label = Kramdown::Document.new(@text[1],{remove_span_html_tags:true}).to_html # render markdown in caption
      label = converter.convert(label).gsub(/<\/?p[^>]*>/, "").chomp # remove
 tags from render output

      if @text[0].start_with?('http://', 'https://','//')
        "
"+
        "
#{label}

"
      else
        "
"+
        "
#{label}

"
      end
    end
  end
end

Liquid::Template.register_tag('fullwidth', Jekyll::RenderFullWidthTag)